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