6ca0e4b4b6d46e2ab24bf645d966c98b14f8b7f5
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-09-03  Devin Rousso  <drousso@apple.com>
2
3         REGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScriptModule::ensureInjected
4         https://bugs.webkit.org/show_bug.cgi?id=201201
5         <rdar://problem/54771560>
6
7         Reviewed by Joseph Pecoraro.
8
9         Tests: inspector/debugger/tail-deleted-frames-this-value.html
10                inspector/heap/getRemoteObject.html
11
12         * inspector/CommandLineAPIModuleSource.js:
13         Avoid executing functions when injecting. Instead, modify the `CommandLineAPI` directly.
14
15 2019-09-03  Zalan Bujtas  <zalan@apple.com>
16
17         [LFC][TFC] Initialize <thead><tbody><tfoot> display boxes.
18         https://bugs.webkit.org/show_bug.cgi?id=201235
19         <rdar://problem/54807060>
20
21         Reviewed by Antti Koivisto.
22
23         Set them as blank for now.
24
25         * layout/tableformatting/TableFormattingContext.cpp:
26         (WebCore::Layout::TableFormattingContext::layout const):
27
28 2019-09-03  Zalan Bujtas  <zalan@apple.com>
29
30         [LFC][Floating] Replace all LayoutState::displayBoxForLayoutBox() calls with FormattingContext::displayBoxForLayoutBox()
31         https://bugs.webkit.org/show_bug.cgi?id=201414
32         <rdar://problem/54963302>
33
34         Reviewed by Antti Koivisto.
35
36         Fix the final LayoutState::displayBoxForLayoutBox() callsites. Now all displayBoxForLayoutBox() calls are directed to the
37         established FormattingContext.
38
39         * layout/FormattingContext.cpp:
40         (WebCore::Layout::mapHorizontalPositionToAncestor):
41         (WebCore::Layout::FormattingContext::mapLeftToAncestor const):
42         (WebCore::Layout::FormattingContext::mapRightToAncestor const):
43         (WebCore::Layout::FormattingContext::mapBoxToAncestor const):
44         (WebCore::Layout::FormattingContext::mapTopToAncestor const):
45         (WebCore::Layout::FormattingContext::mapPointToAncestor const):
46         (WebCore::Layout::FormattingContext::mapPointToDescendent const):
47         (WebCore::Layout::FormattingContext::mapLeftToAncestor): Deleted.
48         (WebCore::Layout::FormattingContext::mapRightToAncestor): Deleted.
49         (WebCore::Layout::FormattingContext::mapBoxToAncestor): Deleted.
50         (WebCore::Layout::FormattingContext::mapTopToAncestor): Deleted.
51         (WebCore::Layout::FormattingContext::mapPointToAncestor): Deleted.
52         (WebCore::Layout::FormattingContext::mapPointToDescendent): Deleted.
53         * layout/FormattingContext.h:
54         (WebCore::Layout::FormattingContext::root const):
55         (WebCore::Layout::FormattingContext::formattingState const):
56         * layout/blockformatting/BlockFormattingContext.cpp:
57         (WebCore::Layout::BlockFormattingContext::layout):
58         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
59         * layout/floats/FloatingContext.cpp:
60         (WebCore::Layout::mapToFormattingContextRoot):
61         (WebCore::Layout::FloatingContext::FloatingContext):
62         (WebCore::Layout::FloatingContext::positionForFloat const):
63         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
64         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
65         (WebCore::Layout::FloatingContext::constraints const):
66         (WebCore::Layout::FloatingContext::append):
67         * layout/floats/FloatingContext.h:
68         (WebCore::Layout::FloatingContext::formattingContext const):
69         (WebCore::Layout::FloatingContext::root const):
70         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
71         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
72         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
73
74 2019-09-03  Zalan Bujtas  <zalan@apple.com>
75
76         [LFC] FloatingState should not need to query for display boxes.
77         https://bugs.webkit.org/show_bug.cgi?id=201408
78         <rdar://problem/54958348>
79
80         Reviewed by Antti Koivisto.
81
82         This is in preparation for transitioning the floating codebase to use the formatting context for
83         retrieving display boxes.
84         FloatingContext should be responsible for adding/removing the new/existing float boxes to the state.
85
86         * layout/blockformatting/BlockFormattingContext.cpp:
87         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
88         * layout/floats/FloatingContext.cpp:
89         (WebCore::Layout::FloatingContext::append):
90         (WebCore::Layout::FloatingContext::remove):
91         * layout/floats/FloatingContext.h:
92         * layout/floats/FloatingState.cpp:
93         (WebCore::Layout::FloatingState::append):
94         (WebCore::Layout::belongsToThisFloatingContext): Deleted.
95         * layout/floats/FloatingState.h:
96         (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
97         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
98         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
99
100 2019-09-03  Zalan Bujtas  <zalan@apple.com>
101
102         [LFC][Floats] Do not pass FloatingState to FloatItem
103         https://bugs.webkit.org/show_bug.cgi?id=201406
104         <rdar://problem/54957097>
105
106         Reviewed by Antti Koivisto.
107
108         This is in preparation for transitioning the floating codebase to use the formatting context for
109         retrieving display boxes. Now FloatItems don't need the FloatingState to compute absolute display boxes.  
110
111         * layout/floats/FloatingState.cpp:
112         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
113         (WebCore::Layout::FloatingState::append):
114         * layout/floats/FloatingState.h:
115
116 2019-09-03  Zalan Bujtas  <zalan@apple.com>
117
118         [LFC][Floats] Do not pass FloatingState to FloatAvoider/FloatBox
119         https://bugs.webkit.org/show_bug.cgi?id=201405
120         <rdar://problem/54956381>
121
122         Reviewed by Antti Koivisto.
123
124         This is in preparation for transitioning the floating codebase to use the formatting context for
125         retrieving display boxes. Now FloatAvoiders/FloatBoxes don't need the FloatingState to compute absolute display boxes.
126
127         * layout/floats/FloatAvoider.cpp:
128         (WebCore::Layout::FloatAvoider::FloatAvoider):
129         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
130         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
131         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
132         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
133         * layout/floats/FloatAvoider.h:
134         (WebCore::Layout::FloatAvoider::floatingState const): Deleted.
135         * layout/floats/FloatBox.cpp:
136         (WebCore::Layout::FloatBox::FloatBox):
137         (WebCore::Layout::FloatBox::initialVerticalPosition const):
138         * layout/floats/FloatBox.h:
139         * layout/floats/FloatingContext.cpp:
140         (WebCore::Layout::mapToFormattingContextRoot):
141         (WebCore::Layout::FloatingContext::positionForFloat const):
142         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
143         * platform/graphics/LayoutPoint.h:
144         (WebCore::LayoutPoint::isZero const):
145
146 2019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
147
148         [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
149         https://bugs.webkit.org/show_bug.cgi?id=201369
150         <rdar://problem/54903724>
151
152         Reviewed by Brent Fulgham.
153
154         * platform/RuntimeApplicationChecks.h:
155         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
156         (WebCore::IOSApplication::isSafariViewService):
157         Adds a way to detect SafariViewService.
158
159 2019-09-03  Simon Fraser  <simon.fraser@apple.com>
160
161         Cache "compositingAncestor" during the compositing updateBackingAndHierarchy() tree walk
162         https://bugs.webkit.org/show_bug.cgi?id=201403
163
164         Reviewed by Antti Koivisto.
165
166         Finding a layer's compositingAncestor requires an ancestor tree walk. We can avoid this during
167         compositing updates, since we're already in the middle of a paint-order tree walk, and can just
168         keep track of the current compositingAncestor on the way down.
169
170         Shaves a few % off time in updateCompositingLayers().
171
172         * rendering/RenderLayerBacking.cpp:
173         (WebCore::RenderLayerBacking::updateConfiguration):
174         (WebCore::ComputedOffsets::ComputedOffsets):
175         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
176         (WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
177         (WebCore::RenderLayerBacking::updateGeometry):
178         * rendering/RenderLayerBacking.h:
179         * rendering/RenderLayerCompositor.cpp:
180         (WebCore::RenderLayerCompositor::UpdateBackingTraversalState::UpdateBackingTraversalState):
181         (WebCore::RenderLayerCompositor::UpdateBackingTraversalState::stateForDescendants const):
182         (WebCore::RenderLayerCompositor::updateCompositingLayers):
183         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
184         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
185         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
186         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
187         (WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const):
188         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
189         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
190         * rendering/RenderLayerCompositor.h:
191
192 2019-09-03  Simon Fraser  <simon.fraser@apple.com>
193
194         Make "clips compositing descendants" an indirect compositing reason
195         https://bugs.webkit.org/show_bug.cgi?id=201381
196
197         Reviewed by Antti Koivisto.
198
199         Whether a layer has to composite to clip composited descendants is an "indirect" reason,
200         just like having to composite for filters if there's a composited descendant. So add
201         IndirectCompositingReason::Clipping, and have computeIndirectCompositingReason() compute this,
202         replacing the code that ran in computeCompositingRequirements().
203
204         This is some preparatory cleanup for webkit.org/b/201330.
205
206         * rendering/RenderLayer.cpp:
207         (WebCore::RenderLayer::calculateClipRects const):
208         * rendering/RenderLayer.h:
209         * rendering/RenderLayerCompositor.cpp:
210         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
211         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
212         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
213         (WebCore::RenderLayerCompositor::computeIndirectCompositingReason const):
214         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): Deleted.
215         * rendering/RenderLayerCompositor.h:
216
217 2019-09-03  Zalan Bujtas  <zalan@apple.com>
218
219         [LFC][Floats] Move FloatingState::constraints to FloatingContext
220         https://bugs.webkit.org/show_bug.cgi?id=201393
221         <rdar://problem/54939361>
222
223         Reviewed by Antti Koivisto.
224
225         This is in preparation for transitioning the floating codebase to use the formatting context for
226         retrieving display boxes. Now FloatingContext (just like any other formatting context) holds on to the formatting
227         context root.
228
229         * layout/blockformatting/BlockFormattingContext.cpp:
230         (WebCore::Layout::BlockFormattingContext::layout):
231         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
232         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
233         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
234         * layout/floats/FloatingContext.cpp:
235         (WebCore::Layout::FloatingContext::FloatingContext):
236         (WebCore::Layout::FloatingContext::positionForFloat const):
237         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
238         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
239         (WebCore::Layout::FloatingContext::constraints const):
240         * layout/floats/FloatingContext.h:
241         (WebCore::Layout::FloatingContext::isEmpty const):
242         (WebCore::Layout::FloatingContext::root const):
243         * layout/floats/FloatingState.cpp:
244         (WebCore::Layout::FloatingState::constraints const): Deleted.
245         * layout/floats/FloatingState.h:
246         (WebCore::Layout::FloatingState::last const):
247         (WebCore::Layout::FloatingState::isEmpty const): Deleted.
248         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
249         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
250         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
251
252 2019-09-03  Chris Lord  <clord@igalia.com>
253
254         [GStreamer] Add support to copy YUV video textures into images
255         https://bugs.webkit.org/show_bug.cgi?id=200922
256
257         Reviewed by Philippe Normand and Xabier Rodriguez-Calvar.
258
259         Use gst_gl_color_convert to convert to RGB before using ImageGStreamer
260         with gstreamer-gl.
261
262         No new tests, not changing behavior.
263
264         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
265         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
266         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
267
268 2019-09-03  Chris Lord  <clord@igalia.com>
269
270         [GStreamer] Add support to copy YUV video textures into platform textures
271         https://bugs.webkit.org/show_bug.cgi?id=200914
272
273         Reviewed by Xabier Rodriguez-Calvar and Miguel Gomez.
274
275         Enable YUV (including planar and semi-planar) video texture to platform
276         texture copy in VideoTextureCopierGStreamer.
277
278         No new tests, not changing behavior.
279
280         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
281         (WebCore::GstVideoFrameHolder::platformLayerBuffer):
282         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
283         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
284         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
285         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
286         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
287         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
288         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
289         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
290         (WebCore::TextureMapperPlatformLayerBuffer::textureVariant):
291
292 2019-09-03  Zan Dobersek  <zdobersek@igalia.com>  and  Chris Lord  <clord@igalia.com>
293
294         [Texmap][GStreamer] Add support to upload more color formats into the texture
295         https://bugs.webkit.org/show_bug.cgi?id=132869
296
297         Reviewed by Xabier Rodriguez-Calvar.
298
299         Support non-interleaved YUV color for gstreamer-gl
300
301         This adds direct support for rendering I420, I444, YV12, YV21, Y42B,
302         NV12, NV21 and VUYA color formats using GLGL shaders when using
303         gstreamer-gl for video rendering. This avoids a surface copy on the GPU
304         in those cases.
305
306         No new tests, not changing behavior.
307
308         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
309         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
310         (WebCore::GstVideoFrameHolder::waitForCPUSync):
311         (WebCore::GstVideoFrameHolder::hasMappedTextures const):
312         (WebCore::GstVideoFrameHolder::videoFrame const):
313         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
314         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
315         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
316         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
317         * platform/graphics/texmap/TextureMapperGL.cpp:
318         (WebCore::optionsForFilterType):
319         (WebCore::TextureMapperGL::drawTexture):
320         (WebCore::prepareTransformationMatrixWithFlags):
321         (WebCore::TextureMapperGL::drawTexturePlanarYUV):
322         (WebCore::TextureMapperGL::drawTextureSemiPlanarYUV):
323         (WebCore::TextureMapperGL::drawTexturePackedYUV):
324         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
325         * platform/graphics/texmap/TextureMapperGL.h:
326         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
327         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
328         (WebCore::TextureMapperPlatformLayerBuffer::~TextureMapperPlatformLayerBuffer):
329         (WebCore::TextureMapperPlatformLayerBuffer::clone):
330         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
331         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
332         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
333         (WebCore::TextureMapperShaderProgram::create):
334         * platform/graphics/texmap/TextureMapperShaderProgram.h:
335
336 2019-09-03  Rob Buis  <rbuis@igalia.com>
337
338         Remove support for load/error on link=prefetch
339         https://bugs.webkit.org/show_bug.cgi?id=201348
340
341         Reviewed by Youenn Fablet.
342
343         Remove support for firing load/error on link=prefetch
344         to address tracking concerns.
345
346         Tests: http/wpt/prefetch/load-events-dynamic.html
347                http/wpt/prefetch/load-events.html
348
349         * html/HTMLLinkElement.cpp:
350         (WebCore::HTMLLinkElement::linkLoaded):
351         (WebCore::HTMLLinkElement::linkLoadingErrored):
352         * html/HTMLLinkElement.h:
353         * testing/Internals.cpp:
354         (WebCore::Internals::addPrefetchLoadEventListener):
355
356 2019-09-02  Yusuke Suzuki  <ysuzuki@apple.com>
357
358         [WebCore] Resource usage accounting should accept non KERN_SUCCESS
359         https://bugs.webkit.org/show_bug.cgi?id=201409
360
361         Reviewed by Andreas Kling.
362
363         While iterating threads, we are not suspending these threads. Underlying threads can have gone
364         at any time and we will get non KERN_SUCCESS error code when a thread has gone. We should ignore
365         these threads.
366
367         * page/cocoa/ResourceUsageThreadCocoa.mm:
368         (WebCore::threadInfos):
369
370 2019-09-02  Fujii Hironori  <Hironori.Fujii@sony.com>
371
372         [SVG] fragment-only url 'url(#fragment)' should be resolved against the current document with regardless to HTML <base> element
373         https://bugs.webkit.org/show_bug.cgi?id=189499
374         <rdar://problem/44466206>
375
376         Reviewed by Said Abou-Hallawa.
377
378         Fragment-only URL 'url(#fragment)' should be resolved against the
379         current document even if HTML <base> element is specified.
380         Spec: <https://drafts.csswg.org/css-values/#local-urls>
381
382         Tests: css3/filters/effect-reference-local-url-with-base.html
383                css3/masking/clip-path-reference-local-url-with-base.html
384                http/tests/svg/local-url-with-valid-base-and-resource.html
385                svg/animations/local-url-target-reference.html
386                svg/custom/local-url-reference-clip-path.html
387                svg/custom/local-url-reference-fill.html
388                svg/custom/local-url-reference-filter.html
389                svg/custom/local-url-reference-marker.html
390                svg/custom/local-url-reference-mask.html
391                svg/custom/local-url-reference-pattern.html
392                svg/custom/local-url-reference-radial-gradient.html
393                svg/custom/local-url-reference-srcdoc.html
394                svg/custom/local-url-reference-stroke.html
395                svg/custom/local-url-reference-use.html
396                svg/text/textpath-local-url-reference.html
397
398         * svg/SVGURIReference.cpp:
399         (WebCore::SVGURIReference::fragmentIdentifierFromIRIString): Return the fragment if the URL starts with '#'.
400
401 2019-09-02  Fujii Hironori  <Hironori.Fujii@sony.com>
402
403         [Win] Remove a unused PlatformWheelEvent constructor
404         https://bugs.webkit.org/show_bug.cgi?id=201398
405
406         Reviewed by Don Olmstead.
407
408         No behavior change.
409
410         * platform/PlatformWheelEvent.h:
411         * platform/win/WheelEventWin.cpp:
412         Removed a unused PlatformWheelEvent constructor.
413
414 2019-09-02  Brent Fulgham  <bfulgham@apple.com>
415
416         [FTW] NativeImagePtr is drawn with invalid scaling
417         https://bugs.webkit.org/show_bug.cgi?id=201391
418
419         Reviewed by Don Olmstead.
420
421         The current implementation of FTW improperly applies scaling factors to native images,
422         resulting in blocky images (in some cases).
423
424         This patch corrects the handling of native images, corrects a bug in bitmap render
425         context scaling, and retrieves more data from the ImageDecoder's metadata system.
426
427         * platform/graphics/win/Direct2DUtilities.cpp:
428         (WebCore::Direct2D::createBitmapRenderTargetOfSize): Supply an appropriately sized
429         pixel dimension for non-unity scale factors.
430         * platform/graphics/win/ImageBufferDirect2D.cpp:
431         (WebCore::ImageBuffer::ImageBuffer): Include the scale factor when creating a
432         bitmap render target.
433         * platform/graphics/win/ImageDecoderDirect2D.cpp:
434         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const): Read the orientation
435         data form the image metadata.
436         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const): Always return
437         true, to match the CG implementation.
438         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const): Correct to match the
439         behavior of CG.
440         * platform/graphics/win/NativeImageDirect2D.cpp:
441         (WebCore::drawNativeImage): Pass through the Direct2DOperations helper method, which
442         handles scaling and subsampling properly.
443
444 2019-09-02  Youenn Fablet  <youenn@apple.com>
445
446         Introduce WorkerMessagePortChannelRegistry
447         https://bugs.webkit.org/show_bug.cgi?id=201333
448
449         Reviewed by Alex Christensen.
450
451         This patch introduces a dedicated registry for workers.
452         This registry will hop to the main thread and use the
453         regular main thread registry to do the actual processing.
454
455         Covered by existing tests.
456
457         * Sources.txt:
458         * WebCore.xcodeproj/project.pbxproj:
459         * dom/Document.cpp:
460         (WebCore::Document::messagePortChannelProvider):
461         * dom/Document.h:
462         * dom/MessageChannel.cpp:
463         (WebCore::MessageChannel::MessageChannel):
464         * dom/MessagePort.cpp:
465         (WebCore::MessagePort::entangle):
466         (WebCore::MessagePort::postMessage):
467         (WebCore::MessagePort::disentangle):
468         (WebCore::MessagePort::close):
469         (WebCore::MessagePort::dispatchMessages):
470         (WebCore::MessagePort::hasPendingActivity const):
471         * dom/messageports/MessagePortChannel.cpp:
472         (WebCore::MessagePortChannel::takeAllMessagesForPort):
473         (WebCore::MessagePortChannel::checkRemotePortForActivity):
474         * dom/messageports/MessagePortChannel.h:
475         * dom/messageports/MessagePortChannelProvider.cpp:
476         (WebCore::MessagePortChannelProvider::singleton):
477         (WebCore::MessagePortChannelProvider::fromContext):
478         * dom/messageports/MessagePortChannelProvider.h:
479         * dom/messageports/MessagePortChannelProviderImpl.cpp:
480         (WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
481         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
482         * dom/messageports/MessagePortChannelProviderImpl.h:
483         * dom/messageports/MessagePortChannelRegistry.cpp:
484         (WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
485         (WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
486         * dom/messageports/MessagePortChannelRegistry.h:
487         * dom/messageports/WorkerMessagePortChannelProvider.cpp: Added.
488         (WebCore::WorkerMessagePortChannelProvider::WorkerMessagePortChannelProvider):
489         (WebCore::WorkerMessagePortChannelProvider::~WorkerMessagePortChannelProvider):
490         (WebCore::WorkerMessagePortChannelProvider::createNewMessagePortChannel):
491         (WebCore::WorkerMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
492         (WebCore::WorkerMessagePortChannelProvider::messagePortDisentangled):
493         (WebCore::WorkerMessagePortChannelProvider::messagePortClosed):
494         (WebCore::WorkerMessagePortChannelProvider::postMessageToRemote):
495         (WebCore::WorkerMessagePortChannelProvider::takeAllMessagesForPort):
496         (WebCore::WorkerMessagePortChannelProvider::checkRemotePortForActivity):
497         (WebCore::WorkerMessagePortChannelProvider::checkProcessLocalPortForActivity):
498         * dom/messageports/WorkerMessagePortChannelProvider.h: Added.
499         * workers/WorkerGlobalScope.cpp:
500         (WebCore::WorkerGlobalScope::messagePortChannelProvider):
501         * workers/WorkerGlobalScope.h:
502
503 2019-09-01  Myles C. Maxfield  <mmaxfield@apple.com>
504
505         [WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
506         https://bugs.webkit.org/show_bug.cgi?id=201383
507
508         Reviewed by Dean Jackson.
509
510         Bind groups correspond to argument buffers in Metal. Both the Metal API and Metal Shading Language
511         have to agree on the layout of exactly which resources lie at which byte offsets within an argument
512         buffer.
513
514         Before this patch, we only emitted code for the items in the argument buffer that were actually
515         referenced by the shader source code. However, because these items are held inside a struct, if
516         we omit one item from the middle of the struct, the byte offets of all the successive items would
517         be wrong. This means that the Metal API and the shader would disagree about how to access these
518         resources, making the resources inaccessible (and causing security problems).
519
520         Tests: webgpu/whlsl/sparse-bind-group-2.html
521                webgpu/whlsl/sparse-bind-group-3.html
522                webgpu/whlsl/sparse-bind-group.html
523
524         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
525         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
526         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
527         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
528         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
529         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
530         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
531         (WebCore::WHLSL::matchResources):
532         (WebCore::WHLSL::matchVertexAttributes):
533         (WebCore::WHLSL::matchColorAttachments):
534
535 2019-09-01  Commit Queue  <commit-queue@webkit.org>
536
537         Unreviewed, rolling out r249369.
538         https://bugs.webkit.org/show_bug.cgi?id=201394
539
540         broke WHLSL tests (Requested by litherum on #webkit).
541
542         Reverted changeset:
543
544         "[WHLSL] Resources don't work when only a subset of a bind
545         group is referenced by a shader"
546         https://bugs.webkit.org/show_bug.cgi?id=201383
547         https://trac.webkit.org/changeset/249369
548
549 2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
550
551         Unreviewed, rolling out r249366.
552
553         WinCairo WebKit2 crashes in some websites and the device scale
554         factor is not correct in high DPI.
555
556         Reverted changeset:
557
558         "[WinCairo, FTW] Properly handle device scale factor"
559         https://bugs.webkit.org/show_bug.cgi?id=201361
560         https://trac.webkit.org/changeset/249366
561
562 2019-09-01  Myles C. Maxfield  <mmaxfield@apple.com>
563
564         [WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
565         https://bugs.webkit.org/show_bug.cgi?id=201383
566
567         Reviewed by Dean Jackson.
568
569         Bind groups correspond to argument buffers in Metal. Both the Metal API and Metal Shading Language
570         have to agree on the layout of exactly which resources lie at which byte offsets within an argument
571         buffer.
572
573         Before this patch, we only emitted code for the items in the argument buffer that were actually
574         referenced by the shader source code. However, because these items are held inside a struct, if
575         we omit one item from the middle of the struct, the byte offets of all the successive items would
576         be wrong. This means that the Metal API and the shader would disagree about how to access these
577         resources, making the resources inaccessible (and causing security problems).
578
579         Tests: webgpu/whlsl/sparse-bind-group-2.html
580                webgpu/whlsl/sparse-bind-group-3.html
581                webgpu/whlsl/sparse-bind-group.html
582
583         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
584         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
585         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
586         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
587         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
588         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
589         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
590         (WebCore::WHLSL::matchResources):
591         (WebCore::WHLSL::matchVertexAttributes):
592         (WebCore::WHLSL::matchColorAttachments):
593
594 2019-09-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
595
596         HTMLImageElement::decode() should return a resolved promise for decoding non bitmap images
597         https://bugs.webkit.org/show_bug.cgi?id=201243
598
599         Reviewed by Youenn Fablet.
600
601         The specs: https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode
602         states that, decode() should resolve the pending promise if the decoding
603         was requested for a non bitmap image.
604
605         Test: fast/images/decode-non-bitmap-image-resolve.html
606
607         * loader/ImageLoader.cpp:
608         (WebCore::resolveDecodePromises):
609         (WebCore::rejectDecodePromises):
610         (WebCore::ImageLoader::notifyFinished):
611         (WebCore::ImageLoader::decode):
612         (WebCore::ImageLoader::decodeError): Deleted.
613         * loader/ImageLoader.h:
614         (WebCore::ImageLoader::hasPendingDecodePromises const):
615
616 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
617
618         [WinCairo, FTW] Properly handle device scale factor
619         https://bugs.webkit.org/show_bug.cgi?id=201361
620
621         Reviewed by Don Olmstead.
622
623         Update the Direct2D ImageBuffer/ImageBufferData classes to correctly handle
624         the device scale factor.
625
626         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
627         (WebCore::ImageBufferData::putData):
628         * platform/graphics/win/ImageBufferDirect2D.cpp:
629         (WebCore::ImageBuffer::putByteArray):
630
631 2019-08-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
632
633         EXIF orientation should be respected when rendering images 
634         https://bugs.webkit.org/show_bug.cgi?id=201123
635
636         Reviewed by Simon Fraser.
637
638         -- Image::size() will return the rendered size based on the image
639            orientation. If image orientation is FromImage, ImageSource will query
640            the actual image orientation from the ImageDecoder. The low level APIs
641            might transpose the size just before calling the system API to draw
642            the image.
643
644         -- RenderElement::imageOrientation() will return ImageOrientation::FromImage
645            for all images and for all ports till the CSS image-orientation specs
646            is finalized.
647
648         -- The default of ImagePaintingOptions argument of GraphicsContext::drawImage()
649            will be changed to { ImageOrientation::FromImage }.
650
651         -- Image element: RenderImage::paintIntoRect() will pass imageOrientation()
652            which returns ImageOrientation::FromImage to GraphicsContext::drawImage().
653
654         -- CSS background image: RenderBoxModelObject::paintFillLayerExtended will
655            pass ImageOrientation::FromImage by default to GraphicsContext::drawTiledImage().
656
657         -- Images on canvas: CanvasRenderingContext2DBase::drawImage() will pass
658            ImageOrientation::FromImage by default to GraphicsContext::drawImage().
659
660         -- SVG images: RenderSVGImage::paintForeground() calls GraphicsContext::drawImage()
661            with the default ImagePaintingOptions which is now { ImageOrientation::FromImage }.
662
663         -- SVG feImage filters: FEImage::platformApplySoftware() calls
664            GraphicsContext::drawImage() with the default ImagePaintingOptions
665            which is now { ImageOrientation::FromImage }.
666
667         -- ImageDocument: RenderElement::imageOrientation() returns FromImage
668            always and for all ports.
669
670         Tests: fast/images/exif-orientation-background.html
671                fast/images/exif-orientation-canvas.html
672                fast/images/exif-orientation-content.html
673                fast/images/exif-orientation-element-object-fit.html
674                fast/images/exif-orientation-element.html
675                fast/images/exif-orientation-image-object.html
676                fast/images/exif-orientation-svg-feimage.html
677                fast/images/exif-orientation-svg-image.html
678
679         * html/canvas/CanvasRenderingContext2DBase.cpp:
680         (WebCore::CanvasRenderingContext2DBase::drawImage):
681         * loader/cache/CachedImage.cpp:
682         (WebCore::CachedImage::imageSizeForRenderer const):
683         * platform/graphics/BitmapImage.h:
684         * platform/graphics/CrossfadeGeneratedImage.h:
685         * platform/graphics/GeneratedImage.h:
686         * platform/graphics/GraphicsContext.h:
687         (WebCore::GraphicsContext::drawImage):
688         * platform/graphics/Image.h:
689         * platform/graphics/ImageFrame.h:
690         (WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
691         * platform/graphics/ImageSource.cpp:
692         (WebCore::ImageSource::ImageSource):
693         (WebCore::ImageSource::orientation):
694         (WebCore::ImageSource::size):
695         (WebCore::ImageSource::sizeRespectingOrientation): Deleted.
696         * platform/graphics/ImageSource.h:
697         * platform/graphics/cg/PDFDocumentImage.cpp:
698         (WebCore::PDFDocumentImage::size const):
699         * platform/graphics/cg/PDFDocumentImage.h:
700         * platform/mac/DragImageMac.mm:
701         (WebCore::createDragImageFromImage):
702         * rendering/RenderBoxModelObject.cpp:
703         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
704         * rendering/RenderElement.cpp:
705         (WebCore::RenderElement::imageOrientation const):
706         * rendering/RenderImage.cpp:
707         (WebCore::RenderImage::paintIntoRect):
708         * svg/graphics/SVGImage.h:
709         * svg/graphics/SVGImageForContainer.cpp:
710         (WebCore::SVGImageForContainer::size const):
711         * svg/graphics/SVGImageForContainer.h:
712
713 2019-08-31  Rob Buis  <rbuis@igalia.com>
714
715         XMLHttpRequest: responseXML returns null if the Content-Type is valid (end in +xml) in some cases
716         https://bugs.webkit.org/show_bug.cgi?id=46146
717
718         Reviewed by Youenn Fablet.
719
720         Make response MIME type fallback to text/xml in case mimeType could
721         not be extracted [1] and use the stricter ParsedContentType for that.
722
723         Behavior matches Firefox.
724
725         Test: web-platform-tests/xhr/responsexml-media-type.htm
726
727         [1] https://xhr.spec.whatwg.org/#response-mime-type
728
729         * xml/XMLHttpRequest.cpp:
730         (WebCore::XMLHttpRequest::responseMIMEType const):
731
732 2019-08-31  Frederic Wang  <fwang@igalia.com>
733
734         Fix interpretation of fraction shifts
735         https://bugs.webkit.org/show_bug.cgi?id=201242
736
737         Reviewed by Rob Buis.
738
739         In fractions, numerator/denominator shifts are currently interpreted relative to the math
740         axis while they should be relative to the baseline [1]. This patch refactors the
741         RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious
742         rendering bugs in fractions.
743
744         [1] https://github.com/mathml-refresh/mathml/issues/123
745         [2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness
746         [3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness
747
748         No new tests, existing tests updated.
749
750         * rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with
751         fractionAscent() which gives the actual baseline position rather than the math axis position.
752         fractionParameters() and stackParameters() are modified so that they only return the shifts,
753         now stored in a shared FractionParameters struct.
754         * rendering/mathml/RenderMathMLFraction.cpp:
755         (WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local
756         variables and perform adjustments to the shift values so that the minimal gap constraints
757         are satisfied. Return them as a FractionParameters.
758         (WebCore::RenderMathMLFraction::stackParameters const): Ditto.
759         (WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above
760         the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize
761         changeset, this continues to ignore contribution of denominator size and not to distinguish
762         ink or non-ink metrics.
763         (WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just
764         calculated as a shift from the baseline. The height is given by the bottom of the
765         denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any
766         sense.
767         (WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of
768         ascentOverHorizontalAxis().
769         (WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto.
770
771 2019-08-31  Chris Dumez  <cdumez@apple.com>
772
773         DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID
774         https://bugs.webkit.org/show_bug.cgi?id=201364
775
776         Reviewed by John Wilander.
777
778         DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID. pageID is
779         redundant since it is being ignored by the callee. For the frame, simply pass the frame object in.
780
781         * dom/DocumentStorageAccess.cpp:
782         (WebCore::DocumentStorageAccess::hasStorageAccess):
783         (WebCore::DocumentStorageAccess::requestStorageAccess):
784         * page/ChromeClient.h:
785         (WebCore::ChromeClient::hasStorageAccess):
786         (WebCore::ChromeClient::requestStorageAccess):
787
788 2019-08-30  Zalan Bujtas  <zalan@apple.com>
789
790         [LFC] Transition from Geometry(formattingContext()) to formattingContext().quirks()
791         https://bugs.webkit.org/show_bug.cgi?id=201372
792         <rdar://problem/54905514>
793
794         Reviewed by Antti Koivisto.
795
796         * layout/FormattingContextGeometry.cpp:
797         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
798         * layout/FormattingContextQuirks.cpp:
799         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
800         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
801         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
802         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
803         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
804         * layout/blockformatting/BlockMarginCollapse.cpp:
805         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
806         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
807         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
808         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
809         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
810         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
811         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
812         * layout/inlineformatting/InlineLine.cpp:
813         (WebCore::Layout::Line::close):
814
815 2019-08-30  Zalan Bujtas  <zalan@apple.com>
816
817         [LFC] Proxy LayoutState::displayBoxForLayoutBox() calls through FormattingContext
818         https://bugs.webkit.org/show_bug.cgi?id=201365
819         <rdar://problem/54900815>
820
821         Reviewed by Antti Koivisto.
822
823         This patch is in preparation for enforcing displayBoxForLayoutBox() calls to stay within the current formatting context.
824         (There are a few odd cases left (floats and coordinate mapping) and they are going to be addressed in a separate patch.)
825
826         * layout/FormattingContext.cpp:
827         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
828         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
829         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
830         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
831         * layout/FormattingContext.h:
832         (WebCore::Layout::FormattingContext::displayBoxForLayoutBox const):
833         (WebCore::Layout::FormattingContext::hasDisplayBox const):
834         * layout/FormattingContextGeometry.cpp:
835         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
836         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
837         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
838         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
839         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
840         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
841         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
842         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
843         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
844         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
845         * layout/FormattingContextQuirks.cpp:
846         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
847         * layout/blockformatting/BlockFormattingContext.cpp:
848         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
849         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
850         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
851         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
852         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
853         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
854         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
855         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
856         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
857         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
858         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
859         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
860         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
861         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
862         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
863         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
864         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
865         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
866         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
867         * layout/blockformatting/BlockMarginCollapse.cpp:
868         (WebCore::Layout::hasClearance):
869         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
870         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
871         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
872         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
873         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
874         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
875         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
876         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
877         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
878         * layout/inlineformatting/InlineFormattingContext.cpp:
879         (WebCore::Layout::InlineFormattingContext::layout):
880         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
881         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
882         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
883         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
884         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
885         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
886         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
887         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
888         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
889         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
890         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
891         (WebCore::Layout::inlineItemWidth):
892         (WebCore::Layout::LineLayout::formattingContext const):
893         (WebCore::Layout::LineLayout::LineLayout):
894         (WebCore::Layout::LineLayout::placeInlineItem):
895         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
896         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
897         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
898         (WebCore::Layout::LineLayout::layoutState const): Deleted.
899         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
900         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
901         * layout/inlineformatting/InlineLine.cpp:
902         (WebCore::Layout::isInlineContainerConsideredEmpty):
903         (WebCore::Layout::Line::isVisuallyEmpty const):
904         (WebCore::Layout::Line::close):
905         (WebCore::Layout::Line::appendNonReplacedInlineBox):
906         (WebCore::Layout::Line::inlineItemContentHeight const):
907         * layout/tableformatting/TableFormattingContext.cpp:
908         (WebCore::Layout::TableFormattingContext::layout):
909         (WebCore::Layout::TableFormattingContext::computedTableWidth):
910
911 2019-08-30  Chris Dumez  <cdumez@apple.com>
912
913         WebPage::fromCorePage() to take and return a C++ reference
914         https://bugs.webkit.org/show_bug.cgi?id=201367
915
916         Reviewed by Antti Koivisto.
917
918         * page/Chrome.cpp:
919         (WebCore::Chrome::createWindow const):
920
921 2019-08-30  Chris Dumez  <cdumez@apple.com>
922
923         Add support for postMessage buffering between the service worker and window
924         https://bugs.webkit.org/show_bug.cgi?id=201169
925
926         Reviewed by Youenn Fablet.
927
928         As per the Service Worker specification, a service worker client's message
929         queue is initially disabled and only gets enabled after:
930         - The DOMContentLoaded event has been fired
931         or
932         - The client sets the navigator.serviceWorker.onmessage event handler
933         or
934         - navigator.serviceWorker.startMessages() is called
935
936         While the message queue is disabled, messages posted by the service worker
937         to the client simply get queued and only get processed once the queue gets
938         enabled.
939
940         No new tests, rebaselined existing test.
941
942         * dom/Document.cpp:
943         (WebCore::Document::finishedParsing):
944         Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
945         been fired.
946
947         * dom/ScriptExecutionContext.cpp:
948         (WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
949         * dom/ScriptExecutionContext.h:
950         * workers/service/SWClientConnection.cpp:
951         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
952         Fix a bug where a service worker would not be able to post a message to a client until
953         that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
954         lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
955         when a message is received from the service worker. Previously, messages were just
956         getting dropped.
957
958         * workers/service/ServiceWorkerContainer.cpp:
959         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
960         When the ServiceWorkerContainer is constructed, suspend its message queue if its context
961         document is still parsing.
962
963         (WebCore::ServiceWorkerContainer::startMessages):
964         Resume the message queue when startMessages() is called.
965
966         (WebCore::ServiceWorkerContainer::postMessage):
967         Enqueue the event instead of firing it right away.
968
969         (WebCore::ServiceWorkerContainer::addEventListener):
970         if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
971         startMessages().
972
973         * workers/service/ServiceWorkerContainer.h:
974
975 2019-08-30  Simon Fraser  <simon.fraser@apple.com>
976
977         Minor optimization in determineNonLayerDescendantsPaintedContent()
978         https://bugs.webkit.org/show_bug.cgi?id=201352
979
980         Reviewed by Antti Koivisto.
981
982         It's cheaper to call renderText.hasRenderedText() than renderText.linesBoundingBox(), because
983         the latter has to traverse all the InlineTextBoxes. This code path is fairly hot when
984         scrolling twitter feeds, since it's called from RenderLayer::updateLayerPositionsAfterScroll()
985         which calls RenderLayer::isVisuallyNonEmpty().
986
987         * rendering/RenderLayer.cpp:
988         (WebCore::RenderLayer::calculateClipRects const):
989
990 2019-08-30  Saam Barati  <sbarati@apple.com>
991
992         [WHLSL] Remove getters/setters/anders
993         https://bugs.webkit.org/show_bug.cgi?id=201008
994
995         Reviewed by Robin Morisset.
996
997         This patch changes WHLSL in a significant way. This patch removes getters/setters/anders
998         from the language. In our experience writing WHLSL shaders, these parts of the language
999         went unused, and they added a lot of complexity to the implementation of the compiler.
1000         
1001         This patch now treats field accesses and array indexes as intrinsics inside the compiler.
1002         This patch removes all notions of named operators, anders, and indexed operators
1003         from the compiler and the standard library. The checker now intrinsically knows the
1004         return type for property accesses and indexed expressions based on what the
1005         base type is.
1006         
1007         To make this work in practice was difficult, since getters/setters/anders
1008         solved a lot of the difficult problems we had in generating metal code. For
1009         example, all swizzle operators were getters and setters, so assigning to a
1010         swizzle fell out naturally from implementing setters. However, during metal
1011         codegen, all we see is a dot expression with "xy" as a property. Our previous
1012         architecture of emitting Metal code using pointers which represent lvalues
1013         doesn't work because you can't take the address of a swizzle. For example,
1014         "auto* x = &vector.yz" is invalid metal code.
1015         
1016         So, this patch changes the entire metal code generator to emit WHLSL expressions
1017         as Metal expressions. To do this, I had to change a lot about how the compiler
1018         was implemented:
1019         - I changed the indexed accesses of matrices to return columns instead of
1020         rows. This allowed WHLSL code like `mat[0].xy = 42` to be compiled into
1021         the equivalent metal code of `mat[0].xy = 42`.
1022         - I changed the native function inliner to emit expressions instead of
1023         statements.
1024         - We also simplify the language by removing null and requiring all
1025         reference type variables to have an initializer. This means that
1026         null is no longer a valid value, which allows us to omit null checks
1027         inside the metal code generator. To make this work with array
1028         accesses, we now clamp accesses instead of returning null for OOB
1029         accesses.
1030         
1031         I've also filed one required bug as a followup. I didn't include it in this
1032         patch to make it easier to review along. Currently, there are two places in
1033         metal codegen where we evaluate effects twice. That will be fixed in:
1034         https://bugs.webkit.org/show_bug.cgi?id=201251
1035
1036         Tests: webgpu/whlsl/address-of-swizzle.html
1037                webgpu/whlsl/array-oob-alias.html
1038                webgpu/whlsl/matrix-index-assign.html
1039                webgpu/whlsl/matrix-index-order.html
1040                webgpu/whlsl/oob-access-2.html
1041                webgpu/whlsl/operator-syntax.html
1042
1043         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
1044         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
1045         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
1046         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
1047         (WebCore::WHLSL::AST::Expression::destroy):
1048         (WebCore::WHLSL::AST::Expression::destruct):
1049         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunctionName const): Deleted.
1050         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunctionName const): Deleted.
1051         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunctionName const): Deleted.
1052         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1053         (WebCore::WHLSL::AST::Expression::copyTypeTo const):
1054         (WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
1055         (WebCore::WHLSL::AST::Expression::isNullLiteral const): Deleted.
1056         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
1057         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
1058         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Removed.
1059         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Removed.
1060         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Removed.
1061         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
1062         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction): Deleted.
1063         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction): Deleted.
1064         (WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction): Deleted.
1065         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction): Deleted.
1066         (WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction): Deleted.
1067         (WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction): Deleted.
1068         (WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction): Deleted.
1069         (WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction): Deleted.
1070         (): Deleted.
1071         * Modules/webgpu/WHLSL/AST/WHLSLType.cpp:
1072         (WebCore::WHLSL::AST::Type::destroy):
1073         (WebCore::WHLSL::AST::Type::destruct):
1074         (WebCore::WHLSL::AST::ResolvableType::canResolve const):
1075         (WebCore::WHLSL::AST::ResolvableType::conversionCost const):
1076         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
1077         (WebCore::WHLSL::AST::Type::isIntegerLiteralType const):
1078         (WebCore::WHLSL::AST::Type::isNullLiteralType const): Deleted.
1079         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
1080         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::HoistedVariableCollector::HoistedVariableCollector):
1081         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
1082         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
1083         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitConstantExpressionString):
1084         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability): Deleted.
1085         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue): Deleted.
1086         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue): Deleted.
1087         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue): Deleted.
1088         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValueAndNullability): Deleted.
1089         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue): Deleted.
1090         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
1091         (WebCore::WHLSL::Metal::metalCodePrologue):
1092         (WebCore::WHLSL::Metal::generateMetalCode):
1093         (WebCore::WHLSL::Metal::metalCodeProlog): Deleted.
1094         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1095         (WebCore::WHLSL::Metal::inlineNativeFunction):
1096         (WebCore::WHLSL::Metal::vectorInnerType): Deleted.
1097         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
1098         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
1099         (WebCore::WHLSL::Metal::writeNativeType):
1100         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
1101         (WebCore::WHLSL::ASTDumper::visit):
1102         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
1103         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
1104         (WebCore::WHLSL::checkDuplicateFunctions):
1105         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1106         (WebCore::WHLSL::resolveByInstantiation):
1107         (WebCore::WHLSL::checkOperatorOverload):
1108         (WebCore::WHLSL::Checker::wrappedUintType):
1109         (WebCore::WHLSL::Checker::normalizedTypeForFunctionKey):
1110         (WebCore::WHLSL::Checker::visit):
1111         (WebCore::WHLSL::matchAndCommit):
1112         (WebCore::WHLSL::Checker::resolveFunction):
1113         (WebCore::WHLSL::Checker::assignConcreteType):
1114         (WebCore::WHLSL::resolveWithOperatorLength): Deleted.
1115         (WebCore::WHLSL::Checker::genericPointerType): Deleted.
1116         (WebCore::WHLSL::Checker::finishVisiting): Deleted.
1117         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
1118         (WebCore::WHLSL::findHighZombies):
1119         (): Deleted.
1120         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
1121         (WebCore::WHLSL::matchAndCommit):
1122         (WebCore::WHLSL::commit):
1123         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
1124         (WebCore::WHLSL::Intrinsics::boolVectorTypeForSize const):
1125         (WebCore::WHLSL::Intrinsics::uintVectorTypeForSize const):
1126         (WebCore::WHLSL::Intrinsics::intVectorTypeForSize const):
1127         (WebCore::WHLSL::Intrinsics::floatVectorTypeForSize const):
1128         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
1129         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
1130         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
1131         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1132         (WebCore::WHLSL::Parser::parseConstantExpression):
1133         (WebCore::WHLSL::Parser::parseEnumerationMember):
1134         (WebCore::WHLSL::Parser::parseTerm):
1135         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
1136         (WebCore::WHLSL::prepareShared):
1137         * Modules/webgpu/WHLSL/WHLSLProgram.cpp: Added.
1138         (WebCore::WHLSL::Program::isValidVectorProperty):
1139         * Modules/webgpu/WHLSL/WHLSLProgram.h:
1140         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
1141         (WebCore::WHLSL::resolveProperties):
1142         (WebCore::WHLSL::PropertyResolver::visit): Deleted.
1143         (WebCore::WHLSL::wrapAnderCallArgument): Deleted.
1144         (WebCore::WHLSL::anderCallArgument): Deleted.
1145         (WebCore::WHLSL::setterCall): Deleted.
1146         (WebCore::WHLSL::getterCall): Deleted.
1147         (WebCore::WHLSL::modify): Deleted.
1148         (WebCore::WHLSL::PropertyResolver::simplifyRightValue): Deleted.
1149         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting): Deleted.
1150         (WebCore::WHLSL::LeftValueSimplifier::visit): Deleted.
1151         (WebCore::WHLSL::PropertyResolver::simplifyLeftValue): Deleted.
1152         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:
1153         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
1154         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
1155         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Removed.
1156         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Removed.
1157         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
1158         (WebCore::WHLSL::synthesizeEnumerationFunctions):
1159         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1160         (WebCore::WHLSL::Visitor::visit):
1161         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
1162         * Sources.txt:
1163         * WebCore.xcodeproj/project.pbxproj:
1164
1165 2019-08-30  Zalan Bujtas  <zalan@apple.com>
1166
1167         [LFC] Pass FormattingContext to Geometry/Quirks/BlockMarginCollapsing classes
1168         https://bugs.webkit.org/show_bug.cgi?id=201355
1169         <rdar://problem/54895959>
1170
1171         Reviewed by Antti Koivisto.
1172
1173         This is in preparation for enforcing LFC to not call outside of the formatting context.
1174         LayoutState::displayBoxForLayoutBox calls will be forced to go through the FormattingContext class to
1175         check LFC escaping.
1176
1177
1178         * layout/FormattingContext.h:
1179         (WebCore::Layout::FormattingContext::isBlockFormattingContext const):
1180         (WebCore::Layout::FormattingContext::isInlineFormattingContext const):
1181         (WebCore::Layout::FormattingContext::isTableFormattingContext const):
1182         (WebCore::Layout::FormattingContext::Geometry::layoutState const):
1183         (WebCore::Layout::FormattingContext::Geometry::layoutState):
1184         (WebCore::Layout::FormattingContext::Geometry::formattingContext const):
1185         (WebCore::Layout::FormattingContext::geometry const):
1186         (WebCore::Layout::FormattingContext::Quirks::layoutState const):
1187         (WebCore::Layout::FormattingContext::Quirks::layoutState):
1188         (WebCore::Layout::FormattingContext::Quirks::formattingContext const):
1189         (WebCore::Layout::FormattingContext::quirks const):
1190         (WebCore::Layout::FormattingContext::Geometry::Geometry):
1191         (WebCore::Layout::FormattingContext::Quirks::Quirks):
1192         * layout/FormattingContextGeometry.cpp:
1193         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
1194         * layout/FormattingContextQuirks.cpp:
1195         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1196         * layout/blockformatting/BlockFormattingContext.h:
1197         (WebCore::Layout::BlockFormattingContext::Geometry::formattingContext const):
1198         (WebCore::Layout::BlockFormattingContext::geometry const):
1199         (WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState):
1200         (WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState const):
1201         (WebCore::Layout::BlockFormattingContext::MarginCollapse::formattingContext const):
1202         (WebCore::Layout::BlockFormattingContext::marginCollapse const):
1203         (WebCore::Layout::BlockFormattingContext::Quirks::formattingContext const):
1204         (WebCore::Layout::BlockFormattingContext::quirks const):
1205         (WebCore::Layout::BlockFormattingContext::Geometry::Geometry):
1206         (WebCore::Layout::BlockFormattingContext::Quirks::Quirks):
1207         (WebCore::Layout::BlockFormattingContext::MarginCollapse::MarginCollapse):
1208         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1209         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1210         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1211         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1212         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1213         * layout/blockformatting/BlockMarginCollapse.cpp:
1214         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1215         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1216         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1217         * layout/inlineformatting/InlineFormattingContext.h:
1218         (WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const):
1219         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const):
1220         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const):
1221         (WebCore::Layout::InlineFormattingContext::Quirks::formattingContext const):
1222         (WebCore::Layout::InlineFormattingContext::quirks const):
1223         (WebCore::Layout::InlineFormattingContext::Geometry::formattingContext const):
1224         (WebCore::Layout::InlineFormattingContext::geometry const):
1225         (WebCore::Layout::InlineFormattingContext::Geometry::Geometry):
1226         (WebCore::Layout::InlineFormattingContext::Quirks::Quirks):
1227         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1228         (WebCore::Layout::LineLayout::LineLayout):
1229         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
1230         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1231         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1232         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1233         * layout/inlineformatting/InlineLine.cpp:
1234         (WebCore::Layout::Line::Line):
1235         (WebCore::Layout::Line::isVisuallyEmpty const):
1236         (WebCore::Layout::Line::close):
1237         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1238         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
1239         (WebCore::Layout::Line::inlineItemContentHeight const):
1240         (WebCore::Layout::Line::layoutState const):
1241         (WebCore::Layout::Line::formattingContext const):
1242         * layout/inlineformatting/InlineLine.h:
1243         * layout/tableformatting/TableFormattingContext.h:
1244         (WebCore::Layout::TableFormattingContext::Geometry::formattingContext const):
1245         (WebCore::Layout::TableFormattingContext::geometry const):
1246         (WebCore::Layout::TableFormattingContext::Geometry::Geometry):
1247         * page/FrameViewLayoutContext.cpp:
1248         (WebCore::layoutUsingFormattingContext):
1249
1250 2019-08-30  Ryan Haddad  <ryanhaddad@apple.com>
1251
1252         Unreviewed, rolling out r249338.
1253
1254         Caused 500+ layout test failures on WK1
1255
1256         Reverted changeset:
1257
1258         "Add support for postMessage buffering between the service
1259         worker and window"
1260         https://bugs.webkit.org/show_bug.cgi?id=201169
1261         https://trac.webkit.org/changeset/249338
1262
1263 2019-08-30  Alex Christensen  <achristensen@webkit.org>
1264
1265         Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
1266         https://bugs.webkit.org/show_bug.cgi?id=201279
1267
1268         Reviewed by Darin Adler.
1269
1270         * platform/network/mac/WebCoreURLResponse.mm:
1271         (WebCore::synthesizeRedirectResponseIfNecessary):
1272         (WebCore::schemeWasUpgradedDueToDynamicHSTS): Deleted.
1273
1274 2019-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1275
1276         Caret does not appear in text field inside a transformed, overflow: hidden container
1277         https://bugs.webkit.org/show_bug.cgi?id=201317
1278         <rdar://problem/54859264>
1279
1280         Reviewed by Simon Fraser.
1281
1282         This patch refactors the heuristic for determining whether to suppress selection gestures and UI in a way that
1283         fixes the corner case encountered in this bug. To understand why this test case fails with our existing
1284         heuristic, consider the below test case.
1285
1286         Let's say we have an input field inside an "overflow: hidden;" container, which is positioned in such a way that
1287         it is completely clipped by its enclosing container which is also "overflow: hidden". Our existing logic would
1288         appropriately identify this as a hidden editable element.
1289
1290         However, let's now apply a transform to the input field's closest "overflow: hidden" ancestor, such that the
1291         field is now visible. Since RenderLayer::offsetFromAncestor doesn't take transforms into account when we try to
1292         find the offset of the "overflow: hidden" layer relative to the root view, we end up passing an offsetFromRoot
1293         of (0, 100vw) to RenderLayer::calculateClipRects, which computes a background clip rect of (0, 0, 100vw, 100vh).
1294
1295         This means that at the end of RenderLayer::calculateClipRects, we end up intersecting the background clip rect
1296         (0, 0, 100vw, 100vh) against (100vw, 0, 100vw, 100vh), which results in the empty rect, and subsequently makes
1297         us believe we're editing a hidden editable element.
1298
1299         Instead of tacking on more logic to isTransparentOrFullyClippedRespectingParentFrames, we can fix this by using
1300         RenderObject::computeVisibleRectInContainer instead, performing a similar walk up the render tree to compute the
1301         visible rect of each focused element or subframe relative to its root. This is capable of taking transforms into
1302         account. See comments below for more details.
1303
1304         Test: editing/selection/ios/show-selection-in-transformed-container-2.html
1305
1306         * rendering/RenderLayer.cpp:
1307         (WebCore::RenderLayer::isTransparentRespectingParentFrames const):
1308
1309         Split out isTransparentOrFullyClippedRespectingParentFrames into two methods: RenderLayer's
1310         isTransparentRespectingParentFrames, and RenderObject's hasNonEmptyVisibleRectRespectingParentFrames. The
1311         transparency check starts at the enclosing layer and walks up the layer tree, while the non-empty visible rect
1312         check looks for renderers that are completely empty relative to their root views.
1313
1314         * rendering/RenderLayer.h:
1315         * rendering/RenderObject.cpp:
1316         (WebCore::RenderObject::hasNonEmptyVisibleRectRespectingParentFrames const):
1317
1318         Rewrite logic for detecting completely clipped editable areas (that formerly lived in
1319         isTransparentOrFullyClippedRespectingParentFrames) to use computeVisibleRectInContainer instead.
1320
1321         * rendering/RenderObject.h:
1322
1323 2019-08-30  Chris Dumez  <cdumez@apple.com>
1324
1325         Add support for postMessage buffering between the service worker and window
1326         https://bugs.webkit.org/show_bug.cgi?id=201169
1327
1328         Reviewed by Youenn Fablet.
1329
1330         As per the Service Worker specification, a service worker client's message
1331         queue is initially disabled and only gets enabled after:
1332         - The DOMContentLoaded event has been fired
1333         or
1334         - The client sets the navigator.serviceWorker.onmessage event handler
1335         or
1336         - navigator.serviceWorker.startMessages() is called
1337
1338         While the message queue is disabled, messages posted by the service worker
1339         to the client simply get queued and only get processed once the queue gets
1340         enabled.
1341
1342         No new tests, rebaselined existing test.
1343
1344         * dom/Document.cpp:
1345         (WebCore::Document::finishedParsing):
1346         Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
1347         been fired.
1348
1349         * dom/ScriptExecutionContext.cpp:
1350         (WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
1351         * dom/ScriptExecutionContext.h:
1352         * workers/service/SWClientConnection.cpp:
1353         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
1354         Fix a bug where a service worker would not be able to post a message to a client until
1355         that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
1356         lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
1357         when a message is received from the service worker. Previously, messages were just
1358         getting dropped.
1359
1360         * workers/service/ServiceWorkerContainer.cpp:
1361         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
1362         When the ServiceWorkerContainer is constructed, suspend its message queue if its context
1363         document is still parsing.
1364
1365         (WebCore::ServiceWorkerContainer::startMessages):
1366         Resume the message queue when startMessages() is called.
1367
1368         (WebCore::ServiceWorkerContainer::postMessage):
1369         Enqueue the event instead of firing it right away.
1370
1371         (WebCore::ServiceWorkerContainer::addEventListener):
1372         if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
1373         startMessages().
1374
1375         * workers/service/ServiceWorkerContainer.h:
1376
1377 2019-08-30  Simon Fraser  <simon.fraser@apple.com>
1378
1379         Add system tracing points for compositing updates, and touch-event dispatching
1380         https://bugs.webkit.org/show_bug.cgi?id=201327
1381
1382         Reviewed by Alex Christensen.
1383
1384         TraceScope in RenderLayerCompositor::updateCompositingLayers().
1385
1386         * rendering/RenderLayerCompositor.cpp:
1387         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1388
1389 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
1390
1391         [FTW] Use DirectX SharedResource as basis for SharedBitmap
1392         https://bugs.webkit.org/show_bug.cgi?id=201157
1393
1394         Reviewed by Alex Christensen.
1395
1396         Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
1397         base type for sharing data between the WebContent Process and the UIProcess. However, this
1398         involves moving GPU memory to local memory, copying that memory into the SharedMemory member
1399         of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.
1400
1401         Profiling indicates that this is the single largest place FTW WebKit spends its time.
1402
1403         Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
1404         between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
1405         CPU->Shared Memory copy, and the shared memory to GPU copy.
1406  
1407         * platform/graphics/win/BackingStoreBackendDirect2D.h:
1408         (WebCore::BackingStoreBackendDirect2D::renderTarget const): Change type.
1409         (WebCore::BackingStoreBackendDirect2D::dxSurface const): Added.
1410         (WebCore::BackingStoreBackendDirect2D::BackingStoreBackendDirect2D): Require a DXD11 device.
1411         * platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
1412         (WebCore::BackingStoreBackendDirect2DImpl::BackingStoreBackendDirect2DImpl): Use Direct2D's
1413         IDXGISurface to make a render target we can use to support our fast cross-process sharing.
1414         (WebCore::BackingStoreBackendDirect2DImpl::scroll):
1415         * platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
1416         * platform/graphics/win/Direct2DOperations.cpp:
1417         (WebCore::Direct2D::fillRect): Remove unneeded PlatformContextStateSaver.
1418         (WebCore::Direct2D::fillRoundedRect): Ditto.
1419         (WebCore::Direct2D::fillRectWithGradient): Ditto.
1420         (WebCore::Direct2D::fillPath): Ditto.
1421         (WebCore::Direct2D::strokePath): Ditto.
1422         * platform/graphics/win/Direct2DUtilities.cpp:
1423         (WebCore::Direct2D::pixelFormat): Switch to constants for bitmap format.
1424         (WebCore::Direct2D::createDXGISurfaceOfSize): Added.
1425         (WebCore::Direct2D::createSurfaceRenderTarget): Added.
1426         (WebCore::Direct2D::writeDiagnosticPNGToPath):
1427         (WebCore::Direct2D::dxgiImmediateContext): Added.
1428         (WebCore::Direct2D::defaultDirectXDevice): Added.
1429         (WebCore::Direct2D::createDeviceAndContext): Added.
1430         (WebCore::Direct2D::toDXGIDevice): Added.
1431         (WebCore::Direct2D::factoryForDXGIDevice): Added.
1432         * platform/graphics/win/Direct2DUtilities.h:
1433
1434 2019-08-30  Sihui Liu  <sihui_liu@apple.com>
1435
1436         IndexedDB: update size of database when database operation is completed
1437         https://bugs.webkit.org/show_bug.cgi?id=201057
1438
1439         Reviewed by Youenn Fablet.
1440
1441         Currently when a database operation was completed, we re-computed the disk usage of the origin. This computation 
1442         listed all databases in the origin directory and read the size of each database file, which was very inefficient 
1443         because the completed operation should only affect one database.
1444
1445         This patch makes UniqueIDBDatabase keep track of database size and reports size change to QuotaUser.
1446
1447         Tested PerformanceTests/IndexedDB/basic/objectstore-add.html on release build minibrowser. This change makes
1448         the test over 50% faster.
1449
1450         * Modules/indexeddb/server/IDBBackingStore.h:
1451         * Modules/indexeddb/server/IDBServer.cpp:
1452         (WebCore::IDBServer::IDBServer::QuotaUser::increaseSpaceUsed):
1453         (WebCore::IDBServer::IDBServer::QuotaUser::decreaseSpaceUsed):
1454         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
1455         (WebCore::IDBServer::IDBServer::increaseSpaceUsed):
1456         (WebCore::IDBServer::IDBServer::decreaseSpaceUsed):
1457         (WebCore::IDBServer::IDBServer::setSpaceUsed): Deleted.
1458         * Modules/indexeddb/server/IDBServer.h:
1459         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1460         (WebCore::IDBServer::MemoryIDBBackingStore::databaseSize const):
1461         (WebCore::IDBServer::MemoryIDBBackingStore::close):
1462         (WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const): Deleted.
1463         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1464         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1465         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForDirectory):
1466         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseSize const):
1467         (WebCore::IDBServer::SQLiteIDBBackingStore::close):
1468         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder): Deleted.
1469         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const): Deleted.
1470         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1471         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1472         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1473         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
1474         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1475         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1476         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1477         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
1478         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1479         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
1480         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1481
1482 2019-08-30  Alicia Boya García  <aboya@igalia.com>
1483
1484         [MSE][GStreamer] Replaying the video should update currentTime
1485         https://bugs.webkit.org/show_bug.cgi?id=201307
1486
1487         Reviewed by Xabier Rodriguez-Calvar.
1488
1489         While writing a test to confirm that https://bugs.webkit.org/show_bug.cgi?id=190050
1490         has indeed been fixed I noticed a non-conformity: when the video has
1491         ended, right after calling .play() for a second playback currentTime
1492         did not return zero, but the video duration.
1493
1494         This turned to be due to the m_isEndReached flag not being reseted on
1495         seeks (replaying a video incurs in a seek done from multi-platform
1496         code).
1497
1498         Test: imported/w3c/web-platform-tests/media-source/mediasource-replay.html
1499
1500         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1501         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
1502
1503 2019-08-30  Zalan Bujtas  <zalan@apple.com>
1504
1505         [LFC] Make Geometry/Quirk/MarginCollapse subclasses stateful.
1506         https://bugs.webkit.org/show_bug.cgi?id=201343
1507         <rdar://problem/54883787>
1508
1509         Reviewed by Antti Koivisto.
1510
1511         This is in preparation for enforcing LFC to not call outside of the formatting context.
1512
1513         * layout/FormattingContext.cpp:
1514         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1515         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1516         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
1517         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
1518         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): Deleted.
1519         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): Deleted.
1520         (WebCore::Layout::FormattingContext::computeBorderAndPadding const): Deleted.
1521         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent const): Deleted.
1522         * layout/FormattingContext.h:
1523         (WebCore::Layout::FormattingContext::Geometry::layoutState const):
1524         (WebCore::Layout::FormattingContext::Geometry::layoutState):
1525         (WebCore::Layout::FormattingContext::geometry const):
1526         (WebCore::Layout::FormattingContext::Quirks::layoutState const):
1527         (WebCore::Layout::FormattingContext::Quirks::layoutState):
1528         (WebCore::Layout::FormattingContext::quirks const):
1529         (WebCore::Layout::FormattingContext::Geometry::Geometry):
1530         (WebCore::Layout::FormattingContext::Quirks::Quirks):
1531         * layout/FormattingContextGeometry.cpp:
1532         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
1533         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1534         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto const):
1535         (WebCore::Layout::FormattingContext::Geometry::fixedValue const):
1536         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
1537         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
1538         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
1539         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
1540         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1541         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1542         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1543         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1544         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
1545         (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
1546         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1547         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
1548         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
1549         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
1550         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1551         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
1552         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1553         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1554         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
1555         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
1556         (WebCore::Layout::FormattingContext::Geometry::computedBorder const):
1557         (WebCore::Layout::FormattingContext::Geometry::computedPadding const):
1558         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
1559         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
1560         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth const):
1561         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): Deleted.
1562         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot): Deleted.
1563         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto): Deleted.
1564         (WebCore::Layout::FormattingContext::Geometry::fixedValue): Deleted.
1565         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight): Deleted.
1566         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight): Deleted.
1567         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned): Deleted.
1568         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned): Deleted.
1569         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
1570         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
1571         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
1572         (WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
1573         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
1574         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
1575         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
1576         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
1577         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
1578         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
1579         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset): Deleted.
1580         (WebCore::Layout::FormattingContext::Geometry::computedBorder): Deleted.
1581         (WebCore::Layout::FormattingContext::Geometry::computedPadding): Deleted.
1582         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin): Deleted.
1583         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin): Deleted.
1584         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth): Deleted.
1585         * layout/FormattingContextQuirks.cpp:
1586         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1587         * layout/blockformatting/BlockFormattingContext.cpp:
1588         (WebCore::Layout::BlockFormattingContext::layout):
1589         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
1590         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
1591         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
1592         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
1593         (WebCore::Layout::BlockFormattingContext::computeStaticPosition):
1594         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
1595         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors):
1596         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot):
1597         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
1598         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
1599         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
1600         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1601         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1602         (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
1603         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
1604         (WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore):
1605         (WebCore::Layout::BlockFormattingContext::layout const): Deleted.
1606         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): Deleted.
1607         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const): Deleted.
1608         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition const): Deleted.
1609         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition const): Deleted.
1610         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const): Deleted.
1611         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const): Deleted.
1612         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const): Deleted.
1613         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const): Deleted.
1614         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const): Deleted.
1615         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): Deleted.
1616         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): Deleted.
1617         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): Deleted.
1618         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): Deleted.
1619         (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints const): Deleted.
1620         (WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const): Deleted.
1621         * layout/blockformatting/BlockFormattingContext.h:
1622         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1623         (WebCore::Layout::BlockFormattingContext::geometry const):
1624         (WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState):
1625         (WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState const):
1626         (WebCore::Layout::BlockFormattingContext::marginCollapse const):
1627         (WebCore::Layout::BlockFormattingContext::quirks const):
1628         (WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore):
1629         (WebCore::Layout::BlockFormattingContext::Geometry::Geometry):
1630         (WebCore::Layout::BlockFormattingContext::Quirks::Quirks):
1631         (WebCore::Layout::BlockFormattingContext::MarginCollapse::MarginCollapse):
1632         (WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const): Deleted.
1633         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1634         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1635         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
1636         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const):
1637         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
1638         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
1639         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition const):
1640         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1641         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1642         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
1643         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
1644         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
1645         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition): Deleted.
1646         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition): Deleted.
1647         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): Deleted.
1648         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1649         (WebCore::Layout::BlockFormattingContext::Quirks::needsStretching const):
1650         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1651         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin const):
1652         (WebCore::Layout::BlockFormattingContext::Quirks::needsStretching): Deleted.
1653         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin): Deleted.
1654         * layout/blockformatting/BlockMarginCollapse.cpp:
1655         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter const):
1656         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
1657         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
1658         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
1659         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
1660         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore const):
1661         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter const):
1662         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
1663         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore const):
1664         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
1665         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
1666         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1667         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1668         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1669         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1670         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
1671         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
1672         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1673         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
1674         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
1675         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter): Deleted.
1676         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore): Deleted.
1677         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
1678         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
1679         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
1680         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter): Deleted.
1681         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore): Deleted.
1682         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough): Deleted.
1683         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling): Deleted.
1684         * layout/inlineformatting/InlineFormattingContext.cpp:
1685         (WebCore::Layout::InlineFormattingContext::layout):
1686         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1687         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
1688         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
1689         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1690         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
1691         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
1692         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1693         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
1694         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
1695         (WebCore::Layout::InlineFormattingContext::layout const): Deleted.
1696         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints const): Deleted.
1697         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox const): Deleted.
1698         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer const): Deleted.
1699         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot const): Deleted.
1700         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin const): Deleted.
1701         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const): Deleted.
1702         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): Deleted.
1703         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): Deleted.
1704         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const): Deleted.
1705         * layout/inlineformatting/InlineFormattingContext.h:
1706         (WebCore::Layout::InlineFormattingContext::quirks const):
1707         (WebCore::Layout::InlineFormattingContext::geometry const):
1708         (WebCore::Layout::InlineFormattingContext::Geometry::Geometry):
1709         (WebCore::Layout::InlineFormattingContext::Quirks::Quirks):
1710         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1711         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1712         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
1713         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin): Deleted.
1714         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1715         (WebCore::Layout::LineLayout::LineLayout):
1716         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1717         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1718         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1719         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1720         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
1721         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
1722         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing): Deleted.
1723         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints): Deleted.
1724         * layout/inlineformatting/InlineLine.cpp:
1725         (WebCore::Layout::Line::Line):
1726         (WebCore::Layout::Line::close):
1727         * layout/inlineformatting/InlineLine.h:
1728         * layout/tableformatting/TableFormattingContext.cpp:
1729         (WebCore::Layout::TableFormattingContext::layout):
1730         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
1731         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
1732         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1733         (WebCore::Layout::TableFormattingContext::computedTableWidth):
1734         (WebCore::Layout::TableFormattingContext::distributeAvailableWidth):
1735         (WebCore::Layout::TableFormattingContext::layout const): Deleted.
1736         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints const): Deleted.
1737         (WebCore::Layout::TableFormattingContext::ensureTableGrid const): Deleted.
1738         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns const): Deleted.
1739         (WebCore::Layout::TableFormattingContext::computedTableWidth const): Deleted.
1740         (WebCore::Layout::TableFormattingContext::distributeAvailableWidth const): Deleted.
1741         * layout/tableformatting/TableFormattingContext.h:
1742         (WebCore::Layout::TableFormattingContext::geometry const):
1743         (WebCore::Layout::TableFormattingContext::Geometry::Geometry):
1744         * layout/tableformatting/TableFormattingContextGeometry.cpp:
1745         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
1746         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin): Deleted.
1747
1748 2019-08-30  Keith Rollin  <krollin@apple.com>
1749
1750         Remove AppKitCompatibilityDeclarations.h
1751         https://bugs.webkit.org/show_bug.cgi?id=201283
1752         <rdar://problem/54822042>
1753
1754         Reviewed by Alexey Proskuryakov.
1755
1756         The two copies of these files -- on in WTF, one in MiniBrowser -- are
1757         empty and can be removed.
1758
1759         No new tests -- no new or changed functionality.
1760
1761         * WebCorePrefix.h:
1762
1763 2019-08-30  Alicia Boya García  <aboya@igalia.com>
1764
1765         [MSE][GStreamer] Gracefully fail on invalid non-first initialization segment
1766         https://bugs.webkit.org/show_bug.cgi?id=201322
1767
1768         Reviewed by Xabier Rodriguez-Calvar.
1769
1770         In normal operation of AppendPipeline, except during tear down,
1771         qtdemux never removes a pad. Even if a new initialization segment is
1772         appended, the pad is reused.
1773
1774         There is an exception though: when the new initialization segment has
1775         an incompatible set of tracks. This is invalid under the MSE spec and
1776         should produce an error, but in this case this was making an assertion
1777         fail -- in particular by sending an EOS to the to-be-removed pad, which
1778         AppendPipeline doesn't expect.
1779
1780         This patch changes the assertion with graceful error handling for that
1781         error.
1782
1783         Fixes media/media-source/media-source-seek-detach-crash.html
1784
1785         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1786         (WebCore::AppendPipeline::AppendPipeline):
1787         (WebCore::AppendPipeline::handleErrorConditionFromStreamingThread):
1788         (WebCore::AppendPipeline::handleErrorSyncMessage):
1789         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1790
1791 2019-08-30  Charlie Turner  <cturner@igalia.com>
1792
1793         [GStreamer] Do not ref the player count from background threads.
1794         https://bugs.webkit.org/show_bug.cgi?id=201222
1795
1796         Reviewed by Xabier Rodriguez-Calvar.
1797
1798         Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.https.html
1799
1800         In the sync-message handler, a ref() was being taken waiting for a
1801         CDM instance to be attached. This hits asserts since you are not
1802         allowed to ref() an object created on the main thread
1803         (BasePlayer) on a background thread.
1804
1805         The protection condition was overly scoped, tidied up the locking
1806         and made it more granular. To avoid needing to hold a ref() in the
1807         background thread, use instead a semaphore to signal when a CDM
1808         instance is attached, or the player has been destroyed.
1809
1810         Also remove an erroneous safe-guard, the operator= in
1811         isCDMInstanceAvailable will ref() the CDMInstance for us. This use
1812         of holding a reference to CDMInstance in the decryptors is not
1813         thread-safe, and now we have a problem since there's no clean way
1814         to communicate with CDMInstance from background threads without
1815         being thread unsafe. For ClearKey and Widevine, a thread safe
1816         ProxyCDM needs to be designed and passed to background
1817         threads (upcoming patch).
1818
1819         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1820         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1821         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
1822         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
1823         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
1824         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
1825         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1826         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1827         (isCDMInstanceAvailable):
1828
1829 2019-08-30  Sihui Liu  <sihui_liu@apple.com>
1830
1831         [wk2] LayoutTest imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a flaky failure
1832         https://bugs.webkit.org/show_bug.cgi?id=169621
1833
1834         Reviewed by Alex Christensen.
1835
1836         Event handlers of IDB objects were called in unexpected order because of race, which made the console messages 
1837         in the tests come out of order.
1838         Usually, an operation/request result is handled as follows:
1839         1. IDBServer sends IDBResultData to IDBClient.
1840         2. IDBClient receives IDBResultData and finishes a IDBTransaction operation with that result.
1841         3. IDBTransaction schedules operation completed timer.
1842         4. (Some time later) Timer fires, and IDBTransaction completes a request with the result and dispatches event.
1843         5. (Some time later) IDBTransaction is notified that event is dispatched. If there are other results received, 
1844         IDBTransaction schedules operation completed timer.
1845
1846         In previous implementation, if the IDBClient received a second IDBResultData for the same IDBTransaction between
1847         step 3 and step 4, it would not schedule timer because timer was still active; if it received the result between
1848         step 4 and step 5, it would schedule timer again.
1849
1850         Consider a flow like this:
1851         result1 of transaction1 received, timer of transaction1 scheduled
1852         result2 of transaction2 received, timer of transaction2 scheduled
1853         result3 of transaction1 is received, timer of transaction1 active so no scheduling
1854         timer of transaction1 fired, event1 to be dispatched to request1
1855         timer of transaction2 fired, event2 to be dispatched to request2
1856         result4 of transaction2 received, timer of transaction2 scheduled
1857         event1 dispatched, timer of transaction1 scheduled (for handling result3)
1858         event2 dispatched, timer of transaction2 active so no scheduling
1859         timer of transaction2 fired, event3 to dispatch to request4
1860         timer of transaction1 fired, event4 to dispatch to request3
1861
1862         request4 would get event before request3, though result3 was received before result4. We should stop scheduling
1863         event if an IDBTransaction is in between step 4 and 5, which means its m_currentlyCompletingRequest is not null.
1864
1865         * Modules/indexeddb/IDBTransaction.cpp:
1866         (WebCore::IDBTransaction::operationCompletedOnServer):
1867
1868 2019-08-29  Devin Rousso  <drousso@apple.com>
1869
1870         Web Inspector: Debugger: async event listener stack traces should be available in Workers
1871         https://bugs.webkit.org/show_bug.cgi?id=200903
1872
1873         Reviewed by Joseph Pecoraro.
1874
1875         Tests: inspector/worker/dom-debugger-event-interval-breakpoints.html
1876                inspector/worker/dom-debugger-event-listener-breakpoints.html
1877                inspector/worker/dom-debugger-event-timeout-breakpoints.html
1878                inspector/worker/dom-debugger-url-breakpoints.html
1879
1880         * inspector/agents/WebDebuggerAgent.h:
1881         * inspector/agents/WebDebuggerAgent.cpp:
1882         (WebCore::WebDebuggerAgent::enabled const): Added.
1883         (WebCore::WebDebuggerAgent::enable):
1884         (WebCore::WebDebuggerAgent::disable):
1885         (WebCore::WebDebuggerAgent::didAddEventListener): Added.
1886         (WebCore::WebDebuggerAgent::willRemoveEventListener): Added.
1887         (WebCore::WebDebuggerAgent::willHandleEvent): Added.
1888         (WebCore::WebDebuggerAgent::didPostMessage): Added.
1889         (WebCore::WebDebuggerAgent::didFailPostMessage): Added.
1890         (WebCore::WebDebuggerAgent::willDispatchPostMessage): Added.
1891         (WebCore::WebDebuggerAgent::didDispatchPostMessage): Added.
1892         (WebCore::WebDebuggerAgent::didClearAsyncStackTraceData): Added.
1893         * inspector/agents/page/PageDebuggerAgent.h:
1894         * inspector/agents/page/PageDebuggerAgent.cpp:
1895         (WebCore::PageDebuggerAgent::enabled const): Added.
1896         (WebCore::PageDebuggerAgent::enable):
1897         (WebCore::PageDebuggerAgent::disable):
1898         (WebCore::PageDebuggerAgent::didClearAsyncStackTraceData): Deleted.
1899         (WebCore::PageDebuggerAgent::didAddEventListener): Deleted.
1900         (WebCore::PageDebuggerAgent::willRemoveEventListener): Deleted.
1901         (WebCore::PageDebuggerAgent::willHandleEvent): Deleted.
1902         (WebCore::PageDebuggerAgent::didPostMessage): Deleted.
1903         (WebCore::PageDebuggerAgent::didFailPostMessage): Deleted.
1904         (WebCore::PageDebuggerAgent::willDispatchPostMessage): Deleted.
1905         (WebCore::PageDebuggerAgent::didDispatchPostMessage): Deleted.
1906         Move various `InspectorInstrumentation` calls from `PageDebuggerAgent` to `WebDebuggerAgent`
1907         so that `WorkerDebuggerAgent` also inherits them.
1908
1909         * inspector/InstrumentingAgents.h:
1910         (WebCore::InstrumentingAgents::webDebuggerAgent const): Added.
1911         (WebCore::InstrumentingAgents::setWebDebuggerAgent): Added.
1912         (WebCore::InstrumentingAgents::inspectorDebuggerAgent const): Deleted.
1913         (WebCore::InstrumentingAgents::setInspectorDebuggerAgent): Deleted.
1914         * inspector/InstrumentingAgents.cpp:
1915         (WebCore::InstrumentingAgents::reset):
1916         * inspector/agents/InspectorTimelineAgent.cpp:
1917         (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
1918         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
1919         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
1920         * inspector/InspectorInstrumentation.cpp:
1921         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
1922         (WebCore::InspectorInstrumentation::isDebuggerPausedImpl):
1923         (WebCore::InspectorInstrumentation::didInstallTimerImpl):
1924         (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
1925         (WebCore::InspectorInstrumentation::didAddEventListenerImpl):
1926         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1927         (WebCore::InspectorInstrumentation::didPostMessageImpl):
1928         (WebCore::InspectorInstrumentation::didFailPostMessageImpl):
1929         (WebCore::InspectorInstrumentation::willDispatchPostMessageImpl):
1930         (WebCore::InspectorInstrumentation::didDispatchPostMessageImpl):
1931         (WebCore::InspectorInstrumentation::willHandleEventImpl):
1932         (WebCore::InspectorInstrumentation::didHandleEventImpl):
1933         (WebCore::InspectorInstrumentation::willFireTimerImpl):
1934         (WebCore::InspectorInstrumentation::didFireTimerImpl):
1935         (WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSPImpl):
1936         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1937         (WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
1938         (WebCore::InspectorInstrumentation::frameStoppedLoadingImpl):
1939         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
1940         (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
1941         (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
1942         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
1943         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
1944         Replace `inspectorDebuggerAgent` with `webDebuggerAgent` so the right instrumentation hooks
1945         are available.
1946
1947 2019-08-29  Chris Dumez  <cdumez@apple.com>
1948
1949         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string
1950         https://bugs.webkit.org/show_bug.cgi?id=201318
1951
1952         Reviewed by Alex Christensen.
1953
1954         Add "IsolatedCopy" in the name of String getters that call isolatedCopy() on the string, for clarity.
1955
1956         * Modules/indexeddb/server/IDBServer.cpp:
1957         (WebCore::IDBServer::IDBServer::createBackingStore):
1958         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
1959         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
1960         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
1961         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
1962         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
1963         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
1964         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
1965         * Modules/indexeddb/server/IDBServer.h:
1966         (WebCore::IDBServer::IDBServer::databaseDirectoryPathIsolatedCopy const):
1967         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1968         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
1969         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
1970         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1971         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1972         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseRootDirectoryIsolatedCopy const):
1973         * Modules/webdatabase/Database.cpp:
1974         (WebCore::Database::markAsDeletedAndClose):
1975         (WebCore::Database::stringIdentifierIsolatedCopy const):
1976         (WebCore::Database::displayNameIsolatedCopy const):
1977         (WebCore::Database::expectedVersionIsolatedCopy const):
1978         (WebCore::Database::fileNameIsolatedCopy const):
1979         (WebCore::Database::details const):
1980         (WebCore::Database::didCommitWriteTransaction):
1981         (WebCore::Database::didExceedQuota):
1982         * Modules/webdatabase/Database.h:
1983         * Modules/webdatabase/DatabaseTracker.cpp:
1984         (WebCore::DatabaseTracker::maximumSize):
1985         (WebCore::DatabaseTracker::doneCreatingDatabase):
1986         (WebCore::DatabaseTracker::addOpenDatabase):
1987         (WebCore::DatabaseTracker::removeOpenDatabase):
1988         * Modules/webdatabase/SQLError.h:
1989         (WebCore::SQLError::messageIsolatedCopy const):
1990         * Modules/webdatabase/SQLError.idl:
1991         * Modules/webdatabase/SQLTransaction.cpp:
1992         (WebCore::SQLTransaction::openTransactionAndPreflight):
1993         * workers/service/server/RegistrationDatabase.cpp:
1994         (WebCore::RegistrationDatabase::openSQLiteDatabase):
1995         (WebCore::RegistrationDatabase::clearAll):
1996         * workers/service/server/RegistrationDatabase.h:
1997         (WebCore::RegistrationDatabase::databaseDirectoryIsolatedCopy const):
1998
1999 2019-08-29  Keith Rollin  <krollin@apple.com>
2000
2001         Update .xcconfig symbols to reflect the current set of past and future product versions.
2002         https://bugs.webkit.org/show_bug.cgi?id=200720
2003         <rdar://problem/54305032>
2004
2005         Reviewed by Alex Christensen.
2006
2007         Remove version symbols related to old OS's we no longer support,
2008         ensure that version symbols are defined for OS's we do support.
2009
2010         No new tests -- no new or changed functionality.
2011
2012         * Configurations/Base.xcconfig:
2013         * Configurations/DebugRelease.xcconfig:
2014         * Configurations/Version.xcconfig:
2015
2016 2019-08-29  Timothy Hatcher  <timothy@apple.com>
2017
2018         Copying and pasting two paragraphs with a newline between them results in stray paragraph with newline inside.
2019         https://bugs.webkit.org/show_bug.cgi?id=201306
2020
2021         Reviewed by Wenson Hsieh.
2022
2023         Test: editing/pasteboard/paste-without-nesting.html
2024
2025         * editing/ReplaceSelectionCommand.cpp:
2026         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor): Consider the ancestor node safe to remove
2027         if there is no rendered text inside, not just if there are any child nodes.
2028
2029 2019-08-29  Devin Rousso  <drousso@apple.com>
2030
2031         Web Inspector: DOMDebugger: support event breakpoints in Worker contexts
2032         https://bugs.webkit.org/show_bug.cgi?id=200651
2033
2034         Reviewed by Joseph Pecoraro.
2035
2036         Tests: inspector/worker/dom-debugger-dom-breakpoints.html
2037                inspector/worker/dom-debugger-event-animation-frame-breakpoints.html
2038                inspector/worker/dom-debugger-event-interval-breakpoints.html
2039                inspector/worker/dom-debugger-event-listener-breakpoints.html
2040                inspector/worker/dom-debugger-event-timeout-breakpoints.html
2041                inspector/worker/dom-debugger-url-breakpoints.html
2042
2043         * inspector/agents/InspectorDOMDebuggerAgent.h:
2044         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2045         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
2046         (WebCore::InspectorDOMDebuggerAgent::enabled const):
2047         (WebCore::InspectorDOMDebuggerAgent::enable):
2048         (WebCore::InspectorDOMDebuggerAgent::disable):
2049         (WebCore::InspectorDOMDebuggerAgent::debuggerWasEnabled):
2050         (WebCore::InspectorDOMDebuggerAgent::debuggerWasDisabled):
2051         (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint):
2052         (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint):
2053         (WebCore::InspectorDOMDebuggerAgent::~InspectorDOMDebuggerAgent): Deleted.
2054         (WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Deleted.
2055         (WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Deleted.
2056         (WebCore::InspectorDOMDebuggerAgent::didInsertDOMNode): Deleted.
2057         (WebCore::InspectorDOMDebuggerAgent::didRemoveDOMNode): Deleted.
2058         (WebCore::domTypeForName): Deleted.
2059         (WebCore::domTypeName): Deleted.
2060         (WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint): Deleted.
2061         (WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint): Deleted.
2062         (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode): Deleted.
2063         (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode): Deleted.
2064         (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr): Deleted.
2065         (WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent): Deleted.
2066         (WebCore::InspectorDOMDebuggerAgent::hasBreakpoint): Deleted.
2067         (WebCore::InspectorDOMDebuggerAgent::updateSubtreeBreakpoints): Deleted.
2068         (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Deleted.
2069         * inspector/agents/page/PageDOMDebuggerAgent.h: Added.
2070         * inspector/agents/page/PageDOMDebuggerAgent.cpp: Added.
2071         (WebCore::domTypeForName):
2072         (WebCore::domTypeName):
2073         (WebCore::PageDOMDebuggerAgent::PageDOMDebuggerAgent):
2074         (WebCore::PageDOMDebuggerAgent::enabled const):
2075         (WebCore::PageDOMDebuggerAgent::enable):
2076         (WebCore::PageDOMDebuggerAgent::disable):
2077         (WebCore::PageDOMDebuggerAgent::setDOMBreakpoint):
2078         (WebCore::PageDOMDebuggerAgent::removeDOMBreakpoint):
2079         (WebCore::PageDOMDebuggerAgent::frameDocumentUpdated):
2080         (WebCore::PageDOMDebuggerAgent::willInsertDOMNode):
2081         (WebCore::PageDOMDebuggerAgent::didInsertDOMNode):
2082         (WebCore::PageDOMDebuggerAgent::willRemoveDOMNode):
2083         (WebCore::PageDOMDebuggerAgent::didRemoveDOMNode):
2084         (WebCore::PageDOMDebuggerAgent::willModifyDOMAttr):
2085         (WebCore::PageDOMDebuggerAgent::willFireAnimationFrame):
2086         (WebCore::PageDOMDebuggerAgent::willInvalidateStyleAttr):
2087         (WebCore::PageDOMDebuggerAgent::setAnimationFrameBreakpoint):
2088         (WebCore::PageDOMDebuggerAgent::descriptionForDOMEvent):
2089         (WebCore::PageDOMDebuggerAgent::updateSubtreeBreakpoints):
2090         (WebCore::PageDOMDebuggerAgent::hasBreakpoint):
2091         * inspector/agents/worker/WorkerDOMDebuggerAgent.h: Added.
2092         * inspector/agents/worker/WorkerDOMDebuggerAgent.cpp: Added.
2093         (WebCore::WorkerDOMDebuggerAgent::WorkerDOMDebuggerAgent):
2094         (WebCore::WorkerDOMDebuggerAgent::setDOMBreakpoint):
2095         (WebCore::WorkerDOMDebuggerAgent::removeDOMBreakpoint):
2096         (WebCore::WorkerDOMDebuggerAgent::setAnimationFrameBreakpoint):
2097         Split the `InspectorDOMDebuggerAgent` into two subclasses depending on the inspected target
2098         type, as certain `DOMDebugger` commands don't make sense for a `Worker` context:
2099          - DOM breakpoints, as there is no DOM in a `Worker` context
2100          - animation frame event breakpoints, as there is no `requestAnimationFrame` function
2101
2102         * inspector/InspectorController.cpp:
2103         (WebCore::InspectorController::createLazyAgents):
2104         * inspector/WorkerInspectorController.cpp:
2105         (WebCore::WorkerInspectorController::createLazyAgents):
2106
2107         * inspector/InstrumentingAgents.h:
2108         (WebCore::InstrumentingAgents::pageDOMDebuggerAgent const): Added.
2109         (WebCore::InstrumentingAgents::setPageDOMDebuggerAgent): Added.
2110         * inspector/InstrumentingAgents.cpp:
2111         (WebCore::InstrumentingAgents::reset):
2112
2113         * inspector/InspectorInstrumentation.cpp:
2114         (WebCore::InspectorInstrumentation::willInsertDOMNodeImpl):
2115         (WebCore::InspectorInstrumentation::didInsertDOMNodeImpl):
2116         (WebCore::InspectorInstrumentation::willRemoveDOMNodeImpl):
2117         (WebCore::InspectorInstrumentation::didRemoveDOMNodeImpl):
2118         (WebCore::InspectorInstrumentation::willModifyDOMAttrImpl):
2119         (WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl):
2120         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2121         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
2122
2123         * Sources.txt:
2124         * WebCore.xcodeproj/project.pbxproj:
2125
2126 2019-08-29  Keith Rollin  <krollin@apple.com>
2127
2128         Remove CCBigNum fallback code
2129         https://bugs.webkit.org/show_bug.cgi?id=201250
2130         <rdar://problem/54814330>
2131
2132         Reviewed by Jiewen Tan.
2133
2134         Bug 184637 added support for CCRSAGetCRTComponents, falling back to
2135         the older CCBigNum code if CCRSAGetCRTComponents was not available. We
2136         now only support OS's that have CCRSAGetCRTComponents so remove the
2137         fallback code.
2138
2139         No new tests -- no new or changed functionality.
2140
2141         * crypto/CommonCryptoUtilities.cpp:
2142         (WebCore::CCBigNum::CCBigNum): Deleted.
2143         (WebCore::CCBigNum::~CCBigNum): Deleted.
2144         (WebCore::CCBigNum::operator=): Deleted.
2145         (WebCore::CCBigNum::data const): Deleted.
2146         (WebCore::CCBigNum::operator- const): Deleted.
2147         (WebCore::CCBigNum::operator% const): Deleted.
2148         (WebCore::CCBigNum::inverse const): Deleted.
2149         * crypto/CommonCryptoUtilities.h:
2150         * crypto/mac/CryptoKeyRSAMac.cpp:
2151         (WebCore::getPrivateKeyComponents):
2152
2153 2019-08-29  Zalan Bujtas  <zalan@apple.com>
2154
2155         [LFC][TFC] Initialize <tr> display boxes.
2156         https://bugs.webkit.org/show_bug.cgi?id=201232
2157         <rdar://problem/54806789>
2158
2159         Reviewed by Antti Koivisto.
2160
2161         Set them as blank for now.
2162
2163         * layout/tableformatting/TableFormattingContext.cpp:
2164         (WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const):
2165         (WebCore::Layout::TableFormattingContext::layout const):
2166         * layout/tableformatting/TableFormattingContext.h:
2167         * layout/tableformatting/TableGrid.cpp:
2168         (WebCore::Layout::TableGrid::Row::Row):
2169         (WebCore::Layout::TableGrid::appendCell):
2170         * layout/tableformatting/TableGrid.h:
2171         (WebCore::Layout::TableGrid::Row::box const):
2172
2173 2019-08-29  Youenn Fablet  <youenn@apple.com>
2174
2175         document.fonts.ready is resolved too quickly
2176         https://bugs.webkit.org/show_bug.cgi?id=174030
2177         <rdar://problem/33083550>
2178
2179         Reviewed by Frédéric Wang.
2180
2181         As described in https://drafts.csswg.org/css-font-loading/#font-face-set-ready, the ready promise
2182         is only fulfilled after layout operations complete and no additional font loads are necessary.
2183
2184         This patch implements this by notifying the FontFaceSet created for the document when the document
2185         is finished loading. At that time, the promise will be resolved as soon as fonts are finished loading if any.
2186
2187         Test: imported/w3c/web-platform-tests/infrastructure/assumptions/document-fonts-ready.html
2188
2189         * css/CSSFontSelector.cpp:
2190         (WebCore::CSSFontSelector::optionalFontFaceSet):
2191         * css/CSSFontSelector.h:
2192         * css/FontFaceSet.cpp:
2193         (WebCore::FontFaceSet::FontFaceSet):
2194         (WebCore::FontFaceSet::startedLoading):
2195         (WebCore::FontFaceSet::didFirstLayout):
2196         (WebCore::FontFaceSet::completedLoading):
2197         * css/FontFaceSet.h:
2198         * dom/Document.cpp:
2199         (WebCore::Document::implicitClose):
2200
2201 2019-08-29  Zalan Bujtas  <zalan@apple.com>
2202
2203         [LFC][BFC] BlockFormattingContext::usedAvailableWidthForFloatAvoider should only be called on float avoiders.
2204         https://bugs.webkit.org/show_bug.cgi?id=201238
2205         <rdar://problem/54807663>
2206
2207         Reviewed by Antti Koivisto.
2208
2209         Make the horizontal available space logic for float avoiders more explicit/readable. 
2210
2211         * layout/blockformatting/BlockFormattingContext.cpp:
2212         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2213         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2214
2215 2019-08-29  Zalan Bujtas  <zalan@apple.com>
2216
2217         [LFC] Inline content logging should have some extra space for better readability
2218         https://bugs.webkit.org/show_bug.cgi?id=201236
2219         <rdar://problem/54807336>
2220
2221         Reviewed by Antti Koivisto.
2222
2223         * layout/layouttree/LayoutTreeBuilder.cpp:
2224         (WebCore::Layout::outputInlineRuns):
2225
2226 2019-08-29  Simon Fraser  <simon.fraser@apple.com>
2227
2228         Avoid running the outline painting phase if no renderers have outlines
2229         https://bugs.webkit.org/show_bug.cgi?id=201284
2230
2231         Reviewed by Said Abou-Hallawa.
2232
2233         The outline painting phase (paintOutlineForFragments()) can take up to 20% of the painting time
2234         even when there are no outlines. Keep track of which renderers have outlines, and only run the phase
2235         when printing (for hasOutlineAnnotation()) or if there are any renderers with outlines.
2236
2237         * rendering/RenderElement.cpp:
2238         (WebCore::RenderElement::styleWillChange):
2239         (WebCore::RenderElement::styleDidChange):
2240         (WebCore::RenderElement::willBeDestroyed):
2241         * rendering/RenderLayer.cpp:
2242         (WebCore::RenderLayer::paintLayerContents):
2243         * rendering/RenderView.h:
2244
2245 2019-08-29  Zalan Bujtas  <zalan@apple.com>
2246
2247         [LFC][TFC] Use the "complicated-cases" category for computing the TFC root's height
2248         https://bugs.webkit.org/show_bug.cgi?id=201230
2249         <rdar://problem/54806131>
2250
2251         Reviewed by Antti Koivisto.
2252
2253         This might change in the future but for now let's use the "complicated cases" when we need to compute the TFC's height and vertical margin.
2254         This is very BFC specific since (block)TFC is always parented in a BFC.
2255
2256         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2257         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2258
2259 2019-08-29  Zalan Bujtas  <zalan@apple.com>
2260
2261         [LFC][TFC] The table wrapper box is a block level box
2262         https://bugs.webkit.org/show_bug.cgi?id=201229
2263         <rdar://problem/54805515>
2264
2265         Reviewed by Antti Koivisto.
2266
2267         This is the anonymous box that we inject as the parent of the table caption/actual table box.
2268
2269         * layout/FormattingContextGeometry.cpp:
2270         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2271         * layout/blockformatting/BlockFormattingContext.cpp:
2272         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
2273         * layout/layouttree/LayoutBox.cpp:
2274         (WebCore::Layout::Box::establishesBlockFormattingContext const):
2275         (WebCore::Layout::Box::isFloatAvoider const):
2276         (WebCore::Layout::Box::isBlockLevelBox const):
2277
2278 2019-08-29  Youenn Fablet  <youenn@apple.com>
2279
2280         Skip fetch event dispatching if no fetch event handler is added at script evaluation time
2281         https://bugs.webkit.org/show_bug.cgi?id=201174
2282
2283         Reviewed by Chris Dumez.
2284
2285         At end of worker script evaluation, store whether a fetch event handler is registered.
2286         Send it back to the SWServer that will store it in the corresponding SWServerWorker.
2287
2288         Add support for soft update directly from the registration.
2289         This will trigger a soft-update from the worker context itself.
2290         In theory, this should be started by the job queue but we do not have a way yet to implement this as per spec.
2291
2292         Test: http/wpt/service-workers/skipFetchEvent.https.html
2293
2294         * workers/DedicatedWorkerThread.h:
2295         (WebCore::DedicatedWorkerThread::start):
2296         * workers/WorkerMessagingProxy.cpp:
2297         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
2298         * workers/WorkerThread.cpp:
2299         (WebCore::WorkerThread::workerThread):
2300         * workers/WorkerThread.h:
2301         (WebCore::WorkerThread::finishedEvaluatingScript):
2302         * workers/service/context/SWContextManager.cpp:
2303         (WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
2304         (WebCore::SWContextManager::startedServiceWorker):
2305         (WebCore::SWContextManager::softUpdate):
2306         * workers/service/context/SWContextManager.h:
2307         * workers/service/context/ServiceWorkerThread.cpp:
2308         (WebCore::ServiceWorkerThread::postFetchTask):
2309         (WebCore::ServiceWorkerThread::softUpdate):
2310         (WebCore::ServiceWorkerThread::finishedEvaluatingScript):
2311         (WebCore::ServiceWorkerThread::start):
2312         * workers/service/context/ServiceWorkerThread.h:
2313         (WebCore::ServiceWorkerThread::doesHandleFetch const):
2314         * workers/service/server/SWServer.h:
2315         * workers/service/server/SWServerRegistration.cpp:
2316         (WebCore::SWServerRegistration::shouldSoftUpdate const):
2317         (WebCore::SWServerRegistration::softUpdate):
2318         * workers/service/server/SWServerRegistration.h:
2319         (WebCore::SWServerRegistration::isStale const):
2320         * workers/service/server/SWServerToContextConnection.cpp:
2321         (WebCore::SWServerToContextConnection::generateConnectionIdentifier):
2322         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
2323         (WebCore::SWServerToContextConnection::scriptContextStarted):
2324         * workers/service/server/SWServerToContextConnection.h:
2325         * workers/service/server/SWServerWorker.cpp:
2326         (WebCore::SWServerWorker::scriptContextStarted):
2327         (WebCore::SWServerWorker::setState):
2328         * workers/service/server/SWServerWorker.h:
2329         (WebCore::SWServerWorker::shouldSkipFetchEvent const):
2330
2331 2019-08-29  Keith Rollin  <krollin@apple.com>
2332
2333         Remove support for macOS < 10.13 (part 3)
2334         https://bugs.webkit.org/show_bug.cgi?id=201224
2335         <rdar://problem/54795934>
2336
2337         Reviewed by Darin Adler.
2338
2339         Remove symbols in WebKitTargetConditionals.xcconfig related to macOS
2340         10.13, including WK_MACOS_1013 and WK_MACOS_BEFORE_1013, and suffixes
2341         like _MACOS_SINCE_1013.
2342
2343         No new tests -- no new or changed functionality.
2344
2345         * Configurations/WebKitTargetConditionals.xcconfig:
2346
2347 2019-08-29  Charlie Turner  <cturner@igalia.com>
2348
2349         [GStreamer] Do not use makeWeakPtr from streaming thread.
2350         https://bugs.webkit.org/show_bug.cgi?id=201220
2351
2352         Reviewed by Xabier Rodriguez-Calvar.
2353
2354         Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-retrieve-persistent-license.https.html
2355
2356         Recently some asserts were added that you can't create WeakPtr's
2357         from streaming threads when the factory is created on the
2358         main-thread. The fix is to eagerly create the WeakPtr at player
2359         initialization time, rather than lazily when the streaming thread
2360         first asks for it.
2361
2362         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2363
2364 2019-08-29  Rob Buis  <rbuis@igalia.com>
2365
2366         Address some MathML FIXMEs 
2367         https://bugs.webkit.org/show_bug.cgi?id=201293
2368
2369         Reviewed by Frédéric Wang.
2370
2371         Add element tag checks for data, time and dialog.
2372
2373         * mathml/MathMLOperatorDictionary.h:
2374         * mathml/MathMLPresentationElement.cpp:
2375         (WebCore::MathMLPresentationElement::isPhrasingContent):
2376         (WebCore::MathMLPresentationElement::isFlowContent):
2377
2378 2019-08-29  Zan Dobersek  <zdobersek@igalia.com>
2379
2380         [Nicosia] Nicosia::Animation is missing the copy assignment operator
2381         https://bugs.webkit.org/show_bug.cgi?id=201298
2382
2383         Reviewed by Carlos Garcia Campos.
2384
2385         Along with the copy constructor, the Nicosia::Animation class also
2386         requires the copy assignment operator that's invoked whenever
2387         the containing Nicosia::Animations object is copied across different
2388         state objects.
2389
2390         Much like the constructor, the copy assignment should clone the
2391         TimingFunction object to make it safely reusable in other contexts.
2392         This fixes the assertion failures in debug configurations over the
2393         improper cross-thread RefCounted usage.
2394
2395         * platform/graphics/nicosia/NicosiaAnimation.cpp:
2396         (Nicosia::Animation::operator=):
2397         * platform/graphics/nicosia/NicosiaAnimation.h:
2398         Explicitly default the move constructor and assignment operator,
2399         providing the whole quartet.
2400
2401 2019-08-29  Rob Buis  <rbuis@igalia.com>
2402
2403         https://bugs.webkit.org/show_bug.cgi?id=200917
2404         Do not call addHTTPOriginIfNeeded for window.open
2405
2406         window.open() always uses GET requests and addHTTPOriginIfNeeded
2407         has no effect for GET, so do not call it.
2408
2409         Reviewed by Frédéric Wang.
2410
2411         * page/DOMWindow.cpp:
2412         (WebCore::DOMWindow::createWindow):
2413
2414 2019-08-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2415
2416         WebSockets: first-party for cookies not set in handshake request when using platform APIs
2417         https://bugs.webkit.org/show_bug.cgi?id=200165
2418
2419         Reviewed by Youenn Fablet.
2420
2421         * Modules/websockets/ThreadableWebSocketChannel.cpp:
2422         (WebCore::ThreadableWebSocketChannel::webSocketConnectRequest):
2423
2424 2019-08-29  Rob Buis  <rbuis@igalia.com>
2425
2426         Implement HTMLOrForeignElement
2427         https://bugs.webkit.org/show_bug.cgi?id=201219
2428
2429         Reviewed by Frédéric Wang.
2430
2431         Add FIXME for updating the spec link.
2432
2433         * html/HTMLOrForeignElement.idl:
2434
2435 2019-08-28  Zan Dobersek  <zdobersek@igalia.com>
2436
2437         [Nicosia] Implement layer representation retain, release mechanics
2438         https://bugs.webkit.org/show_bug.cgi?id=201133
2439
2440         Reviewed by Carlos Garcia Campos.
2441
2442         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp:
2443         (WebCore::LayerRepresentation::retainPlatformLayer):
2444         Type-cast the layer object to the reference-counted
2445         Nicosia::PlatformLayer type and reference that object.
2446         (WebCore::LayerRepresentation::releasePlatformLayer):
2447         Ditto, but dereference the object.
2448
2449 2019-08-28  Zan Dobersek  <zdobersek@igalia.com>
2450
2451         [Nicosia] Add Nicosia::PlatformLayer::accessStaging() helper
2452         https://bugs.webkit.org/show_bug.cgi?id=201132
2453
2454         Reviewed by Carlos Garcia Campos.
2455
2456         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
2457         (Nicosia::CompositionLayer::accessStaging):
2458         Add an accessor into the staging state of the Nicosia::PlatformLayer
2459         object. This will be needed for the application of scrolling changes
2460         in the asynchronous scrolling system.
2461
2462 2019-08-28  Zan Dobersek  <zdobersek@igalia.com>
2463
2464         [CoordGraphics] Expose Nicosia layer as the underlying CoordinatedGraphicsLayer platform layer
2465         https://bugs.webkit.org/show_bug.cgi?id=201131
2466
2467         Reviewed by Carlos Garcia Campos.
2468
2469         Add the CoordinatedGraphicsLayer::platformLayer() override, returning
2470         the Nicosia::CompositionLayer object as the underlying platform layer.
2471         This will come in handy for asynchronous scrolling.
2472
2473         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2474         (WebCore::CoordinatedGraphicsLayer::platformLayer const):
2475         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2476
2477 2019-08-28  Zan Dobersek  <zdobersek@igalia.com>
2478
2479         [Nicosia] Polish ScrollingCoordinator implementation
2480         https://bugs.webkit.org/show_bug.cgi?id=201130
2481
2482         Reviewed by Carlos Garcia Campos.
2483
2484         These changes primarily mirror the Mac implementation of this class.
2485
2486         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
2487         (WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
2488         Upon releasing the ThreadedScrollingTree, it should also be invalidated
2489         on the scrolling thread.
2490         (WebCore::ScrollingCoordinatorNicosia::commitTreeState):
2491         Invoke willCommitTree() at the beginning of this method. Additionally
2492         the pending-commit-count is incremented for the ThreadedScrollingTree
2493         object.
2494
2495 2019-08-28  Ryosuke Niwa  <rniwa@webkit.org>
2496
2497         Make tabIndex IDL attribute reflect its content attribute
2498         https://bugs.webkit.org/show_bug.cgi?id=199606
2499         <rdar://problem/52811448>
2500
2501         Reviewed by Chris Dumez.
2502
2503         This patch makes tabIndex IDL attribute no longer return 0 when the element is focusable
2504         to match the latest HTML5 specification. Instead, the IDL attribute simply reflect the tabindex
2505         content attribute with some elements having 0 as the default tab index (see r248784):
2506         https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
2507
2508         The practical implication is that tabIndex IDL attribute on a root editable element (a.k.a.
2509         editing host in HTML5 spec term), body element in design mode, and media elements with
2510         media controls would start returning -1 instead of 0.
2511
2512         Mechanically, this is accomplished by removing the special case in Element::tabIndexForBindings
2513         when supportsFocus returned true. The effect, if any, this patch has on each element which
2514         overrides Element::supportsFocus is summarized as follows (indentation simplies inheritance):
2515
2516         HTMLAnchorElement -> No effect since defaultTabIndex returns 0.
2517             HTMLAreaElement -> Ditto.
2518         HTMLBodyElement -> Changes to return -1 in design mode.
2519         HTMLElement -> Changes to return -1 on a root editable element.
2520         HTMLFormControlElement
2521             HTMLButtonElement -> No effect since defaultTabIndex returns 0.
2522             HTMLFieldSetElement -> No effect since this is an override to use HTMLElement's supportsFocus.
2523             HTMLFormControlElementWithState
2524                 HTMLKeygenElement -> No effect since defaultTabIndex returns 0.
2525                 HTMLSelectElement -> Ditto.
2526                 HTMLTextFormControlElement -> Ditto.
2527                     HTMLInputElement -> Ditto.
2528                     HTMLTextAreaElement -> Ditto.
2529             HTMLOutputElement -> No effect since this is an override to use HTMLElement's supportsFocus.
2530         HTMLFrameElementBase - No change. Added defaultTabIndex on HTMLIFrameElement and HTMLFrameElement
2531             to returns 0.
2532         HTMLImageElement - No impact since it only affects when an image is set to be editable via SPI.
2533         HTMLMediaElement - Changes to return -1 when media controls is present.
2534         HTMLPlugInElement - applet and embed elements change to return -1 when the plugin is available.
2535         HTMLSummaryElement - No change. Added defaultTabIndex to return 0 when it's active to match
2536             supportsFocus as well as the HTML5 specification.
2537         MathMLElement - No effect since tabIndex IDL attribute does not exist in MathML.
2538         SVGAElement - No effect since defaultTabIndex returns 0.
2539         SVGClipPathElement - No effect since it always returns false.
2540         SVGDefsElement - No effect since it always returns false.
2541
2542         Tests: fast/dom/tabindex-defaults.html
2543                plugins/focus.html
2544
2545         * dom/Element.cpp:
2546         (WebCore::Element::tabIndexForBindings const): Made the change.
2547         * html/HTMLFrameElement.cpp:
2548         (WebCore::HTMLFrameElement::defaultTabIndex const): Added to preserve the existing behavior.
2549         * html/HTMLFrameElement.h:
2550         * html/HTMLIFrameElement.cpp:
2551         (WebCore::HTMLIFrameElement::defaultTabIndex const): Ditto.
2552         * html/HTMLIFrameElement.h:
2553         * html/HTMLObjectElement.cpp:
2554         (WebCore::HTMLObjectElement::defaultTabIndex const): Added. Always return 0 to match the spec.
2555         * html/HTMLObjectElement.h:
2556         * html/HTMLSummaryElement.cpp:
2557         (WebCore::HTMLSummaryElement::defaultTabIndex const): Added. Return 0 when the this summary
2558         is the active summary element of the details element.
2559         * html/HTMLSummaryElement.h:
2560
2561 2019-08-28  Simon Fraser  <simon.fraser@apple.com>
2562
2563         Make FillLayer::hasImage() inline
2564         https://bugs.webkit.org/show_bug.cgi?id=201265
2565
2566         Reviewed by Zalan Bujtas.
2567
2568         FillLayer::hasImage() shows up on profiles because it's called from hot functions like
2569         isTransparent() and hasMask(), so make a basic inline version that doens't have
2570         to walk the list.
2571
2572         * rendering/style/FillLayer.cpp:
2573         (WebCore::FillLayer::hasImageInAnyLayer const):
2574         (WebCore::FillLayer::hasImage const): Deleted.
2575         * rendering/style/FillLayer.h:
2576         (WebCore::FillLayer::hasImage const):
2577
2578 2019-08-28  Peng Liu  <peng.liu6@apple.com>
2579
2580         REGRESSION: String check: “realtime” Suggesting “real time”
2581         https://bugs.webkit.org/show_bug.cgi?id=201107
2582         <rdar://problem/46372620>
2583
2584         Reviewed by Jer Noble.
2585
2586         Update Localizable.strings.
2587
2588         No new test.
2589
2590         * en.lproj/Localizable.strings:
2591         * platform/LocalizedStrings.cpp:
2592         (WebCore::localizedMediaControlElementString):
2593
2594 2019-08-28  Simon Fraser  <simon.fraser@apple.com>
2595
2596         PaintFrequencyTracker triggers too many calls to MonotonicTime::now() on layer painting
2597         https://bugs.webkit.org/show_bug.cgi?id=201261
2598
2599         Reviewed by Zalan Bujtas.
2600
2601         MonotonicTime::now() shows up as expensive when painting layer-heavy content, because PaintFrequencyTracker
2602         makes two calls per layer paint.
2603
2604         Halve the number of calls by storing m_lastPaintTime at the start of the paint; doing so doesn't substantially
2605         change the behavior of the tracker.
2606
2607         * rendering/PaintFrequencyTracker.h:
2608         (WebCore::PaintFrequencyTracker::begin):
2609         (WebCore::PaintFrequencyTracker::end):
2610
2611 2019-08-28  Ross Kirsling  <ross.kirsling@sony.com>
2612
2613         Unreviewed. Restabilize non-unified build.
2614
2615         * inspector/agents/WebConsoleAgent.h:
2616         * loader/ResourceLoadObserver.h:
2617
2618 2019-08-28  Simon Fraser  <simon.fraser@apple.com>
2619
2620         Devirtualize RenderBox::visualOverflowRect()
2621         https://bugs.webkit.org/show_bug.cgi?id=201231
2622
2623         Reviewed by Zalan Bujtas.
2624
2625         The only override of RenderBox::visualOverflowRect() was in RenderView, for "paintsEntireContents" views, and as
2626         far as I can tell this is not necessary. visualOverflowRect() is hot when called from RenderLayer::localBoundingBox() --
2627         this shows in profiles when scrolling large patch reviews, so making it non-virtual is a performance enhancement.
2628         
2629         RenderLayer::localBoundingBox() can also just call visualOverflowRect(), since that returns borderBoxRect()
2630         when there is no overflow.
2631
2632         * rendering/RenderBox.h:
2633         (WebCore::RenderBox::visualOverflowRect const):
2634         * rendering/RenderLayer.cpp:
2635         (WebCore::performOverlapTests): Minor optimization to avoid a call to boundingBox().
2636         (WebCore::RenderLayer::calculateClipRects const):
2637         * rendering/RenderView.cpp:
2638         (WebCore::RenderView::visualOverflowRect const): Deleted.
2639         * rendering/RenderView.h:
2640
2641 2019-08-28  Austin Eng  <enga@chromium.org>
2642
2643         Create ANGLE EGL Context with all extensions disabled by default
2644         https://bugs.webkit.org/show_bug.cgi?id=200900
2645
2646         Reviewed by Alex Christensen.
2647
2648         In WebGL, extensions must be explicitly requested before they are enabled.
2649         Fixes the following WebGL conformance tests with the ANGLE backend
2650         LayoutTests/webgl/*/conformance/extensions/ext-blend-minmax.html
2651         LayoutTests/webgl/*/conformance/extensions/ext-frag-depth.html
2652         LayoutTests/webgl/*/conformance/extensions/ext-shader-texture-lod.html
2653         LayoutTests/webgl/*/conformance/extensions/ext-sRGB.html
2654         LayoutTests/webgl/*/conformance/extensions/oes-standard-derivatives.html
2655         LayoutTests/webgl/*/conformance/extensions/oes-texture-float.html
2656         LayoutTests/webgl/*/conformance/extensions/webgl-compressed-texture-s3tc.html
2657         LayoutTests/webgl/*/conformance/glsl/misc/shader-with-dfdx.frag.html
2658         LayoutTests/webgl/*/conformance/glsl/variables/glsl-built-ins.html
2659         LayoutTests/webgl/*/conformance/textures/misc/texture-npot-video.html
2660         LayoutTests/webgl/*/conformance/textures/misc/texture-npot.html
2661
2662         * html/canvas/ANGLEInstancedArrays.cpp:
2663         (WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
2664         (WebCore::ANGLEInstancedArrays::supported):
2665         * html/canvas/WebGLCompressedTextureASTC.cpp:
2666         (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
2667         * html/canvas/WebGLCompressedTextureATC.cpp:
2668         (WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
2669         * html/canvas/WebGLCompressedTexturePVRTC.cpp:
2670         (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
2671         * html/canvas/WebGLCompressedTextureS3TC.cpp:
2672         (WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
2673         (WebCore::WebGLCompressedTextureS3TC::supported):
2674         * html/canvas/WebGLDebugShaders.cpp:
2675         (WebCore::WebGLDebugShaders::WebGLDebugShaders):
2676         * html/canvas/WebGLDepthTexture.cpp:
2677         (WebCore::WebGLDepthTexture::WebGLDepthTexture):
2678         * html/canvas/WebGLDrawBuffers.cpp:
2679         (WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
2680         (WebCore::WebGLDrawBuffers::supported):
2681         * platform/graphics/angle/GraphicsContext3DANGLE.cpp:
2682         (WebCore::GraphicsContext3D::reshapeFBOs):
2683         (WebCore::GraphicsContext3D::validateDepthStencil):
2684         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
2685         (WebCore::GraphicsContext3D::GraphicsContext3D):
2686
2687 2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2688
2689         All image drawing functions should take an argument of type ImagePaintingOptions
2690         https://bugs.webkit.org/show_bug.cgi?id=201059
2691
2692         Reviewed by Simon Fraser.
2693
2694         In this patch:
2695         -- All the image drawing function will take an argument of type
2696            ImagePaintingOptions instead of passing individual options.
2697
2698         -- ImagePaintingOptions is made like a set of options. It can be
2699            initialized with any number of options and the order does not matter
2700
2701         -- Image::originalSize() is deleted because it returns size() and none
2702            of the Image concrete classes overrides this implementation.
2703
2704         * Headers.cmake:
2705         * WebCore.xcodeproj/project.pbxproj:
2706         * html/ImageBitmap.cpp:
2707         (WebCore::ImageBitmap::createPromise):
2708         (WebCore::ImageBitmap::createFromBuffer):
2709         * html/canvas/CanvasRenderingContext2DBase.cpp:
2710         (WebCore::CanvasRenderingContext2DBase::drawImage):
2711         (WebCore::drawImageToContext):
2712         (WebCore::CanvasRenderingContext2DBase::fullCanvasCompositedDrawImage):
2713         * platform/graphics/BitmapImage.cpp:
2714         (WebCore::BitmapImage::draw):
2715         (WebCore::BitmapImage::drawPattern):
2716         * platform/graphics/BitmapImage.h:
2717         * platform/graphics/CrossfadeGeneratedImage.cpp:
2718         (WebCore::drawCrossfadeSubimage):
2719         (WebCore::CrossfadeGeneratedImage::draw):
2720         (WebCore::CrossfadeGeneratedImage::drawPattern):
2721         * platform/graphics/CrossfadeGeneratedImage.h:
2722         * platform/graphics/CustomPaintImage.cpp:
2723         (WebCore::CustomPaintImage::draw):
2724         (WebCore::CustomPaintImage::drawPattern):
2725         * platform/graphics/CustomPaintImage.h:
2726         * platform/graphics/GeneratedImage.h:
2727         (WebCore::GeneratedImage::draw):
2728         (WebCore::GeneratedImage::drawPattern):
2729         * platform/graphics/GradientImage.cpp:
2730         (WebCore::GradientImage::draw):
2731         (WebCore::GradientImage::drawPattern):
2732         * platform/graphics/GradientImage.h:
2733         * platform/graphics/GraphicsContext.cpp:
2734         (WebCore::GraphicsContext::drawImage):
2735         (WebCore::GraphicsContext::drawTiledImage):
2736         (WebCore::GraphicsContext::drawImageBuffer):
2737         (WebCore::GraphicsContext::drawConsumingImageBuffer):
2738         * platform/graphics/GraphicsContext.h:
2739         (WebCore::GraphicsContext::drawNativeImage):
2740         (WebCore::GraphicsContext::drawImage):
2741         (WebCore::GraphicsContext::drawTiledImage):
2742         (WebCore::GraphicsContext::drawImageBuffer):
2743         (WebCore::GraphicsContext::drawPattern):
2744         (WebCore::GraphicsContext::drawConsumingImageBuffer):
2745         (WebCore::ImagePaintingOptions::ImagePaintingOptions): Deleted.
2746         (WebCore::ImagePaintingOptions::usesDefaultInterpolation const): Deleted.
2747         * platform/graphics/GraphicsContextImpl.cpp:
2748         (WebCore::GraphicsContextImpl::drawImageImpl):
2749         (WebCore::GraphicsContextImpl::drawTiledImageImpl):
2750         * platform/graphics/GraphicsContextImpl.h:
2751         * platform/graphics/Image.cpp:
2752         (WebCore::Image::drawPattern):
2753         (WebCore::Image::drawTiled):
2754         (WebCore::Image::computeIntrinsicDimensions):
2755         * platform/graphics/Image.h:
2756         (WebCore::Image::drawPattern):
2757         (WebCore::Image::draw):
2758         (WebCore::Image::drawTiled):
2759         (WebCore::Image::originalSize const): Deleted.
2760         * platform/graphics/ImageBuffer.h:
2761         (WebCore::ImageBuffer::draw):
2762         (WebCore::ImageBuffer::drawPattern):
2763         (WebCore::ImageBuffer::drawConsuming):
2764         * platform/graphics/ImagePaintingOptions.h: Added.
2765         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
2766         (WebCore::ImagePaintingOptions::compositeOperator const):
2767         (WebCore::ImagePaintingOptions::blendMode const):
2768         (WebCore::ImagePaintingOptions::decodingMode const):
2769         (WebCore::ImagePaintingOptions::orientation const):
2770         (WebCore::ImagePaintingOptions::interpolationQuality const):
2771         (WebCore::ImagePaintingOptions::setOption):
2772         * platform/graphics/NamedImageGeneratedImage.cpp:
2773         (WebCore::NamedImageGeneratedImage::draw):
2774         (WebCore::NamedImageGeneratedImage::drawPattern):
2775         * platform/graphics/NamedImageGeneratedImage.h:
2776         * platform/graphics/NativeImage.h:
2777         * platform/graphics/cairo/CairoOperations.cpp:
2778         (WebCore::Cairo::drawShadowLayerBuffer):
2779         (WebCore::Cairo::drawShadowImage):
2780         (WebCore::Cairo::drawNativeImage):
2781         (WebCore::Cairo::drawPattern):
2782         * platform/graphics/cairo/CairoOperations.h:
2783         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2784         (WebCore::GraphicsContext::drawNativeImage):
2785         (WebCore::GraphicsContext::drawPattern):
2786         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
2787         (WebCore::GraphicsContextImplCairo::drawNativeImage):
2788         (WebCore::GraphicsContextImplCairo::drawPattern):
2789         * platform/graphics/cairo/GraphicsContextImplCairo.h:
2790         * platform/graphics/cairo/ImageBufferCairo.cpp:
2791         (WebCore::ImageBuffer::drawConsuming):
2792         (WebCore::ImageBuffer::draw):
2793         (WebCore::ImageBuffer::drawPattern):
2794         * platform/graphics/cairo/NativeImageCairo.cpp:
2795         (WebCore::drawNativeImage):
2796         * platform/graphics/cg/GraphicsContext3DCG.cpp:
2797         (WebCore::GraphicsContext3D::paintToCanvas):
2798         * platform/graphics/cg/GraphicsContextCG.cpp:
2799         (WebCore::GraphicsContext::drawNativeImage):
2800         (WebCore::GraphicsContext::drawPattern):
2801         * platform/graphics/cg/ImageBufferCG.cpp:
2802         (WebCore::ImageBuffer::drawConsuming):
2803         (WebCore::ImageBuffer::draw):
2804         (WebCore::ImageBuffer::drawPattern):
2805         * platform/graphics/cg/NativeImageCG.cpp:
2806         (WebCore::drawNativeImage):
2807         * platform/graphics/cg/PDFDocumentImage.cpp:
2808         (WebCore::PDFDocumentImage::draw):
2809         * platform/graphics/cg/PDFDocumentImage.h:
2810         * platform/graphics/displaylists/DisplayListItems.cpp:
2811         (WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
2812         (WebCore::DisplayList::DrawNativeImage::apply const):
2813         (WebCore::DisplayList::DrawPattern::DrawPattern):
2814         (WebCore::DisplayList::DrawPattern::apply const):
2815         * platform/graphics/displaylists/DisplayListItems.h:
2816         (WebCore::DisplayList::DrawNativeImage::create):
2817         (WebCore::DisplayList::DrawPattern::create):
2818         (WebCore::DisplayList::DrawPattern::DrawPattern):
2819         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2820         (WebCore::DisplayList::Recorder::drawNativeImage):
2821         (WebCore::DisplayList::Recorder::drawPattern):
2822         * platform/graphics/displaylists/DisplayListRecorder.h:
2823         * platform/graphics/filters/FEBlend.cpp:
2824         (WebCore::FEBlend::platformApplySoftware):
2825         * platform/graphics/filters/FEComposite.cpp:
2826         (WebCore::FEComposite::platformApplySoftware):
2827         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2828         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2829         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
2830         (Nicosia::CairoOperationRecorder::drawNativeImage):
2831         (Nicosia::CairoOperationRecorder::drawPattern):
2832         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
2833         * platform/graphics/win/Direct2DOperations.cpp:
2834         (WebCore::Direct2D::drawNativeImage):
2835         (WebCore::Direct2D::drawPattern):
2836         * platform/graphics/win/Direct2DOperations.h:
2837         * platform/graphics/win/GraphicsContextImplDirect2D.h:
2838         * platform/graphics/win/ImageCGWin.cpp:
2839         (WebCore::BitmapImage::getHBITMAPOfSize):
2840         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
2841         * platform/graphics/win/ImageCairoWin.cpp:
2842         (WebCore::BitmapImage::getHBITMAPOfSize):
2843         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
2844         * platform/graphics/win/NativeImageDirect2D.cpp:
2845         (WebCore::drawNativeImage):
2846         * platform/ios/DragImageIOS.mm:
2847         (WebCore::createDragImageFromImage):
2848         * rendering/RenderBoxModelObject.cpp:
2849         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2850         * rendering/RenderEmbeddedObject.cpp:
2851         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
2852         * rendering/RenderImage.cpp:
2853         (WebCore::RenderImage::paintReplaced):
2854         (WebCore::RenderImage::paintIntoRect):
2855         * rendering/RenderSnapshottedPlugIn.cpp:
2856         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
2857         * rendering/RenderThemeMac.mm:
2858         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
2859         * svg/graphics/SVGImage.cpp:
2860         (WebCore::SVGImage::drawForContainer):
2861         (WebCore::SVGImage::nativeImageForCurrentFrame):
2862         (WebCore::SVGImage::nativeImage):
2863         (WebCore::SVGImage::drawPatternForContainer):
2864         (WebCore::SVGImage::draw):
2865         * svg/graphics/SVGImage.h:
2866         * svg/graphics/SVGImageForContainer.cpp:
2867         (WebCore::SVGImageForContainer::draw):
2868         (WebCore::SVGImageForContainer::drawPattern):
2869         * svg/graphics/SVGImageForContainer.h:
2870
2871 2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2872
2873         XLinkNames namespace is required before the 'href' attribute of SVG animate elements
2874         https://bugs.webkit.org/show_bug.cgi?id=201227
2875
2876         Reviewed by Ryosuke Niwa.
2877
2878         To get the animation target element, get the value of the "href" attribute
2879         or the "xlink:href" attribute.
2880
2881         Tests: svg/custom/href-svg-namespace-animate-target.svg
2882
2883         * svg/animation/SVGSMILElement.cpp:
2884         (WebCore::SVGSMILElement::buildPendingResource):
2885
2886 2019-08-28  Truitt Savell  <tsavell@apple.com>
2887
2888         Unreviewed, rolling out r249209.
2889
2890         Broke 19 webgpu/ tests
2891
2892         Reverted changeset:
2893
2894         "[WHLSL] Inline typedef'd types during Metal code generation
2895         to simplify generated code while also making it easier to
2896         read"
2897         https://bugs.webkit.org/show_bug.cgi?id=201185
2898         https://trac.webkit.org/changeset/249209
2899
2900 2019-08-28  Myles C. Maxfield  <mmaxfield@apple.com>
2901
2902         [WHLSL] Matrices need to have correct alignment
2903         https://bugs.webkit.org/show_bug.cgi?id=201212
2904
2905         Reviewed by Robin Morisset.
2906
2907         Matrices have particular alignment requirements and size requirements.
2908
2909           Type   | Alignment | Size
2910         ---------------------------
2911         float2x2 |         8 |   16
2912         float2x3 |        16 |   32
2913         float2x4 |        16 |   32
2914         float3x2 |         8 |   24
2915         float3x3 |        16 |   48
2916         float3x4 |        16 |   48
2917         float4x2 |         8 |   32
2918         float4x3 |        16 |   64
2919         float4x4 |        16 |   64
2920
2921         These are important because they may be a member of a struct, and we don't want to misplace
2922         every successive item in the struct.
2923
2924         Test: webgpu/whlsl/matrix-alignment.html
2925
2926         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
2927         (WebCore::WHLSL::Metal::writeNativeType):
2928
2929 2019-08-28  Rob Buis  <rbuis@igalia.com>
2930
2931         Implement HTMLOrForeignElement
2932         https://bugs.webkit.org/show_bug.cgi?id=201219
2933
2934         Reviewed by Ryosuke Niwa.
2935
2936         Add the HTMLOrForeignElement [1] interface to share properties
2937         and methods between HTML, SVG and MathML.
2938
2939         [1] https://github.com/mathml-refresh/mathml/issues/83
2940
2941         * CMakeLists.txt:
2942         * DerivedSources-input.xcfilelist:
2943         * DerivedSources-output.xcfilelist:
2944         * DerivedSources.make:
2945         * Sources.txt:
2946         * WebCore.xcodeproj/project.pbxproj:
2947         * dom/StaticRange.h:
2948         * html/HTMLElement.idl:
2949         * html/HTMLOrForeignElement.idl: Added.
2950         * svg/SVGElement.idl:
2951
2952 2019-08-28  Sam Weinig  <weinig@apple.com>
2953
2954         [WHLSL] Inline typedef'd types during Metal code generation to simplify generated code while also making it easier to read
2955         https://bugs.webkit.org/show_bug.cgi?id=201185
2956
2957         Reviewed by Saam Barati.
2958
2959         The current Metal code generation generates many unnecessary typedefs during TypeNamer::emitMetalTypeDefinitions
2960         such as 'typedef float2 type19;' that can be removed by just using resolved type whereever the typedef would have
2961         been used. The only types that actually need to be predefined are the types that declare a new struct or enum, which 
2962         means we can stop emitting for AST::TypeReference, AST::Pointer, AST::Array, and AST::TypeDefinition. Instead, the
2963         relevent mangledNameForType constructs the computed name on the fly. 
2964         
2965         This is a 25% speedup in the metal code generation phase.
2966
2967         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2968         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2969         Switch to using auto rather than Mangled*Name when it is obvious and the actual return type
2970         may need to become more complicated (e.g. MangledOrNativeTypeName).
2971
2972         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
2973         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2974         (WebCore::WHLSL::Metal::TypeNamer::visit):
2975         There is no need to generate typenames for AST::TypeDefinitions if they are never used.
2976
2977         (WebCore::WHLSL::Metal::TypeNamer::generateUniquedTypeName):
2978         The only UnnamedType that needs a generated typename now is AST::ArrayReferenceType, which emits a struct interface.
2979
2980         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2981         Stop generating type definitions for AST::TypeReference, AST::Pointer, AST::Array.
2982
2983         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
2984         Stop generating type definitions for AST::TypeDefinition.
2985
2986         (WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
2987         Update for rename from m_unnamedTypeMapping to m_arrayReferenceTypeMapping.
2988
2989         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
2990         Look into the types and generate a concrete type name when necessary. Lazily cache the constructed
2991         names for AST::ArrayType and AST::Pointer.
2992
2993 2019-08-28  Keith Rollin  <krollin@apple.com>
2994
2995         Remove support for macOS < 10.13 (part 2)
2996         https://bugs.webkit.org/show_bug.cgi?id=201197
2997         <rdar://problem/54759985>
2998
2999         Reviewed by Darin Adler.
3000
3001         Update conditionals that reference WK_MACOS_1013 and suffixes like
3002         _MACOS_SINCE_1013, assuming that we're always building on 10.13 or
3003         later and that these conditionals are always True or False.
3004
3005         See Bug 200694 for earlier changes in this area.
3006
3007         No new tests -- no new or changed functionality.
3008
3009         * Configurations/FeatureDefines.xcconfig:
3010
3011 2019-08-28  Chris Dumez  <cdumez@apple.com>
3012
3013         geolocation.watchPosition() / getCurrentPosition() should return PERMISSION_DENIED when context is not secure
3014         https://bugs.webkit.org/show_bug.cgi?id=201221
3015
3016         Reviewed by Ryosuke Niwa.
3017
3018         geolocation.watchPosition() / getCurrentPosition() should return PERMISSION_DENIED when context is not secure,
3019         not POSITION_UNAVAILABLE. Both Gecko and Blink agree on PERMISSION_DENIED.
3020
3021         No new tests, updated existing tests.
3022
3023         * Modules/geolocation/Geolocation.cpp:
3024         (WebCore::Geolocation::startRequest):
3025
3026 2019-08-28  Alicia Boya García  <aboya@igalia.com>
3027
3028         [MSE][GStreamer] WebKitMediaSrc rework
3029         https://bugs.webkit.org/show_bug.cgi?id=199719
3030
3031         Reviewed by Xabier Rodriguez-Calvar.
3032
3033         This patch reworks the WebKitMediaSrc element and many of the player
3034         private methods that interacted with it.
3035
3036         In comparison with the old WebKitMediaSrc, in the new one seeks have
3037         been massively simplified.
3038
3039         The new WebKitMediaSrc no longer relies on a bin or appsrc, having
3040         greater control over its operation. This made it comparatively much
3041         easier to implement features such as seek before playback or
3042         single-stream flushing.
3043
3044         stream-collection events are emitted from the WebKitMediaSrc to reuse
3045         the track handling in MediaPlayerPrivateGStreamer for playbin3, which
3046         is now used for MSE pipelines.
3047
3048         Additional tests have been added to check some assumptions, and some
3049         bugs that have surfaced with the changes have been fixed but no new
3050         features (like multi-track support) are implemented in this patch.
3051
3052         One instance of these bugs is `resized` events, which were previously
3053         being emitted when frames with different resolutions where appended.
3054         This is a wrong behavior that has not been preserved in the rework, as
3055         resize events should be emitted when the frames are shown, not
3056         just appended.
3057
3058         There are subtler bugfixes, such as ignoring PTS-less frames in
3059         AppendPipeline::appsinkNewSample(). These frames are problematic for
3060         MSE, yet they were somehow passing through the pipelines. Since
3061         WebKitMediaSrc is stricter with assertions, these have to be filtered.
3062
3063         This test gets rid of !m_mseSeekCompleted assertion failures in tests
3064         and potentially other hard to debug bugs in the previous seek
3065         algorithm.
3066
3067         This patch makes the following existing tests pass:
3068
3069         imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-a-bitrate.html
3070         imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-v-framesize.html
3071
3072         New test: imported/w3c/web-platform-tests/media-source/mediasource-buffered-seek.html
3073         New test: LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_timeupdate_on_seek.html (non-MSE related)
3074
3075         * Headers.cmake:
3076         * platform/GStreamer.cmake:
3077         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3078         (WTF::adoptGRef):
3079         (WTF::refGPtr<GstMiniObject>):
3080         (WTF::derefGPtr<GstMiniObject>):
3081         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
3082         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3083         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
3084         (WebCore::MediaPlayerPrivateGStreamer::paused const):
3085         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
3086         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
3087         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
3088         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
3089         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
3090         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3091         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3092         (WebCore::MediaPlayerPrivateGStreamer::invalidateCachedPosition):
3093         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3094         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
3095         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSizeFromCaps const):
3096         (WebCore::MediaPlayerPrivateGStreamerBase::samplesHaveDifferentNaturalSize const):
3097         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3098         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3099         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
3100         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
3101         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3102         (WebCore::AppendPipeline::appsinkNewSample):
3103         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
3104         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3105         (WebCore::AppendPipeline::appsinkCaps):
3106         (WebCore::AppendPipeline::streamType):
3107         (WebCore::AppendPipeline::demuxerSrcPadCaps):
3108         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3109         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
3110         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
3111         (WebCore::MediaPlayerPrivateGStreamerMSE::play):
3112         (WebCore::MediaPlayerPrivateGStreamerMSE::pause):
3113         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
3114         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
3115         (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
3116         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
3117         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
3118         (WebCore::MediaPlayerPrivateGStreamerMSE::didEnd):
3119         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
3120         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
3121         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
3122         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3123         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3124         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
3125         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
3126         (WebCore::MediaSourceClientGStreamerMSE::flush):
3127         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
3128         (WebCore::MediaSourceClientGStreamerMSE::isReadyForMoreSamples):
3129         (WebCore::MediaSourceClientGStreamerMSE::notifyClientWhenReadyForMoreSamples):
3130         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
3131         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
3132         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
3133         (WebCore::MediaSourceGStreamer::markEndOfStream):
3134         (WebCore::MediaSourceGStreamer::unmarkEndOfStream):
3135         (WebCore::MediaSourceGStreamer::waitForSeekCompleted):
3136         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h:
3137         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Removed.
3138         * platform/graphics/gstreamer/mse/PlaybackPipeline.h: Removed.
3139         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
3140         (WebCore::SourceBufferPrivateGStreamer::enqueueSample):
3141         (WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
3142         (WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
3143         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
3144         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3145         (WebKitMediaSrcPrivate::streamByName):
3146         (Stream::Stream):
3147         (Stream::StreamingMembers::StreamingMembers):
3148         (Stream::StreamingMembers::durationEnqueued const):
3149         (findPipeline):
3150         (webkit_media_src_class_init):
3151         (webkit_media_src_init):
3152         (webKitMediaSrcFinalize):
3153         (debugProbe):
3154         (collectionPlusStream):
3155         (collectionMinusStream):
3156         (gstStreamType):
3157         (webKitMediaSrcAddStream):
3158         (webKitMediaSrcRemoveStream):
3159         (webKitMediaSrcActivateMode):
3160         (webKitMediaSrcPadLinked):
3161         (webKitMediaSrcStreamNotifyLowWaterLevel):
3162         (webKitMediaSrcLoop):
3163         (webKitMediaSrcEnqueueObject):
3164         (webKitMediaSrcEnqueueSample):
3165         (webKitMediaSrcEnqueueEvent):
3166         (webKitMediaSrcEndOfStream):
3167         (webKitMediaSrcIsReadyForMoreSamples):
3168         (webKitMediaSrcNotifyWhenReadyForMoreSamples):
3169         (webKitMediaSrcChangeState):
3170         (webKitMediaSrcStreamFlushStart):
3171         (webKitMediaSrcStreamFlushStop):
3172         (webKitMediaSrcFlush):
3173         (webKitMediaSrcSeek):
3174         (countStreamsOfType):
3175         (webKitMediaSrcGetProperty):
3176         (webKitMediaSrcUriGetType):
3177         (webKitMediaSrcGetProtocols):
3178         (webKitMediaSrcGetUri):
3179         (webKitMediaSrcSetUri):
3180         (webKitMediaSrcUriHandlerInit):
3181         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
3182         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Removed.
3183
3184 2019-08-28  Simon Fraser  <simon.fraser@apple.com>
3185
3186         Have RenderSVGBlock compute visual overflow just like everyone else
3187         https://bugs.webkit.org/show_bug.cgi?id=201211
3188
3189         Reviewed by Zalan Bujtas.
3190
3191         RenderSVGBlock overrode visualOverflowRect() just to account for text shadow. This prevents callers
3192         optimizing calls to visualOverflowRect(), so instead have RenderSVGBlock implement computeOverflow()
3193         and call addVisualOverflow().
3194
3195         * rendering/svg/RenderSVGBlock.cpp:
3196         (WebCore::RenderSVGBlock::computeOverflow):
3197         (WebCore::RenderSVGBlock::visualOverflowRect const): Deleted.
3198         * rendering/svg/RenderSVGBlock.h:
3199
3200 2019-08-28  Ryosuke Niwa  <rniwa@webkit.org>
3201
3202         REGRESSION (r248807): Objects stored in ElementRareData are leaked
3203         https://bugs.webkit.org/show_bug.cgi?id=200954
3204
3205         Reviewed by Antti Koivisto.
3206
3207         Use a custom deleter in std::unique_ptr to call the correct destructor instead of making
3208         NodeRareData's destructor virtual. Added NodeRareData::isElementRareData to differentiate
3209         ElementRareData and NodeRareData by borrowing 1 bit from the frame count.
3210
3211         No new tests since there should be no behavioral change.
3212
3213         * dom/ElementRareData.h:
3214         (WebCore::ElementRareData::ElementRareData):
3215         * dom/Node.cpp:
3216         (WebCore::Node::materializeRareData): Call the constructors of unique_ptr directly since
3217         make_unique does not take a custom deleter. We can't add the support to makeUnique either
3218         without making it three arguments since we need to cast ElementRareData to NodeRareData
3219         in addition to specifying a custom deleter (normal casting wouldn't work due to
3220         the presence of a custom deleter).
3221         (WebCore::Node::NodeRareDataDeleter::operator() const): Added.
3222         * dom/Node.h:
3223         (WebCore::Node::NodeRareDataDeleter): Added.
3224         * dom/NodeRareData.cpp:
3225         * dom/NodeRareData.h:
3226         (WebCore::NodeRareData::NodeRareData): Makes newly added Type.
3227         (WebCore::NodeRareData::isElementRareData): Added.
3228         (WebCore::NodeRareData::~NodeRareData): Deleted.
3229
3230 2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>
3231
3232         [SOUP] Shut compilation warning
3233
3234         Unreviewed. RELEASE_LOG_ERROR() needs a channel.
3235
3236         * platform/network/soup/SoupNetworkSession.cpp:
3237         (WebCore::SoupNetworkSession::setupHSTSEnforcer):
3238
3239 2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>
3240
3241         [SOUP] Fix the debug build after r249192
3242
3243         Unreviewed build fix.
3244
3245         * platform/network/soup/SoupNetworkSession.cpp:
3246         (WebCore::SoupNetworkSession::setupHSTSEnforcer):
3247
3248 2019-08-28  Carlos Garcia Campos  <cgarcia@igalia.com>
3249
3250         Unable to enter text in https://eat.fi
3251         https://bugs.webkit.org/show_bug.cgi?id=193046
3252
3253         Reviewed by Ryosuke Niwa.
3254
3255         This is because the button element inside the label is receiving the click event, which causes the form to be
3256         submitted. According to the spec we should do nothing in this case, because button element is considered to be
3257         interactive content.
3258
3259         "The activation behavior of a label element for events targeted at interactive content descendants of a label
3260         element, and any descendants of those interactive content descendants, must be to do nothing."
3261         https://html.spec.whatwg.org/#the-label-element
3262
3263         This patch adds HTMLElement::isInteractiveContent() according to the HTML spec:
3264
3265         "Interactive content is content that is specifically intended for user interaction.
3266         a (if the href attribute is present), audio (if the controls attribute is present), button, details, embed,
3267         iframe, img (if the usemap attribute is present), input (if the type attribute is not in the Hidden state),
3268         label, object (if the usemap attribute is present), select, textarea, video (if the controls attribute is
3269         present)"
3270         https://html.spec.whatwg.org/#interactive-content-2
3271
3272         That's used in HTMLLabelElement::defaultEventHandler() using the helper method
3273         isEventTargetedAtInteractiveDescendants() to decide whether to simulate a click event or do nothing.
3274
3275         * html/HTMLAnchorElement.cpp:
3276         (WebCore::HTMLAnchorElement::isInteractiveContent const):
3277         * html/HTMLAnchorElement.h:
3278         * html/HTMLButtonElement.h:
3279         * html/HTMLDetailsElement.h:
3280         * html/HTMLElement.h:
3281         (WebCore::HTMLElement::isInteractiveContent const):
3282         * html/HTMLEmbedElement.h:
3283         * html/HTMLIFrameElement.h:
3284         * html/HTMLImageElement.cpp:
3285         (WebCore::HTMLImageElement::isInteractiveContent const):
3286         * html/HTMLImageElement.h:
3287         * html/HTMLInputElement.cpp:
3288         (WebCore::HTMLInputElement::isInteractiveContent const):
3289         * html/HTMLInputElement.h:
3290         * html/HTMLLabelElement.cpp:
3291         (WebCore::HTMLLabelElement::isEventTargetedAtInteractiveDescendants const):
3292         (WebCore::HTMLLabelElement::defaultEventHandler):
3293         * html/HTMLLabelElement.h:
3294         * html/HTMLMediaElement.cpp:
3295         (WebCore::HTMLMediaElement::isInteractiveContent const):
3296         * html/HTMLMediaElement.h:
3297         * html/HTMLObjectElement.cpp:
3298         (WebCore::HTMLObjectElement::isInteractiveContent const):
3299         * html/HTMLObjectElement.h:
3300         * html/HTMLSelectElement.h:
3301         * html/HTMLTextAreaElement.h:
3302         * html/HiddenInputType.h:
3303         * html/InputType.cpp:
3304         (WebCore::InputType::isInteractiveContent const):
3305         * html/InputType.h:
3306
3307 2019-08-28  Claudio Saavedra  <csaavedra@igalia.com>
3308
3309         [GTK][WPE] Implement HSTS for the soup network backend
3310         https://bugs.webkit.org/show_bug.cgi?id=192074
3311
3312         Reviewed by Carlos Garcia Campos.
3313
3314         libsoup 2.67.1 introduced HSTS support via a SoupSessionFeature.
3315         Add support to the soup network backend by adding the feature to
3316         SoupNetworkSession and handling HSTS protocol upgrades, by
3317         propagating the scheme change further to clients. This patch adds
3318         the HSTS feature unconditionally, but it still possible to add
3319         a boolean property to the web context class if desired.
3320
3321         Additionally, add API to the WebKitWebsiteDataManager to specify
3322         the directory where the HSTS database is saved. If the directory
3323         is not set or if the data manager is ephemeral, use a
3324         non-persistent, memory only HSTS enforcer.
3325
3326         Implement as well the methods needed to clean-up and delete HSTS
3327         policies from the storage and expose the feature in GTK+ MiniBrowser's
3328         about:data.
3329
3330         * platform/network/soup/GUniquePtrSoup.h:
3331         * platform/network/soup/SoupNetworkSession.cpp:
3332         (WebCore::hstsStorageDirectory):
3333         (WebCore::SoupNetworkSession::SoupNetworkSession):
3334         (WebCore::SoupNetworkSession::setHSTSPersistentStorage):
3335         (WebCore::SoupNetworkSession::setupHSTSEnforcer):
3336         (WebCore::SoupNetworkSession::getHostNamesWithHSTSCache):
3337         (WebCore::SoupNetworkSession::deleteHSTSCacheForHostNames):
3338         (WebCore::SoupNetworkSession::clearHSTSCache):
3339         * platform/network/soup/SoupNetworkSession.h:
3340
3341 2019-08-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3342
3343         SVG2: Add length, item getter and item setter to all SVG lists
3344         https://bugs.webkit.org/show_bug.cgi?id=199526
3345
3346         Reviewed by Simon Fraser.
3347
3348         -- Implement the SVG2 specs for SVG lists:
3349         https://svgwg.org/svg2-draft/types.html#TermListInterface.
3350
3351         -- Match the arguments' names in the IDL files with the specs.
3352
3353         Tests: svg/dom/SVGLengthList-length-indexed-access.xhtml
3354                svg/dom/SVGPathSegList-length-indexed-access.xhtml
3355
3356         * svg/SVGLengthList.idl:
3357         * svg/SVGNumberList.idl:
3358         * svg/SVGPathSegList.h:
3359         * svg/SVGPathSegList.idl:
3360         * svg/SVGPointList.idl:
3361         * svg/SVGStringList.idl:
3362         * svg/SVGTransformList.idl:
3363         * svg/properties/SVGList.h:
3364         (WebCore::SVGList::length const):
3365         (WebCore::SVGList::setItem):
3366
3367 2019-08-27  John Wilander  <wilander@apple.com>  and  Fujii Hironori  <Hironori.Fujii@sony.com>
3368
3369         Make FrameLoader::open() set outgoing referrer properly
3370         https://bugs.webkit.org/show_bug.cgi?id=167050
3371         <rdar://problem/27972404>
3372
3373         Reviewed by Youenn Fablet.
3374
3375         In debug builds, an assertion failed in WebCore::SecurityPolicy::generateReferrerHeader:
3376         ASSERTION FAILED: referrer == URL(URL(), referrer).strippedForUseAsReferrer()
3377
3378         In release builds, cached pages with a URL fragment sent its URL fragment in the referrer.
3379
3380         m_outgoingReferrer mistakenly had a URL fragment.
3381
3382         Test: http/tests/navigation/page-cache-fragment-referrer.html
3383
3384         * loader/FrameLoader.cpp:
3385         (WebCore::FrameLoader::open): Set m_outgoingReferrer by using
3386         FrameLoader::setOutgoingReferrer to remove URL fragments.
3387
3388 2019-08-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
3389
3390         Unreviewed. Build fix after r249175.
3391
3392         Fix the condition which generates the declaration of vm in
3393         GenerateGetOwnPropertySlotByIndex.
3394
3395         * bindings/scripts/CodeGeneratorJS.pm:
3396         (GenerateGetOwnPropertySlotByIndex):
3397
3398 2019-08-27  Justin Fan  <justin_fan@apple.com>
3399
3400         [WebGPU] Implement GPUErrors for and relax GPUBuffer validation rules
3401         https://bugs.webkit.org/show_bug.cgi?id=200852
3402
3403         Reviewed by Dean Jackson.
3404
3405         Fix incorrect usage validation during GPUBuffer creation.
3406         Implement GPUError reporting for GPUBuffer creation and methods.
3407
3408         Test: webgpu/buffer-errors.html
3409
3410         * Modules/webgpu/WebGPUBuffer.cpp:
3411         (WebCore::WebGPUBuffer::create):
3412         (WebCore::WebGPUBuffer::WebGPUBuffer):
3413         (WebCore::WebGPUBuffer::unmap):
3414         (WebCore::WebGPUBuffer::destroy):
3415         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
3416         * Modules/webgpu/WebGPUBuffer.h: Now inherits from GPUObjectBase.
3417         * Modules/webgpu/WebGPUDevice.cpp:
3418         (WebCore::WebGPUDevice::createBuffer const):
3419         (WebCore::WebGPUDevice::createBufferMapped const):
3420         * platform/graphics/gpu/GPUBuffer.h: No longer inherits from GPUObjectBase.
3421         * platform/graphics/gpu/GPUObjectBase.h:
3422         (WebCore::GPUObjectBase::errorScopes):
3423         (WebCore::GPUObjectBase::generateError): Deleted.
3424         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3425         (WebCore::GPUBuffer::validateBufferUsage):
3426         (WebCore::GPUBuffer::tryCreate): Alignment issue should be general WebGPU requirement.
3427         (WebCore::GPUBuffer::GPUBuffer):
3428         (WebCore::GPUBuffer::~GPUBuffer): Must do cleanup without generating errors.
3429         (WebCore::GPUBuffer::registerMappingCallback):
3430         (WebCore::GPUBuffer::copyStagingBufferToGPU):
3431         (WebCore::GPUBuffer::unmap):
3432         (WebCore::GPUBuffer::destroy):
3433
3434 2019-08-27  Zalan Bujtas  <zalan@apple.com>
3435
3436         [LFC][TFC] Layout and position the cell boxes
3437         https://bugs.webkit.org/show_bug.cgi?id=201192
3438         <rdar://problem/54758638>
3439
3440         Reviewed by Antti Koivisto.
3441
3442         Add a very basic (and faily incomplete) table cell layout logic. This is mostly WIP.
3443
3444         * Sources.txt:
3445         * WebCore.xcodeproj/project.pbxproj:
3446         * layout/FormattingContext.h:
3447         * layout/FormattingContextGeometry.cpp:
3448         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot):
3449         (WebCore::Layout::contentHeightForFormattingContextRoot): Deleted.
3450         * layout/tableformatting/TableFormattingContext.cpp:
3451         (WebCore::Layout::TableFormattingContext::layout const):
3452         (WebCore::Layout::TableFormattingContext::computedTableWidth const):
3453         * layout/tableformatting/TableFormattingContext.h:
3454         * layout/tableformatting/TableFormattingContextGeometry.cpp: Copied from Source/WebCore/layout/tableformatting/TableFormattingContext.h.
3455         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin):
3456         * layout/tableformatting/TableGrid.cpp:
3457         (WebCore::Layout::TableGrid::Column::setLogicalLeft):
3458         (WebCore::Layout::TableGrid::Column::logicalLeft const):
3459         * layout/tableformatting/TableGrid.h:
3460         (WebCore::Layout::TableGrid::Column::logicalRight const):
3461         (WebCore::Layout::TableGrid::Row::setLogicalTop):
3462         (WebCore::Layout::TableGrid::Row::logicalTop const):
3463         (WebCore::Layout::TableGrid::Row::setLogicalHeight):
3464         (WebCore::Layout::TableGrid::Row::logicalHeight const):
3465         (WebCore::Layout::TableGrid::Row::logicalBottom const):
3466
3467 2019-08-27  Mark Lam  <mark.lam@apple.com>
3468
3469         Refactor to use VM& instead of VM* at as many places as possible.
3470         https://bugs.webkit.org/show_bug.cgi?id=201172
3471
3472         Reviewed by Yusuke Suzuki.
3473
3474         No new tests.  Covered by existing tests.
3475
3476         * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
3477         (WebCore::CDMSessionClearKey::update):
3478         * Modules/plugins/QuickTimePluginReplacement.mm:
3479         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
3480         (WebCore::QuickTimePluginReplacement::installReplacement):
3481         * animation/KeyframeEffect.cpp:
3482         (WebCore::processKeyframeLikeObject):
3483         * bindings/js/GCController.cpp:
3484         (WebCore::GCController::dumpHeap):
3485         * bindings/js/IDBBindingUtilities.cpp:
3486         (WebCore::get):
3487         (WebCore::set):
3488         * bindings/js/JSCSSRuleListCustom.cpp:
3489         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
3490         * bindings/js/JSCustomElementRegistryCustom.cpp:
3491         (WebCore::JSCustomElementRegistry::define):
3492         * bindings/js/JSCustomXPathNSResolver.cpp:
3493         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3494         * bindings/js/JSDOMConvertRecord.h:
3495         * bindings/js/JSDOMConvertStrings.h:
3496         (WebCore::JSConverter<IDLDOMString>::convert):
3497         (WebCore::JSConverter<IDLByteString>::convert):
3498         (WebCore::JSConverter<IDLUSVString>::convert):
3499         * bindings/js/JSDOMWindowCustom.cpp:
3500         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3501         (WebCore::addScopedChildrenIndexes):
3502         (WebCore::JSDOMWindow::defineOwnProperty):
3503         (WebCore::DialogHandler::dialogCreated):
3504         (WebCore::DialogHandler::returnValue const):
3505         (WebCore::JSDOMWindow::setOpener):
3506         (WebCore::JSDOMWindow::setOpenDatabase):
3507         * bindings/js/JSDOMWindowProperties.cpp:
3508         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
3509         * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
3510         (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
3511         * bindings/js/JSEventListener.cpp:
3512         (WebCore::JSEventListener::handleEvent):
3513         * bindings/js/JSImageDataCustom.cpp:
3514         (WebCore::toJSNewlyCreated):
3515         * bindings/js/JSLazyEventListener.cpp:
3516         (WebCore::JSLazyEventListener::initializeJSFunction const):
3517         * bindings/js/JSLocationCustom.cpp:
3518         (WebCore::JSLocation::getOwnPropertySlotByIndex):
3519         (WebCore::JSLocation::putByIndex):
3520         * bindings/js/JSNodeListCustom.cpp:
3521         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
3522         * bindings/js/JSPluginElementFunctions.cpp:
3523         (WebCore::pluginElementCustomGetCallData):
3524         * bindings/js/JSRemoteDOMWindowCustom.cpp:
3525         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
3526         * bindings/js/ReadableStreamDefaultController.cpp:
3527         (WebCore::ReadableStreamDefaultController::invoke):
3528         * bindings/js/ScriptController.cpp:
3529         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
3530         * bindings/js/ScriptModuleLoader.cpp:
3531         (WebCore::ScriptModuleLoader::resolve):
3532         (WebCore::ScriptModuleLoader::importModule):
3533         (WebCore::ScriptModuleLoader::createImportMetaProperties):
3534         * bindings/js/SerializedScriptValue.cpp:
3535         (WebCore::CloneSerializer::CloneSerializer):
3536         (WebCore::CloneSerializer::write):
3537         (WebCore::CloneSerializer::serialize):
3538         (WebCore::CloneDeserializer::CachedString::jsString):
3539         (WebCore::CloneDeserializer::readTerminal):
3540         (WebCore::CloneDeserializer::deserialize):
3541         * bindings/js/WebCoreBuiltinNames.h:
3542         (WebCore::WebCoreBuiltinNames::WebCoreBuiltinNames):
3543         * bindings/js/WebCoreJSClientData.cpp:
3544         (WebCore::JSVMClientData::JSVMClientData):
3545         * bindings/js/WindowProxy.cpp:
3546         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
3547         * bindings/scripts/CodeGeneratorJS.pm:
3548         (GenerateGetOwnPropertySlotByIndex):
3549         (GenerateGetOwnPropertyNames):
3550         (GeneratePutByIndex):
3551         (GenerateDeletePropertyByIndex):
3552         (GenerateDictionaryImplementationContent):
3553         (addUnscopableProperties):
3554         (GenerateImplementation):
3555         (GenerateAttributeSetterBodyDefinition):
3556         (GenerateOperationDefinition):
3557         (GenerateSerializerDefinition):
3558         (GenerateCallbackImplementationContent):
3559         (GenerateConstructorHelperMethods):
3560         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3561         (WebCore::JSInterfaceNameConstructor::initializeProperties):
3562         * bindings/scripts/test/JS/JSMapLike.cpp:
3563         (WebCore::JSMapLikeConstructor::initializeProperties):
3564         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3565         (WebCore::JSReadOnlyMapLikeConstructor::initializeProperties):
3566         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3567         (WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
3568         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3569         (WebCore::JSTestCEReactionsConstructor::initializeProperties):
3570         (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter):
3571         (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter):
3572         (WebCore::setJSTestCEReactionsStringifierAttributeSetter):
3573         (WebCore::setJSTestCEReactionsAttributeWithCEReactionsNotNeededSetter):
3574         (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsNotNeededSetter):
3575         (WebCore::setJSTestCEReactionsStringifierAttributeNotNeededSetter):
3576         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3577         (WebCore::JSTestCEReactionsStringifierConstructor::initializeProperties):
3578         (WebCore::setJSTestCEReactionsStringifierValueSetter):
3579         (WebCore::setJSTestCEReactionsStringifierValueWithoutReactionsSetter):
3580         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3581         (WebCore::JSTestCallTracerConstructor::initializeProperties):
3582         (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
3583         (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
3584         (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
3585         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
3586         (WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
3587         (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
3588         (WebCore::JSTestCallbackInterface::callbackWithNoParam):
3589         (WebCore::JSTestCallbackInterface::callbackWithArrayParam):
3590         (WebCore::JSTestCallbackInterface::callbackWithSerializedScriptValueParam):
3591         (WebCore::JSTestCallbackInterface::callbackWithStringList):
3592         (WebCore::JSTestCallbackInterface::callbackWithBoolean):
3593         (WebCore::JSTestCallbackInterface::callbackRequiresThisToPass):
3594         (WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
3595         (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
3596         (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
3597         (WebCore::JSTestCallbackInterface::callbackWithThisObject):
3598         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3599         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeProperties):
3600         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3601         (WebCore::JSTestDOMJITConstructor::initializeProperties):
3602         (WebCore::jsTestDOMJITPrototypeFunctionGetAttributeWithoutTypeCheck):
3603         (WebCore::jsTestDOMJITPrototypeFunctionItemWithoutTypeCheck):
3604         (WebCore::jsTestDOMJITPrototypeFunctionHasAttributeWithoutTypeCheck):
3605         (WebCore::jsTestDOMJITPrototypeFunctionGetElementByIdWithoutTypeCheck):
3606         (WebCore::jsTestDOMJITPrototypeFunctionGetElementsByNameWithoutTypeCheck):
3607         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3608         (WebCore::JSTestEnabledBySettingConstructor::initializeProperties):
3609         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
3610         (WebCore::setJSTestEnabledBySettingTestSubObjEnabledBySettingConstructorSetter):
3611         (WebCore::setJSTestEnabledBySettingEnabledBySettingAttributeSetter):
3612         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
3613         (WebCore::JSTestEnabledForContextConstructor::initializeProperties):
3614         (WebCore::setJSTestEnabledForContextTestSubObjEnabledForContextConstructorSetter):
3615         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3616         (WebCore::convertDictionary<TestEventConstructor::Init>):
3617         (WebCore::JSTestEventConstructorConstructor::initializeProperties):
3618         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3619         (WebCore::JSTestEventTargetConstructor::initializeProperties):
3620         (WebCore::JSTestEventTarget::getOwnPropertySlotByIndex):
3621         (WebCore::JSTestEventTarget::getOwnPropertyNames):
3622         * bindings/scripts/test/JS/JSTestException.cpp:
3623         (WebCore::JSTestExceptionConstructor::initializeProperties):
3624         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3625         (WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
3626         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3627         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3628         (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
3629         (WebCore::setJSTestGlobalObjectRegularAttributeSetter):
3630         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttributeSetter):
3631         (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttributeSetter):
3632         (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttributeSetter):
3633         (WebCore::setJSTestGlobalObjectTestCEReactionsConstructorSetter):
3634         (WebCore::setJSTestGlobalObjectTestCEReactionsStringifierConstructorSetter):
3635         (WebCore::setJSTestGlobalObjectTestCallTracerConstructorSetter):
3636         (WebCore::setJSTestGlobalObjectTestCallbackInterfaceConstructorSetter):
3637         (WebCore::setJSTestGlobalObjectTestClassWithJSBuiltinConstructorConstructorSetter):
3638         (WebCore::setJSTestGlobalObjectTestDOMJITConstructorSetter):
3639         (WebCore::setJSTestGlobalObjectTestDomainSecurityConstructorSetter):
3640         (WebCore::setJSTestGlobalObjectTestEnabledBySettingConstructorSetter):
3641         (WebCore::setJSTestGlobalObjectTestEnabledForContextConstructorSetter):
3642         (WebCore::setJSTestGlobalObjectTestEventConstructorConstructorSetter):
3643         (WebCore::setJSTestGlobalObjectTestEventTargetConstructorSetter):
3644         (WebCore::setJSTestGlobalObjectTestExceptionConstructorSetter):
3645         (WebCore::setJSTestGlobalObjectTestGenerateIsReachableConstructorSetter):
3646         (WebCore::setJSTestGlobalObjectTestGlobalObjectConstructorSetter):
3647         (WebCore::setJSTestGlobalObjectTestIndexedSetterNoIdentifierConstructorSetter):
3648         (WebCore::setJSTestGlobalObjectTestIndexedSetterThrowingExceptionConstructorSetter):
3649         (WebCore::setJSTestGlobalObjectTestIndexedSetterWithIdentifierConstructorSetter):
3650         (WebCore::setJSTestGlobalObjectTestInterfaceConstructorSetter):
3651         (WebCore::setJSTestGlobalObjectTestInterfaceLeadingUnderscoreConstructorSetter):
3652         (WebCore::setJSTestGlobalObjectTestIterableConstructorSetter):
3653         (WebCore::setJSTestGlobalObjectTestJSBuiltinConstructorConstructorSetter):
3654         (WebCore::setJSTestGlobalObjectTestMapLikeConstructorSetter):
3655         (WebCore::setJSTestGlobalObjectTestMediaQueryListListenerConstructorSetter):
3656         (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterNoIdentifierConstructorSetter):
3657         (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterThrowingExceptionConstructorSetter):
3658         (WebCore::setJSTestGlobalObjectTestNamedAndIndexedSetterWithIdentifierConstructorSetter):
3659         (WebCore::setJSTestGlobalObjectTestNamedConstructorConstructorSetter):
3660         (WebCore::setJSTestGlobalObjectAudioConstructorSetter):
3661         (WebCore::setJSTestGlobalObjectTestNamedDeleterNoIdentifierConstructorSetter):
3662         (WebCore::setJSTestGlobalObjectTestNamedDeleterThrowingExceptionConstructorSetter):
3663         (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIdentifierConstructorSetter):
3664         (WebCore::setJSTestGlobalObjectTestNamedDeleterWithIndexedGetterConstructorSetter):
3665         (WebCore::setJSTestGlobalObjectTestNamedGetterCallWithConstructorSetter):
3666         (WebCore::setJSTestGlobalObjectTestNamedGetterNoIdentifierConstructorSetter):
3667         (WebCore::setJSTestGlobalObjectTestNamedGetterWithIdentifierConstructorSetter):
3668         (WebCore::setJSTestGlobalObjectTestNamedSetterNoIdentifierConstructorSetter):
3669         (WebCore::setJSTestGlobalObjectTestNamedSetterThrowingExceptionConstructorSetter):
3670         (WebCore::setJSTestGlobalObjectTestNamedSetterWithIdentifierConstructorSetter):
3671         (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterConstructorSetter):
3672         (WebCore::setJSTestGlobalObjectTestNamedSetterWithIndexedGetterAndSetterConstructorSetter):
3673         (WebCore::setJSTestGlobalObjectTestNamedSetterWithOverrideBuiltinsConstructorSetter):
3674         (WebCore::setJSTestGlobalObjectTestNamedSetterWithUnforgablePropertiesConstructorSetter):
3675         (WebCore::setJSTestGlobalObjectTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructorSetter):
3676         (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsConstructorSetter):
3677         (WebCore::setJSTestGlobalObjectTestOverloadedConstructorsWithSequenceConstructorSetter):
3678         (WebCore::setJSTestGlobalObjectTestOverrideBuiltinsConstructorSetter):
3679         (WebCore::setJSTestGlobalObjectTestPluginInterfaceConstructorSetter):
3680         (WebCore::setJSTestGlobalObjectTestReadOnlyMapLikeConstructorSetter):
3681         (WebCore::setJSTestGlobalObjectTestReportExtraMemoryCostConstructorSetter):
3682         (WebCore::setJSTestGlobalObjectTestSerializationConstructorSetter):
3683         (WebCore::setJSTestGlobalObjectTestSerializationIndirectInheritanceConstructorSetter):
3684         (WebCore::setJSTestGlobalObjectTestSerializationInheritConstructorSetter):
3685         (WebCore::setJSTestGlobalObjectTestSerializationInheritFinalConstructorSetter):
3686         (WebCore::setJSTestGlobalObjectTestSerializedScriptValueInterfaceConstructorSetter):
3687         (WebCore::setJSTestGlobalObjectTestStringifierConstructorSetter):
3688         (WebCore::setJSTestGlobalObjectTestStringifierAnonymousOperationConstructorSetter):
3689         (WebCore::setJSTestGlobalObjectTestStringifierNamedOperationConstructorSetter):
3690         (WebCore::setJSTestGlobalObjectTestStringifierOperationImplementedAsConstructorSetter):
3691         (WebCore::setJSTestGlobalObjectTestStringifierOperationNamedToStringConstructorSetter):
3692         (WebCore::setJSTestGlobalObjectTestStringifierReadOnlyAttributeConstructorSetter):
3693         (WebCore::setJSTestGlobalObjectTestStringifierReadWriteAttributeConstructorSetter):
3694         (WebCore::setJSTestGlobalObjectTestTypedefsConstructorSetter):
3695         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3696         (WebCore::JSTestIndexedSetterNoIdentifierConstructor::initializeProperties):
3697         (WebCore::JSTestIndexedSetterNoIdentifier::getOwnPropertyNames):
3698         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3699         (WebCore::JSTestIndexedSetterThrowingExceptionConstructor::initializeProperties):
3700         (WebCore::JSTestIndexedSetterThrowingException::getOwnPropertyNames):
3701         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3702         (WebCore::JSTestIndexedSetterWithIdentifierConstructor::initializeProperties):
3703         (WebCore::JSTestIndexedSetterWithIdentifier::getOwnPropertyNames):
3704         * bindings/scripts/test/JS/JSTestInterface.cpp:
3705         (WebCore::JSTestInterfaceConstructor::initializeProperties):
3706         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttrSetter):
3707         (WebCore::setJSTestInterfaceImplementsStr2Setter):
3708         (WebCore::setJSTestInterfaceImplementsStr3Setter):
3709         (WebCore::setJSTestInterfaceImplementsNodeSetter):
3710         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttrSetter):
3711         (WebCore::setJSTestInterfaceSupplementalStr2Setter):
3712         (WebCore::setJSTestInterfaceSupplementalStr3Setter):
3713         (WebCore::setJSTestInterfaceSupplementalNodeSetter):
3714         (WebCore::setJSTestInterfaceReflectAttributeSetter):
3715         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3716         (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
3717         * bindings/scripts/test/JS/JSTestIterable.cpp:
3718         (WebCore::JSTestIterableConstructor::initializeProperties):
3719         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3720         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
3721         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustomSetter):
3722         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3723         (WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
3724         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3725         (WebCore::JSTestNamedAndIndexedSetterNoIdentifierConstructor::initializeProperties):
3726         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertySlotByIndex):
3727         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::getOwnPropertyNames):
3728         (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::putByIndex):
3729         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3730         (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionConstructor::initializeProperties):
3731         (WebCore::JSTestNamedAndIndexedSetterThrowingException::getOwnPropertySlotByIndex):
3732         (WebCore::JSTestNamedAndIndexedSetterThrowingException::getOwnPropertyNames):
3733         (WebCore::JSTestNamedAndIndexedSetterThrowingException::putByIndex):
3734         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3735         (WebCore::JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties):
3736         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlotByIndex):
3737         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertyNames):
3738         (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::putByIndex):
3739         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3740         (WebCore::JSTestNamedConstructorConstructor::initializeProperties):
3741         (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
3742         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3743         (WebCore::JSTestNamedDeleterNoIdentifierConstructor::initializeProperties):
3744         (WebCore::JSTestNamedDeleterNoIdentifier::getOwnPropertySlotByIndex):
3745         (WebCore::JSTestNamedDeleterNoIdentifier::getOwnPropertyNames):
3746         (WebCore::JSTestNamedDeleterNoIdentifier::deletePropertyByIndex):
3747         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3748         (WebCore::JSTestNamedDeleterThrowingExceptionConstructor::initializeProperties):
3749         (WebCore::JSTestNamedDeleterThrowingException::getOwnPropertySlotByIndex):
3750         (WebCore::JSTestNamedDeleterThrowingException::getOwnPropertyNames):
3751         (WebCore::JSTestNamedDeleterThrowingException::deletePropertyByIndex):
3752         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3753         (WebCore::JSTestNamedDeleterWithIdentifierConstructor::initializeProperties):
3754         (WebCore::JSTestNamedDeleterWithIdentifier::getOwnPropertySlotByIndex):
3755         (WebCore::JSTestNamedDeleterWithIdentifier::getOwnPropertyNames):
3756         (WebCore::JSTestNamedDeleterWithIdentifier::deletePropertyByIndex):
3757         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3758         (WebCore::JSTestNamedDeleterWithIndexedGetterConstructor::initializeProperties):
3759         (WebCore::JSTestNamedDeleterWithIndexedGetter::getOwnPropertySlotByIndex):
3760         (WebCore::JSTestNamedDeleterWithIndexedGetter::getOwnPropertyNames):
3761         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3762         (WebCore::JSTestNamedGetterCallWithConstructor::initializeProperties):
3763         (WebCore::JSTestNamedGetterCallWith::getOwnPropertySlotByIndex):
3764         (WebCore::JSTestNamedGetterCallWith::getOwnPropertyNames):
3765         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3766         (WebCore::JSTestNamedGetterNoIdentifierConstructor::initializeProperties):
3767         (WebCore::JSTestNamedGetterNoIdentifier::getOwnPropertySlotByIndex):
3768         (WebCore::JSTestNamedGetterNoIdentifier::getOwnPropertyNames):
3769         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3770         (WebCore::JSTestNamedGetterWithIdentifierConstructor::initializeProperties):
3771         (WebCore::JSTestNamedGetterWithIdentifier::getOwnPropertySlotByIndex):
3772         (WebCore::JSTestNamedGetterWithIdentifier::getOwnPropertyNames):
3773         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3774         (WebCore::JSTestNamedSetterNoIdentifierConstructor::initializeProperties):
3775         (WebCore::JSTestNamedSetterNoIdentifier::getOwnPropertySlotByIndex):
3776         (WebCore::JSTestNamedSetterNoIdentifier::getOwnPropertyNames):
3777         (WebCore::JSTestNamedSetterNoIdentifier::putByIndex):
3778         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3779         (WebCore::JSTestNamedSetterThrowingExceptionConstructor::initializeProperties):
3780         (WebCore::JSTestNamedSetterThrowingException::getOwnPropertySlotByIndex):
3781         (WebCore::JSTestNamedSetterThrowingException::getOwnPropertyNames):
3782         (WebCore::JSTestNamedSetterThrowingException::putByIndex):
3783         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3784         (WebCore::JSTestNamedSetterWithIdentifierConstructor::initializeProperties):
3785         (WebCore::JSTestNamedSetterWithIdentifier::getOwnPropertySlotByIndex):
3786         (WebCore::JSTestNamedSetterWithIdentifier::getOwnPropertyNames):
3787         (WebCore::JSTestNamedSetterWithIdentifier::putByIndex):
3788         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3789         (WebCore::JSTestNamedSetterWithIndexedGetterConstructor::initializeProperties):
3790         (WebCore::JSTestNamedSetterWithIndexedGetter::getOwnPropertySlotByIndex):
3791         (WebCore::JSTestNamedSetterWithIndexedGetter::getOwnPropertyNames):
3792         (WebCore::JSTestNamedSetterWithIndexedGetter::putByIndex):
3793         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3794         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterConstructor::initializeProperties):
3795         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertySlotByIndex):
3796         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::getOwnPropertyNames):
3797         (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::putByIndex):
3798         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3799         (WebCore::JSTestNamedSetterWithOverrideBuiltinsConstructor::initializeProperties):
3800         (WebCore::JSTestNamedSetterWithOverrideBuiltins::getOwnPropertySlotByIndex):
3801         (WebCore::JSTestNamedSetterWithOverrideBuiltins::getOwnPropertyNames):
3802         (WebCore::JSTestNamedSetterWithOverrideBuiltins::putByIndex):
3803         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3804         (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::initializeProperties):
3805         (WebCore::JSTestNamedSetterWithUnforgableProperties::getOwnPropertySlotByIndex):
3806         (WebCore::JSTestNamedSetterWithUnforgableProperties::getOwnPropertyNames):
3807         (WebCore::JSTestNamedSetterWithUnforgableProperties::putByIndex):
3808         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3809         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::initializeProperties):
3810         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlotByIndex):
3811         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertyNames):
3812         (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::putByIndex):
3813         * bindings/scripts/test/JS/JSTestNode.cpp:
3814         (WebCore::JSTestNodeConstructor::initializeProperties):
3815         (WebCore::JSTestNodePrototype::finishCreation):
3816         (WebCore::setJSTestNodeNameSetter):
3817         (WebCore::JSTestNode::serialize):
3818         * bindings/scripts/test/JS/JSTestObj.cpp:
3819         (WebCore::convertDictionary<TestObj::Dictionary>):
3820         (WebCore::convertDictionaryToJS):
3821         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
3822         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
3823         (WebCore::convertDictionary<AlternateDictionaryName>):
3824         (WebCore::convertDictionary<TestObj::ParentDictionary>):
3825         (WebCore::convertDictionary<TestObj::ChildDictionary>):
3826         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
3827         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
3828         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
3829         (WebCore::JSTestObjConstructor::initializeProperties):
3830         (WebCore::JSTestObjPrototype::finishCreation):
3831         (WebCore::JSTestObj::getOwnPropertyNames):
3832         (WebCore::setJSTestObjConstructorStaticStringAttrSetter):
3833         (WebCore::setJSTestObjEnumAttrSetter):
3834         (WebCore::setJSTestObjByteAttrSetter):
3835         (WebCore::setJSTestObjOctetAttrSetter):
3836         (WebCore::setJSTestObjShortAttrSetter):
3837         (WebCore::setJSTestObjClampedShortAttrSetter):
3838         (WebCore::setJSTestObjEnforceRangeShortAttrSetter):
3839         (WebCore::setJSTestObjUnsignedShortAttrSetter):
3840         (WebCore::setJSTestObjLongAttrSetter):
3841         (WebCore::setJSTestObjLongLongAttrSetter):
3842         (WebCore::setJSTestObjUnsignedLongLongAttrSetter):
3843         (WebCore::setJSTestObjStringAttrSetter):
3844         (WebCore::setJSTestObjUsvstringAttrSetter):
3845         (WebCore::setJSTestObjTestObjAttrSetter):
3846         (WebCore::setJSTestObjTestNullableObjAttrSetter):
3847         (WebCore::setJSTestObjLenientTestObjAttrSetter):
3848         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyStringSetter):
3849         (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyStringSetter):
3850         (WebCore::setJSTestObjByteStringAttrTreatingNullAsEmptyStringSetter):
3851         (WebCore::setJSTestObjStringLongRecordAttrSetter):
3852         (WebCore::setJSTestObjUsvstringLongRecordAttrSetter):
3853         (WebCore::setJSTestObjStringObjRecordAttrSetter):
3854         (WebCore::setJSTestObjStringNullableObjRecordAttrSetter):
3855         (WebCore::setJSTestObjDictionaryAttrSetter):
3856         (WebCore::setJSTestObjNullableDictionaryAttrSetter):
3857         (WebCore::setJSTestObjAnnotatedTypeInUnionAttrSetter):
3858         (WebCore::setJSTestObjAnnotatedTypeInSequenceAttrSetter):
3859         (WebCore::setJSTestObjImplementationEnumAttrSetter):
3860         (WebCore::setJSTestObjXMLObjAttrSetter):
3861         (WebCore::setJSTestObjCreateSetter):
3862         (WebCore::setJSTestObjReflectedStringAttrSetter):
3863         (WebCore::setJSTestObjReflectedUSVStringAttrSetter):
3864         (WebCore::setJSTestObjReflectedIntegralAttrSetter):
3865         (WebCore::setJSTestObjReflectedUnsignedIntegralAttrSetter):
3866         (WebCore::setJSTestObjReflectedBooleanAttrSetter):
3867         (WebCore::setJSTestObjReflectedURLAttrSetter):
3868         (WebCore::setJSTestObjReflectedUSVURLAttrSetter):
3869         (WebCore::setJSTestObjReflectedCustomIntegralAttrSetter):
3870         (WebCore::setJSTestObjReflectedCustomBooleanAttrSetter):
3871         (WebCore::setJSTestObjReflectedCustomURLAttrSetter):
3872         (WebCore::setJSTestObjEnabledAtRuntimeAttributeSetter):
3873         (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter):
3874         (WebCore::setJSTestObjTypedArrayAttrSetter):
3875         (WebCore::setJSTestObjCustomAttrSetter):
3876         (WebCore::setJSTestObjOnfooSetter):
3877         (WebCore::setJSTestObjOnwebkitfooSetter):
3878         (WebCore::setJSTestObjWithExecStateAttributeSetter):