[GTK][WPE] Fix non-unified builds after r250857
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-19  Adrian Perez de Castro  <aperez@igalia.com>
2
3         [GTK][WPE] Fix non-unified builds after r250857
4         https://bugs.webkit.org/show_bug.cgi?id=203145
5
6         Reviewed by Carlos Garcia Campos.
7
8         No new tests needed.
9
10         * Modules/async-clipboard/ClipboardItem.cpp: Add missing inclusion of the Clipboard.h header.
11         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: Add missing inclusion of the
12         ClipboardItem.h header.
13         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp: Add missing inclusions of
14         the Clipboard.h, ClipboardItem.h, and JSDOMPromiseDeferred.h headers.
15         * dom/AbstractEventLoop.h: Add missing inclusion of the wtf/RefCounted.h header.
16         * dom/WindowEventLoop.h: Add missing inclusion of the DocumentIdentifier.h header.
17         * dom/IdleCallbackController.h: Add missing forward-declaration for the Document class.
18         * dom/RadioButtonGroups.h: Add needed inclusion of of the wtf/text/AtomStringHash.h header,
19         needed because AtomString is used as key for a HashMap; remove the (now unneeded) of the
20         wtf/Forward.h header.
21         * page/WheelEventTestMonitor.cpp: Add missing inclusion of the wtf/OptionSet.h header.
22         * rendering/style/ShadowData.cpp: Add missing inclusion of the wtf/text/TextStream.h header.
23
24 2019-10-19  Ryosuke Niwa  <rniwa@webkit.org>
25
26         Integrate media query evaluation into HTML5 event loop
27         https://bugs.webkit.org/show_bug.cgi?id=203134
28         <rdar://problem/56396316>
29
30         Reviewed by Antti Koivisto.
31
32         Moved the code to call media query listeners to HTML5 event loop's step to update the rendering:
33         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
34
35         Tests: fast/media/mq-inverted-colors-live-update-for-listener.html
36                fast/media/mq-prefers-reduced-motion-live-update-for-listener.html
37
38         * css/MediaQueryMatcher.cpp:
39         (WebCore::MediaQueryMatcher::evaluateAll): Renamed from styleResolverChanged.
40         * css/MediaQueryMatcher.h:
41         * dom/Document.cpp:
42         (WebCore::Document::updateElementsAffectedByMediaQueries): Split from evaluateMediaQueryList.
43         This function is still called right after each layout update so that picture element may start
44         requesting newly selected image resources without having to wait for a rendering update.
45         But this function will no longer execute arbitrary scripts.
46         (WebCore::Document::evaluateMediaQueriesAndReportChanges): Split from evaluateMediaQueryList.
47         Evaluates media query listeners.
48         * dom/Document.h:
49         * inspector/agents/InspectorPageAgent.cpp:
50         (WebCore::InspectorPageAgent::setEmulatedMedia): Force the evaluation of media queries for now
51         but this code should really be scheduling a rendering update instead so added a FIXME.
52         * page/Frame.cpp:
53         (WebCore::Frame::setPrinting): Evaluate media queries. We should consider invoking the full
54         algorithm to update the rendering here. e.g. intersection observer may add more contents.
55         * page/Page.cpp:
56         (WebCore::Page::updateRendering): Call evaluateMediaQueriesAndReportChanges.
57
58 2019-10-18  Tim Horton  <timothy_horton@apple.com>
59
60         macCatalyst: Cursor should send mouse events, not touch events
61         https://bugs.webkit.org/show_bug.cgi?id=203175
62         <rdar://problem/56321134>
63
64         Reviewed by Simon Fraser.
65
66         * dom/Element.cpp:
67         (WebCore::shouldIgnoreMouseEvent):
68         (WebCore::Element::dispatchMouseEvent):
69         * page/PointerCaptureController.cpp:
70         (WebCore::PointerCaptureController::reset):
71         Share more code between platforms that support touch events and platforms that don't;
72         we want to be able to dispatch pointer events that originate from mouse events
73         in macCatalyst despite touch events being enabled (by virtue of being iOS WebKit),
74         so un-ifdef that code.
75
76 2019-10-18  Simon Fraser  <simon.fraser@apple.com>
77
78         Make it possible to query scrollbar pseudo-style without having a scrollbar
79         https://bugs.webkit.org/show_bug.cgi?id=203174
80
81         Reviewed by Tim Horton.
82
83         A future patch needs the ability to query scrollbar pseudo-style without having
84         a scrollbar, and it was ugly to pass a live RenderScrollbar into CSS style resolution
85         functions. Instead, pass in a pure-data object that has information about the scrollbar.
86
87         * css/ElementRuleCollector.cpp:
88         (WebCore::ElementRuleCollector::ruleMatches):
89         * css/SelectorChecker.h:
90         * css/SelectorCheckerTestFunctions.h:
91         (WebCore::scrollbarMatchesEnabledPseudoClass):
92         (WebCore::scrollbarMatchesDisabledPseudoClass):
93         (WebCore::scrollbarMatchesHoverPseudoClass):
94         (WebCore::scrollbarMatchesActivePseudoClass):
95         (WebCore::scrollbarMatchesHorizontalPseudoClass):
96         (WebCore::scrollbarMatchesVerticalPseudoClass):
97         (WebCore::scrollbarMatchesDecrementPseudoClass):
98         (WebCore::scrollbarMatchesIncrementPseudoClass):
99         (WebCore::scrollbarMatchesStartPseudoClass):
100         (WebCore::scrollbarMatchesEndPseudoClass):
101         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
102         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
103         (WebCore::scrollbarMatchesNoButtonPseudoClass):
104         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
105         * css/StyleResolver.h:
106         (WebCore::PseudoStyleRequest::PseudoStyleRequest):
107         * rendering/RenderScrollbar.cpp:
108         (WebCore::RenderScrollbar::getScrollbarPseudoStyle):
109
110 2019-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
111
112         [SVG2]: Remove the SVGExternalResourcesRequired interface
113         https://bugs.webkit.org/show_bug.cgi?id=191293
114
115         Reviewed by Simon Fraser.
116
117         The spec page is: https://www.w3.org/TR/SVG/changes.html.
118
119         r251290 made externalResourcesRequired have no effect on firing the load
120         event. All the control was moved to SVGURIReference. This patch will remove
121         this interface entirely to conform with SVG2 specs and other browsers.
122
123         * CMakeLists.txt:
124         * DerivedSources-input.xcfilelist:
125         * DerivedSources-output.xcfilelist:
126         * DerivedSources.make:
127         * Sources.txt:
128         * WebCore.xcodeproj/project.pbxproj:
129         * svg/SVGAElement.cpp:
130         (WebCore::SVGAElement::SVGAElement):
131         (WebCore::SVGAElement::parseAttribute):
132         (WebCore::SVGAElement::svgAttributeChanged):
133         * svg/SVGAElement.h:
134         * svg/SVGAElement.idl:
135         * svg/SVGAnimationElement.cpp:
136         (WebCore::SVGAnimationElement::SVGAnimationElement):
137         (WebCore::SVGAnimationElement::isSupportedAttribute):
138         (WebCore::SVGAnimationElement::parseAttribute):
139         * svg/SVGAnimationElement.h:
140         * svg/SVGAnimationElement.idl:
141         * svg/SVGCircleElement.cpp:
142         (WebCore::SVGCircleElement::SVGCircleElement):
143         (WebCore::SVGCircleElement::parseAttribute):
144         (WebCore::SVGCircleElement::svgAttributeChanged):
145         * svg/SVGCircleElement.h:
146         * svg/SVGCircleElement.idl:
147         * svg/SVGClipPathElement.cpp:
148         (WebCore::SVGClipPathElement::SVGClipPathElement):
149         (WebCore::SVGClipPathElement::parseAttribute):
150         (WebCore::SVGClipPathElement::svgAttributeChanged):
151         * svg/SVGClipPathElement.h:
152         * svg/SVGClipPathElement.idl:
153         * svg/SVGCursorElement.cpp:
154         (WebCore::SVGCursorElement::SVGCursorElement):
155         (WebCore::SVGCursorElement::parseAttribute):
156         * svg/SVGCursorElement.h:
157         * svg/SVGCursorElement.idl:
158         * svg/SVGDefsElement.cpp:
159         (WebCore::SVGDefsElement::SVGDefsElement):
160         * svg/SVGDefsElement.h:
161         * svg/SVGDefsElement.idl:
162         * svg/SVGEllipseElement.cpp:
163         (WebCore::SVGEllipseElement::SVGEllipseElement):
164         (WebCore::SVGEllipseElement::parseAttribute):
165         (WebCore::SVGEllipseElement::svgAttributeChanged):
166         * svg/SVGEllipseElement.h:
167         * svg/SVGEllipseElement.idl:
168         * svg/SVGExternalResourcesRequired.cpp: Removed.
169         * svg/SVGExternalResourcesRequired.h: Removed.
170         * svg/SVGExternalResourcesRequired.idl: Removed.
171         * svg/SVGFEImageElement.cpp:
172         (WebCore::SVGFEImageElement::SVGFEImageElement):
173         (WebCore::SVGFEImageElement::parseAttribute):
174         * svg/SVGFEImageElement.h:
175         * svg/SVGFEImageElement.idl:
176         * svg/SVGFilterElement.cpp:
177         (WebCore::SVGFilterElement::SVGFilterElement):
178         (WebCore::SVGFilterElement::parseAttribute):
179         (WebCore::SVGFilterElement::svgAttributeChanged):
180         * svg/SVGFilterElement.h:
181         * svg/SVGFilterElement.idl:
182         * svg/SVGFontElement.cpp:
183         (WebCore::SVGFontElement::SVGFontElement):
184         * svg/SVGFontElement.h:
185         * svg/SVGForeignObjectElement.cpp:
186         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
187         (WebCore::SVGForeignObjectElement::parseAttribute):
188         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
189         * svg/SVGForeignObjectElement.h:
190         * svg/SVGForeignObjectElement.idl:
191         * svg/SVGGElement.cpp:
192         (WebCore::SVGGElement::SVGGElement):
193         (WebCore::SVGGElement::parseAttribute): Deleted.
194         (WebCore::SVGGElement::svgAttributeChanged): Deleted.
195         * svg/SVGGElement.h:
196         * svg/SVGGElement.idl:
197         * svg/SVGGradientElement.cpp:
198         (WebCore::SVGGradientElement::SVGGradientElement):
199         (WebCore::SVGGradientElement::parseAttribute):
200         * svg/SVGGradientElement.h:
201         * svg/SVGGradientElement.idl:
202         * svg/SVGImageElement.cpp:
203         (WebCore::SVGImageElement::SVGImageElement):
204         (WebCore::SVGImageElement::parseAttribute):
205         (WebCore::SVGImageElement::svgAttributeChanged):
206         * svg/SVGImageElement.h:
207         * svg/SVGImageElement.idl:
208         * svg/SVGLineElement.cpp:
209         (WebCore::SVGLineElement::SVGLineElement):
210         (WebCore::SVGLineElement::parseAttribute):
211         (WebCore::SVGLineElement::svgAttributeChanged):
212         * svg/SVGLineElement.h:
213         * svg/SVGLineElement.idl:
214         * svg/SVGMPathElement.cpp:
215         (WebCore::SVGMPathElement::SVGMPathElement):
216         (WebCore::SVGMPathElement::parseAttribute):
217         (WebCore::SVGMPathElement::svgAttributeChanged):
218         * svg/SVGMPathElement.h:
219         * svg/SVGMPathElement.idl:
220         * svg/SVGMarkerElement.cpp:
221         (WebCore::SVGMarkerElement::SVGMarkerElement):
222         (WebCore::SVGMarkerElement::parseAttribute):
223         (WebCore::SVGMarkerElement::svgAttributeChanged):
224         * svg/SVGMarkerElement.h:
225         * svg/SVGMarkerElement.idl:
226         * svg/SVGMaskElement.cpp:
227         (WebCore::SVGMaskElement::SVGMaskElement):
228         (WebCore::SVGMaskElement::parseAttribute):
229         (WebCore::SVGMaskElement::svgAttributeChanged):
230         * svg/SVGMaskElement.h:
231         * svg/SVGMaskElement.idl:
232         * svg/SVGPathElement.cpp:
233         (WebCore::SVGPathElement::SVGPathElement):
234         (WebCore::SVGPathElement::parseAttribute):
235         (WebCore::SVGPathElement::svgAttributeChanged):
236         * svg/SVGPathElement.h:
237         * svg/SVGPathElement.idl:
238         * svg/SVGPatternElement.cpp:
239         (WebCore::SVGPatternElement::SVGPatternElement):
240         (WebCore::SVGPatternElement::parseAttribute):
241         (WebCore::SVGPatternElement::svgAttributeChanged):
242         * svg/SVGPatternElement.h:
243         * svg/SVGPatternElement.idl:
244         * svg/SVGPolyElement.cpp:
245         (WebCore::SVGPolyElement::SVGPolyElement):
246         (WebCore::SVGPolyElement::parseAttribute):
247         (WebCore::SVGPolyElement::svgAttributeChanged):
248         * svg/SVGPolyElement.h:
249         * svg/SVGPolygonElement.idl:
250         * svg/SVGPolylineElement.idl:
251         * svg/SVGRectElement.cpp:
252         (WebCore::SVGRectElement::SVGRectElement):
253         (WebCore::SVGRectElement::parseAttribute):
254         (WebCore::SVGRectElement::svgAttributeChanged):
255         * svg/SVGRectElement.h:
256         * svg/SVGRectElement.idl:
257         * svg/SVGSVGElement.cpp:
258         (WebCore::SVGSVGElement::SVGSVGElement):
259         (WebCore::SVGSVGElement::parseAttribute):
260         (WebCore::SVGSVGElement::svgAttributeChanged):
261         * svg/SVGSVGElement.h:
262         * svg/SVGSVGElement.idl:
263         * svg/SVGScriptElement.cpp:
264         (WebCore::SVGScriptElement::SVGScriptElement):
265         (WebCore::SVGScriptElement::parseAttribute):
266         (WebCore::SVGScriptElement::svgAttributeChanged):
267         * svg/SVGScriptElement.h:
268         * svg/SVGScriptElement.idl:
269         * svg/SVGSwitchElement.cpp:
270         (WebCore::SVGSwitchElement::SVGSwitchElement):
271         * svg/SVGSwitchElement.h:
272         * svg/SVGSwitchElement.idl:
273         * svg/SVGSymbolElement.cpp:
274         (WebCore::SVGSymbolElement::SVGSymbolElement):
275         (WebCore::SVGSymbolElement::parseAttribute):
276         (WebCore::SVGSymbolElement::svgAttributeChanged): Deleted.
277         * svg/SVGSymbolElement.h:
278         * svg/SVGSymbolElement.idl:
279         * svg/SVGTextContentElement.cpp:
280         (WebCore::SVGTextContentElement::SVGTextContentElement):
281         (WebCore::SVGTextContentElement::parseAttribute):
282         (WebCore::SVGTextContentElement::svgAttributeChanged):
283         * svg/SVGTextContentElement.h:
284         * svg/SVGTextContentElement.idl:
285         * svg/SVGUseElement.cpp:
286         (WebCore::SVGUseElement::SVGUseElement):
287         (WebCore::SVGUseElement::parseAttribute):
288         (WebCore::SVGUseElement::svgAttributeChanged):
289         * svg/SVGUseElement.h:
290         * svg/SVGUseElement.idl:
291         * svg/SVGViewElement.cpp:
292         (WebCore::SVGViewElement::SVGViewElement):
293         (WebCore::SVGViewElement::parseAttribute):
294         (WebCore::SVGViewElement::svgAttributeChanged):
295         * svg/SVGViewElement.h:
296         * svg/SVGViewElement.idl:
297
298 2019-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
299
300         [Clipboard API] Refactor Pasteboard::read() to take an optional item index
301         https://bugs.webkit.org/show_bug.cgi?id=203161
302
303         Reviewed by Tim Horton.
304
305         Adds an optional `itemIndex` argument to Pasteboard::read(PasteboardPlainText&) and
306         Pasteboard::read(PasteboardWebContentReader&, WebContentReadingPolicy). See below for more details.
307
308         Tests:  CopyHTML.ItemTypesWhenCopyingWebContent
309                 PasteWebArchive.WebArchiveTypeIdentifier
310
311         * editing/mac/EditorMac.mm:
312         (WebCore::Editor::dataSelectionForPasteboard):
313
314         Recognize "com.apple.webarchive" alongside "Apple Web Archive pasteboard type" when writing and reading from the
315         platform pasteboard on macOS. We add support for this here because the existing private type cannot be written
316         to an NSPasteboardItem, since it does not conform to a valid UTI format. Luckily, there already exists a UTI
317         that represents a web archive, so we can use it instead.
318
319         We need to write and read web archive data from NSPasteboardItem in order to support the case where there are
320         multiple items in the pasteboard that contain different web archive data.
321
322         * platform/Pasteboard.h:
323         * platform/StaticPasteboard.h:
324         * platform/gtk/PasteboardGtk.cpp:
325         (WebCore::Pasteboard::read):
326         * platform/ios/PasteboardIOS.mm:
327         (WebCore::Pasteboard::read):
328
329         Read the string from `itemIndex` if specified; otherwise, fall back to index 0. This could actually be fixed in
330         the future to scan all pasteboard items for a suitable string instead of falling back on the first item, but for
331         now, we maintain the existing behavior.
332
333         (WebCore::Pasteboard::readRespectingUTIFidelities):
334
335         If an `itemIndex` is specified, ignore all other item indices when looking for suitable content.
336
337         * platform/libwpe/PasteboardLibWPE.cpp:
338         (WebCore::Pasteboard::read):
339         * platform/mac/DragDataMac.mm:
340         (WebCore::DragData::containsCompatibleContent const):
341         * platform/mac/PasteboardMac.mm:
342         (WebCore::Pasteboard::write):
343         (WebCore::readStringAtPreferredItemIndex):
344         (WebCore::readBufferAtPreferredItemIndex):
345
346         Add helper methods to read strings and buffers from the pasteboard, at an optional `itemIndex` if specified.
347
348         (WebCore::Pasteboard::read):
349
350         Adopt the helper functions when reading plain text and web content, and respect the given `itemIndex`. To do
351         this, we need to read both legacy and modern types from the pasteboard, instead of just legacy types. This is
352         because NSPasteboardItem on macOS only accepts and provides data in the form of modern pasteboard types.
353
354         * platform/mac/PlatformPasteboardMac.mm:
355         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
356         (WebCore::PlatformPasteboard::readBuffer const):
357         (WebCore::PlatformPasteboard::readString const):
358
359         Fix these methods to accept platform pasteboard types instead of MIME types, to match the behavior of existing
360         readBuffer and readString methods in PlatformPasteboardIOS.
361
362         * platform/win/PasteboardWin.cpp:
363         (WebCore::Pasteboard::read):
364
365 2019-10-18  Devin Rousso  <drousso@apple.com>
366
367         [ASAN] Fix WebGPU tests after r250258
368         https://bugs.webkit.org/show_bug.cgi?id=203133
369         <rdar://problem/56379008>
370
371         Reviewed by Joseph Pecoraro.
372
373         * platform/graphics/gpu/GPUObjectBase.h:
374         (WebCore::GPUObjectBase::~GPUObjectBase): Added.
375         Add a default virtual destructor since this class class is the one that is `RefCounted` and
376         the `WebGPUPipeline` subclass is virtual.
377
378         * Modules/webgpu/WebGPUPipeline.h:
379         (WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.
380         * Modules/webgpu/WebGPUPipeline.cpp:
381         (WebCore::WebGPUPipeline::WebGPUPipeline):
382         (WebCore::WebGPUPipeline::contextDestroyed): Added.
383         Make `WebGPUPipeline` a subclass of `ContextDestructionObserver` so that the raw pointer to
384         the associated `ScriptExecutionContext` is properly cleared and isn't UAFd.
385
386         * Modules/webgpu/WebGPUComputePipeline.h:
387         * Modules/webgpu/WebGPUComputePipeline.cpp:
388         (WebCore::WebGPUComputePipeline::create):
389         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
390         (WebCore::WebGPUComputePipeline::cloneShaderModules):
391         (WebCore::WebGPUComputePipeline::recompile):
392         * Modules/webgpu/WebGPURenderPipeline.h:
393         * Modules/webgpu/WebGPURenderPipeline.cpp:
394         (WebCore::WebGPURenderPipeline::create):
395         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
396         (WebCore::WebGPURenderPipeline::cloneShaderModules):
397         (WebCore::WebGPURenderPipeline::recompile):
398         * Modules/webgpu/WebGPUDevice.cpp:
399         (WebCore::WebGPUDevice::createRenderPipeline):
400         (WebCore::WebGPUDevice::createComputePipeline):
401         Rework how Web Inspector preserves related shader modules so that there isn't as much wasted
402         space in the class layout, as we can use the `RefPtr` itself instead of an `Optional`.
403
404         * Modules/webgpu/WebGPUBuffer.idl:
405         Now that `GPUObjectBase` has a virtual destructor, it has a vtable, which means that this
406         object also does and therefore cannot be marked with `ImplementationLacksVTable`.
407
408         * inspector/InspectorShaderProgram.cpp:
409         (WebCore::shaderForType):
410         (WebCore::InspectorShaderProgram::requestShaderSource):
411         (WebCore::InspectorShaderProgram::updateShader):
412         (WebCore::InspectorShaderProgram::buildObjectForShaderProgram):
413
414 2019-10-18  Ryosuke Niwa  <rniwa@webkit.org>
415
416         Refactor AbstractEventLoop out of WindowEventLoop
417         https://bugs.webkit.org/show_bug.cgi?id=203136
418         <rdar://problem/56396749>
419
420         Reviewed by Antti Koivisto.
421
422         Extract AbstractEventLoop out of WindowEventLoop as a preparation for adding WorkerEventLoop.
423
424         Also replaced m_activeTaskCount with a boolean m_isScheduledToRun since it doesn't need to count.
425
426         * WebCore.xcodeproj/project.pbxproj:
427         * dom/AbstractEventLoop.cpp: Added.
428         * dom/AbstractEventLoop.h: Added.
429         (WebCore::AbstractEventLoop): Added.
430         * dom/WindowEventLoop.cpp:
431         (WebCore::WindowEventLoop::WindowEventLoop): Deleted. Use the default constructor in the header instead.
432         (WebCore::WindowEventLoop::queueTask):
433         (WebCore::WindowEventLoop::suspend):
434         (WebCore::WindowEventLoop::resume):
435         (WebCore::WindowEventLoop::scheduleToRunIfNeeded): Extracted out of queueTask.
436         (WebCore::WindowEventLoop::run):
437         * dom/WindowEventLoop.h:
438
439 2019-10-18  Devin Rousso  <drousso@apple.com>
440
441         Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
442         https://bugs.webkit.org/show_bug.cgi?id=203159
443
444         Reviewed by Brian Burg.
445
446         Test: inspector/dom/setAllowEditingUserAgentShadowTrees.html
447
448         * inspector/agents/InspectorDOMAgent.h:
449         * inspector/agents/InspectorDOMAgent.cpp:
450         (WebCore::InspectorDOMAgent::assertEditableNode):
451         (WebCore::InspectorDOMAgent::setInspectedNode):
452         (WebCore::InspectorDOMAgent::setAllowEditingUserAgentShadowTrees): Added.
453
454 2019-10-17  Ryosuke Niwa  <rniwa@webkit.org>
455
456         Document::m_closeAfterStyleRecalc is unnecessary
457         https://bugs.webkit.org/show_bug.cgi?id=203143
458
459         Reviewed by Antti Koivisto.
460
461         Removed the code to defer implicit close until the style recalc is done
462         since we call FrameLoader::checkCompleted asynchronously via a timer these days.
463
464         * dom/Document.cpp:
465         (WebCore::Document::resolveStyle):
466         (WebCore::Document::implicitClose):
467         * dom/Document.h:
468
469 2019-10-17  Dean Jackson  <dino@apple.com>
470
471         texImage2D for a half-float texture only accepts null
472         https://bugs.webkit.org/show_bug.cgi?id=169999
473         <rdar://problem/31713571>
474
475         Reviewed by Simon Fraser.
476
477         After we initially implemented this, the extension was
478         modified such that texImage2D could upload to half-float
479         from a Uint16 array.
480
481         Test: fast/canvas/webgl/oes-texture-half-float-uint16.html
482
483         * html/canvas/WebGLRenderingContextBase.cpp:
484         (WebCore::WebGLRenderingContextBase::validateArrayBufferType): Accept
485         Uint16.
486
487 2019-10-18  Daniel Bates  <dabates@apple.com>
488
489         REGRESSION (r241747): [iOS] Adjust default SVG focus ring width to match width for HTML documents
490         https://bugs.webkit.org/show_bug.cgi?id=203011
491
492         Reviewed by Wenson Hsieh.
493
494         Update default user agent stylesheet for SVG documents (i.e. .svg resources) to use the same 3px
495         outline width for focused elements as we do for HTML documents.
496
497         This makes the test imported/blink/svg/custom/focus-ring-2.svg pass on iOS.
498
499         * css/svg.css:
500
501 2019-10-18  Jer Noble  <jer.noble@apple.com>
502
503         Add experimental HDR MediaCapabilities support.
504         https://bugs.webkit.org/show_bug.cgi?id=203113
505
506         Reviewed by Eric Carlson.
507
508         Tests: media/mediacapabilities/mock-decodingInfo-hdr.html
509                platform/mac/media/mediacapabilities/hevc-decodingInfo-hdr.html
510
511         Add support for MediaCapabilities.decodeInfo() HDR support detection.
512
513         Add new enum IDL types to MediaCapabilities and remove old unused ones. Add
514         mock implementation for HDR detection. Add Cocoa platform implementation.
515
516         * CMakeLists.txt:
517         * DerivedSources-input.xcfilelist:
518         * DerivedSources-output.xcfilelist:
519         * DerivedSources.make:
520         * Modules/mediacapabilities/ColorGamut.idl: 
521         * Modules/mediacapabilities/HdrMetadataType.idl: 
522         * Modules/mediacapabilities/ScreenLuminance.h: 
523         * Modules/mediacapabilities/TransferFunction.idl: 
524         * Modules/mediacapabilities/VideoConfiguration.idl:
525         * Scripts/GenerateSettings.rb:
526         * Sources.txt:
527         * WebCore.xcodeproj/project.pbxproj:
528         * bindings/scripts/CodeGenerator.pm:
529         (WK_ucfirst):
530         * bindings/scripts/CodeGeneratorJS.pm:
531         (ToMethodName):
532         * page/Settings.yaml:
533         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
534         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
535         * platform/mediacapabilities/ColorGamut.h: 
536         * platform/mediacapabilities/HdrMetadataType.h: 
537         * platform/mediacapabilities/TransferFunction.h: 
538         * platform/mediacapabilities/VideoConfiguration.h:
539         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
540         (WebCore::canDecodeMedia):
541         (WebCore::canEncodeMedia):
542
543 2019-10-18  Jiewen Tan  <jiewen_tan@apple.com>
544
545         [WebAuthn] Implement AuthenticatorCancel
546         https://bugs.webkit.org/show_bug.cgi?id=191523
547         <rdar://problem/55920204>
548
549         Reviewed by Brent Fulgham.
550
551         Covered by new tests in existing test files.
552
553         * Modules/credentialmanagement/CredentialsContainer.cpp:
554         (WebCore::CredentialsContainer::get):
555         (WebCore::CredentialsContainer::isCreate):
556         * Modules/webauthn/AuthenticatorCoordinator.cpp:
557         (WebCore::AuthenticatorCoordinator::create const):
558         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
559         * Modules/webauthn/AuthenticatorCoordinator.h:
560         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: Removed.
561         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
562         * Modules/webauthn/PublicKeyCredential.cpp:
563         (WebCore::PublicKeyCredential::tryCreate):
564         * Modules/webauthn/PublicKeyCredential.h:
565         * Modules/webauthn/PublicKeyCredentialData.h:
566         * Modules/webauthn/fido/DeviceRequestConverter.h:
567         * Modules/webauthn/fido/FidoHidMessage.cpp:
568         (fido::FidoHidMessage::FidoHidMessage):
569         * Modules/webauthn/fido/FidoHidPacket.cpp:
570         (fido::FidoHidInitPacket::getSerializedData const):
571         (fido::FidoHidContinuationPacket::getSerializedData const):
572         * Sources.txt:
573         * WebCore.xcodeproj/project.pbxproj:
574         * testing/MockWebAuthenticationConfiguration.h:
575         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::encode const):
576         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
577         * testing/MockWebAuthenticationConfiguration.idl:
578         Adds a new option to test AuthenticatorCancel.
579
580 2019-10-18  Simon Fraser  <simon.fraser@apple.com>
581
582         Add TextStream dumping for BasicShape types
583         https://bugs.webkit.org/show_bug.cgi?id=203150
584
585         Reviewed by Zalan Bujtas.
586
587         Add dumping for the classes, and make the BasicShape enum an enum class.
588
589         * css/BasicShapeFunctions.cpp:
590         (WebCore::valueForBasicShape):
591         * rendering/shapes/Shape.cpp:
592         (WebCore::Shape::createShape):
593         * rendering/style/BasicShapes.cpp:
594         (WebCore::BasicShapeCircle::dump const):
595         (WebCore::BasicShapeEllipse::dump const):
596         (WebCore::BasicShapePolygon::dump const):
597         (WebCore::BasicShapePath::dump const):
598         (WebCore::BasicShapeInset::dump const):
599         (WebCore::operator<<):
600         * rendering/style/BasicShapes.h:
601         (WebCore::BasicShapeCenterCoordinate::BasicShapeCenterCoordinate):
602
603 2019-10-18  Antti Koivisto  <antti@apple.com>
604
605         ElementRuleCollector function signature cleanups
606         https://bugs.webkit.org/show_bug.cgi?id=203153
607         <rdar://problem/56412684>
608
609         Unreviewed followup.
610
611         * css/ElementRuleCollector.cpp:
612         (WebCore::ElementRuleCollector::transferMatchedRules):
613
614         Try to appease MSVC.
615
616 2019-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
617
618         Load event must be fired only for the SVG structurally external elements and the outermost SVG element
619         https://bugs.webkit.org/show_bug.cgi?id=203044
620
621         Reviewed by Simon Fraser.
622
623         The SVG1.1 spec for SVGLoad event is:
624             https://www.w3.org/TR/SVG11/interact.html
625
626         The SVG2 spec for the load event is:
627             https://www.w3.org/TR/SVG/changes.html#interact
628             https://www.w3.org/TR/SVG/interact.html
629
630         SVG2 removes the SVGExternalResourcesRequired interface. It also simplifies
631         the rules for firing the load event and made them consistent with the HTML
632         specs. The plan is to remove SVGExternalResourcesRequired in a following
633         patch. This patch makes SVGExternalResourcesRequired have no effect on the
634         load event firing rules. It moves all the functionalities to SVGURIReference
635         as a step towards removing the SVGExternalResourcesRequired interface.
636
637         Test: svg/custom/image-load-event.html
638
639         * dom/Document.cpp:
640         (WebCore::Document::implicitClose):
641         Do not use the SVGLoad term. It has been removed from the specs.
642
643         * dom/ScriptElement.cpp:
644         (WebCore::ScriptElement::ScriptElement):
645         * dom/ScriptElement.h:
646         (WebCore::ScriptElement::errorOccurred const):
647         (WebCore::ScriptElement::setErrorOccurred):
648         Add a method to track the occurrence  of loading error. errorOccurred()
649         || haveFiredLoadEvent() means no pending loading activity.
650
651         * svg/SVGDocumentExtensions.cpp:
652         (WebCore::SVGDocumentExtensions::dispatchLoadEventToOutermostSVGElements):
653         (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements): Deleted.
654         * svg/SVGDocumentExtensions.h:
655         Do not use the SVGLoad term. 
656
657         * svg/SVGElement.cpp:
658         (WebCore::SVGElement::sendLoadEventIfPossible):
659         (WebCore::SVGElement::loadEventTimerFired):
660         (WebCore::SVGElement::loadEventTimer):
661         (WebCore::SVGElement::finishParsingChildren):
662         (WebCore::SVGElement::sendSVGLoadEventIfPossible): Deleted.
663         (WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously): Deleted.
664         (WebCore::SVGElement::svgLoadEventTimerFired): Deleted.
665         (WebCore::SVGElement::svgLoadEventTimer): Deleted.
666         * svg/SVGElement.h:
667         finishParsingChildren() won't fire 'load' event anymore. The 'load' event 
668         will be fired explicitly for the outermost SVG element from Document::implicitClose().
669
670         * svg/SVGExternalResourcesRequired.cpp:
671         (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
672         (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent): Deleted.
673         (WebCore::SVGExternalResourcesRequired::insertedIntoDocument): Deleted.
674         (WebCore::SVGExternalResourcesRequired::finishParsingChildren): Deleted.
675         (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const): Deleted.
676         * svg/SVGExternalResourcesRequired.h:
677         (WebCore::SVGExternalResourcesRequired::setHaveFiredLoadEvent): Deleted.
678         (WebCore::SVGExternalResourcesRequired::isParserInserted const): Deleted.
679         (WebCore::SVGExternalResourcesRequired::haveFiredLoadEvent const): Deleted.
680         * svg/SVGImageElement.cpp:
681         (WebCore::SVGImageElement::haveLoadedRequiredResources):
682         * svg/SVGImageLoader.cpp:
683         (WebCore::SVGImageLoader::dispatchLoadEvent):
684         The value of externalResourcesRequired() no longer controls firing the
685         'load' event.
686
687         * svg/SVGScriptElement.cpp:
688         (WebCore::SVGScriptElement::SVGScriptElement):
689         (WebCore::SVGScriptElement::insertedIntoAncestor):
690         (WebCore::SVGScriptElement::dispatchErrorEvent):
691         (WebCore::SVGScriptElement::finishParsingChildren): Deleted.
692         * svg/SVGScriptElement.h:
693         dispatchErrorEvent() is now a virtual function. Let SVGScriptElement
694         overrides it so it can track when the loader finishes its activity.
695
696         * svg/SVGStyleElement.cpp:
697         (WebCore::SVGStyleElement::SVGStyleElement):
698         * svg/SVGStyleElement.h:
699
700         * svg/SVGURIReference.cpp:
701         (WebCore::SVGURIReference::contextElement const):
702         (WebCore::SVGURIReference::parseAttribute):
703         (WebCore::SVGURIReference::haveLoadedRequiredResources const):
704         (WebCore::SVGURIReference::dispatchLoadEvent):
705         * svg/SVGURIReference.h:
706         (WebCore::SVGURIReference::haveFiredLoadEvent const):
707         (WebCore::SVGURIReference::setHaveFiredLoadEvent):
708         (WebCore::SVGURIReference::errorOccurred const):
709         (WebCore::SVGURIReference::setErrorOccurred):
710         SVGURIReference will decide whether the 'load' event can be fired or not.
711
712         * svg/SVGUseElement.cpp:
713         (WebCore::SVGUseElement::SVGUseElement):
714         (WebCore::SVGUseElement::insertedIntoAncestor):
715         (WebCore::SVGUseElement::notifyFinished):
716         (WebCore::SVGUseElement::finishParsingChildren): Deleted.
717         (WebCore::SVGUseElement::isValid const): Deleted.
718         (WebCore::SVGUseElement::haveLoadedRequiredResources): Deleted.
719         (WebCore::SVGUseElement::setHaveFiredLoadEvent): Deleted.
720         (WebCore::SVGUseElement::haveFiredLoadEvent const): Deleted.
721         (WebCore::SVGUseElement::svgLoadEventTimer): Deleted.
722         * svg/SVGUseElement.h:
723         SVGUseElement needs to track firing the load event or error occurrence 
724         the same way SVGImageElement and SVGScriptElement do.
725
726 2019-10-18  Antti Koivisto  <antti@apple.com>
727
728         ElementRuleCollector function signature cleanups
729         https://bugs.webkit.org/show_bug.cgi?id=203153
730
731         Reviewed by Zalan Bujtas.
732
733         Many functions in ElementRuleCollector take repetitive arguments that can be removed:
734
735         - Make includeEmptyRules argument a class member
736         - Remove RuleRange argument, update the ranges in rule transfer step.
737
738         * css/ElementRuleCollector.cpp:
739         (WebCore::MatchRequest::MatchRequest):
740         (WebCore::ElementRuleCollector::addMatchedRule):
741         (WebCore::ElementRuleCollector::collectMatchingRules):
742         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
743         (WebCore::ElementRuleCollector::transferMatchedRules):
744         (WebCore::ElementRuleCollector::matchAuthorRules):
745         (WebCore::ElementRuleCollector::matchesAnyAuthorRules):
746         (WebCore::ElementRuleCollector::collectMatchingAuthorRules):
747         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
748         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
749         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
750         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
751         (WebCore::ElementRuleCollector::matchPartPseudoElementRulesForScope):
752         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
753         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
754         (WebCore::ElementRuleCollector::matchUserRules):
755         (WebCore::ElementRuleCollector::matchUARules):
756         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
757         (WebCore::ElementRuleCollector::matchAllRules):
758         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
759         * css/ElementRuleCollector.h:
760         (WebCore::ElementRuleCollector::setIncludeEmptyRules):
761         (WebCore::ElementRuleCollector::transferMatchedRules):
762
763         Range update happens now here based on the supplied argument.
764
765         * css/StyleResolver.cpp:
766         (WebCore::StyleResolver::pseudoStyleForElement):
767         (WebCore::StyleResolver::pseudoStyleRulesForElement):
768 x
769 2019-10-18  Antti Koivisto  <antti@apple.com>
770
771         [CSS Shadow Parts] :part rules should be able to override style attribute
772         https://bugs.webkit.org/show_bug.cgi?id=202919
773
774         Reviewed by Zalan Bujtas.
775
776         Element inline style was simply appended to the matching declaration list and not sorted with the rest of the author style.
777         This used to work because before CSS Shadow Parts feature inline style would always win.
778
779         Fixing this involves refactoring the rule collection code to remove this assumption.
780
781         * css/ElementRuleCollector.cpp:
782         (WebCore::ElementRuleCollector::addMatchedRule):
783
784         Both initialize and update ranges here.
785
786         (WebCore::ElementRuleCollector::clearMatchedRules):
787         (WebCore::ElementRuleCollector::addElementStyleProperties):
788
789         Both initialize and update ranges here.
790
791         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
792
793         Split out transfering to a separate function.
794
795         (WebCore::ElementRuleCollector::transferMatchedRules):
796
797         Add a parameter to limit transfer to rules from a scope.
798
799         (WebCore::ElementRuleCollector::matchAuthorRules):
800         (WebCore::ElementRuleCollector::matchesAnyAuthorRules):
801
802         Replace hasMatchedRules() with a more specific function. This can use collectMatchingAuthorRules and avoids unnecessary sorting step.
803
804         (WebCore::ElementRuleCollector::collectMatchingAuthorRules):
805
806         Split out collecting the rules from matchAuthorRules. Like other collect functions, this doesn't do any sorting.
807
808         (WebCore::ElementRuleCollector::matchAllRules):
809
810         Add element inline style before transfering rules from the containing host scope.
811
812         (WebCore::ElementRuleCollector::addElementInlineStyleProperties):
813
814         Factor adding inline style into a function.
815
816 ]        * css/ElementRuleCollector.h:
817         (WebCore::ElementRuleCollector::hasMatchedRules const): Deleted.
818         * css/StyleProperties.h:
819         (WebCore::StylePropertiesBase::deref const):
820         (WebCore::StylePropertiesBase::deref): Deleted.
821
822         Make const to allow RefPtr<const StyleProperties>
823
824         * css/StyleResolver.cpp:
825         (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
826
827         Sort !important properties taking into account that the host scope has lower priority.
828
829         * style/StyleInvalidator.cpp:
830         (WebCore::Style::Invalidator::invalidateIfNeeded):
831
832 2019-10-18  Zalan Bujtas  <zalan@apple.com>
833
834         [LFC][TFC] Include horizontal spacing when checking for the extra horizontal space
835         https://bugs.webkit.org/show_bug.cgi?id=203154
836         <rdar://problem/56408032>
837
838         Reviewed by Antti Koivisto.
839
840         * layout/tableformatting/TableFormattingContext.cpp:
841         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
842
843 2019-10-18  Zalan Bujtas  <zalan@apple.com>
844
845         [LFC][TFC] Fix table's total horizontal spacing computation
846         https://bugs.webkit.org/show_bug.cgi?id=203151
847         <rdar://problem/56406930>
848
849         Reviewed by Antti Koivisto.
850
851         The horizontal spacing value sets the gaps between
852         1. first column and the left edge of the table's content box
853         2. between 2 columns
854         3. last column and the right edge of the table's content box
855         In case of 'n' columns, the number of gaps is 'n + 1'.
856
857         * layout/tableformatting/TableGrid.h:
858         (WebCore::Layout::TableGrid::totalHorizontalSpacing const):
859
860 2019-10-18  Zalan Bujtas  <zalan@apple.com>
861
862         [LFC][TFC] Cache table's width constraint values.
863         https://bugs.webkit.org/show_bug.cgi?id=203135
864         <rdar://problem/56396352>
865
866         Reviewed by Antti Koivisto.
867
868         This patch ensures that when computedIntrinsicWidthConstraints is called from both the preferred width and the actual layout codepaths during a layout frame, we don't
869         end up building up the grid twice.
870
871         * layout/tableformatting/TableFormattingContext.cpp:
872         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
873         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
874         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
875         * layout/tableformatting/TableGrid.cpp:
876         (WebCore::Layout::TableGrid::widthConstraints):
877         (WebCore::Layout::TableGrid::widthConstraints const): Deleted.
878         * layout/tableformatting/TableGrid.h:
879         (WebCore::Layout::TableGrid::hasComputedWidthConstraints const):
880
881 2019-10-18  Zalan Bujtas  <zalan@apple.com>
882
883         [LFC][BFC] TableFormattingContext::computedIntrinsicWidthConstraints should not expect a valid containing block's width
884         https://bugs.webkit.org/show_bug.cgi?id=203131
885         <rdar://problem/56394676>
886
887         Reviewed by Antti Koivisto.
888
889         When TableFormattingContext::computedIntrinsicWidthConstraints is called by the preferred width computation (<div style="float: left"><table>)
890         the containing block's width is not yet set (it gets computed based on the preferred width) so computedIntrinsicWidthConstraints should not be relying
891         on it. Let's move that logic out to TableFormattingContext::layoutInFlowContent() where it belongs. 
892
893         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
894         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
895         * layout/tableformatting/TableFormattingContext.cpp:
896         (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
897         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
898         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
899         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
900         (WebCore::Layout::TableFormattingContext::computedTableWidth): Deleted.
901         (WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace): Deleted.
902         * layout/tableformatting/TableFormattingContext.h:
903
904 2019-10-18  Zalan Bujtas  <zalan@apple.com>
905
906         [LFC][BFC] Fix block level formatting root inflow box height computation
907         https://bugs.webkit.org/show_bug.cgi?id=203085
908         <rdar://problem/56372306>
909
910         Reviewed by Antti Koivisto.
911
912         Section 10.6.7 (https://www.w3.org/TR/CSS22/visudet.html#root-height) defines the height computation for block level formatting context roots.
913         We already use it for floats, out-of-flow and block level boxes when overflow computes to not "visible".
914         This patch makes generic in-flow non-replaced BFC roots (e.g. principal block container box for <table>) compute their heights according to 10.6.7.
915
916         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
917         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
918
919 2019-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
920
921         [Clipboard API] Support navigator.clipboard.read()
922         https://bugs.webkit.org/show_bug.cgi?id=203021
923
924         Reviewed by Ryosuke Niwa.
925
926         Add support for navigator.clipboard.read(), which returns a promise that resolves to a list of ClipboardItems.
927         See below for more details.
928
929         Tests: editing/async-clipboard/clipboard-change-data-while-reading.html
930                editing/async-clipboard/clipboard-read-basic.html
931
932         * Modules/async-clipboard/Clipboard.cpp:
933         (WebCore::Clipboard::read):
934
935         Implement read(). This makes two calls to the platform pasteboard: the first to get the current change count,
936         and if the change count is different from the changeCount used for the last read() call (or there are no
937         existing clipboard items being tracked), then we request pasteboard item information for all items on the
938         pasteboard, and use this information to create new clipboard items. Otherwise, if the changeCount is still valid
939         for the current list of clipboard items, simply return these clipboard items.
940
941         If the changeCount ends up being different in between the initial changeCount request and when the pasteboard
942         item information is received, we immediately bail with a NotAllowedError. The new layout test
943         clipboard-change-data-while-reading.html exercises this scenario.
944
945         (WebCore::Clipboard::getType):
946         (WebCore::Clipboard::frame const):
947         * Modules/async-clipboard/Clipboard.h:
948         * Modules/async-clipboard/ClipboardItem.cpp:
949         (WebCore::ClipboardItem::blobFromString):
950         (WebCore::ClipboardItem::ClipboardItem):
951         (WebCore::ClipboardItem::create):
952         (WebCore::ClipboardItem::navigator):
953
954         Refactor this so that each clipboard item itself has a WeakPtr to its Navigator. This avoids having to follow
955         the weak pointer to the Clipboard to get to the Clipboard's navigator during garbage collection when computing
956         reachability from opaque roots, since this may happen on a background (GC) thread.
957
958         (WebCore::ClipboardItem::clipboard):
959         * Modules/async-clipboard/ClipboardItem.h:
960         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
961         (WebCore::ClipboardItemBindingsDataSource::getType):
962         (WebCore::blobFromString): Deleted.
963
964         Move this to ClipboardItem, and make it a static method.
965
966         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
967         (WebCore::ClipboardItemPasteboardDataSource::ClipboardItemPasteboardDataSource):
968         (WebCore::ClipboardItemPasteboardDataSource::getType):
969         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.h:
970
971         Move a couple of member variables (index and changeCount) out of ClipboardItem. Instead of having each
972         ClipboardItem keep track of this information, have the Clipboard that owns the ClipboardItem keep this
973         information. This means that reading data from ClipboardItem will (in a future patch) work by having the item
974         ask its Clipboard object to read data on its behalf.
975
976         * platform/Pasteboard.cpp:
977         (WebCore::Pasteboard::allPasteboardItemInfo const):
978         (WebCore::Pasteboard::pasteboardItemInfo const):
979         (WebCore::Pasteboard::readString):
980         (WebCore::Pasteboard::readBuffer):
981         (WebCore::Pasteboard::readURL):
982
983         Add some null checks to handle the case where there is no pasteboard strategy.
984
985 2019-10-17  Chris Dumez  <cdumez@apple.com>
986
987         Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
988         https://bugs.webkit.org/show_bug.cgi?id=203108
989         <rdar://problem/56375671>
990
991         Reviewed by Geoff Garen.
992
993         We don't want to go back to a visually empty page on back/forward navigation.
994
995         * history/BackForwardCache.cpp:
996         (WebCore::canCacheFrame):
997         * page/DiagnosticLoggingKeys.cpp:
998         (WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
999         * page/DiagnosticLoggingKeys.h:
1000
1001 2019-10-17  Simon Fraser  <simon.fraser@apple.com>
1002
1003         Only include "deep color" in layer tree dumps if a tests requests it
1004         https://bugs.webkit.org/show_bug.cgi?id=203125
1005
1006         Reviewed by Tim Horton.
1007         
1008         Layer tree dumping tests can fail when run on different devices because the "deep color"
1009         property on layers is device-dependent. Stop dumping this by default, and have one test
1010         that sets the bit. iphone-7 is the only device we test that has deep color support.
1011
1012         Tests: compositing/contents-format/deep-color-backing-store.html
1013                compositing/contents-format/ipad/deep-color-backing-store.html
1014                compositing/contents-format/iphone-7/deep-color-backing-store.html
1015
1016         * page/Frame.h:
1017         * platform/graphics/GraphicsLayerClient.h:
1018         * platform/graphics/ca/GraphicsLayerCA.cpp:
1019         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1020         * rendering/RenderLayerCompositor.cpp:
1021         (WebCore::RenderLayerCompositor::layerTreeAsText):
1022         * testing/Internals.cpp:
1023         (WebCore::toLayerTreeFlags):
1024         * testing/Internals.h:
1025         * testing/Internals.idl:
1026
1027 2019-10-17  Dean Jackson  <dino@apple.com>
1028
1029         ctx.font = "" asserts in CSS parser
1030         https://bugs.webkit.org/show_bug.cgi?id=203127
1031         <rdar://problem/56391016>
1032
1033         Reviewed by Devin Rousso.
1034
1035         The HTML specification says:
1036         "values that cannot be parsed as CSS font values are ignored", so
1037         return early if we get an empty string, otherwise the CSS parser
1038         will assert. This was the only case I could find where we sidestepped
1039         most of the parsing infrastructure and injected a raw string.
1040
1041         Test: http/wpt/2dcontext/text-styles/2d.text.font.parse.invalid.html
1042
1043         * html/canvas/CanvasRenderingContext2D.cpp:
1044         (WebCore::CanvasRenderingContext2D::setFont):
1045
1046 2019-10-17  Ryosuke Niwa  <rniwa@webkit.org>
1047
1048         Integrate resize event with HTML5 event loop
1049         https://bugs.webkit.org/show_bug.cgi?id=202964
1050
1051         Reviewed by Geoffrey Garen.
1052
1053         Dispatch resize events in "run the resize steps" during the "update the rendering":
1054         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
1055
1056         Exisitng code in WebCore which was dispatching or scheduling dispatching of resize events now simply sets
1057         a flag on document and schedules a rendering update. In Page::updateRendering, we fire resize events on
1058         any documents with this flag set.
1059
1060         Test: fast/events/resize-subframe-in-rendering-update.html
1061
1062         * dom/Document.cpp:
1063         (WebCore::Document::setNeedsDOMWindowResizeEvent): Added.
1064         (WebCore::Document::setNeedsVisualViewportResize): Added.
1065         (WebCore::Document::runResizeSteps): Added. https://drafts.csswg.org/cssom-view/#run-the-resize-steps
1066         * dom/Document.h:
1067         * page/DOMWindow.cpp:
1068         (WebCore::DOMWindow::resizeTo const):
1069         * page/FrameView.cpp:
1070         (WebCore::FrameView::sendResizeEventIfNeeded): Now sets m_needsDOMWindowResizeEvent on Document instead of
1071         enqueuing a resize event.
1072         * page/Page.cpp:
1073         (WebCore::Page::updateRendering): Call runResizeSteps on each document.
1074         (WebCore::Page::collectDocuments): Added.
1075         * page/Page.h:
1076         * page/VisualViewport.cpp:
1077         (WebCore::VisualViewport::enqueueResizeEvent):
1078
1079 2019-10-17  Chris Dumez  <cdumez@apple.com>
1080
1081         Unreviewed, rolling out r251255.
1082
1083         This is causing the existing back/forward tests to be flaky
1084
1085         Reverted changeset:
1086
1087         "Don't put pages that have not reached the non-visually empty
1088         layout milestone in the back/forward cache"
1089         https://bugs.webkit.org/show_bug.cgi?id=203108
1090         https://trac.webkit.org/changeset/251255
1091
1092 2019-10-17  Mark Lam  <mark.lam@apple.com>
1093
1094         Use constexpr in more places and remove some unnecessary external linkage.
1095         https://bugs.webkit.org/show_bug.cgi?id=203115
1096
1097         Reviewed by Yusuke Suzuki.
1098
1099         No new tests because this patch adds no new functionality.
1100
1101         * html/track/TextTrackCueGeneric.cpp:
1102         * html/track/VTTCue.cpp:
1103         * page/EventHandler.cpp:
1104         (WebCore::SyntheticTouchPoint::SyntheticTouchPoint):
1105         * page/FrameTree.h:
1106         * page/scrolling/ScrollingMomentumCalculator.cpp:
1107         (WebCore::projectedInertialScrollDistance):
1108         * platform/graphics/FontTaggedSettings.h:
1109         * platform/graphics/Region.cpp:
1110         * platform/graphics/filters/FELighting.cpp:
1111         * rendering/TableLayout.h:
1112         * rendering/svg/SVGRenderingContext.h:
1113
1114 2019-10-17  Simon Fraser  <simon.fraser@apple.com>
1115
1116         [ Mojave+ ] Layout Test compositing/fixed-with-main-thread-scrolling.html is a flaky timeout
1117         https://bugs.webkit.org/show_bug.cgi?id=198757
1118
1119         Reviewed by Tim Horton.
1120         
1121         WheelEventTestMonitor depends on "deferral reasons" getting added and removed, such that there is always
1122         at least one reason active until scrolling quiesces.
1123
1124         WheelEventTestMonitor made the incorrect assumption that every call into ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent()
1125         would result in a scroll change making it to the main thread, so it would defer "ScrollingThreadSyncNeeded" there,
1126         and rely on AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() to remove that deferral reason.
1127         That assumption is wrong, because wheel events may coalesce, or have no impact on scroll position if already scrolled
1128         to the max/min extent (e.g. when rubber banding).
1129         
1130         Fix by adding a new "HandlingWheelEvent" deferral reason for the duration that the scrolling thread is processing an wheel event,
1131         and then having ScrollingThreadSyncNeeded just represent the phase where any resulting scroll is being sent to the UI process.
1132         These phases should always overlap.
1133         
1134         This required moving isMonitoringWheelEvents() from the root scrolling node to the ScrollingTree.
1135
1136         * page/WheelEventTestMonitor.cpp:
1137         (WebCore::operator<<):
1138         * page/WheelEventTestMonitor.h:
1139         * page/scrolling/AsyncScrollingCoordinator.cpp:
1140         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1141         * page/scrolling/ScrollingTree.cpp:
1142         (WebCore::ScrollingTree::commitTreeState):
1143         * page/scrolling/ScrollingTree.h:
1144         (WebCore::ScrollingTree::isMonitoringWheelEvents const):
1145         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1146         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1147         * page/scrolling/ScrollingTreeScrollingNode.h:
1148         * page/scrolling/ThreadedScrollingTree.cpp:
1149         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1150         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1151         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
1152         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
1153         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
1154
1155 2019-10-17  Ryosuke Niwa  <rniwa@webkit.org>
1156
1157         Make requestIdleCallback suspendable
1158         https://bugs.webkit.org/show_bug.cgi?id=203023
1159
1160         Reviewed by Chris Dumez.
1161
1162         Make requestIdleCallback suspendable by making WindowEventLoop itself suspendable.
1163         Because WindowEventLoop can be shared across documents, we don't want to make it an ActiveDOMObject.
1164
1165         Instead, we would make CachedFrameBase::restore and CachedFrame manually invoke suspend & resume.
1166
1167         Test: requestidlecallback/requestidlecallback-in-page-cache.html
1168
1169         * dom/Document.h:
1170         (WebCore::Document::eventLoopIfExists): Added. This should probably go away once most of the event loop
1171         is implemented since we're almost always going to have this object then.
1172         * dom/WindowEventLoop.cpp:
1173         (WebCore::WindowEventLoop::queueTask): Because m_tasks may contain tasks of suspended documents,
1174         we check m_activeTaskCount, which is only positive when there is a task for non-suspended documents,
1175         to decide whether we schedule a callback or not.
1176         (WebCore::WindowEventLoop::suspend): Added. No-op for now.
1177         (WebCore::WindowEventLoop::resume): Added. Schedule a callback if there is a task associated with
1178         this document.
1179         (WebCore::WindowEventLoop::run): Skip a task for a suspended document, and add it back to m_tasks along
1180         with other tasks that got scheduled by running the current working set of tasks.
1181         * dom/WindowEventLoop.h:
1182         * history/CachedFrame.cpp:
1183         (WebCore::CachedFrameBase::restore):
1184         (WebCore::CachedFrame::CachedFrame):
1185
1186 2019-10-17  Chris Dumez  <cdumez@apple.com>
1187
1188         Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
1189         https://bugs.webkit.org/show_bug.cgi?id=203108
1190
1191         Reviewed by Geoffrey Garen.
1192
1193         We don't want to go back to a visually empty page on back/forward navigation.
1194
1195         * history/BackForwardCache.cpp:
1196         (WebCore::canCacheFrame):
1197         * page/DiagnosticLoggingKeys.cpp:
1198         (WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
1199         * page/DiagnosticLoggingKeys.h:
1200
1201 2019-10-17  Dirk Schulze  <krit@webkit.org>
1202
1203         transform-box: content-box, stroke-box missing
1204         https://bugs.webkit.org/show_bug.cgi?id=201892
1205
1206         Reviewed by Simon Fraser.
1207
1208         Added the keywords content-box and stroke-box to the
1209         transform-box CSS property.
1210         Those keywords were added to the spec after the implementation
1211         in WebKit.
1212
1213         Test: transforms/transform-box.html
1214
1215         * css/CSSPrimitiveValueMappings.h:
1216         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1217         (WebCore::CSSPrimitiveValue::operator TransformBox const):
1218         * css/CSSProperties.json:
1219         * css/CSSValueKeywords.in:
1220         * css/parser/CSSPropertyParser.cpp:
1221         (WebCore::CSSPropertyParser::parseSingleValue):
1222         * rendering/RenderLayer.cpp:
1223         (WebCore::computeReferenceBox):
1224         (WebCore::transformBoxToCSSBoxType):
1225         (WebCore::RenderLayer::currentTransform const):
1226         * rendering/style/RenderStyleConstants.h:
1227         * svg/SVGGraphicsElement.cpp:
1228         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
1229
1230 2019-10-17  Youenn Fablet  <youenn@apple.com>
1231
1232         SincResampler does not need to create a new AudioBus for each consumeSource call
1233         https://bugs.webkit.org/show_bug.cgi?id=202983
1234
1235         Reviewed by Eric Carlson.
1236
1237         Allocate an internal AudioBus once and for all.
1238         No observable change of behavior.
1239
1240         * platform/audio/SincResampler.cpp:
1241         (WebCore::SincResampler::consumeSource):
1242         * platform/audio/SincResampler.h:
1243
1244 2019-10-17  Chris Dumez  <cdumez@apple.com>
1245
1246         Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
1247         https://bugs.webkit.org/show_bug.cgi?id=203086
1248
1249         Reviewed by Geoffrey Garen.
1250
1251         Rename ActiveDOMObject::canSuspendForDocumentSuspension() to shouldPreventEnteringBackForwardCache_DEPRECATED()
1252         to make it clear that no new overrides should be added and that it is no longer OK to prevent the page from
1253         entering the back/forward cache. Also provide a default implementation that returns false so that well-behaved
1254         classes no longer need to override this.
1255
1256         * Modules/applepay/ApplePaySession.cpp:
1257         (WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1258         (WebCore::ApplePaySession::canSuspendForDocumentSuspension const): Deleted.
1259         * Modules/applepay/ApplePaySession.h:
1260         * Modules/cache/DOMCache.cpp:
1261         (WebCore::DOMCache::canSuspendForDocumentSuspension const): Deleted.
1262         * Modules/cache/DOMCache.h:
1263         * Modules/cache/DOMCacheStorage.cpp:
1264         (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const): Deleted.
1265         * Modules/cache/DOMCacheStorage.h:
1266         * Modules/encryptedmedia/MediaKeySession.cpp:
1267         (WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1268         (WebCore::MediaKeySession::canSuspendForDocumentSuspension const): Deleted.
1269         * Modules/encryptedmedia/MediaKeySession.h:
1270         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1271         (WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1272         (WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension const): Deleted.
1273         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1274         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
1275         (WebCore::FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1276         (WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const): Deleted.
1277         * Modules/entriesapi/FileSystemDirectoryReader.h:
1278         * Modules/entriesapi/FileSystemEntry.cpp:
1279         (WebCore::FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1280         (WebCore::FileSystemEntry::canSuspendForDocumentSuspension const): Deleted.
1281         * Modules/entriesapi/FileSystemEntry.h:
1282         * Modules/fetch/FetchRequest.cpp:
1283         (WebCore::FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1284         (WebCore::FetchRequest::canSuspendForDocumentSuspension const): Deleted.
1285         * Modules/fetch/FetchRequest.h:
1286         * Modules/fetch/FetchResponse.cpp:
1287         (WebCore::FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1288         (WebCore::FetchResponse::canSuspendForDocumentSuspension const): Deleted.
1289         * Modules/fetch/FetchResponse.h:
1290         * Modules/geolocation/Geolocation.cpp:
1291         (WebCore::Geolocation::page const):
1292         (WebCore::Geolocation::canSuspendForDocumentSuspension const): Deleted.
1293         * Modules/geolocation/Geolocation.h:
1294         * Modules/indexeddb/IDBDatabase.cpp:
1295         (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): Deleted.
1296         * Modules/indexeddb/IDBDatabase.h:
1297         * Modules/indexeddb/IDBIndex.cpp:
1298         (WebCore::IDBIndex::canSuspendForDocumentSuspension const): Deleted.
1299         * Modules/indexeddb/IDBIndex.h:
1300         * Modules/indexeddb/IDBObjectStore.cpp:
1301         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const): Deleted.
1302         * Modules/indexeddb/IDBObjectStore.h:
1303         * Modules/indexeddb/IDBRequest.cpp:
1304         (WebCore::IDBRequest::canSuspendForDocumentSuspension const): Deleted.
1305         * Modules/indexeddb/IDBRequest.h:
1306         * Modules/indexeddb/IDBTransaction.cpp:
1307         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): Deleted.
1308         * Modules/indexeddb/IDBTransaction.h:
1309         * Modules/mediarecorder/MediaRecorder.cpp:
1310         (WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1311         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const): Deleted.
1312         * Modules/mediarecorder/MediaRecorder.h:
1313         * Modules/mediasource/MediaSource.cpp:
1314         (WebCore::MediaSource::canSuspendForDocumentSuspension const): Deleted.
1315         * Modules/mediasource/MediaSource.h:
1316         * Modules/mediasource/SourceBuffer.cpp:
1317         (WebCore::SourceBuffer::canSuspendForDocumentSuspension const): Deleted.
1318         * Modules/mediasource/SourceBuffer.h:
1319         * Modules/mediasource/SourceBufferList.cpp:
1320         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Deleted.
1321         * Modules/mediasource/SourceBufferList.h:
1322         * Modules/mediastream/MediaDevices.cpp:
1323         (WebCore::MediaDevices::canSuspendForDocumentSuspension const): Deleted.
1324         * Modules/mediastream/MediaDevices.h:
1325         * Modules/mediastream/MediaStream.cpp:
1326         (WebCore::MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1327         (WebCore::MediaStream::canSuspendForDocumentSuspension const): Deleted.
1328         * Modules/mediastream/MediaStream.h:
1329         * Modules/mediastream/MediaStreamTrack.cpp:
1330         (WebCore::MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1331         (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension const): Deleted.
1332         * Modules/mediastream/MediaStreamTrack.h:
1333         * Modules/mediastream/RTCDTMFSender.cpp:
1334         (WebCore::RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1335         (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const): Deleted.
1336         * Modules/mediastream/RTCDTMFSender.h:
1337         * Modules/mediastream/RTCDataChannel.h:
1338         * Modules/mediastream/RTCPeerConnection.cpp:
1339         (WebCore::RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1340         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const): Deleted.
1341         * Modules/mediastream/RTCPeerConnection.h:
1342         * Modules/mediastream/UserMediaRequest.cpp:
1343         (WebCore::UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1344         (WebCore::UserMediaRequest::canSuspendForDocumentSuspension const): Deleted.
1345         * Modules/mediastream/UserMediaRequest.h:
1346         * Modules/notifications/Notification.cpp:
1347         (WebCore::Notification::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1348         (WebCore::Notification::canSuspendForDocumentSuspension const): Deleted.
1349         * Modules/notifications/Notification.h:
1350         * Modules/paymentrequest/PaymentRequest.cpp:
1351         (WebCore::PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1352         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Deleted.
1353         * Modules/paymentrequest/PaymentRequest.h:
1354         * Modules/paymentrequest/PaymentResponse.cpp:
1355         (WebCore::PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1356         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Deleted.
1357         * Modules/paymentrequest/PaymentResponse.h:
1358         * Modules/pictureinpicture/PictureInPictureWindow.cpp:
1359         (WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const): Deleted.
1360         * Modules/pictureinpicture/PictureInPictureWindow.h:
1361         * Modules/webaudio/AudioContext.cpp:
1362         (WebCore::AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1363         (WebCore::AudioContext::canSuspendForDocumentSuspension const): Deleted.
1364         * Modules/webaudio/AudioContext.h:
1365         * Modules/webdatabase/DatabaseContext.cpp:
1366         (WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1367         (WebCore::DatabaseContext::canSuspendForDocumentSuspension const): Deleted.
1368         * Modules/webdatabase/DatabaseContext.h:
1369         * Modules/webgpu/GPUCanvasContext.h:
1370         * Modules/websockets/WebSocket.cpp:
1371         (WebCore::WebSocket::canSuspendForDocumentSuspension const): Deleted.
1372         * Modules/websockets/WebSocket.h:
1373         * Modules/webvr/VRDisplay.cpp:
1374         (WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1375         (WebCore::VRDisplay::canSuspendForDocumentSuspension const): Deleted.
1376         * Modules/webvr/VRDisplay.h:
1377         * animation/WebAnimation.cpp:
1378         (WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1379         (WebCore::WebAnimation::canSuspendForDocumentSuspension const): Deleted.
1380         * animation/WebAnimation.h:
1381         * css/FontFaceSet.cpp:
1382         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const): Deleted.
1383         * css/FontFaceSet.h:
1384         * dom/ActiveDOMObject.h:
1385         * dom/GenericEventQueue.cpp:
1386         (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const): Deleted.
1387         * dom/GenericEventQueue.h:
1388         * dom/MessagePort.cpp:
1389         (WebCore::MessagePort::canSuspendForDocumentSuspension const): Deleted.
1390         * dom/MessagePort.h:
1391         * dom/ScriptExecutionContext.cpp:
1392         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
1393         * fileapi/FileReader.cpp:
1394         (WebCore::FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1395         (WebCore::FileReader::canSuspendForDocumentSuspension const): Deleted.
1396         * fileapi/FileReader.h:
1397         * html/HTMLMarqueeElement.cpp:
1398         (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension const): Deleted.
1399         * html/HTMLMarqueeElement.h:
1400         * html/HTMLMediaElement.cpp:
1401         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): Deleted.
1402         * html/HTMLMediaElement.h:
1403         * html/HTMLSourceElement.cpp:
1404         (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension const): Deleted.
1405         * html/HTMLSourceElement.h:
1406         * html/ImageBitmap.cpp:
1407         * html/PublicURLManager.cpp:
1408         (WebCore::PublicURLManager::canSuspendForDocumentSuspension const): Deleted.
1409         * html/PublicURLManager.h:
1410         * html/canvas/WebGLRenderingContextBase.cpp:
1411         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const): Deleted.
1412         * html/canvas/WebGLRenderingContextBase.h:
1413         * html/track/TrackListBase.cpp:
1414         (WebCore::TrackListBase::canSuspendForDocumentSuspension const): Deleted.
1415         * html/track/TrackListBase.h:
1416         * page/EventSource.cpp:
1417         (WebCore::EventSource::canSuspendForDocumentSuspension const): Deleted.
1418         * page/EventSource.h:
1419         * page/IntersectionObserver.cpp:
1420         (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): Deleted.
1421         * page/IntersectionObserver.h:
1422         * page/ResizeObserver.cpp:
1423         (WebCore::ResizeObserver::canSuspendForDocumentSuspension const): Deleted.
1424         * page/ResizeObserver.h:
1425         * page/SuspendableTimer.cpp:
1426         (WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const): Deleted.
1427         * page/SuspendableTimer.h:
1428         * platform/SuspendableTaskQueue.cpp:
1429         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const): Deleted.
1430         * platform/SuspendableTaskQueue.h:
1431         * testing/Internals.cpp:
1432         * workers/Worker.cpp:
1433         (WebCore::Worker::canSuspendForDocumentSuspension const): Deleted.
1434         * workers/Worker.h:
1435         * workers/service/ServiceWorker.cpp:
1436         (WebCore::ServiceWorker::canSuspendForDocumentSuspension const): Deleted.
1437         * workers/service/ServiceWorker.h:
1438         * workers/service/ServiceWorkerContainer.cpp:
1439         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): Deleted.
1440         * workers/service/ServiceWorkerContainer.h:
1441         * workers/service/ServiceWorkerRegistration.cpp:
1442         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const): Deleted.
1443         * workers/service/ServiceWorkerRegistration.h:
1444         * xml/XMLHttpRequest.cpp:
1445         (WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1446         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const): Deleted.
1447         * xml/XMLHttpRequest.h:
1448
1449 2019-10-17  Zalan Bujtas  <zalan@apple.com>
1450
1451         [LFC][TFC] Table formatting context accesses geometry information from parent BFC
1452         https://bugs.webkit.org/show_bug.cgi?id=203082
1453         <rdar://problem/56370827>
1454
1455         Reviewed by Antti Koivisto.
1456
1457         Tables are wrapped in a 2 level formatting context structure. A <table> element initiates a block formatting context for its principal table box
1458         where the caption and the table content live. It also initiates a table wrapper box which establishes the table formatting context.
1459         In many cases the TFC needs access to the parent (generated) BFC.
1460
1461         * layout/FormattingContext.cpp:
1462         (WebCore::Layout::FormattingContext::geometryForBox const):
1463         * layout/FormattingContext.h:
1464         * layout/tableformatting/TableFormattingContext.cpp:
1465         (WebCore::Layout::TableFormattingContext::computedTableWidth):
1466
1467 2019-10-17  Zalan Bujtas  <zalan@apple.com>
1468
1469         [LFC][Painting] Add support for image/background image painting
1470         https://bugs.webkit.org/show_bug.cgi?id=203054
1471         <rdar://problem/56347733>
1472
1473         Reviewed by Antti Koivisto.
1474
1475         In addition to image rendering, this patch also addresses various run/decoration painting issues.
1476
1477         * layout/displaytree/DisplayPainter.cpp:
1478         (WebCore::Display::paintBoxDecoration):
1479         (WebCore::Display::paintInlineContent):
1480         (WebCore::Display::absoluteDisplayBox):
1481         (WebCore::Display::paintBoxDecorationAndChildren):
1482         (WebCore::Display::Painter::paint):
1483         * layout/displaytree/DisplayRun.h:
1484         (WebCore::Display::Run::setImage):
1485         (WebCore::Display::Run::image const):
1486         * layout/inlineformatting/InlineLine.cpp:
1487         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1488         (WebCore::Layout::Line::appendReplacedInlineBox):
1489         * layout/layouttree/LayoutReplaced.h:
1490         (WebCore::Layout::Replaced::setCachedImage):
1491         (WebCore::Layout::Replaced::cachedImage const):
1492         * layout/layouttree/LayoutTreeBuilder.cpp:
1493         (WebCore::Layout::TreeBuilder::createLayoutBox):
1494
1495 2019-10-17  Zalan Bujtas  <zalan@apple.com>
1496
1497         [LFC][IFC] Add Display::Run/LineBox mapping
1498         https://bugs.webkit.org/show_bug.cgi?id=203051
1499         <rdar://problem/56342487>
1500
1501         Reviewed by Antti Koivisto.
1502
1503         Mapping enables us to paint baseline aligned runs on the current line. This is temporary until after we figure out the final run/line structure.
1504
1505         * layout/FormattingContextGeometry.cpp:
1506         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1507         * layout/Verification.cpp:
1508         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
1509         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1510         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1511         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1512         * layout/displaytree/DisplayPainter.cpp:
1513         (WebCore::Display::paintInlineContent):
1514         * layout/inlineformatting/InlineFormattingContext.cpp:
1515         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
1516         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1517         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
1518         * layout/inlineformatting/InlineFormattingState.h:
1519         (WebCore::Layout::InlineFormattingState::addLineBox):
1520         (WebCore::Layout::InlineFormattingState::lineBoxForRun const):
1521         (WebCore::Layout::InlineFormattingState::addInlineRun):
1522         * layout/inlineformatting/InlineLine.cpp:
1523         (WebCore::Layout::Line::Run::Run):
1524         (WebCore::Layout::Line::alignContentVertically):
1525         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
1526         * layout/inlineformatting/InlineLine.h:
1527         (WebCore::Layout::Line::Run::displayRun const):
1528         (WebCore::Layout::Line::Run::logicalRect const):
1529         (WebCore::Layout::Line::Run::adjustLogicalTop):
1530         (WebCore::Layout::Line::Run::moveVertically):
1531         (WebCore::Layout::Line::Run::moveHorizontally):
1532         (WebCore::Layout::Line::Run::expand):
1533         * layout/inlineformatting/InlineLineBox.h:
1534         * layout/inlineformatting/InlineLineLayout.h:
1535         * layout/layouttree/LayoutTreeBuilder.cpp:
1536         (WebCore::Layout::outputInlineRuns):
1537
1538 2019-10-17  Antoine Quint  <graouts@apple.com>
1539
1540         [Web Animations] Enable the Web Animations JavaScript API by default
1541         https://bugs.webkit.org/show_bug.cgi?id=203075
1542
1543         Reviewed by Antti Koivisto.
1544
1545         * page/RuntimeEnabledFeatures.h:
1546
1547 2019-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1548
1549         Unreviewed, fix watchOS and tvOS builds after r251224
1550
1551         * platform/ios/PlatformPasteboardIOS.mm:
1552         (WebCore::shouldTreatAtLeastOneTypeAsFile):
1553
1554         Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
1555         section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.
1556
1557 2019-10-17  Youenn Fablet  <youenn@apple.com>
1558
1559         MultiChannelResampler does not need to recreate a ChannelProvider for every process call
1560         https://bugs.webkit.org/show_bug.cgi?id=202982
1561
1562         Reviewed by Eric Carlson.
1563
1564         We no longer allocate a new ChannelProvider for every process call.
1565         No observable change of behavior.
1566
1567         * platform/audio/MultiChannelResampler.cpp:
1568         (WebCore::MultiChannelResampler::ChannelProvider::ChannelProvider):
1569         (WebCore::MultiChannelResampler::ChannelProvider::setProvider):
1570         (WebCore::MultiChannelResampler::MultiChannelResampler):
1571         (WebCore::MultiChannelResampler::process):
1572         * platform/audio/MultiChannelResampler.h:
1573
1574 2019-10-17  Devin Rousso  <drousso@apple.com>
1575
1576         Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
1577         https://bugs.webkit.org/show_bug.cgi?id=200384
1578         <rdar://problem/53850352>
1579
1580         Reviewed by Joseph Pecoraro.
1581
1582         * inspector/InspectorFrontendClient.h:
1583         (WebCore::InspectorFrontendClient::backendCommandsURL): Deleted.
1584         (WebCore::InspectorFrontendClient::debuggableType): Deleted.
1585         * inspector/InspectorFrontendClientLocal.h:
1586         * page/PageDebuggable.h:
1587         (WebCore::PageDebuggable::type const):
1588         * testing/Internals.cpp:
1589         (WebCore::InspectorStubFrontend::debuggableType const): Added.
1590         Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).
1591
1592 2019-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
1593
1594         [Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard may contain files
1595         https://bugs.webkit.org/show_bug.cgi?id=203065
1596
1597         Reviewed by Tim Horton.
1598
1599         Platform-specific pasteboard refactoring before tackling webkit.org/b/203021. See below for details. No new
1600         tests, as there is no change in behavior.
1601
1602         * platform/Pasteboard.h:
1603         (WebCore::Pasteboard::changeCount const):
1604
1605         Add a stub for Pasteboard::changeCount() on non-Cocoa platforms.
1606
1607         * platform/ios/PlatformPasteboardIOS.mm:
1608         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
1609
1610         Move this helper function farther up the file, so it can be used in more places.
1611
1612         (WebCore::webSafeTypes):
1613
1614         Add a separate helper to compute the list of web-safe MIME types (for instance, "text/plain") given a list of
1615         platform types, and a function to determine whether to avoid exposing a given URL to the DOM.
1616
1617         (WebCore::shouldTreatAtLeastOneTypeAsFile):
1618
1619         Split this out into a separate helper function, so that it can be invoked when determining whether a given
1620         NSItemProvider is suspected to contain file paths. In the case where we're getting the full list of types that
1621         are safe for the DOM to read, we want to pass in the entire pasteboard object and iterate through all of the
1622         available types in search for something that could feasibly accompany a file URL.
1623
1624         In the case of computing the web-safe types per item, we only have an item provider, in which case we only
1625         iterate through the types in that NSItemProvider. See call sites below for examples.
1626
1627         (WebCore::PlatformPasteboard::informationForItemAtIndex):
1628
1629         Invoke the new `webSafeTypes` helper method.
1630
1631         (WebCore::pasteboardMayContainFilePaths):
1632         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1633
1634         Invoke the new `webSafeTypes` helper method.
1635
1636 2019-10-16  Brent Fulgham  <bfulgham@apple.com>
1637
1638         [FTW] Correct radial gradient handling of various radius orderings
1639         https://bugs.webkit.org/show_bug.cgi?id=202815
1640
1641         Reviewed by Per Arne Vollan.
1642
1643         Revise the 'generateGradient' implementation to recognize that the
1644         radius arguments might not be in increasing order. Direct2D's
1645         implementation does expect this, so we need to swap order and
1646         revise the gradient range to match.
1647
1648         Drive-by fix: Stop building unused image decoders if building with
1649         the Apple stack.
1650
1651         * PlatformFTW.cmake: Stop building unused image decoders.
1652         * platform/graphics/win/GradientDirect2D.cpp:
1653         (WebCore::Gradient::generateGradient):
1654
1655 2019-10-16  Chris Dumez  <cdumez@apple.com>
1656
1657         Rename PageCache to BackForwardCache
1658         https://bugs.webkit.org/show_bug.cgi?id=203048
1659
1660         Reviewed by Alex Christensen.
1661
1662         Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.
1663
1664         * Modules/geolocation/Geolocation.cpp:
1665         (WebCore::Geolocation::suspend):
1666         * Modules/mediarecorder/MediaRecorder.cpp:
1667         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
1668         * Modules/mediastream/RTCPeerConnection.cpp:
1669         (WebCore::RTCPeerConnection::suspend):
1670         * Modules/websockets/WebSocket.cpp:
1671         (WebCore::WebSocket::suspend):
1672         * Sources.txt:
1673         * WebCore.xcodeproj/project.pbxproj:
1674         * animation/WebAnimation.cpp:
1675         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
1676         * bindings/js/WindowProxy.cpp:
1677         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
1678         * bindings/js/WindowProxy.h:
1679         * dom/ActiveDOMObject.h:
1680         * dom/Document.cpp:
1681         (WebCore::Document::~Document):
1682         (WebCore::Document::scheduleStyleRecalc):
1683         (WebCore::Document::needsStyleRecalc const):
1684         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
1685         (WebCore::Document::createRenderTree):
1686         (WebCore::Document::didBecomeCurrentDocumentInFrame):
1687         (WebCore::Document::attachToCachedFrame):
1688         (WebCore::Document::detachFromCachedFrame):
1689         (WebCore::Document::prepareForDestruction):
1690         (WebCore::Document::adjustFocusedNodeOnNodeRemoval):
1691         (WebCore::Document::setFocusedElement):
1692         (WebCore::Document::takeDOMWindowFrom):
1693         (WebCore::Document::setBackForwardCacheState):
1694         (WebCore::Document::suspend):
1695         (WebCore::Document::resume):
1696         (WebCore::Document::topDocument const):
1697         * dom/Document.h:
1698         (WebCore::Document::backForwardCacheState const):
1699         * dom/FullscreenManager.cpp:
1700         (WebCore::FullscreenManager::willEnterFullscreen):
1701         (WebCore::FullscreenManager::didEnterFullscreen):
1702         (WebCore::FullscreenManager::willExitFullscreen):
1703         (WebCore::FullscreenManager::didExitFullscreen):
1704         * dom/FullscreenManager.h:
1705         * dom/ScriptExecutionContext.cpp:
1706         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
1707         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
1708         * history/BackForwardCache.cpp: Renamed from Source/WebCore/history/PageCache.cpp.
1709         (WebCore::logBackForwardCacheFailureDiagnosticMessage):
1710         (WebCore::canCacheFrame):
1711         (WebCore::canCachePage):
1712         (WebCore::BackForwardCache::singleton):
1713         (WebCore::BackForwardCache::BackForwardCache):
1714         (WebCore::BackForwardCache::dump const):
1715         (WebCore::BackForwardCache::canCache const):
1716         (WebCore::BackForwardCache::pruneToSizeNow):
1717         (WebCore::BackForwardCache::setMaxSize):
1718         (WebCore::BackForwardCache::frameCount const):
1719         (WebCore::BackForwardCache::markPagesForDeviceOrPageScaleChanged):
1720         (WebCore::BackForwardCache::markPagesForContentsSizeChanged):
1721         (WebCore::BackForwardCache::markPagesForCaptionPreferencesChanged):
1722         (WebCore::setBackForwardCacheState):
1723         (WebCore::BackForwardCache::addIfCacheable):
1724         (WebCore::BackForwardCache::take):
1725         (WebCore::BackForwardCache::removeAllItemsForPage):
1726         (WebCore::BackForwardCache::get):
1727         (WebCore::BackForwardCache::remove):
1728         (WebCore::BackForwardCache::prune):
1729         * history/BackForwardCache.h: Renamed from Source/WebCore/history/PageCache.h.
1730         * history/CachedFrame.cpp:
1731         (WebCore::CachedFrameBase::restore):
1732         (WebCore::CachedFrame::CachedFrame):
1733         (WebCore::CachedFrame::clear):
1734         (WebCore::CachedFrame::destroy):
1735         * history/CachedFramePlatformData.h:
1736         * history/HistoryItem.cpp:
1737         (WebCore::HistoryItem::setCachedPage):
1738         (WebCore::HistoryItem::setURL):
1739         * history/HistoryItem.h:
1740         (WebCore::HistoryItem::isInBackForwardCache const):
1741         * html/HTMLMediaElement.cpp:
1742         (WebCore::HTMLMediaElement::suspend):
1743         (WebCore::HTMLMediaElement::resume):
1744         * html/HTMLPlugInImageElement.cpp:
1745         (WebCore::HTMLPlugInImageElement::createElementRenderer):
1746         * html/HTMLSourceElement.cpp:
1747         (WebCore::HTMLSourceElement::suspend):
1748         * html/MediaElementSession.cpp:
1749         (WebCore::MediaElementSession::autoplayPermitted const):
1750         * loader/DocumentLoader.cpp:
1751         (WebCore::DocumentLoader::addSubresourceLoader):
1752         * loader/DocumentLoader.h:
1753         * loader/EmptyFrameLoaderClient.h:
1754         * loader/FrameLoader.cpp:
1755         (WebCore::FrameLoader::closeURL):
1756         (WebCore::FrameLoader::clear):
1757         (WebCore::FrameLoader::stopAllLoaders):
1758         (WebCore::FrameLoader::stopForBackForwardCache):
1759         (WebCore::FrameLoader::commitProvisionalLoad):
1760         (WebCore::FrameLoader::open):
1761         (WebCore::FrameLoader::frameDetached):
1762         (WebCore::FrameLoader::detachFromParent):
1763         (WebCore::FrameLoader::receivedMainResourceError):
1764         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
1765         (WebCore::FrameLoader::dispatchUnloadEvents):
1766         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1767         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
1768         (WebCore::FrameLoader::loadDifferentDocumentItem):
1769         * loader/FrameLoader.h:
1770         * loader/FrameLoaderClient.h:
1771         * loader/HistoryController.cpp:
1772         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
1773         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1774         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
1775         (WebCore::HistoryController::updateForReload):
1776         * loader/appcache/ApplicationCacheHost.cpp:
1777         (WebCore::ApplicationCacheHost::canCacheInBackForwardCache):
1778         * loader/appcache/ApplicationCacheHost.h:
1779         * loader/cache/CachedResource.cpp:
1780         (WebCore::CachedResource::load):
1781         * page/DOMWindow.cpp:
1782         (WebCore::DOMWindow::suspendForBackForwardCache):
1783         (WebCore::DOMWindow::resumeFromBackForwardCache):
1784         (WebCore::DOMWindow::decrementScrollEventListenersCount):
1785         * page/DOMWindow.h:
1786         * page/DOMWindowExtension.cpp:
1787         (WebCore::DOMWindowExtension::suspendForBackForwardCache):
1788         (WebCore::DOMWindowExtension::resumeFromBackForwardCache):
1789         * page/DOMWindowExtension.h:
1790         * page/DiagnosticLoggingKeys.cpp:
1791         (WebCore::DiagnosticLoggingKeys::backForwardCacheKey):
1792         (WebCore::DiagnosticLoggingKeys::backForwardCacheFailureKey):
1793         * page/DiagnosticLoggingKeys.h:
1794         * page/EventSource.cpp:
1795         (WebCore::EventSource::scheduleReconnect):
1796         (WebCore::EventSource::didReceiveResponse):
1797         (WebCore::EventSource::didReceiveData):
1798         (WebCore::EventSource::didFinishLoading):
1799         (WebCore::EventSource::didFail):
1800         (WebCore::EventSource::abortConnectionAttempt):
1801         (WebCore::EventSource::suspend):
1802         (WebCore::EventSource::resume):
1803         (WebCore::EventSource::dispatchMessageEvent):
1804         * page/EventSource.h:
1805         * page/Frame.cpp:
1806         (WebCore::Frame::setView):
1807         (WebCore::Frame::setDocument):
1808         (WebCore::Frame::willDetachPage):
1809         * page/FrameView.cpp:
1810         (WebCore::FrameView::didRestoreFromBackForwardCache):
1811         (WebCore::FrameView::setContentsSize):
1812         * page/FrameView.h:
1813         * page/FrameViewLayoutContext.cpp:
1814         (WebCore::FrameViewLayoutContext::layout):
1815         (WebCore::FrameViewLayoutContext::scheduleLayout):
1816         * page/MemoryRelease.cpp:
1817         (WebCore::releaseCriticalMemory):
1818         (WebCore::releaseMemory):
1819         * page/MemoryRelease.h:
1820         * page/Page.cpp:
1821         (WebCore::Page::~Page):
1822         (WebCore::Page::setViewScaleFactor):
1823         (WebCore::Page::setDeviceScaleFactor):
1824         * page/Page.h:
1825         * page/PageGroup.cpp:
1826         (WebCore::PageGroup::captionPreferencesChanged):
1827         * page/PerformanceLogging.cpp:
1828         (WebCore::PerformanceLogging::memoryUsageStatistics):
1829         * page/Settings.yaml:
1830         * page/SettingsBase.cpp:
1831         (WebCore::SettingsBase::usesBackForwardCacheChanged):
1832         * page/SettingsBase.h:
1833         * page/animation/AnimationBase.cpp:
1834         (WebCore::AnimationBase::setNeedsStyleRecalc):
1835         * page/animation/CSSAnimationController.cpp:
1836         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
1837         (WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
1838         (WebCore::CSSAnimationController::cancelAnimations):
1839         (WebCore::CSSAnimationController::updateAnimations):
1840         * page/animation/ImplicitAnimation.cpp:
1841         (WebCore::ImplicitAnimation::sendTransitionEvent):
1842         * page/animation/KeyframeAnimation.cpp:
1843         (WebCore::KeyframeAnimation::sendAnimationEvent):
1844         * page/scrolling/AsyncScrollingCoordinator.cpp:
1845         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1846         * platform/mac/ScrollAnimatorMac.mm:
1847         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
1848         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1849         * rendering/RenderLayerBacking.cpp:
1850         (WebCore::RenderLayerBacking::paintIntoLayer):
1851         * rendering/RenderLayerCompositor.cpp:
1852         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1853         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1854         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1855         * rendering/RenderLayerCompositor.h:
1856         * rendering/RenderObject.h:
1857         * rendering/SimpleLineLayoutCoverage.cpp:
1858         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
1859         * style/StyleTreeResolver.cpp:
1860         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
1861         * testing/Internals.cpp:
1862         (WebCore::Internals::clearBackForwardCache):
1863         (WebCore::Internals::backForwardCacheSize const):
1864         (WebCore::Internals::preventDocumentForEnteringBackForwardCache):
1865         * testing/Internals.h:
1866         * testing/Internals.idl:
1867         * xml/XMLHttpRequest.cpp:
1868         (WebCore::XMLHttpRequest::suspend):
1869
1870 2019-10-16  John Wilander  <wilander@apple.com>
1871
1872         Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
1873         https://bugs.webkit.org/show_bug.cgi?id=203017
1874         <rdar://problem/56262708>
1875
1876         Reviewed by Alex Christensen.
1877
1878         NetworkStorageSession::shouldBlockCookies() now checks if the first-party website has
1879         received user interaction and if not, blocks all third-party cookies, regardless of the
1880         status of those third-party domains (prevalent or not).
1881
1882         Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.
1883
1884         Tests: http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html
1885                http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html
1886
1887         * page/RuntimeEnabledFeatures.h:
1888         (WebCore::RuntimeEnabledFeatures::setIsITPSessionSwitchingEnabled): Deleted.
1889         (WebCore::RuntimeEnabledFeatures::isITPSessionSwitchingEnabled const): Deleted.
1890         * page/Settings.yaml:
1891         * platform/network/NetworkStorageSession.cpp:
1892         (WebCore::NetworkStorageSession::hasHadUserInteractionAsFirstParty const):
1893         (WebCore::NetworkStorageSession::shouldBlockCookies const):
1894         (WebCore::NetworkStorageSession::setDomainsWithUserInteractionAsFirstParty):
1895         * platform/network/NetworkStorageSession.h:
1896         (WebCore::NetworkStorageSession::setIsThirdPartyCookieBlockingOnSitesWithoutUserInteractionEnabled):
1897
1898 2019-10-16  Zalan Bujtas  <zalan@apple.com>
1899
1900         [LFC][IFC] Add style and text content to Display::Run
1901         https://bugs.webkit.org/show_bug.cgi?id=203045
1902         <rdar://problem/56340105>
1903
1904         Reviewed by Antti Koivisto.
1905
1906         Painting Display::Runs requires style and text content. Currently there's no mapping structure to connect Display::Runs to Display::Boxes to access style and content.
1907
1908         * layout/displaytree/DisplayRun.h:
1909         (WebCore::Display::Run::TextContext::content const):
1910         (WebCore::Display::Run::style const):
1911         (WebCore::Display::Run::Run):
1912         (WebCore::Display::Run::TextContext::TextContext):
1913         (WebCore::Display::Run::TextContext::expand):
1914         * layout/inlineformatting/InlineLine.cpp:
1915         (WebCore::Layout::Line::appendNonBreakableSpace):
1916         (WebCore::Layout::Line::appendTextContent):
1917         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1918         (WebCore::Layout::Line::appendHardLineBreak):
1919         * layout/inlineformatting/InlineLine.h:
1920         (WebCore::Layout::Line::Run::expand):
1921
1922 2019-10-16  Simon Fraser  <simon.fraser@apple.com>
1923
1924         Add dumping for BorderData and StyleBackgroundData
1925         https://bugs.webkit.org/show_bug.cgi?id=203038
1926
1927         Reviewed by Zalan Bujtas.
1928
1929         As part of adding dumping for all RenderStyle data, add dumping support for 
1930         BorderData and StyleBackgroundData.
1931         
1932         For large classes it's beneficial to avoid dumping default values; those classes
1933         get a dump() function that can take an argument to say whether values which are default
1934         should be printed.
1935
1936         * Sources.txt:
1937         * WebCore.xcodeproj/project.pbxproj:
1938         * platform/LengthSize.h:
1939         (WebCore::LengthSize::isZero const):
1940         * rendering/style/BorderData.cpp: Added.
1941         (WebCore::operator<<):
1942         (WebCore::BorderData::dump const):
1943         * rendering/style/BorderData.h:
1944         * rendering/style/RenderStyleConstants.h:
1945         * rendering/style/StyleBackgroundData.cpp:
1946         (WebCore::StyleBackgroundData::dump const):
1947         (WebCore::operator<<):
1948         * rendering/style/StyleBackgroundData.h:
1949
1950 2019-10-16  Chris Dumez  <cdumez@apple.com>
1951
1952         [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
1953         https://bugs.webkit.org/show_bug.cgi?id=203034
1954         <rdar://problem/56332453>
1955
1956         Reviewed by Antti Koivisto.
1957
1958         Use Seconds type for backForwardCacheExpirationInterval setting instead of
1959         double, for clarity.
1960
1961         * history/CachedPage.cpp:
1962         (WebCore::CachedPage::CachedPage):
1963         (WebCore::CachedPage::hasExpired const):
1964         * page/Settings.yaml:
1965
1966 2019-10-16  Zalan Bujtas  <zalan@apple.com>
1967
1968         [LFC][IFC] Fix various vertical alignment issues.
1969         https://bugs.webkit.org/show_bug.cgi?id=203041
1970
1971         Reviewed by Antti Koivisto.
1972
1973         This patch fixes both regular inline box and inline-block baseline aligment. It also addresses a few related vertical positioning issues. 
1974
1975         * layout/inlineformatting/InlineLine.cpp:
1976         (WebCore::Layout::Line::alignContentVertically):
1977         (WebCore::Layout::Line::appendInlineContainerStart):
1978         (WebCore::Layout::Line::appendInlineContainerEnd):
1979         (WebCore::Layout::Line::appendTextContent):
1980         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1981         (WebCore::Layout::Line::appendHardLineBreak):
1982         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
1983         (WebCore::Layout::Line::inlineItemContentHeight const):
1984         * layout/inlineformatting/InlineLine.h:
1985         * layout/inlineformatting/InlineLineBox.h:
1986         (WebCore::Layout::LineBox::resetDescent):
1987         (WebCore::Layout::LineBox::setLogicalHeightIfGreater):
1988         (WebCore::Layout::LineBox::setBaselineOffsetIfGreater):
1989         (WebCore::Layout::LineBox::setAscentIfGreater):
1990         (WebCore::Layout::LineBox::setDescentIfGreater):
1991         (WebCore::Layout::LineBox::resetBaseline):
1992         (WebCore::
1993         Layout::LineBox::setBaseline): Deleted.
1994         (WebCore::Layout::LineBox::baseline): Deleted.
1995         (WebCore::Layout::LineBox::setBaselineOffset): Deleted.
1996         (WebCore::Layout::LineBox::Baseline::setAscentIfGreater): Deleted.
1997         (WebCore::Layout::LineBox::Baseline::setDescentIfGreater): Deleted.
1998
1999 2019-10-16  Chris Dumez  <cdumez@apple.com>
2000
2001         Drop unused WKPageSetResourceCachingDisabled() SPI
2002         https://bugs.webkit.org/show_bug.cgi?id=203035
2003
2004         Reviewed by Alex Christensen.
2005
2006         * history/PageCache.cpp:
2007         (WebCore::canCachePage):
2008         (WebCore::PageCache::take):
2009         (WebCore::PageCache::get):
2010         * html/HTMLMediaElement.cpp:
2011         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
2012         * inspector/agents/page/PageNetworkAgent.cpp:
2013         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
2014         * inspector/agents/worker/WorkerNetworkAgent.cpp:
2015         (WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
2016         * loader/FrameLoader.cpp:
2017         (WebCore::FrameLoader::subresourceCachePolicy const):
2018         (WebCore::FrameLoader::addExtraFieldsToRequest):
2019         * loader/cache/CachedResourceLoader.cpp:
2020         (WebCore::CachedResourceLoader::cachePolicy const):
2021         * page/Page.h:
2022         (WebCore::Page::isResourceCachingDisabledByWebInspector const):
2023         (WebCore::Page::setResourceCachingDisabledByWebInspector):
2024         (WebCore::Page::isResourceCachingDisabled const): Deleted.
2025         (WebCore::Page::setResourceCachingDisabled): Deleted.
2026         (WebCore::Page::setResourceCachingDisabledOverride): Deleted.
2027         * workers/WorkerDebuggerProxy.h:
2028         * workers/WorkerMessagingProxy.cpp:
2029         (WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
2030         (WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
2031         * workers/WorkerMessagingProxy.h:
2032         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2033         (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
2034         (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
2035         * workers/service/context/ServiceWorkerThreadProxy.h:
2036
2037 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2038
2039         DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testRunner.accummulateLogsForChannel
2040         https://bugs.webkit.org/show_bug.cgi?id=203024
2041
2042         Reviewed by Alex Christensen.
2043
2044         * platform/LogInitialization.h:
2045         * platform/Logging.cpp:
2046         (WebCore::clearAllLogChannelsToAccumulate): Added.
2047         * platform/Logging.h:
2048         * testing/js/WebCoreTestSupport.cpp:
2049         (WebCoreTestSupport::clearAllLogChannelsToAccumulate): Added.
2050         * testing/js/WebCoreTestSupport.h:
2051
2052 2019-10-16  Youenn Fablet  <youenn@apple.com>
2053
2054         WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly
2055         https://bugs.webkit.org/show_bug.cgi?id=202930
2056         <rdar://problem/56006776>
2057
2058         Reviewed by Eric Carlson.
2059
2060         There is a time where the bus channel number and audio source channel numbers may be different.
2061         In case the bus channel number is less than the audio source channel number, initialization of
2062         the WebAudioBufferList might not be fully done.
2063         In that case, output silence and return early.
2064         Reduce the number of frames to process based on the number of frames the output audio bus plans to process.
2065
2066         Partially covered by new API test (this a race so we cannot reproduce the crash easily).
2067
2068         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2069         (WebCore::MediaStreamAudioSourceNode::process):
2070         Make sure to process the number of frames the output bus expect.
2071         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2072         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
2073
2074 2019-10-16  Zalan Bujtas  <zalan@apple.com>
2075
2076         [LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore fixed width columns
2077         https://bugs.webkit.org/show_bug.cgi?id=203010
2078
2079         Reviewed by Antti Koivisto.
2080
2081         Fixed width columns (e.g. <col width=100px>) don't participate in the extra horizontal space distribution.
2082
2083         * layout/tableformatting/TableFormattingContext.cpp:
2084         (WebCore::Layout::TableFormattingContext::computedTableWidth):
2085         (WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace):
2086         (WebCore::Layout::TableFormattingContext::distributeAvailableWidth): Deleted.
2087         * layout/tableformatting/TableFormattingContext.h:
2088         * layout/tableformatting/TableGrid.cpp:
2089         (WebCore::Layout::TableGrid::Column::hasFixedWidth const):
2090         (WebCore::Layout::TableGrid::widthConstraints const):
2091         * layout/tableformatting/TableGrid.h:
2092         (WebCore::Layout::TableGrid::totalHorizontalSpacing const):
2093         (WebCore::Layout::TableGrid::columnsContext const):
2094
2095 2019-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2096
2097         [GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
2098         https://bugs.webkit.org/show_bug.cgi?id=202976
2099
2100         Reviewed by Adrian Perez de Castro.
2101
2102         This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
2103         blob, so we shouldn't assert.
2104
2105         * platform/sql/SQLiteStatement.cpp:
2106         (WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.
2107
2108 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2109
2110         Unreviewed build fix for Windows ports
2111         https://bugs.webkit.org/show_bug.cgi?id=203016
2112         <rdar://problem/56317774>
2113
2114         * page/DOMTimer.h: Added WEBCORE_EXPORT to ~DOMTimer().
2115
2116 2019-10-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2117
2118         image/apng not recognized in source tag
2119         https://bugs.webkit.org/show_bug.cgi?id=202785
2120
2121         Reviewed by Dean Jackson.
2122
2123         Add image/apng as supported mime type for images on Mac/iOS and
2124         on all the other platforms that enable apng support.
2125
2126         This fixes the test imported/w3c/web-platform-tests/apng/supported-in-source-type.html
2127
2128         * platform/MIMETypeRegistry.cpp:
2129         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2130
2131 2019-10-15  Ryosuke Niwa  <rniwa@webkit.org>
2132
2133         adoptRef DOMTimer in install instead of its constructor
2134         https://bugs.webkit.org/show_bug.cgi?id=203016
2135
2136         Reviewed by Simon Fraser.
2137
2138         Moved the code to add DOMTimer to ScriptExecutionContext's map to DOMTimer::install
2139         instead of its constructor so that we can adoptRef there instead for clarity & simplicity.
2140
2141         * dom/ScriptExecutionContext.h:
2142         (WebCore::ScriptExecutionContext::addTimeout):
2143         * page/DOMTimer.cpp:
2144         (WebCore::DOMTimer::DOMTimer):
2145         (WebCore::DOMTimer::install):
2146         (WebCore::DOMTimer::fired):
2147
2148 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2149
2150         ScrollingTreeScrollingNodeDelegateMac::stretchAmount() should not have side effects
2151         https://bugs.webkit.org/show_bug.cgi?id=203009
2152
2153         Reviewed by Dean Jackson.
2154
2155         Calling ScrollingTreeScrollingNodeDelegateMac::stretchAmount() had the side effect of calling
2156         setMainFrameIsRubberBanding() on the scrolling tree.
2157         
2158         Remove this badness and replace it by modifying updateMainFramePinState() (which is called every time
2159         the scroll position changes) to also compute if we're rubber-banding.
2160         
2161         Also make a bunch of methods on ScrollControllerClient const, which makes it clear that
2162         they don't have side effects.
2163
2164         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2165         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2166         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2167         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
2168         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState):
2169         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState): Deleted.
2170         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
2171         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2172         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture const):
2173         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const):
2174         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const):
2175         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount const):
2176         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection const):
2177         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally const):
2178         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically const):
2179         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
2180         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2181         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching): Deleted.
2182         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching): Deleted.
2183         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount): Deleted.
2184         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection): Deleted.
2185         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally): Deleted.
2186         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically): Deleted.
2187         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection): Deleted.
2188         * platform/cocoa/ScrollController.h:
2189         * platform/mac/ScrollAnimatorMac.h:
2190         * platform/mac/ScrollAnimatorMac.mm:
2191         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent const):
2192         (WebCore::ScrollAnimatorMac::pinnedInDirection const):
2193         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture const):
2194         (WebCore::ScrollAnimatorMac::allowsVerticalStretching const):
2195         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching const):
2196         (WebCore::ScrollAnimatorMac::stretchAmount const):
2197         (WebCore::ScrollAnimatorMac::canScrollHorizontally const):
2198         (WebCore::ScrollAnimatorMac::canScrollVertically const):
2199         (WebCore::ScrollAnimatorMac::shouldRubberBandInDirection const):
2200         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): Deleted.
2201         (WebCore::ScrollAnimatorMac::pinnedInDirection): Deleted.
2202         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2203         (WebCore::ScrollAnimatorMac::allowsVerticalStretching): Deleted.
2204         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching): Deleted.
2205         (WebCore::ScrollAnimatorMac::stretchAmount): Deleted.
2206         (WebCore::ScrollAnimatorMac::canScrollHorizontally): Deleted.
2207         (WebCore::ScrollAnimatorMac::canScrollVertically): Deleted.
2208         (WebCore::ScrollAnimatorMac::shouldRubberBandInDirection): Deleted.
2209         * platform/mock/ScrollAnimatorMock.h:
2210
2211 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2212
2213         WheelEventTestMonitor doesn't need to be threadsafe
2214         https://bugs.webkit.org/show_bug.cgi?id=203012
2215
2216         Reviewed by Dean Jackson.
2217
2218         WheelEventTestMonitor is only called on the main thread, so doesn't need a lock to protect
2219         m_deferCompletionReasons, and add main thread assertions.
2220
2221         * page/WheelEventTestMonitor.cpp:
2222         (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
2223         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
2224         (WebCore::WheelEventTestMonitor::deferForReason):
2225         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
2226         (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
2227         * page/WheelEventTestMonitor.h:
2228
2229 2019-10-15  Andres Gonzalez  <andresg_22@apple.com>
2230
2231         AX: Make AXIsolatedTree compile again
2232         https://bugs.webkit.org/show_bug.cgi?id=202702
2233         <rdar://problem/56084968>
2234
2235         Reviewed by Joanmarie Diggs.
2236
2237         Re-submitting r251045 with a fix for internal builds.
2238
2239         * accessibility/AXObjectCache.cpp:
2240         (WebCore::AXObjectCache::remove):
2241         (WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy):
2242         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2243         (WebCore::AXIsolatedTree::treePageCache):
2244         (WebCore::AXIsolatedTree::nodeForID const):
2245         (WebCore::AXIsolatedTree::applyPendingChanges):
2246         (WebCore::AXIsolatedTree::initializePageTreeForID): Deleted.
2247         (WebCore::AXIsolatedTree::setInitialRequestInProgress): Deleted.
2248         * accessibility/isolatedtree/AXIsolatedTree.h:
2249         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
2250         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
2251         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
2252         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
2253         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2254         (convertToNSArray):
2255         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2256         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
2257
2258 2019-10-15  Ryosuke Niwa  <rniwa@webkit.org>
2259
2260         [iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
2261         https://bugs.webkit.org/show_bug.cgi?id=202878
2262
2263         Unreviewed. Addressed Darin's post-commit review comment.
2264
2265         * dom/Node.cpp:
2266         (WebCore::tryAddEventListener):
2267
2268 2019-10-15  Chris Dumez  <cdumez@apple.com>
2269
2270         [macOS] Simplify main thread initialization
2271         https://bugs.webkit.org/show_bug.cgi?id=203001
2272
2273         Reviewed by Geoff Garen.
2274
2275         * bridge/objc/WebScriptObject.mm:
2276         (+[WebScriptObject initialize]):
2277         * platform/cocoa/SharedBufferCocoa.mm:
2278         (+[WebCoreSharedBufferData initialize]):
2279
2280 2019-10-15  Peng Liu  <peng.liu6@apple.com>
2281
2282         [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture()
2283         https://bugs.webkit.org/show_bug.cgi?id=201024
2284
2285         Reviewed by Eric Carlson.
2286
2287         Implement the support to enter and exit PiP mode with the Picture-in-Picture API.
2288         Majority work of this patch was done by Carlos Eduardo Ramalho <cadubentzen@gmail.com>.
2289
2290         Also, fix a build error of Modules/webaudio/OfflineAudioContext.cpp because of this patch (due to unified build).
2291
2292         Tests: imported/w3c/web-platform-tests/picture-in-picture/css-selector.html
2293                imported/w3c/web-platform-tests/picture-in-picture/disable-picture-in-picture.html
2294                imported/w3c/web-platform-tests/picture-in-picture/enter-picture-in-picture.html
2295                imported/w3c/web-platform-tests/picture-in-picture/exit-picture-in-picture.html
2296                imported/w3c/web-platform-tests/picture-in-picture/idlharness.window.html
2297                imported/w3c/web-platform-tests/picture-in-picture/leave-picture-in-picture.html
2298                imported/w3c/web-platform-tests/picture-in-picture/mediastream.html
2299                imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-element.html
2300                imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-window.html
2301                imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture-twice.html
2302                imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture.html
2303                imported/w3c/web-platform-tests/picture-in-picture/shadow-dom.html
2304
2305         * CMakeLists.txt:
2306         * Configurations/FeatureDefines.xcconfig:
2307         * DerivedSources-input.xcfilelist:
2308         * DerivedSources-output.xcfilelist:
2309         * DerivedSources.make:
2310         * Modules/pictureinpicture/DocumentPictureInPicture.cpp: Added.
2311         (WebCore::DocumentPictureInPicture::exitPictureInPicture):
2312         (WebCore::DocumentPictureInPicture::from):
2313         * Modules/pictureinpicture/DocumentPictureInPicture.h: Added.
2314         (WebCore::DocumentPictureInPicture::pictureInPictureEnabled):
2315         (WebCore::DocumentPictureInPicture::supplementName):
2316         * Modules/pictureinpicture/DocumentPictureInPicture.idl: Added.
2317         * Modules/pictureinpicture/EnterPictureInPictureEvent.cpp: Added.
2318         (WebCore::EnterPictureInPictureEvent::create):
2319         (WebCore::EnterPictureInPictureEvent::EnterPictureInPictureEvent):
2320         * Modules/pictureinpicture/EnterPictureInPictureEvent.h: Added.
2321         * Modules/pictureinpicture/EnterPictureInPictureEvent.idl: Added.
2322         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp: Added.
2323         (WebCore::HTMLVideoElementPictureInPicture::HTMLVideoElementPictureInPicture):
2324         (WebCore::HTMLVideoElementPictureInPicture::~HTMLVideoElementPictureInPicture):
2325         (WebCore::HTMLVideoElementPictureInPicture::from):
2326         (WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture):
2327         (WebCore::HTMLVideoElementPictureInPicture::autoPictureInPicture):
2328         (WebCore::HTMLVideoElementPictureInPicture::setAutoPictureInPicture):
2329         (WebCore::HTMLVideoElementPictureInPicture::disablePictureInPicture):
2330         (WebCore::HTMLVideoElementPictureInPicture::setDisablePictureInPicture):
2331         (WebCore::HTMLVideoElementPictureInPicture::exitPictureInPicture):
2332         (WebCore::HTMLVideoElementPictureInPicture::didEnterPictureInPicture):
2333         (WebCore::HTMLVideoElementPictureInPicture::didExitPictureInPicture):
2334         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h: Added.
2335         (WebCore::HTMLVideoElementPictureInPicture::supplementName):
2336         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: Added.
2337         * Modules/pictureinpicture/PictureInPictureWindow.cpp: Added.
2338         (WebCore::PictureInPictureWindow::create):
2339         (WebCore::PictureInPictureWindow::PictureInPictureWindow):
2340         (WebCore::PictureInPictureWindow::activeDOMObjectName const):
2341         (WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const):
2342         (WebCore::PictureInPictureWindow::eventTargetInterface const):
2343         (WebCore::PictureInPictureWindow::scriptExecutionContext const):
2344         * Modules/pictureinpicture/PictureInPictureWindow.h: Added.
2345         * Modules/pictureinpicture/PictureInPictureWindow.idl: Added.
2346         * Modules/webaudio/OfflineAudioContext.cpp:
2347         * Sources.txt:
2348         * WebCore.xcodeproj/project.pbxproj:
2349         * bindings/js/WebCoreBuiltinNames.h:
2350         * dom/Document.cpp:
2351         (WebCore::Document::pictureInPictureElement const):
2352         (WebCore::Document::setPictureInPictureElement):
2353         * dom/Document.h:
2354         * dom/DocumentOrShadowRoot.idl:
2355         * dom/EventNames.h:
2356         * dom/EventNames.in:
2357         * dom/EventTargetFactory.in:
2358         * dom/ShadowRoot.cpp:
2359         (WebCore::ShadowRoot::pictureInPictureElement const):
2360         * dom/ShadowRoot.h:
2361         * html/HTMLVideoElement.cpp:
2362         (WebCore::HTMLVideoElement::fullscreenModeChanged):
2363         (WebCore::HTMLVideoElement::setPictureInPictureObserver):
2364         * html/HTMLVideoElement.h:
2365         * page/Settings.yaml:
2366         * platform/PictureInPictureObserver.h: Added.
2367         (WebCore::PictureInPictureObserver::~PictureInPictureObserver):
2368         * testing/InternalSettings.h:
2369
2370 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2371
2372         Add TextStream dumping for ThemeTypes enums
2373         https://bugs.webkit.org/show_bug.cgi?id=202972
2374
2375         Reviewed by Dean Jackson.
2376
2377         Make ControlPart, SelectionPart, ThemeFont and ThemeColor dumpable.
2378
2379         * Sources.txt:
2380         * WebCore.xcodeproj/project.pbxproj:
2381         * platform/ThemeTypes.cpp: Added.
2382         (WebCore::operator<<):
2383         * platform/ThemeTypes.h:
2384
2385 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2386
2387         Add dumping for Animation and AnimationList
2388         https://bugs.webkit.org/show_bug.cgi?id=202973
2389
2390         Reviewed by Dean Jackson.
2391
2392         Make Animation, AnimationList and related enums dumpable.
2393
2394         * platform/animation/Animation.cpp:
2395         (WebCore::operator<<):
2396         * platform/animation/Animation.h:
2397         * platform/animation/AnimationList.cpp:
2398         (WebCore::operator<<):
2399         * platform/animation/AnimationList.h:
2400
2401 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2402
2403         Don't mutate a NinePieceImage to create a mask default image
2404         https://bugs.webkit.org/show_bug.cgi?id=202967
2405
2406         Reviewed by Dean Jackson.
2407
2408         For every StyleRareNonInheritedData, the maskBoxImage undergoes copy-on-write
2409         via maskBoxImage.setMaskDefaults(). Fix by giving NinePieceImage a constructor
2410         argument that cna make the mask flavor of image.
2411
2412         * css/StyleBuilderConverter.h:
2413         (WebCore::StyleBuilderConverter::convertBorderMask):
2414         (WebCore::StyleBuilderConverter::convertReflection):
2415         * rendering/style/NinePieceImage.cpp:
2416         (WebCore::NinePieceImage::defaultMaskData):
2417         (WebCore::NinePieceImage::NinePieceImage):
2418         * rendering/style/NinePieceImage.h:
2419         (WebCore::NinePieceImage::setMaskDefaults): Deleted.
2420         * rendering/style/StyleRareNonInheritedData.cpp:
2421         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2422         * rendering/style/StyleReflection.h:
2423         (WebCore::StyleReflection::StyleReflection):
2424
2425 2019-10-15  youenn fablet  <youenn@apple.com>
2426
2427         Move headers to keep from a HTTPHeaderNameSet to an OptionSet
2428         https://bugs.webkit.org/show_bug.cgi?id=202977
2429
2430         Reviewed by Anders Carlsson.
2431
2432         Covered by existing tests.
2433         New representation is smaller and more efficient to process.
2434
2435         * loader/CrossOriginAccessControl.cpp:
2436         (WebCore::httpHeadersToKeepFromCleaning):
2437         (WebCore::cleanHTTPRequestHeadersForAccessControl):
2438         * loader/CrossOriginAccessControl.h:
2439         (WebCore::cleanHTTPRequestHeadersForAccessControl): Deleted.
2440         * loader/ResourceLoaderOptions.h:
2441
2442 2019-10-15  Zalan Bujtas  <zalan@apple.com>
2443
2444         [LFC][TFC] Use <col> to adjust the preferred column width.
2445         https://bugs.webkit.org/show_bug.cgi?id=202997
2446         <rdar://problem/56300345>
2447
2448         Reviewed by Antti Koivisto.
2449
2450         The <col> elment can set the preferred width on the table column. Let's take these values into account while computing the preferred width for columns.
2451
2452         * layout/tableformatting/TableFormattingContext.cpp:
2453         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
2454         * layout/tableformatting/TableFormattingContext.h:
2455         * layout/tableformatting/TableFormattingContextGeometry.cpp:
2456         (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const):
2457         * layout/tableformatting/TableGrid.h:
2458         (WebCore::Layout::TableGrid::Column::columnBox const):
2459
2460 2019-10-15  Zalan Bujtas  <zalan@apple.com>
2461
2462         [LFC][TFC] Add support for colgroup/col
2463         https://bugs.webkit.org/show_bug.cgi?id=202991
2464         <rdar://problem/56294715>
2465
2466         Reviewed by Antti Koivisto.
2467
2468         This patch sets up the column context when <colgroup> is present. This is in preparation for using <col>'s width to adjust the preferred width on table columns.
2469
2470         * layout/layouttree/LayoutTreeBuilder.cpp:
2471         (WebCore::Layout::TreeBuilder::createLayoutBox):
2472         * layout/tableformatting/TableFormattingContext.cpp:
2473         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
2474         * layout/tableformatting/TableGrid.cpp:
2475         (WebCore::Layout::TableGrid::Column::Column):
2476         (WebCore::Layout::TableGrid::ColumnsContext::addColumn):
2477         * layout/tableformatting/TableGrid.h:
2478
2479 2019-10-15  Alex Christensen  <achristensen@webkit.org>
2480
2481         Unreviewed, rolling out r251138.
2482
2483         Broke API tests
2484
2485         Reverted changeset:
2486
2487         "Pass CORS-enabled schemes through WebProcess instead of
2488         having them NetworkProcess-global"
2489         https://bugs.webkit.org/show_bug.cgi?id=202891
2490         https://trac.webkit.org/changeset/251138
2491
2492 2019-10-15  Chris Dumez  <cdumez@apple.com>
2493
2494         Stop using inheritance for WebBackForwardCacheEntry
2495         https://bugs.webkit.org/show_bug.cgi?id=202989
2496
2497         Reviewed by Alex Christensen.
2498
2499         * history/BackForwardItemIdentifier.h:
2500         (WebCore::BackForwardItemIdentifier::operator bool const):
2501
2502 2019-10-15  Alex Christensen  <achristensen@webkit.org>
2503
2504         Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
2505         https://bugs.webkit.org/show_bug.cgi?id=202891
2506
2507         Reviewed by Youenn Fablet.
2508
2509         * platform/LegacySchemeRegistry.cpp:
2510         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
2511         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
2512         (WebCore::LegacySchemeRegistry::allURLSchemesRegisteredAsCORSEnabled):
2513         * platform/LegacySchemeRegistry.h:
2514
2515 2019-10-15  Zalan Bujtas  <zalan@apple.com>
2516
2517         [LFC] Adjust computed width value when box sizing is border-box
2518         https://bugs.webkit.org/show_bug.cgi?id=202966
2519         <rdar://problem/56277954>
2520
2521         Reviewed by Antti Koivisto.
2522
2523         box-sizing: border-box; means the width value sets the size of the border box (and not the content box).
2524
2525         * layout/FormattingContext.cpp:
2526         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
2527         * layout/FormattingContext.h:
2528         * layout/FormattingContextGeometry.cpp:
2529         (WebCore::Layout::FormattingContext::Geometry::computedContentWidth const):
2530         (WebCore::Layout::FormattingContext::Geometry::computedMinWidth const):
2531         (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth const):
2532         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2533         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2534         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
2535         * layout/blockformatting/BlockFormattingContext.cpp:
2536         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
2537         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2538         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
2539
2540 2019-10-15  Zalan Bujtas  <zalan@apple.com>
2541
2542         [LFC][TFC] Add <col> element's width attribute value to Layout::Box rare data
2543         https://bugs.webkit.org/show_bug.cgi?id=202988
2544         <rdar://problem/56291048>
2545
2546         Reviewed by Antti Koivisto.
2547
2548         Sadly RenderStyle does not have this value.
2549
2550         * layout/layouttree/LayoutBox.cpp:
2551         (WebCore::Layout::Box::setColumnWidth):
2552         (WebCore::Layout::Box::columnWidth const):
2553         * layout/layouttree/LayoutBox.h:
2554         * layout/layouttree/LayoutTreeBuilder.cpp:
2555         (WebCore::Layout::TreeBuilder::createLayoutBox):
2556         (WebCore::Layout::outputLayoutBox):
2557
2558 2019-10-15  Zalan Bujtas  <zalan@apple.com>
2559
2560         [LFC] Adjust computed height value when box sizing is border-box
2561         https://bugs.webkit.org/show_bug.cgi?id=202965
2562         <rdar://problem/56276771>
2563
2564         Reviewed by Antti Koivisto.
2565
2566         box-sizing: border-box; means the height value sets the size of the border box (and not the content box).  
2567
2568         * layout/FormattingContext.cpp:
2569         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
2570         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
2571         * layout/FormattingContext.h:
2572         * layout/FormattingContextGeometry.cpp:
2573         (WebCore::Layout::FormattingContext::Geometry::computedContentHeight const):
2574         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
2575         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
2576         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
2577         (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
2578         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2579         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
2580         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
2581         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
2582         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2583         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
2584         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
2585         * layout/LayoutState.cpp:
2586         (WebCore::Layout::LayoutState::displayBoxForLayoutBox):
2587         * layout/LayoutUnits.h:
2588         * layout/blockformatting/BlockFormattingContext.cpp:
2589         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
2590         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2591         * layout/blockformatting/BlockFormattingContext.h:
2592         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2593         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2594         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
2595         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const):
2596         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2597         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2598         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2599         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2600         * layout/displaytree/DisplayBox.cpp:
2601         (WebCore::Display::Box::Box):
2602         (WebCore::Display::Box::Style::Style): Deleted.
2603         * layout/displaytree/DisplayBox.h:
2604         * layout/inlineformatting/InlineFormattingContext.cpp:
2605         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
2606         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
2607         * layout/inlineformatting/InlineFormattingContext.h:
2608         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2609         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2610         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
2611         * layout/tableformatting/TableFormattingContext.cpp:
2612         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2613         * layout/tableformatting/TableFormattingContext.h:
2614         * layout/tableformatting/TableFormattingContextGeometry.cpp:
2615         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
2616
2617 2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2618
2619         [Clipboard API] Implement getType() for ClipboardItems created from bindings
2620         https://bugs.webkit.org/show_bug.cgi?id=202943
2621
2622         Reviewed by Tim Horton.
2623
2624         Adds basic support for ClipboardItem.getType(), in the case where the ClipboardItems are created by the page. To
2625         achieve this, we introduce ClipboardItemDataSource, which represents the data source backing a given clipboard
2626         item. This backing may either consist of a list of types and their corresponding DOMPromises (for ClipboardItems
2627         that come from the page), or may consist of a list of items that will ask the platformr pasteboard for their
2628         data (to be supported in a future patch).
2629
2630         See below for more details.
2631
2632         Test: editing/async-clipboard/clipboard-item-basic.html
2633
2634         * Modules/async-clipboard/Clipboard.h:
2635         * Modules/async-clipboard/ClipboardItem.cpp:
2636         (WebCore::clipboardItemPresentationStyle):
2637         (WebCore::ClipboardItem::ClipboardItem):
2638
2639         Pass in the parent Clipboard object for ClipboardItems that are backed by the platform pasteboard (which are
2640         returned by Clipboard.read()). (Note that this doesn't make any difference until this codepath is actually
2641         exercised when we add support for Clipboard.read()).
2642
2643         (WebCore::ClipboardItem::create):
2644         (WebCore::ClipboardItem::types const):
2645         (WebCore::ClipboardItem::getType):
2646
2647         Plumb types() and getType() to the clipboard item's datasource.
2648
2649         (WebCore::ClipboardItem::navigator):
2650
2651         Make navigator() return the parent Clipboard object's navigator.
2652
2653         * Modules/async-clipboard/ClipboardItem.h:
2654         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: Added.
2655         (WebCore::blobFromString):
2656         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemBindingsDataSource):
2657
2658         Store the given list of types and DOM promises.
2659
2660         (WebCore::ClipboardItemBindingsDataSource::types const):
2661         (WebCore::ClipboardItemBindingsDataSource::getType):
2662
2663         Implement getType() by finding the matching promised type in the item's array of types, and waiting for the
2664         promise to either resolve or reject. If the promise resolves to either a string or blob, we deliver the result
2665         back to the page by resolving the promise returned by getType(). Otherwise, we reject it.
2666
2667         * Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
2668         * Modules/async-clipboard/ClipboardItemDataSource.h:
2669         (WebCore::ClipboardItemDataSource::ClipboardItemDataSource):
2670         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
2671
2672         Add a stub implementation of a clipboard item data source that is backed by data in the platform pasteboard. In
2673         a future patch, this will implement getType() by calling out to the platform pasteboard.
2674
2675         (WebCore::ClipboardItemPasteboardDataSource::ClipboardItemPasteboardDataSource):
2676         (WebCore::ClipboardItemPasteboardDataSource::types const):
2677         (WebCore::ClipboardItemPasteboardDataSource::getType):
2678         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.h:
2679         * Modules/mediastream/RTCRtpReceiver.cpp:
2680         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
2681
2682         Unrelated build fixes, due to changes in unified source groupings.
2683
2684         * Sources.txt:
2685         * WebCore.xcodeproj/project.pbxproj:
2686         * platform/network/mac/UTIUtilities.mm:
2687
2688         More build fixes, due to changes in unified source groupings.
2689
2690 2019-10-15  Zalan Bujtas  <zalan@apple.com>
2691
2692         [LFC][IFC] Add support for text-transform: uppercase/lowercase
2693         https://bugs.webkit.org/show_bug.cgi?id=202968
2694         <rdar://problem/56278141>
2695
2696         Reviewed by Antti Koivisto.
2697
2698         The text content on the layout box should be in its final state (This might change if we actually need the original content for some reason though).
2699
2700         * layout/layouttree/LayoutTreeBuilder.cpp:
2701         (WebCore::Layout::applyTextTransform):
2702         (WebCore::Layout::TreeBuilder::createLayoutBox):
2703
2704 2019-10-14  Youenn Fablet  <youenn@apple.com>
2705
2706         Handle service worker loads through NetworkResourceLoader
2707         https://bugs.webkit.org/show_bug.cgi?id=202309
2708
2709         Reviewed by Alex Christensen.
2710
2711         Allow to serialize HTTP header names as enumeration.
2712         Updated SWServer ability to handle schemes by adding built-in support for HTTP and HTTPS as done in LegacySchemeRegistry.
2713
2714         Covered by existing tests.
2715
2716         * loader/ResourceLoaderOptions.h:
2717         * platform/network/create-http-header-name-table:
2718         * workers/service/server/SWServer.cpp:
2719         (WebCore::SWServer::canHandleScheme const):
2720         * workers/service/server/SWServer.h:
2721         * workers/service/server/SWServerJobQueue.cpp:
2722         (WebCore::SWServerJobQueue::runRegisterJob):
2723
2724 2019-10-14  Tim Horton  <timothy_horton@apple.com>
2725
2726         Unify sources for bindings more densely
2727         https://bugs.webkit.org/show_bug.cgi?id=202918
2728
2729         Reviewed by Simon Fraser.
2730
2731         No new tests, just a build time speedup.
2732         For me, this is a reliable 17% boost on the WebCore Build Time Benchmark.
2733
2734         * Scripts/generate-unified-sources.sh:
2735         Use dense bundles for JS* and bindings/js/*.
2736         This seems acceptable for a few reasons:
2737
2738         - most of the time building these files is spent parsing the exact
2739         same set of JSC headers, because the generated bindings code ends
2740         up including the same set of things
2741
2742         - the incremental build cost of bundling more bindings sources together
2743         is small, because the JSC headers dominate the time
2744
2745         - folks will frequently have to rebuild all of the bindings (on every
2746         pull, for example, because they indirectly include most JSC headers),
2747         but rarely end up rebuilding only a single one (in my experience)
2748
2749         * bindings/js/ReadableStreamDefaultController.cpp:
2750         (WebCore::readableStreamCallFunction):
2751         (WebCore::ReadableStreamDefaultController::invoke):
2752         (WebCore::callFunction): Deleted.
2753         Deduplicate static functions that now get bundled together.
2754
2755         * platform/graphics/ca/PlatformCALayer.cpp:
2756         (WebCore::PlatformCALayer::currentTimeToMediaTime):
2757         * platform/graphics/ca/PlatformCALayer.h:
2758         In older macOS SDKs, CABase.h included ApplicationServices.h, which
2759         causes lots of trouble.
2760
2761 2019-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2762
2763         [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER
2764         https://bugs.webkit.org/show_bug.cgi?id=202362
2765
2766         Reviewed by Carlos Alberto Lopez Perez.
2767
2768         The problem is that PlatformDisplayLibWPE::initialize() is failing to initialize the EGL display for some
2769         reason. We need to understand why, but we should also handle the case of failing to initialize the EGL display
2770         and simply disable accelerated compositing mode to avoid white pages and crashes in websites using WebGL. This
2771         patch doesn't actually fix the bug, it just handles the EGL display initialization failure.
2772
2773         * platform/graphics/PlatformDisplay.cpp:
2774         (WebCore::PlatformDisplay::~PlatformDisplay): Set s_sharedDisplayForCompositing to nullptr when the shared
2775         display for compositing is destroyed.
2776         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
2777         (WebCore::PlatformDisplayLibWPE::initialize): Return false when EGL display initialization fails.
2778         * platform/graphics/libwpe/PlatformDisplayLibWPE.h:
2779
2780 2019-10-14  Chris Dumez  <cdumez@apple.com>
2781
2782         [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses
2783         https://bugs.webkit.org/show_bug.cgi?id=202929
2784         <rdar://problem/56250421>
2785
2786         Reviewed by Alex Christensen.
2787
2788         Drop FrameLoaderClient::didSaveToPageCache() function as it is no longer needed.
2789         Instead, we now call HistoryItem::notifyChanged() whenever HistoryItem::m_cachedPage
2790         changes. This communicates to the UIProcess whether or not a HistoryItem has an
2791         associated CachedPage.
2792
2793         I also added more release logging to the PageCache and renamed its logging channel
2794         from PageCache to WebBackForwardCache to match the UIProcess's channel.
2795
2796         * history/BackForwardItemIdentifier.h:
2797         (WebCore::BackForwardItemIdentifier::string const):
2798         * history/CachedFrame.cpp:
2799         (WebCore::CachedFrame::CachedFrame):
2800         * history/HistoryItem.cpp:
2801         (WebCore::HistoryItem::setCachedPage):
2802         (WebCore::HistoryItem::takeCachedPage):
2803         * history/HistoryItem.h:
2804         * history/PageCache.cpp:
2805         (WebCore::PageCache::addIfCacheable):
2806         (WebCore::PageCache::take):
2807         (WebCore::PageCache::removeAllItemsForPage):
2808         (WebCore::PageCache::get):
2809         (WebCore::PageCache::remove):
2810         (WebCore::PageCache::prune):
2811         * loader/EmptyFrameLoaderClient.h:
2812         * loader/FrameLoader.cpp:
2813         (WebCore::FrameLoader::commitProvisionalLoad):
2814         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
2815         * loader/FrameLoaderClient.h:
2816         * platform/Logging.h:
2817
2818 2019-10-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
2819
2820         Outsets for referenced SVG filters are always zero
2821         https://bugs.webkit.org/show_bug.cgi?id=202826
2822
2823         Reviewed by Simon Fraser.
2824
2825         Sometimes the filter is applied only to a part of the image, so we need
2826         to enlarge the source rectangle such that the border of the result image
2827         looks like as if the filter were applied to the whole image.
2828
2829         The filter outsets should only be calculated for the blur and the drop
2830         shadow filters. The problem is FilterOperations::outsets() was returning
2831         empty outsets always for the referenced filters.
2832
2833         Since the referenced filters must be software filters, the fix is to rely
2834         on CSSFilter in calculating the filter outsets for software filters.
2835
2836         By adding a virtual function called outset() to the FilterEffect class, 
2837         we can loop through the CSSFilter::m_effects asking every FilterEffect
2838         to return its outset(). This function is only overridden by FEDropShadow
2839         and FEGaussianBlur.
2840
2841         This should work because RenderLayer builds the CSSFilter when the styleChanged()
2842         happens through its updateFilterPaintingStrategy(). This will guarantee 
2843         that m_filters->filter()->outsets() will return the correct outsets for
2844         the referenced and the non-referenced software filters.
2845
2846         We should keep FilterOperations::outsets() because it has be used for
2847         the hardware non-referenced filters. In that case, RenderLayer does not
2848         build the the filter effects. Therefore m_filters can't be used because
2849         it is null in this case.
2850
2851         For accuracy, hasOutsets() implementation is deleted. Having a blur or
2852         drop shadow filter effect is not enough to say hasOutsets() is true. We
2853         need to calculate the outsets first and then ask if it isZero() or not.
2854
2855         Test: css3/filters/svg-blur-filter-clipped.html
2856
2857         * platform/graphics/IntRectExtent.h:
2858         (WebCore::operator==):
2859         (WebCore::operator+=):
2860         (WebCore::IntRectExtent::expandRect const): Deleted.
2861         IntRectExtent is only used as a filter outsets. So add the definition of
2862         IntOutsets in IntRectExtent.h.
2863
2864         * platform/graphics/filters/FEDropShadow.cpp:
2865         (WebCore::FEDropShadow::outsets const):
2866         * platform/graphics/filters/FEDropShadow.h:
2867         * platform/graphics/filters/FEGaussianBlur.cpp:
2868         (WebCore::FEGaussianBlur::calculateOutsetSize):
2869         (WebCore::FEGaussianBlur::outsets const):
2870         * platform/graphics/filters/FEGaussianBlur.h:
2871         * platform/graphics/filters/FilterEffect.h:
2872         (WebCore::FilterEffect::outsets const):
2873         * platform/graphics/filters/FilterOperations.cpp:
2874         (WebCore::FilterOperations::outsets const):
2875         (WebCore::outsetSizeForBlur): Deleted.
2876         (WebCore::FilterOperations::hasOutsets const): Deleted.
2877         * platform/graphics/filters/FilterOperations.h:
2878         (WebCore::FilterOperations::hasOutsets const):
2879         * platform/graphics/texmap/TextureMapperLayer.cpp:
2880         (WebCore::TextureMapperLayer::computeOverlapRegions):
2881
2882         * rendering/CSSFilter.cpp:
2883         (WebCore::CSSFilter::build):
2884         (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
2885         (WebCore::CSSFilter::outsets const):
2886         Calculate m_outsets once and cache its value for later uses.
2887
2888         * rendering/CSSFilter.h:
2889         * rendering/RenderLayer.cpp:
2890         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
2891         (WebCore::RenderLayer::hasAncestorWithFilterOutsets const):
2892         (WebCore::transparencyClipBox):
2893         (WebCore::RenderLayer::calculateClipRects const):
2894         * rendering/RenderLayer.h:
2895         * rendering/style/RenderStyle.h:
2896         (WebCore::RenderStyle::filterOutsets const):
2897         (WebCore::RenderStyle::hasFilterOutsets const): Deleted.
2898
2899 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2900
2901         [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items
2902         https://bugs.webkit.org/show_bug.cgi?id=202916
2903
2904         Reviewed by Tim Horton.
2905
2906         Adjusts the `Pasteboard::write` codepath for writing PasteboardCustomData to the platform pasteboard, such that
2907         it accepts multiple PasteboardCustomDatas. No new tests, since there is no behavior change.
2908
2909         * dom/DataTransfer.cpp:
2910         (WebCore::DataTransfer::commitToPasteboard):
2911
2912         Pass in the PasteboardCustomData as a single-item vector.
2913
2914         * platform/Pasteboard.h:
2915         * platform/PasteboardStrategy.h:
2916         * platform/PlatformPasteboard.h:
2917         * platform/StaticPasteboard.h:
2918         * platform/cocoa/PasteboardCocoa.mm:
2919         (WebCore::Pasteboard::writeCustomData):
2920         * platform/gtk/PasteboardGtk.cpp:
2921         (WebCore::Pasteboard::writeCustomData):
2922         * platform/gtk/PlatformPasteboardGtk.cpp:
2923         (WebCore::PlatformPasteboard::write):
2924         * platform/ios/PlatformPasteboardIOS.mm:
2925         (WebCore::PlatformPasteboard::write):
2926
2927         Adjust this method to return the updated change count.
2928
2929         * platform/libwpe/PasteboardLibWPE.cpp:
2930         (WebCore::Pasteboard::writeCustomData):
2931         * platform/libwpe/PlatformPasteboardLibWPE.cpp:
2932         (WebCore::PlatformPasteboard::write):
2933         * platform/mac/PlatformPasteboardMac.mm:
2934         (WebCore::PlatformPasteboard::write):
2935
2936         Add logic to fall back to writing legacy pasteboard types in the case where there is only one item.
2937
2938         * platform/win/PasteboardWin.cpp:
2939         (WebCore::Pasteboard::writeCustomData):
2940
2941 2019-10-14  Ryosuke Niwa  <rniwa@webkit.org>
2942
2943         Deploy smart pointers in RadioButtonGroups and RadioButtonGroup
2944         https://bugs.webkit.org/show_bug.cgi?id=202942
2945
2946         Reviewed by Zalan Bujtas.
2947
2948         Use Ref & WeakPtr instead of raw pointers in RadioButtonGroups and RadioButtonGroup.
2949
2950         Also made RadioButtonGroups::m_nameToGroupMap a HashMap instead of a unique_ptr of HashMap
2951         since RadioButtonGroups is lazily created in TreeScope as of r250708.
2952
2953         No new tests since there should be no observable behavioral change.
2954
2955         * accessibility/AccessibilityRenderObject.cpp:
2956         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
2957         * dom/RadioButtonGroups.cpp:
2958         (WebCore::RadioButtonGroup): Use WeakHashSet and WeakPtr instead of raw pointers.
2959         (WebCore::RadioButtonGroup::isEmpty const):
2960         (WebCore::RadioButtonGroup::checkedButton const):
2961         (WebCore::RadioButtonGroup::members const):
2962         (WebCore::RadioButtonGroup::setCheckedButton):
2963         (WebCore::RadioButtonGroup::updateCheckedState):
2964         (WebCore::RadioButtonGroup::requiredStateChanged):
2965         (WebCore::RadioButtonGroup::remove):
2966         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
2967         (WebCore::RadioButtonGroup::updateValidityForAllButtons):
2968         (WebCore::RadioButtonGroup::contains const):
2969         (WebCore::RadioButtonGroups::addButton):
2970         (WebCore::RadioButtonGroups::groupMembers const):
2971         (WebCore::RadioButtonGroups::updateCheckedState):
2972         (WebCore::RadioButtonGroups::requiredStateChanged):
2973         (WebCore::RadioButtonGroups::checkedButtonForGroup const):
2974         (WebCore::RadioButtonGroups::hasCheckedButton const):
2975         (WebCore::RadioButtonGroups::isInRequiredGroup const):
2976         (WebCore::RadioButtonGroups::removeButton):
2977         * dom/RadioButtonGroups.h:
2978         (WebCore::RadioButtonGroups):
2979         * html/HTMLInputElement.cpp:
2980         (WebCore::HTMLInputElement::radioButtonGroup const):
2981         (WebCore::HTMLInputElement::checkedRadioButtonForGroup const):
2982         * html/HTMLInputElement.h:
2983
2984 2019-10-14  David Quesada  <david_quesada@apple.com>
2985
2986         Remove WebCore::IOSApplication::isWebApp()
2987         https://bugs.webkit.org/show_bug.cgi?id=181259
2988
2989         Reviewed by Alex Christensen.
2990
2991         As of iOS 11, the Web.app process no longer uses WebKit directly, so IOSApplication::isWebApp()
2992         is never true. Since it's no longer needed, remove it.
2993
2994         * platform/RuntimeApplicationChecks.h:
2995         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2996         (WebCore::IOSApplication::isWebApp): Deleted.
2997
2998 2019-10-14  Andy Estes  <aestes@apple.com>
2999
3000         REGRESSION (r243682): Quick Look previews loaded from the memory cache render with the wrong content type
3001         https://bugs.webkit.org/show_bug.cgi?id=202935
3002         <rdar://problem/54318133>
3003
3004         Reviewed by Tim Horton.
3005
3006         When loading a Quick Look preview after deciding content policy, PreviewLoader would update
3007         DocumentLoader with the preview response (the response that contains the preview's
3008         Content-Type). It would not update the CachedResource representing the preview main
3009         resource, however, which caches the underlying ResourceResponse in m_response.
3010
3011         When loading from the memory cache, it's the CachedResource's response that's used to
3012         synthesize DocumentLoader::responseReceived. When loading Quick Look previews *before*
3013         deciding content policy, this response would be the preview response, but as described
3014         above, when loading after deciding content policy it's the underlying response.
3015
3016         This patch updates a Quick Look preview's CachedResource with the preview response along
3017         with updating DocumentLoader so that there is not a mismatch between the resource's content
3018         type and its underlying data.
3019
3020         Added a new API test.
3021
3022         * loader/DocumentLoader.cpp:
3023         (WebCore::DocumentLoader::previewResponseReceived):
3024         * loader/DocumentLoader.h:
3025         * loader/ResourceLoader.h:
3026         (WebCore::ResourceLoader::didReceivePreviewResponse):
3027         * loader/SubresourceLoader.cpp:
3028         (WebCore::SubresourceLoader::didReceivePreviewResponse):
3029         * loader/SubresourceLoader.h:
3030         * loader/cache/CachedRawResource.cpp:
3031         (WebCore::CachedRawResource::previewResponseReceived):
3032         * loader/cache/CachedRawResource.h:
3033         * loader/cache/CachedRawResourceClient.h:
3034         (WebCore::CachedRawResourceClient::previewResponseReceived):
3035         * loader/cache/CachedResource.cpp:
3036         (WebCore::CachedResource::previewResponseReceived):
3037         * loader/cache/CachedResource.h:
3038         * loader/ios/PreviewLoader.mm:
3039         (-[WebPreviewLoader _loadPreviewIfNeeded]):
3040
3041 2019-10-14  Youenn Fablet  <youenn@apple.com>
3042
3043         A response body promise should be rejected in case of a failure happening after the HTTP response
3044         https://bugs.webkit.org/show_bug.cgi?id=202792
3045
3046         Reviewed by Chris Dumez.
3047
3048         Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-error.https.html
3049
3050         * Modules/fetch/FetchResponse.cpp:
3051         (WebCore::FetchResponse::BodyLoader::didFail):
3052         Propagate error to fetch body consumer if any.
3053
3054 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3055
3056         [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
3057         https://bugs.webkit.org/show_bug.cgi?id=202851
3058
3059         Reviewed by Darin Adler.
3060
3061         This patch refactors some logic around WebCore::PasteboardCustomData, in preparation for implementing the async
3062         clipboard API. There are two main goals of this refactoring:
3063
3064         1. Enable writing multiple items (each backed by PasteboardCustomData) to the platform pasteboard.
3065         2. Enable writing platform data in the form of SharedBuffers to the platform pasteboard.
3066
3067         See below for more details; no tests, as there is no change in behavior yet.
3068
3069         * Headers.cmake:
3070         * Sources.txt:
3071         * SourcesCocoa.txt:
3072         * WebCore.xcodeproj/project.pbxproj:
3073
3074         Move PasteboardCustomData out of Pasteboard.h and into its own file.
3075
3076         * dom/DataTransfer.cpp:
3077         (WebCore::DataTransfer::commitToPasteboard):
3078         * editing/cocoa/EditorCocoa.mm:
3079         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
3080         * platform/Pasteboard.cpp:
3081         (WebCore::PasteboardCustomData::createSharedBuffer const): Deleted.
3082         (WebCore::PasteboardCustomData::fromSharedBuffer): Deleted.
3083
3084         Moved these method implementations to PasteboardCustomData.cpp.
3085
3086         * platform/Pasteboard.h:
3087
3088         Refactor PasteboardCustomData so that its member variables are now private, and encapsulated behind methods
3089         Additionally, make it so that the only way to set data on PasteboardCustomData is to use the writeString,
3090         writeData, and writeStringInCustomData methods, which ensure that the PasteboardCustomData is always in a
3091         consistent state.
3092
3093         * platform/PasteboardCustomData.cpp: Added.
3094         (WebCore::copyPlatformData):
3095         (WebCore::PasteboardCustomData::Entry::Entry):
3096         (WebCore::PasteboardCustomData::Entry::operator=):
3097
3098         Refactor the implementation of PasteboardCustomData, so that it contains a list of PasteboardCustomData entries
3099         instead of individual Vectors and HashMaps.
3100
3101         (WebCore::PasteboardCustomData::PasteboardCustomData):
3102         (WebCore::PasteboardCustomData::createSharedBuffer const):
3103         (WebCore::PasteboardCustomData::fromSharedBuffer):
3104         (WebCore::PasteboardCustomData::writeString):
3105         (WebCore::PasteboardCustomData::writeData):
3106         (WebCore::PasteboardCustomData::writeStringInCustomData):
3107         (WebCore::PasteboardCustomData::addOrMoveEntryToEnd):
3108
3109         Move logic from StaticPasteboard into PasteboardCustomData, and refactor these methods to handle
3110         Vector<PasteboardCustomData::Entry>.
3111
3112         (WebCore::PasteboardCustomData::clear):
3113         (WebCore::PasteboardCustomData::operator=):
3114         (WebCore::PasteboardCustomData::orderedTypes const):
3115         (WebCore::PasteboardCustomData::hasData const):
3116         (WebCore::PasteboardCustomData::hasSameOriginCustomData const):
3117         (WebCore::PasteboardCustomData::sameOriginCustomStringData const):
3118         (WebCore::PasteboardCustomData::readBuffer const):
3119         (WebCore::PasteboardCustomData::readString const):
3120         (WebCore::PasteboardCustomData::readStringInCustomData const):
3121         (WebCore::PasteboardCustomData::forEachType const):
3122         (WebCore::PasteboardCustomData::forEachPlatformString const):
3123         (WebCore::PasteboardCustomData::forEachCustomString const):
3124         (WebCore::PasteboardCustomData::forEachPlatformStringOrBuffer const):
3125
3126         Moved these method implementations from StaticPasteboard to PasteboardCustomData, and also introduced some new
3127         methods to help iterate through types and data.
3128
3129         * platform/PasteboardCustomData.h: Added.
3130         (WebCore::PasteboardCustomData::origin const):
3131         (WebCore::PasteboardCustomData::setOrigin):
3132         (WebCore::PasteboardCustomData::data const):
3133         * platform/PasteboardStrategy.h:
3134         * platform/PlatformPasteboard.h:
3135         * platform/SharedBuffer.cpp:
3136         (WebCore::SharedBuffer::decoder const):
3137         * platform/SharedBuffer.h:
3138         * platform/StaticPasteboard.cpp:
3139         (WebCore::StaticPasteboard::hasData):
3140         (WebCore::StaticPasteboard::typesSafeForBindings):
3141         (WebCore::StaticPasteboard::typesForLegacyUnsafeBindings):
3142         (WebCore::StaticPasteboard::readString):
3143         (WebCore::StaticPasteboard::readStringInCustomData):
3144         (WebCore::StaticPasteboard::writeString):
3145         (WebCore::StaticPasteboard::writeData):
3146         (WebCore::StaticPasteboard::writeStringInCustomData):
3147         (WebCore::StaticPasteboard::clear):
3148         (WebCore::StaticPasteboard::takeCustomData):
3149         (WebCore::StaticPasteboard::StaticPasteboard): Deleted.
3150
3151         Refactor StaticPasteboard to now contain a PasteboardCustomData; additionally, adjust several methods in
3152         StaticPasteboard to simply call into PasteboardCustomData to write, read, or clear data.
3153
3154         (WebCore::updateTypes): Deleted.
3155         * platform/StaticPasteboard.h:
3156         * platform/cocoa/PasteboardCocoa.mm:
3157         (WebCore::Pasteboard::readStringInCustomData):
3158         (WebCore::Pasteboard::readOrigin):
3159         (WebCore::PasteboardCustomData::cocoaType): Deleted.
3160
3161         Moved the implementation of PasteboardCustomData::cocoaType from PasteboardCocoa.mm to
3162         PasteboardCustomDataCocoa.mm.
3163
3164         * platform/cocoa/PasteboardCustomDataCocoa.mm: Added.
3165         (WebCore::PasteboardCustomData::cocoaType):
3166         * platform/ios/AbstractPasteboard.h:
3167         * platform/ios/PlatformPasteboardIOS.mm:
3168         (WebCore::PlatformPasteboard::changeCount const):
3169         (WebCore::registerItemsToPasteboard):
3170         (WebCore::registerItemToPasteboard):
3171         (WebCore::PlatformPasteboard::write):
3172
3173         Support writing multiple PasteboardCustomData objects to the platform pasteboard on iOS, by generating
3174         NSItemProviders for each one. This refactors the existing `registerItemToPasteboard` helper to handle multiple
3175         registration lists, renames it to `registerItemsToPasteboard` (plural), and then reimplements
3176         `registerItemToPasteboard` in terms of `registerItemsToPasteboard`.
3177
3178         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3179         (WebCore::createItemProviderRegistrationList):
3180
3181         Adjust these to use getters on PasteboardCustomData instead of accessing the member variables directly.
3182
3183         * platform/ios/WebItemProviderPasteboard.mm:
3184         (-[WebItemProviderPasteboard init]):
3185         (-[WebItemProviderPasteboard stageRegistrationLists:]):
3186         (-[WebItemProviderPasteboard clearRegistrationLists]):
3187         (-[WebItemProviderPasteboard takeRegistrationLists]):
3188
3189         Refactor registration list staging on WebItemProviderPasteboard to support multiple registration lists, each
3190         representing a single item provider.
3191
3192         (-[WebItemProviderPasteboard stageRegistrationList:]): Deleted.
3193         (-[WebItemProviderPasteboard takeRegistrationList]): Deleted.
3194         * platform/mac/PasteboardMac.mm:
3195         (WebCore::Pasteboard::write):
3196         * platform/mac/PasteboardWriter.mm:
3197         (WebCore::createPasteboardWriter):
3198         * platform/mac/PlatformPasteboardMac.mm:
3199         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3200         (WebCore::PlatformPasteboard::write):
3201
3202         Support writing multiple PasteboardCustomData objects to the platform pasteboard on macOS, by creating and
3203         setting NSPasteboardItems for each custom data. This means that instead of using legacy macOS pasteboard types,
3204         we need to use the "modern" NSPasteboardTypes when writing each item. This is because NSPasteboardItem quietly
3205         fails when attempting to set data for a legacy pasteboard type.
3206
3207         (WebCore::createPasteboardItem):
3208
3209 2019-10-14  Truitt Savell  <tsavell@apple.com>
3210
3211         Unreviewed, rolling out r251081.
3212
3213         Broke macOS and iOS builds
3214
3215         Reverted changeset:
3216
3217         "transform-box: content-box, stroke-box missing"
3218         https://bugs.webkit.org/show_bug.cgi?id=201892
3219         https://trac.webkit.org/changeset/251081
3220
3221 2019-10-14  Dean Jackson  <dino@apple.com>
3222
3223         Reset maxCanvasPixelMemory between tests
3224         https://bugs.webkit.org/show_bug.cgi?id=202941
3225         <rdar://problem/56260865>
3226
3227         Reviewed by Wenson Hsieh.
3228
3229         Reset the maximum canvas memory between tests.
3230
3231         * testing/Internals.cpp:
3232         (WebCore::Internals::resetToConsistentState):
3233
3234 2019-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
3235
3236         [Cocoa] font-family:system-ui on Chinese systems don't get Chinese quote marks
3237         https://bugs.webkit.org/show_bug.cgi?id=202778
3238
3239         Unreviewed.
3240
3241         Addressing post-review comment.
3242
3243         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3244         (WebCore::SystemFontDatabaseCoreText::createSystemUIFont):
3245
3246 2019-10-14  Alex Christensen  <achristensen@webkit.org>
3247
3248         REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
3249         https://bugs.webkit.org/show_bug.cgi?id=201902
3250
3251         Reviewed by Ryosuke Niwa.
3252
3253         * Modules/webauthn/fido/U2fResponseConverter.cpp:
3254         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
3255
3256 2019-10-14  Russell Epstein  <russell_e@apple.com>
3257
3258         Unreviewed, rolling out r251081.
3259
3260         Broke macOS and iOS builds.
3261
3262         Reverted changeset:
3263
3264         "transform-box: content-box, stroke-box missing"
3265         https://bugs.webkit.org/show_bug.cgi?id=201892
3266         https://trac.webkit.org/changeset/251081
3267
3268 2019-10-14  Dirk Schulze  <krit@webkit.org>
3269
3270         transform-box: content-box, stroke-box missing
3271         https://bugs.webkit.org/show_bug.cgi?id=201892
3272
3273         Reviewed by Simon Fraser.
3274
3275         Added the keywords content-box and stroke-box to the
3276         transform-box CSS property.
3277         Those keywords were added to the spec after the implementation
3278         in WebKit.
3279
3280         Test: transforms/transform-box.html
3281
3282         * css/CSSPrimitiveValueMappings.h:
3283         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3284         (WebCore::CSSPrimitiveValue::operator TransformBox const):
3285         * css/CSSProperties.json:
3286         * css/CSSValueKeywords.in:
3287         * css/parser/CSSPropertyParser.cpp:
3288         (WebCore::CSSPropertyParser::parseSingleValue):
3289         * rendering/RenderLayer.cpp:
3290         (WebCore::computeReferenceBox):
3291         (WebCore::transformBoxToCSSBoxType):
3292         (WebCore::RenderLayer::currentTransform const):
3293         * rendering/style/RenderStyleConstants.h:
3294         * svg/SVGGraphicsElement.cpp:
3295         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
3296
3297 2019-10-14  Truitt Savell  <tsavell@apple.com>
3298
3299         Unreviewed, rolling out r251045.
3300
3301         Broke internal builds
3302
3303         Reverted changeset:
3304
3305         "AX: Make AXIsolatedTree compile again"
3306         https://bugs.webkit.org/show_bug.cgi?id=202702
3307         https://trac.webkit.org/changeset/251045
3308
3309 2019-10-14  youenn fablet  <youenn@apple.com>
3310
3311         Reuse existing web processes for running service workers
3312         https://bugs.webkit.org/show_bug.cgi?id=202195
3313
3314         Reviewed by Chris Dumez.
3315
3316         Update implementation to be able to run service workers jointly with page.
3317         Add internals API to get the process ID.
3318         This allows writing tests to check whether a service worker is in the same process as its client or not.
3319
3320         Test: http/wpt/service-workers/service-worker-different-process.https.html
3321
3322         * testing/Internals.cpp:
3323         (WebCore::Internals::processIdentifier const):
3324         * testing/Internals.h:
3325         * testing/Internals.idl:
3326         * testing/ServiceWorkerInternals.cpp:
3327         (WebCore::ServiceWorkerInternals::processIdentifier const):
3328         * testing/ServiceWorkerInternals.h:
3329         * testing/ServiceWorkerInternals.idl:
3330         * workers/service/ServiceWorkerProvider.cpp:
3331         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
3332         Do not register dummy documents whose sole purpose is to do loading for service workers.
3333         * workers/service/context/SWContextManager.cpp:
3334         (WebCore::SWContextManager::setConnection):
3335         Now that connections might be created more than once on a given process,
3336         Make sure that the replaced connection is stopped or there is no replaced connection.
3337         (WebCore::SWContextManager::stopAllServiceWorkers):
3338         Add routine to stop all service workers running in a given web process.
3339         * workers/service/context/SWContextManager.h:
3340         (WebCore::SWContextManager::Connection::isClosed const):
3341         (WebCore::SWContextManager::Connection::setAsClosed):
3342
3343 2019-10-13  Tim Horton  <timothy_horton@apple.com>
3344
3345         Stop 'using namespace *Names' in files generated by make_names.pl
3346         https://bugs.webkit.org/show_bug.cgi?id=202907
3347
3348         Reviewed by Geoffrey Garen.
3349
3350         * dom/make_names.pl:
3351         (printFunctionTable):
3352         (printFactoryCppFile):
3353         (printWrapperFactoryCppFile):
3354         Stop 'using namespace SVGNames' and 'using namepace HTMLNames' in
3355         files generated by make_names.pl. Just use fully-qualified names.
3356
3357         There is some overlap between the two namespaces, so this is a
3358         prerequsite for doing more aggressive unified source bundling in bindings.
3359
3360 2019-10-13  Tim Horton  <timothy_horton@apple.com>
3361
3362         Don't include ApplicationServices in npapi.h
3363         https://bugs.webkit.org/show_bug.cgi?id=202911
3364
3365         Reviewed by Sam Weinig.
3366
3367         * plugins/npapi.h:
3368         Just include CoreGraphics.h, not ApplicationServices.h.
3369         ApplicationServices.h pulls in all sorts of crazy things like
3370         QuickDraw headers that have symbol conflicts with JSC (like Handle).
3371
3372 2019-10-13  Stephan Szabo  <stephan.szabo@sony.com>
3373
3374         Wincairo build broken: EventLoop.h: No such file or directory
3375         https://bugs.webkit.org/show_bug.cgi?id=202893
3376
3377         Reviewed by Fujii Hironori.
3378
3379         Remove include of EventLoop.h.
3380
3381         * platform/network/curl/SynchronousLoaderClientCurl.cpp:
3382
3383 2019-10-13  Konstantin Tokarev  <annulen@yandex.ru>
3384
3385         Fix compilation of Crypto.cpp on macOS with !WEB_CRYPTO
3386         https://bugs.webkit.org/show_bug.cgi?id=202895
3387
3388         Reviewed by Alexey Proskuryakov.
3389
3390         Crypto.cpp does not use getCommonCryptoDigestAlgorithm(), defined in
3391         CommonCryptoUtilities.h, but requires CommonCrypto includes which are
3392         coming with it. However, when WEB_CRYPTO is disabled necessary
3393         transitive includes are missing.
3394
3395         * page/Crypto.cpp:
3396
3397 2019-10-13  Simon Fraser  <simon.fraser@apple.com>
3398
3399         Convert ENinePieceImageRule into an enum class and rename
3400         https://bugs.webkit.org/show_bug.cgi?id=202889
3401
3402         Reviewed by Alex Christensen.
3403
3404         Enum classify ENinePieceImageRule.
3405         
3406         The bitfield in NinePieceImage isn't saving anything so don't use one there.
3407
3408         * css/CSSComputedStyleDeclaration.cpp:
3409         (WebCore::valueForRepeatRule):
3410         * css/CSSToStyleMap.cpp:
3411         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
3412         * css/StyleBuilderCustom.h:
3413         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue):
3414         * rendering/style/NinePieceImage.cpp:
3415         (WebCore::NinePieceImage::NinePieceImage):
3416         (WebCore::NinePieceImage::computeMiddleTileScale):
3417         (WebCore::NinePieceImage::computeTileScales):
3418         (WebCore::NinePieceImage::Data::Data):
3419         (WebCore::NinePieceImage::Data::create):
3420         * rendering/style/NinePieceImage.h:
3421         (WebCore::NinePieceImage::horizontalRule const):
3422         (WebCore::NinePieceImage::setHorizontalRule):
3423         (WebCore::NinePieceImage::verticalRule const):
3424         (WebCore::NinePieceImage::setVerticalRule):
3425
3426 2019-10-13  Simon Fraser  <simon.fraser@apple.com>
3427
3428         Clarify the naming of the radius-related functions on BorderData
3429         https://bugs.webkit.org/show_bug.cgi?id=202888
3430
3431         Reviewed by Alex Christensen.
3432
3433         BorderData had some confusingly named data members and functions ("topLeft"'"). Renamed
3434         to include the term "radius".
3435
3436         * platform/graphics/PathUtilities.cpp:
3437         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
3438         * rendering/style/BorderData.h:
3439         (WebCore::BorderData::BorderData):
3440         (WebCore::BorderData::hasBorderRadius const):
3441         (WebCore::BorderData::operator== const):
3442         (WebCore::BorderData::topLeftRadius const):
3443         (WebCore::BorderData::topRightRadius const):
3444         (WebCore::BorderData::bottomLeftRadius const):
3445         (WebCore::BorderData::bottomRightRadius const):
3446         (WebCore::BorderData::topLeft const): Deleted.
3447         (WebCore::BorderData::topRight const): Deleted.
3448         (WebCore::BorderData::bottomLeft const): Deleted.
3449         (WebCore::BorderData::bottomRight const): Deleted.
3450         * rendering/style/RenderStyle.cpp:
3451         (WebCore::calcRadiiFor):
3452         * rendering/style/RenderStyle.h:
3453         (WebCore::RenderStyle::borderTopLeftRadius const):
3454         (WebCore::RenderStyle::borderTopRightRadius const):
3455         (WebCore::RenderStyle::borderBottomLeftRadius const):
3456         (WebCore::RenderStyle::borderBottomRightRadius const):
3457         (WebCore::RenderStyle::resetBorderTopLeftRadius):
3458         (WebCore::RenderStyle::resetBorderTopRightRadius):
3459         (WebCore::RenderStyle::resetBorderBottomLeftRadius):
3460         (WebCore::RenderStyle::resetBorderBottomRightRadius):
3461         (WebCore::RenderStyle::setBorderTopLeftRadius):
3462         (WebCore::RenderStyle::setBorderTopRightRadius):
3463         (WebCore::RenderStyle::setBorderBottomLeftRadius):
3464         (WebCore::RenderStyle::setBorderBottomRightRadius):
3465
3466 2019-10-13  Simon Fraser  <simon.fraser@apple.com>
3467
3468         Convert LineBoxContain to use an OptionSet<>
3469         https://bugs.webkit.org/show_bug.cgi?id=202890
3470
3471         Reviewed by Alex Christensen.
3472
3473         Use OptionSet<LineBoxContain>.
3474
3475         * css/CSSComputedStyleDeclaration.cpp:
3476         (WebCore::createLineBoxContainValue):
3477         * css/CSSLineBoxContainValue.cpp:
3478         (WebCore::CSSLineBoxContainValue::CSSLineBoxContainValue):
3479         (WebCore::CSSLineBoxContainValue::customCSSText const):
3480         * css/CSSLineBoxContainValue.h:
3481         * css/StyleBuilderConverter.h:
3482         (WebCore::StyleBuilderConverter::convertLineBoxContain):
3483         * css/parser/CSSPropertyParser.cpp:
3484         (WebCore::consumeLineBoxContain):
3485         * rendering/RenderBlock.cpp:
3486         (WebCore::RenderBlock::minLineHeightForReplacedRenderer const):
3487         * rendering/RootInlineBox.cpp:
3488         (WebCore::RootInlineBox::ascentAndDescentForBox const):
3489         (WebCore::RootInlineBox::includeLeadingForBox const):
3490         (WebCore::RootInlineBox::includeFontForBox const):
3491         (WebCore::RootInlineBox::includeGlyphsForBox const):
3492         (WebCore::RootInlineBox::includeInitialLetterForBox const):
3493         (WebCore::RootInlineBox::includeMarginForBox const):
3494         (WebCore::RootInlineBox::fitsToGlyphs const):
3495         (WebCore::RootInlineBox::includesRootLineBoxFontOrLeading const):
3496         * rendering/SimpleLineLayout.cpp:
3497         (WebCore::SimpleLineLayout::canUseForFontAndText):
3498         (WebCore::SimpleLineLayout::canUseForStyle):
3499         * rendering/style/RenderStyle.h:
3500         (WebCore::RenderStyle::lineBoxContain const):
3501         (WebCore::RenderStyle::setLineBoxContain):
3502         (WebCore::RenderStyle::initialLineBoxContain):
3503         * rendering/style/StyleRareInheritedData.cpp:
3504         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3505         * rendering/style/StyleRareInheritedData.h:
3506         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
3507         (WebCore::styleForFirstLetter):
3508
3509 2019-10-12  Ryosuke Niwa  <rniwa@webkit.org>
3510
3511         [iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
3512         https://bugs.webkit.org/show_bug.cgi?id=202878
3513
3514         Reviewed by Alex Christensen.
3515
3516         Added the missing null check in tryAddEventListener and tryRemoveEventListener for scroll event.
3517
3518         Test: fast/events/scroll-event-on-document-without-window.html
3519
3520         * dom/Node.cpp:
3521         (WebCore::tryAddEventListener):
3522         (WebCore::tryRemoveEventListener):
3523
3524 2019-10-12  Simon Fraser  <simon.fraser@apple.com>
3525
3526         Move CSSReflectionDirection into RenderStyleConstants as ReflectionDirection
3527         https://bugs.webkit.org/show_bug.cgi?id=202886
3528
3529         Reviewed by Sam Weinig.
3530
3531         Make CSSReflectionDirection an enum class ReflectionDirection, and fix the usage sites.
3532
3533         * Headers.cmake:
3534         * WebCore.xcodeproj/project.pbxproj:
3535         * css/CSSComputedStyleDeclaration.cpp:
3536         (WebCore::valueForReflection):
3537         * css/CSSPrimitiveValueMappings.h:
3538         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3539         (WebCore::CSSPrimitiveValue::operator ReflectionDirection const):
3540         (WebCore::CSSPrimitiveValue::operator CSSReflectionDirection const): Deleted.
3541         * css/CSSReflectionDirection.h: Removed.
3542         * rendering/RenderBox.cpp:
3543         (WebCore::RenderBox::reflectionOffset const):
3544         (WebCore::RenderBox::reflectedRect const):
3545         * rendering/RenderLayer.cpp:
3546         (WebCore::RenderLayer::calculateClipRects const):
3547         * rendering/style/RenderStyleConstants.cpp:
3548         (WebCore::operator<<):
3549         * rendering/style/RenderStyleConstants.h:
3550         * rendering/style/StyleReflection.h:
3551         (WebCore::StyleReflection::direction const):
3552         (WebCore::StyleReflection::setDirection):
3553         (WebCore::StyleReflection::StyleReflection):
3554
3555 2019-10-12  Simon Fraser  <simon.fraser@apple.com>
3556
3557         Fix the spelling of ThreeDDarkDhasowColor and unwrap the ThemeType enums
3558         https://bugs.webkit.org/show_bug.cgi?id=202887
3559
3560         Reviewed by Wenson Hsieh.
3561
3562         ThreeDDarkDhasowColor was misspelled, and one enum value per line please.
3563
3564         * platform/ThemeTypes.h:
3565
3566 2019-10-12  Chris Dumez  <cdumez@apple.com>
3567
3568         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects
3569         https://bugs.webkit.org/show_bug.cgi?id=202869
3570
3571         Reviewed by Ryosuke Niwa.
3572
3573         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects, this is necessary so that the wrapper
3574         stays alive as long as ActiveDOMObject::hasPendingActivity() returns true. We may have
3575         subtle lifetime bugs otherwise.
3576
3577         * Modules/encryptedmedia/MediaKeySession.h:
3578         * Modules/encryptedmedia/MediaKeySession.idl:
3579         * Modules/entriesapi/FileSystemDirectoryReader.idl:
3580         * Modules/entriesapi/FileSystemEntry.idl:
3581         * Modules/geolocation/Geolocation.idl:
3582         * Modules/indexeddb/IDBObjectStore.h:
3583         * Modules/indexeddb/IDBObjectStore.idl:
3584         * Modules/paymentrequest/PaymentResponse.idl:
3585         * Modules/webvr/VRDisplay.h:
3586         * Modules/webvr/VRDisplay.idl:
3587         * workers/service/ServiceWorkerContainer.idl:
3588
3589 2019-10-12  Simon Fraser  <simon.fraser@apple.com>
3590
3591         Implement TextStream-based dumping for all the RenderStyle and SVGRenderStyle enum classes
3592         https://bugs.webkit.org/show_bug.cgi?id=202877
3593
3594         Reviewed by Dean Jackson.
3595
3596         Make style-related enum classes dumpable with TextStream,  and make some SVG style-related
3597         classes dumpable.
3598
3599         * rendering/style/RenderStyleConstants.cpp:
3600         (WebCore::operator<<):
3601         * rendering/style/RenderStyleConstants.h:
3602         * rendering/style/SVGRenderStyleDefs.cpp:
3603         (WebCore::operator<<):
3604         * rendering/style/SVGRenderStyleDefs.h:
3605         * rendering/style/ShadowData.cpp:
3606         (WebCore::operator<<):
3607         * rendering/style/ShadowData.h:
3608
3609 2019-10-12  Chris Dumez  <cdumez@apple.com>
3610
3611         Unreviewed, rolling out r251040.
3612
3613         Broke IDB tests in Debug
3614
3615         Reverted changeset:
3616
3617         "Add [ActiveDOMObject] to IDLs of ActiveDOMObjects"
3618         https://bugs.webkit.org/show_bug.cgi?id=202869
3619         https://trac.webkit.org/changeset/251040
3620
3621 2019-10-12  Ryosuke Niwa  <rniwa@webkit.org>
3622
3623         Invoke callbacks registered by requestIdleCallback
3624         https://bugs.webkit.org/show_bug.cgi?id=202824
3625
3626         Reviewed by Antti Koivisto.
3627
3628         Invoke callbacks registered by requestIdleCallback unless it's canceled.
3629
3630         To do this, this patch introduces WindowEventLoop class, which represents the HTML5 event loop:
3631         https://html.spec.whatwg.org/multipage/webappapis.html#window-event-loop
3632
3633         Because each and only each agent cluster is meant to have its own window event loop, this class will be shared
3634         across multiple documents of the same registrable domain:
3635         https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-agent-cluster-formalism
3636
3637         Tests: requestidlecallback/requestidlecallback-is-called.html
3638                requestidlecallback/requestidlecallback-is-not-called-when-canceled.html
3639
3640         * Sources.txt:
3641         * WebCore.xcodeproj/project.pbxproj:
3642         * dom/Document.cpp:
3643         (WebCore::Document::eventLoop): Added.
3644         (WebCore::Document::requestIdleCallback): Associate IdleCallbackController with this document.
3645         * dom/Document.h:
3646         (WebCore::Document::idleCallbackController): Added. Used for release assertions.
3647         * dom/IdleCallbackController.cpp:
3648         (WebCore::IdleCallbackController::IdleCallbackController): Keeps a weak pointer to Document.
3649         (WebCore::IdleCallbackController::queueIdleCallback):
3650         (WebCore::IdleCallbackController::removeIdleCallback):
3651         (WebCore::IdleCallbackController::queueTaskToStartIdlePeriod): Added.
3652         (WebCore::IdleCallbackController::startIdlePeriod): Added. Implements the start an idle period algorithm:
3653         https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm
3654         (WebCore::IdleCallbackController::queueTaskToInvokeIdleCallbacks): Added.
3655         (WebCore::IdleCallbackController::invokeIdleCallbacks): Added. The invoke idle callback timeout algorithm:
3656         https://w3c.github.io/requestidlecallback/#invoke-idle-callback-timeout-algorithm
3657         * dom/IdleCallbackController.h:
3658         * dom/IdleDeadline.h:
3659         * dom/WindowEventLoop.cpp: Added.
3660         (WebCore::WindowEventLoop::create): Added.
3661         (WebCore::WindowEventLoop::WindowEventLoop): Added.
3662         (WebCore::WindowEventLoop::queueTask): Added.
3663         (WebCore::WindowEventLoop::run): Added.
3664         * dom/WindowEventLoop.h: Added.
3665         * page/Page.cpp:
3666         (WebCore::Page::updateRendering): Added comments for the missing pieces.
3667
3668 2019-10-12  Chris Dumez  <cdumez@apple.com>
3669
3670         Back/Forward cache does not work after doing a favorite navigation
3671         https://bugs.webkit.org/show_bug.cgi?id=202762
3672         <rdar://problem/56126911>
3673
3674         Reviewed by Antti Koivisto.
3675
3676         When a subframe goes into the page cache, make sure we null out the opener
3677         link of any windows that were opened by this frame. This matches what would
3678         happened if this frame were closed.
3679
3680         Covered by the following API tests:
3681         ProcessSwap.PageCacheAfterProcessSwapByClient
3682         ProcessSwap.OpenerLinkAfterAPIControlledProcessSwappingOfOpener
3683
3684         * history/CachedFrame.cpp:
3685         (WebCore::CachedFrame::CachedFrame):
3686         * loader/FrameLoader.cpp:
3687         (WebCore::FrameLoader::~FrameLoader):
3688         (WebCore::FrameLoader::detachFromAllOpenedFrames):
3689         * loader/FrameLoader.h:
3690
3691 2019-10-12  Chris Fleizach  <cfleizach@apple.com>
3692
3693         AX: Make AXIsolatedTree compile again
3694         https://bugs.webkit.org/show_bug.cgi?id=202702
3695         <rdar://problem/56084968>
3696
3697         Reviewed by Joanmarie Diggs.
3698
3699         Fix compilation and runtime issues when building with ACCESSIBILITY_ISOLATED_TREE.
3700
3701         * accessibility/AccessibilityRenderObject.cpp:
3702         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
3703         * accessibility/isolatedtree/AXIsolatedTree.cpp:
3704         (WebCore::AXIsolatedTree::treePageCache):
3705         (WebCore::AXIsolatedTree::nodeForID const):
3706             - Remove release assert here because the initial request that comes through happens on the main thread.
3707               We need to handle that case specific case.
3708         (WebCore::AXIsolatedTree::applyPendingChanges):
3709         (WebCore::AXIsolatedTree::initializePageTreeForID): Deleted.
3710         (WebCore::AXIsolatedTree::setInitialRequestInProgress): Deleted.
3711         * accessibility/isolatedtree/AXIsolatedTree.h:
3712         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
3713         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
3714         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3715         (convertToNSArray):
3716         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3717         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
3718
3719 2019-10-11  Ryosuke Niwa  <rniwa@webkit.org>
3720
3721         Windows build fix attempt after r251043.
3722
3723         * dom/ShadowRoot.cpp:
3724
3725 2019-10-11  Ryosuke Niwa  <rniwa@webkit.org>
3726
3727         Add the support for ShadowRoot.delegateFocus
3728         https://bugs.webkit.org/show_bug.cgi?id=166484
3729         <rdar://problem/29816058>
3730
3731         Reviewed by Antti Koivisto.
3732
3733         Implement delegatesFocus as specified in https://github.com/whatwg/html/pull/4796
3734
3735         When the shadow root of an element has delegates focus flag set, focusing on the shadow host would automatically
3736         "delegates" focus to the first focusable element in the shadow tree instead.
3737
3738         The first focusable element is determined as the first element that is programatically focusable or mouse focusable
3739         in the flat tree (composed tree in WebKit's terminology) in the case of the element getting focused via DOM API,
3740         Element.prototype.focus, by via mouse down. In the case of sequential focus navigation (via tab key), it's the
3741         first keyboard focusable element in the tabIndex order.
3742
3743         Tests: imported/w3c/web-platform-tests/shadow-dom/focus/click-focus-delegatesFocus-click-method.html
3744                imported/w3c/web-platform-tests/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html
3745                imported/w3c/web-platform-tests/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html
3746                imported/w3c/web-platform-tests/shadow-dom/focus/focus-method-delegatesFocus.html
3747                imported/w3c/web-platform-tests/shadow-dom/focus/focus-tabindex-order-shadow-negative-delegatesFocus.html
3748                imported/w3c/web-platform-tests/shadow-dom/focus/focus-tabindex-order-shadow-varying-delegatesFocus.html
3749                imported/w3c/web-platform-tests/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html
3750
3751         * dom/Element.cpp:
3752         (WebCore::Element::isKeyboardFocusable const): A shadow host with the delegates focus flag is not considered as
3753         keyboard focusable. The rest is taken care of by the existing logic in FocusController.
3754         (WebCore::isProgramaticallyFocusable): Extracted from Element::focus.
3755         (WebCore::findFirstProgramaticallyFocusableElementInComposedTree): Added.
3756         (WebCore::Element::focus): Added the support for delegatesFocus.
3757         * dom/Element.h:
3758         (WebCore::ShadowRootInit::delegatesFocus): Added.
3759         * dom/Element.idl: Ditto.
3760         * dom/ShadowRoot.cpp:
3761         (WebCore::ShadowRoot::ShadowRoot): Added delegatesFocus to the constructor.
3762         * dom/ShadowRoot.h:
3763         * page/EventHandler.cpp:
3764         (WebCore::findFirstMouseFocusableElementInComposedTree): Added.
3765         (WebCore::EventHandler::dispatchMouseEvent): Added the support for delegatesFocus. Uses the first mouse focusable
3766         element in the flat tree (composed tree) order.
3767         * page/FocusController.cpp:
3768         (WebCore::FocusController::findFirstFocusableElementInShadowRoot):
3769         * page/FocusController.h:
3770
3771 2019-10-11  Rob Buis  <rbuis@igalia.com>
3772
3773         Cleanup RuntimeEnabledFeatures includes
3774         https://bugs.webkit.org/show_bug.cgi?id=202857
3775
3776         Reviewed by Eric Carlson.
3777
3778         These classes must have had made use of runtime flags before
3779         but are not using them anymore.
3780
3781         * Modules/mediastream/MediaDevices.cpp:
3782         * Modules/mediastream/RTCRtpSender.cpp:
3783         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3784         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
3785         * accessibility/AccessibilityObject.cpp:
3786         * css/CSSComputedStyleDeclaration.cpp:
3787         * css/MediaQueryEvaluator.cpp:
3788         * css/MediaQueryExpression.cpp:
3789         * css/parser/CSSParser.cpp:
3790         * dom/ContainerNode.cpp:
3791         * dom/EventTarget.cpp:
3792         * dom/Position.cpp:
3793         * dom/PseudoElement.cpp:
3794         * dom/TreeScope.cpp:
3795         * dom/ViewportArguments.cpp:
3796         * history/CachedFrame.cpp:
3797         * html/HTMLPlugInElement.cpp:
3798         * html/HTMLStyleElement.cpp:
3799         * html/HTMLTrackElement.cpp:
3800         * inspector/agents/InspectorNetworkAgent.cpp:
3801         * loader/ResourceLoadNotifier.cpp:
3802         * page/DOMWindow.cpp:
3803         * page/EventHandler.cpp:
3804         * page/PointerLockController.cpp:
3805         * page/csp/ContentSecurityPolicy.cpp:
3806         * page/scrolling/ScrollingCoordinator.cpp:
3807         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3808         * rendering/RenderFlexibleBox.cpp:
3809         * rendering/style/RenderStyle.cpp:
3810         * rendering/updating/RenderTreeUpdater.cpp:
3811
3812 2019-10-11  Chris Dumez  <cdumez@apple.com>
3813
3814         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects
3815         https://bugs.webkit.org/show_bug.cgi?id=202869
3816
3817         Reviewed by Ryosuke Niwa.
3818
3819         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects, this is necessary so that the wrapper
3820         stays alive as long as ActiveDOMObject::hasPendingActivity() returns true. We may have
3821         subtle lifetime bugs otherwise.
3822
3823         * Modules/encryptedmedia/MediaKeySession.h:
3824         * Modules/encryptedmedia/MediaKeySession.idl:
3825         * Modules/entriesapi/FileSystemDirectoryReader.idl:
3826         * Modules/entriesapi/FileSystemEntry.idl:
3827         * Modules/geolocation/Geolocation.idl:
3828         * Modules/indexeddb/IDBObjectStore.h:
3829         * Modules/indexeddb/IDBObjectStore.idl:
3830         * Modules/paymentrequest/PaymentResponse.idl:
3831         * Modules/webvr/VRDisplay.h:
3832         * Modules/webvr/VRDisplay.idl:
3833         * workers/service/ServiceWorkerContainer.idl:
3834
3835 2019-10-11  Devin Rousso  <drousso@apple.com>
3836
3837         Web Inspector: Elements: Computed: show shorthand properties in addition to longhand ones
3838         https://bugs.webkit.org/show_bug.cgi?id=200554
3839
3840         Reviewed by Matt Baker.
3841
3842         Test: inspector/css/getComputedStyleForNode.html
3843
3844         Include additional `CSS.CSSComputedStyleProperty` items for shorthand CSS properties when
3845         calling `CSS.getComputedStyleForNode`.
3846
3847         * inspector/InspectorStyleSheet.h:
3848         * inspector/InspectorStyleSheet.cpp:
3849         (WebCore::InspectorStyle::buildArrayForComputedStyle const):
3850         (WebCore::InspectorStyle::collectProperties const): Added.
3851         (WebCore::InspectorStyle::styleWithProperties const):
3852         (WebCore::InspectorStyle::populateAllProperties const): Deleted.
3853
3854 2019-10-08  Ryosuke Niwa  <rniwa@webkit.org>
3855
3856         Make WebInspector's remote debug EventLoop code into RunLoop
3857         https://bugs.webkit.org/show_bug.cgi?id=202716
3858
3859         Reviewed by Joseph Pecoraro.
3860
3861         Use RunLoop::cycle.
3862
3863         * PlatformFTW.cmake:
3864         * PlatformPlayStation.cmake:
3865         * PlatformWin.cmake:
3866         * SourcesCocoa.txt:
3867         * WebCore.xcodeproj/project.pbxproj:
3868         * inspector/PageScriptDebugServer.cpp:
3869         (WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
3870         * platform/SourcesGLib.txt:
3871         * platform/glib/EventLoopGlib.cpp: Removed.
3872         * platform/playstation/EventLoopPlayStation.cpp: Removed.
3873         * platform/win/EventLoopWin.cpp: Removed.
3874
3875 2019-10-11  Dean Jackson  <dino@apple.com>
3876
3877         REGRESSION (r244239) Layout Test fast/canvas/canvas-too-large-to-draw.html is failing
3878         https://bugs.webkit.org/show_bug.cgi?id=202870
3879
3880         Reviewed by Simon Fraser.
3881
3882         Add an internal method to specify a fake limit of canvas pixel memory
3883         so our tests produce reproducible results.
3884
3885         * html/HTMLCanvasElement.cpp:
3886         (WebCore::maxActivePixelMemory):
3887         (WebCore::HTMLCanvasElement::setMaxPixelMemoryForTesting):
3888         * html/HTMLCanvasElement.h:
3889         * testing/Internals.cpp:
3890         (WebCore::Internals::setMaxCanvasPixelMemory):
3891         * testing/Internals.h:
3892         * testing/Internals.idl:
3893
3894 2019-10-11  Chris Dumez  <cdumez@apple.com>
3895
3896         API Test TestWebKitAPI.WebKit.DefaultQuota is very flaky on High Sierra
3897         https://bugs.webkit.org/show_bug.cgi?id=202850
3898
3899         Reviewed by Alex Christensen.
3900
3901         Make sure the DOMCache / DOMCacheStorage objects stay alive while they have pending
3902         promises to be resolved.
3903
3904         * Modules/cache/DOMCache.cpp:
3905         (WebCore::DOMCache::hasPendingActivity const):
3906         * Modules/cache/DOMCache.h:
3907         * Modules/cache/DOMCache.idl:
3908         * Modules/cache/DOMCacheStorage.cpp:
3909         (WebCore::DOMCacheStorage::hasPendingActivity const):
3910         * Modules/cache/DOMCacheStorage.h:
3911         * Modules/cache/DOMCacheStorage.idl:
3912
3913 2019-10-11  Chris Dumez  <cdumez@apple.com>
3914
3915         Unreviewed, address post-landing feedback from Darin for r251019.
3916
3917         Added a new comment for clarity.
3918
3919         * loader/FrameLoader.cpp:
3920         (WebCore::FrameLoader::stopForPageCache):
3921
3922 2019-10-11  Alex Christensen  <achristensen@webkit.org>
3923
3924         Only use CFNetwork SPI for metrics where needed
3925         https://bugs.webkit.org/show_bug.cgi?id=202825
3926
3927         Reviewed by Joseph Pecoraro.
3928
3929         * platform/network/NetworkLoadMetrics.h:
3930
3931 2019-10-11  Chris Dumez  <cdumez@apple.com>
3932
3933         Pages frequently fail to enter the back/forward cache due to frames with a quick redirect coming
3934         https://bugs.webkit.org/show_bug.cgi?id=202768
3935         <rdar://problem/56132022>
3936
3937         Reviewed by Alex Christensen.
3938
3939         When a quick redirect is scheduled with the navigation scheduler, we set the m_quickRedirectComing flag.
3940         This flag is supposed to get unset if the navigation gets cancelled and when the navigation actually
3941         happens. However, for a navigation to a javascript: URL, we would return early after executing the JS
3942         and fail to reset the m_quickRedirectComing flag. Later on, we would fail to enter the page cache because
3943         we would think that the iframe still has a quick redirect scheduled.
3944
3945         Test: fast/history/page-cache-iframe-js-url.html
3946
3947         * loader/FrameLoader.cpp:
3948         (WebCore::FrameLoader::urlSelected):
3949         Reset the m_quickRedirectComing flag if we return early after executing
3950         the javascript URL.
3951
3952         (WebCore::FrameLoader::stopForPageCache):
3953         Stop policy checks & cancel scheduled navigations after stopping loads. Stopping loads may
3954         run script which may in theory schedule new navigations. This is hardening.
3955
3956 2019-10-11  Antti Koivisto  <antti@apple.com>
3957
3958         Position::upstream/downstream should not need to call ensureLineBoxes
3959         https://bugs.webkit.org/show_bug.cgi?id=202203
3960
3961         Reviewed by Zalan Bujtas.
3962
3963         This avoids forced switch to complex text layout path by Position constructor and will allow future cleanups.
3964
3965         Currently simple line path strips end of line whitespace when white-space:pre-wrap is set.
3966         These are don't affect rendering but they are needed for editing positions.
3967         This patch makes simple line path match the complex path by generating runs for these whitespaces.
3968
3969         * dom/Position.cpp:
3970         (WebCore::Position::upstream const):
3971         (WebCore::Position::downstream const):
3972         (WebCore::ensureLineBoxesIfNeeded): Deleted.
3973         * rendering/SimpleLineLayout.cpp:
3974         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
3975
3976         Create a new run if isLineBreak bit is set.
3977
3978         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3979         (WebCore::SimpleLineLayout::LineState::trailingWhitespaceWidth const):
3980         (WebCore::SimpleLineLayout::computeLineLeft):
3981
3982         Also compute width of the hanging whitespace when aligning the line. This matches the code
3983         in updateLogicalWidthForLeft/Right/CenterAlignedBlock in the complex path.
3984
3985         (WebCore::SimpleLineLayout::preWrap):
3986
3987         breakSpaces implies preWrap is off.
3988
3989         (WebCore::SimpleLineLayout::firstFragment):
3990         (WebCore::SimpleLineLayout::createLineRuns):
3991