Rename StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32)...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-08-13  Sam Weinig  <weinig@apple.com>
2
3         Rename StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32) to avoid accidental change in behavior when replacing append with flexibleAppend
4         https://bugs.webkit.org/show_bug.cgi?id=200675
5
6         Reviewed by Darin Adler.
7
8         * bindings/js/JSDOMConvertStrings.cpp:
9         (WebCore::stringToUSVString):
10         * css/CSSMarkup.cpp:
11         (WebCore::serializeCharacter):
12         (WebCore::serializeIdentifier):
13         (WebCore::serializeString):
14         * css/parser/CSSTokenizer.cpp:
15         (WebCore::CSSTokenizer::consumeStringTokenUntil):
16         (WebCore::CSSTokenizer::consumeUrlToken):
17         (WebCore::CSSTokenizer::consumeName):
18         * html/parser/HTMLEntityParser.cpp:
19         (WebCore::HTMLEntityParser::consumeNamedEntity):
20         * platform/mock/mediasource/MockBox.cpp:
21         (WebCore::MockBox::peekType):
22         (WebCore::MockTrackBox::MockTrackBox):
23         * rendering/RenderText.cpp:
24         (WebCore::capitalize):
25         * xml/parser/CharacterReferenceParserInlines.h:
26         (WebCore::consumeCharacterReference):
27         Update for rename from StringBuilder::append(UChar32) to StringBuilder::appendCharacter(UChar32).
28
29 2019-08-13  Saam Barati  <sbarati@apple.com>
30
31         [WHLSL] Make lexing faster
32         https://bugs.webkit.org/show_bug.cgi?id=200596
33
34         Reviewed by Myles C. Maxfield.
35
36         Previously, our lexer would just branch on a series of string compares.
37         We'd have code like this to match keywords:
38         ```
39         ...
40         if (matchCurrent("false"))
41             return FalseToken;
42         if (matchCurrent("true"))
43             return TrueToken;
44         ...
45         ```
46         
47         However, this is extremely inefficient. We now lex using a trie, which means
48         we never backtrack in the lexer.
49         
50         This patch is a 3ms speedup in compute_boids.
51
52         Tests: webgpu/whlsl/lexing.html
53                webgpu/whlsl/literals.html
54
55         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
56         (WebCore::WHLSL::isValidIdentifierStart):
57         (WebCore::WHLSL::isValidNonStartingIdentifierChar):
58         (WebCore::WHLSL::isHexadecimalCharacter):
59         (WebCore::WHLSL::isDigit):
60         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
61         (WebCore::WHLSL::Lexer::recognizeKeyword): Deleted.
62         (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const): Deleted.
63         (WebCore::WHLSL::Lexer::decimalIntLiteral const): Deleted.
64         (WebCore::WHLSL::Lexer::decimalUintLiteral const): Deleted.
65         (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const): Deleted.
66         (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const): Deleted.
67         (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const): Deleted.
68         (WebCore::WHLSL::Lexer::intLiteral const): Deleted.
69         (WebCore::WHLSL::Lexer::uintLiteral const): Deleted.
70         (WebCore::WHLSL::Lexer::digit const): Deleted.
71         (WebCore::WHLSL::Lexer::digitStar const): Deleted.
72         (WebCore::WHLSL::Lexer::character const): Deleted.
73         (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const): Deleted.
74         (WebCore::WHLSL::Lexer::coreFloatLiteral const): Deleted.
75         (WebCore::WHLSL::Lexer::floatLiteral const): Deleted.
76         (WebCore::WHLSL::Lexer::validIdentifier const): Deleted.
77         (WebCore::WHLSL::Lexer::identifier const): Deleted.
78         (WebCore::WHLSL::Lexer::completeOperatorName const): Deleted.
79         * Modules/webgpu/WHLSL/WHLSLLexer.h:
80         (WebCore::WHLSL::Lexer::string const): Deleted.
81
82 2019-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
83
84         shouldRespectImageOrientation should be a value in ImageOrientation
85         https://bugs.webkit.org/show_bug.cgi?id=200553
86
87         Reviewed by Simon Fraser.
88
89         This patch is a step towards implementing the css image-orientation.
90
91         Instead of having ImageOrientationEnum, ImageOrientationDescription,
92         ImageOrientation and RespectImageOrientationEnum we are going to have a
93         single structure named 'ImageOrientation' which is a wrapper for the enum
94         type "Orientation".
95
96         This structure will have a constructor and casting operator such that
97         assigning an enum value and comparing with an enum value will be done
98         implicitly.
99
100         RespectImageOrientation is represented as a new enum value 'FromImage'.
101
102         * Sources.txt:
103         * WebCore.xcodeproj/project.pbxproj:
104         * css/CSSPrimitiveValueMappings.h:
105         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
106         (WebCore::CSSPrimitiveValue::operator ImageOrientation const):
107         (WebCore::CSSPrimitiveValue::operator ImageOrientationEnum const): Deleted.
108         * dom/DataTransfer.cpp:
109         (WebCore::DataTransfer::createDragImage const):
110         * html/HTMLCanvasElement.cpp:
111         (WebCore::HTMLCanvasElement::paint):
112         * loader/cache/CachedImage.cpp:
113         (WebCore::CachedImage::imageSizeForRenderer const):
114         * page/DragController.cpp:
115         (WebCore::DragController::doImageDrag):
116         * platform/DragImage.cpp:
117         (WebCore::createDragImageFromSnapshot):
118         (WebCore::createDragImageFromImage):
119         * platform/DragImage.h:
120         * platform/graphics/BitmapImage.cpp:
121         (WebCore::BitmapImage::draw):
122         (WebCore::BitmapImage::drawPattern):
123         * platform/graphics/BitmapImage.h:
124         * platform/graphics/CrossfadeGeneratedImage.cpp:
125         (WebCore::CrossfadeGeneratedImage::draw):
126         * platform/graphics/CrossfadeGeneratedImage.h:
127         * platform/graphics/CustomPaintImage.cpp:
128         (WebCore::CustomPaintImage::draw):
129         * platform/graphics/CustomPaintImage.h:
130         * platform/graphics/GeneratedImage.h:
131         * platform/graphics/GradientImage.cpp:
132         (WebCore::GradientImage::draw):
133         * platform/graphics/GradientImage.h:
134         * platform/graphics/GraphicsContext.cpp:
135         (WebCore::GraphicsContext::drawImage):
136         (WebCore::GraphicsContext::drawTiledImage):
137         * platform/graphics/GraphicsContext.h:
138         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
139         * platform/graphics/GraphicsContextImpl.cpp:
140         (WebCore::GraphicsContextImpl::drawImageImpl):
141         (WebCore::GraphicsContextImpl::drawTiledImageImpl):
142         * platform/graphics/Image.cpp:
143         (WebCore::Image::drawTiled):
144         * platform/graphics/Image.h:
145         * platform/graphics/ImageFrame.h:
146         * platform/graphics/ImageOrientation.cpp: Removed.
147         * platform/graphics/ImageOrientation.h:
148         (WebCore::ImageOrientation::ImageOrientation):
149         (WebCore::ImageOrientation::fromEXIFValue):
150         (WebCore::ImageOrientation::operator Orientation const):
151         (WebCore::ImageOrientation::usesWidthAsHeight const):
152         (WebCore::ImageOrientation::transformFromDefault const):
153         (WebCore::ImageOrientation::isValidOrientation):
154         (WebCore::ImageOrientation::isValidEXIFOrientation):
155         (WebCore::ImageOrientationDescription::ImageOrientationDescription): Deleted.
156         (WebCore::ImageOrientationDescription::setRespectImageOrientation): Deleted.
157         (WebCore::ImageOrientationDescription::respectImageOrientation): Deleted.
158         (WebCore::ImageOrientationDescription::setImageOrientationEnum): Deleted.
159         (WebCore::ImageOrientationDescription::imageOrientation): Deleted.
160         (WebCore::ImageOrientation::operator ImageOrientationEnum const): Deleted.
161         (WebCore::ImageOrientation::operator== const): Deleted.
162         (WebCore::ImageOrientation::operator!= const): Deleted.
163         * platform/graphics/ImageSource.cpp:
164         (WebCore::ImageSource::dump):
165         * platform/graphics/NamedImageGeneratedImage.cpp:
166         (WebCore::NamedImageGeneratedImage::draw):
167         * platform/graphics/NamedImageGeneratedImage.h:
168         * platform/graphics/NativeImage.h:
169         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
170         (WebCore::ImageDecoderAVFObjC::frameOrientationAtIndex const):
171         * platform/graphics/cairo/CairoOperations.cpp:
172         (WebCore::Cairo::drawShadowLayerBuffer):
173         (WebCore::Cairo::drawShadowImage):
174         (WebCore::Cairo::drawNativeImage):
175         * platform/graphics/cairo/ImageBufferCairo.cpp:
176         (WebCore::ImageBuffer::draw):
177         * platform/graphics/cairo/NativeImageCairo.cpp:
178         (WebCore::drawNativeImage):
179         * platform/graphics/cg/GraphicsContextCG.cpp:
180         (WebCore::GraphicsContext::drawNativeImage):
181         * platform/graphics/cg/ImageDecoderCG.cpp:
182         (WebCore::orientationFromProperties):
183         (WebCore::ImageDecoderCG::frameOrientationAtIndex const):
184         * platform/graphics/cg/NativeImageCG.cpp:
185         (WebCore::drawNativeImage):
186         * platform/graphics/cg/PDFDocumentImage.cpp:
187         (WebCore::PDFDocumentImage::draw):
188         * platform/graphics/cg/PDFDocumentImage.h:
189         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
190         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
191         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
192         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
193         (WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
194         (WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
195         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
196         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
197         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
198         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
199         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
200         * platform/graphics/win/Direct2DOperations.cpp:
201         (WebCore::Direct2D::drawNativeImage):
202         * platform/graphics/win/ImageCGWin.cpp:
203         (WebCore::BitmapImage::getHBITMAPOfSize):
204         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
205         * platform/graphics/win/ImageCairoWin.cpp:
206         (WebCore::BitmapImage::getHBITMAPOfSize):
207         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
208         * platform/graphics/win/ImageDecoderDirect2D.cpp:
209         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
210         * platform/graphics/win/ImageDirect2D.cpp:
211         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
212         * platform/graphics/win/NativeImageDirect2D.cpp:
213         (WebCore::drawNativeImage):
214         * platform/gtk/DragImageGtk.cpp:
215         (WebCore::createDragImageFromImage):
216         * platform/image-decoders/ScalableImageDecoderFrame.h:
217         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
218         (WebCore::readImageOrientation):
219         * platform/ios/DragImageIOS.mm:
220         (WebCore::createDragImageFromImage):
221         * platform/mac/DragImageMac.mm:
222         (WebCore::createDragImageFromImage):
223         * platform/win/DragImageCGWin.cpp:
224         (WebCore::createDragImageFromImage):
225         * platform/win/DragImageCairoWin.cpp:
226         (WebCore::createDragImageFromImage):
227         * platform/win/DragImageDirect2D.cpp:
228         (WebCore::createDragImageFromImage):
229         * rendering/RenderBoxModelObject.cpp:
230         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
231         * rendering/RenderElement.cpp:
232         (WebCore::RenderElement::imageOrientation const):
233         (WebCore::RenderElement::shouldRespectImageOrientation const): Deleted.
234         * rendering/RenderElement.h:
235         * rendering/RenderEmbeddedObject.cpp:
236         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
237         * rendering/RenderImage.cpp:
238         (WebCore::RenderImage::paintReplaced):
239         (WebCore::RenderImage::paintIntoRect):
240         * rendering/RenderLayerBacking.cpp:
241         (WebCore::RenderLayerBacking::isDirectlyCompositedImage const):
242         * rendering/RenderSnapshottedPlugIn.cpp:
243         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
244         * rendering/style/RenderStyle.h:
245         (WebCore::RenderStyle::setImageOrientation):
246         (WebCore::RenderStyle::initialImageOrientation):
247         (WebCore::RenderStyle::imageOrientation const):
248         * rendering/style/StyleRareInheritedData.h:
249         * svg/graphics/SVGImage.cpp:
250         (WebCore::SVGImage::drawForContainer):
251         (WebCore::SVGImage::nativeImageForCurrentFrame):
252         (WebCore::SVGImage::nativeImage):
253         (WebCore::SVGImage::draw):
254         * svg/graphics/SVGImage.h:
255         * svg/graphics/SVGImageForContainer.cpp:
256         (WebCore::SVGImageForContainer::draw):
257         * svg/graphics/SVGImageForContainer.h:
258
259 2019-08-13  Robin Morisset  <rmorisset@apple.com>
260
261         [WHLSL] Move Qualifiers and Semantic from VariableDeclaration to VariableDeclaration::RareData
262         https://bugs.webkit.org/show_bug.cgi?id=200696
263
264         Reviewed by Myles C. Maxfield.
265
266         Shrinking VariableDeclaration by 16 bytes in the common case.
267
268         No new tests as there is no intended functional change.
269
270         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
271
272 2019-08-13  Robin Morisset  <rmorisset@apple.com>
273
274         [WHLSL] Don't generate empty comma expressions for bare ';'
275         https://bugs.webkit.org/show_bug.cgi?id=200681
276
277         Reviewed by Myles C. Maxfield.
278
279         Currently we emit a comma expression with no sub-expression for bare ';', as well as for the initialization of for loops with no initializers.
280         This crashes the Checker, as it tries to access the last sub-expression of comma expressions.
281         Instead we should generate an empty statement block for that case.
282
283         This problem was found (and originally fixed before the commit was reverted) in https://bugs.webkit.org/show_bug.cgi?id=199726.
284         I am just isolating the fix here for easier review and debugging.
285
286         New test: LayoutTests/webgpu/whlsl/for-loop.html
287
288         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
289         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
290         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
291         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
292         (WebCore::WHLSL::ASTDumper::visit):
293         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
294         (WebCore::WHLSL::Checker::visit):
295         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
296         (WebCore::WHLSL::Parser::parseForLoop):
297         (WebCore::WHLSL::Parser::parseStatement):
298         (WebCore::WHLSL::Parser::parseEffectfulExpression):
299         * Modules/webgpu/WHLSL/WHLSLParser.h:
300         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
301         (WebCore::WHLSL::Visitor::visit):
302
303 2019-08-13  Daniel Bates  <dabates@apple.com>
304
305         Focus rings are black
306         https://bugs.webkit.org/show_bug.cgi?id=200593
307         <rdar://problem/54145925>
308
309         Reviewed by Wenson Hsieh.
310
311         Work around <rdar://problem/50838886> and make focus rings a pretty blue.
312
313         * rendering/RenderThemeIOS.mm:
314         (WebCore::RenderThemeIOS::platformFocusRingColor const):
315
316 2019-08-13  Zalan Bujtas  <zalan@apple.com>
317
318         [ContentChangeObserver] adjustStateAndNotifyContentChangeIfNeeded should check isObservationTimeWindowActive()
319         https://bugs.webkit.org/show_bug.cgi?id=200687
320         <rdar://problem/54271221>
321
322         Reviewed by Simon Fraser.
323
324         Move the check to adjustStateAndNotifyContentChangeIfNeeded.
325
326         * page/ios/ContentChangeObserver.cpp:
327         (WebCore::ContentChangeObserver::adjustObservedState):
328
329 2019-08-13  John Wilander  <wilander@apple.com>
330
331         Resource Load Statistics: Switch NSURLSession on top navigation to prevalent resource with user interaction
332         https://bugs.webkit.org/show_bug.cgi?id=200642
333         <rdar://problem/53962073>
334
335         Reviewed by Alex Christensen.
336
337         Tests: http/tests/resourceLoadStatistics/do-not-switch-session-on-navigation-to-prevalent-without-interaction.html
338                http/tests/resourceLoadStatistics/switch-session-on-navigation-to-prevalent-with-interaction.html
339
340         This patch splits m_registrableDomainsToBlockCookieFor in WebCore:NetworkStorageSession into:
341         - m_registrableDomainsToBlockAndDeleteCookiesFor
342         - m_registrableDomainsToBlockButKeepCookiesFor
343         ... to support different network load policies based on this distinction.
344
345         * page/RuntimeEnabledFeatures.h:
346         (WebCore::RuntimeEnabledFeatures::setITPSessionSwitchingEnabled):
347         (WebCore::RuntimeEnabledFeatures::itpSessionSwitchingEnabled const):
348         * page/Settings.yaml:
349         * platform/network/NetworkStorageSession.cpp:
350         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
351         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookiesButKeepFirstPartyCookiesFor const):
352         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockAndDeleteCookiesFor):
353         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockButKeepCookiesFor):
354         (WebCore::NetworkStorageSession::removePrevalentDomains):
355         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
356         * platform/network/NetworkStorageSession.h:
357
358 2019-08-13  Zalan Bujtas  <zalan@apple.com>
359
360         [ContentChangeObserver] setShouldObserveDOMTimerScheduling and setShouldObserveTransitions are always called in pairs.
361         https://bugs.webkit.org/show_bug.cgi?id=200685
362         <rdar://problem/54269778>
363
364         Reviewed by Simon Fraser.
365
366         Let's merge these 2 functions.
367
368         * page/ios/ContentChangeObserver.cpp:
369         (WebCore::ContentChangeObserver::stopObservingPendingActivities):
370         (WebCore::ContentChangeObserver::adjustObservedState):
371         * page/ios/ContentChangeObserver.h:
372         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
373         (WebCore::ContentChangeObserver::isObservingContentChanges const):
374         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerSchedulingAndTransitions):
375         (WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling): Deleted.
376         (WebCore::ContentChangeObserver::setShouldObserveTransitions): Deleted.
377
378 2019-08-13  Zalan Bujtas  <zalan@apple.com>
379
380         [ContentChangeObserver] Scope events in adjustObservedState
381         https://bugs.webkit.org/show_bug.cgi?id=200679
382         <rdar://problem/54266172>
383
384         Reviewed by Simon Fraser.
385
386         This is in preparation for simplifying adjustObservedState.
387
388         * page/ios/ContentChangeObserver.cpp:
389         (WebCore::ContentChangeObserver::didFinishTransition):
390         (WebCore::ContentChangeObserver::adjustObservedState):
391         * page/ios/ContentChangeObserver.h:
392
393 2019-08-13  Justin Fan  <justin_fan@apple.com>
394
395         [WebGPU] Improve GPUBindGroup performance using one device-shared argument MTLBuffer
396         https://bugs.webkit.org/show_bug.cgi?id=200606
397
398         Reviewed by Myles C. Maxfield.
399
400         Manage all argument buffer storage for GPUBindGroups in one large MTLBuffer for a GPUDevice.
401         Vastly improves GPUProgrammablePassEncoder.setBindGroup performance; in alpha MotionMark WebGPU benchmark,
402         score improves from ~12000 to ~90000.
403
404         No expected change in WebGPU behavior, though bind-groups.html has been updated to cover more cases.
405
406         * Modules/webgpu/WebGPUDevice.cpp:
407         (WebCore::WebGPUDevice::createBindGroup const):
408         * SourcesCocoa.txt:
409         * WebCore.xcodeproj/project.pbxproj:
410         * platform/graphics/gpu/GPUBindGroup.h: No longer manages one unique MTLBuffer per MTLArgumentEncoder.
411         (WebCore::GPUBindGroup::argumentBuffer const): Delegates to GPUBindGroupAllocator for current argument buffer.
412         (WebCore::GPUBindGroup::vertexArgsBuffer const): Deleted.
413         (WebCore::GPUBindGroup::fragmentArgsBuffer const): Deleted.
414         (WebCore::GPUBindGroup::computeArgsBuffer const): Deleted.
415         * platform/graphics/gpu/GPUBindGroupAllocator.h: Added. Allocates MTLBuffer for and assigns offsets for argument buffers.
416         (WebCore::GPUBindGroupAllocator::argumentBuffer const):
417         * platform/graphics/gpu/GPUBindGroupLayout.h:
418         * platform/graphics/gpu/GPUBuffer.h: Move MTLResourceUsage calculation to GPUBuffer construction.
419         (WebCore::GPUBuffer::platformUsage const):
420         * platform/graphics/gpu/GPUComputePassEncoder.h: Prevent any potiential narrowing issues, as offset can be large.
421         * platform/graphics/gpu/GPUDevice.cpp: Now owns a GPUBindGroupAllocator for owning all its argument buffer storage.
422         (WebCore::GPUDevice::tryCreateBindGroup const):
423         * platform/graphics/gpu/GPUDevice.h:
424         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
425         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
426         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
427         (WebCore::GPUProgrammablePassEncoder::setComputeBuffer):
428         * platform/graphics/gpu/GPURenderPassEncoder.h:
429         * platform/graphics/gpu/GPUTexture.h: Move MTLResourceUsage calculation to GPUTexture construction.
430         (WebCore::GPUTexture::platformUsage const):
431         * platform/graphics/gpu/cocoa/GPUBindGroupAllocatorMetal.mm: Added.
432         (WebCore::GPUBindGroupAllocator::create):
433         (WebCore::GPUBindGroupAllocator::GPUBindGroupAllocator):
434         (WebCore::GPUBindGroupAllocator::allocateAndSetEncoders): Ensures that MTLArgumentEncoders have appropriate allocation for encoding.
435         (WebCore::GPUBindGroupAllocator::reallocate): Create new MTLBuffer large enough for new encoder requirement, and copy over old argument buffer data.
436         (WebCore::GPUBindGroupAllocator::tryReset): For now, resets argument buffer if all GPUBindGroups created with this allocator are destroyed.
437         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
438         (WebCore::tryGetResourceAsBufferBinding): Add size check.
439         (WebCore::GPUBindGroup::tryCreate): No longer owns new MTLBuffers. Requests argument buffer space from GPUBindGroupAllocator.
440         (WebCore::GPUBindGroup::GPUBindGroup):
441         (WebCore::GPUBindGroup::~GPUBindGroup): Remind allocator to check for possible reset.
442         (WebCore::tryCreateArgumentBuffer): Deleted.
443         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
444         (WebCore::GPUBuffer::GPUBuffer):
445         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
446         (WebCore::GPUComputePassEncoder::setComputeBuffer):
447         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
448         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
449         (WebCore::GPUProgrammablePassEncoder::setBindGroup): No need to recalculate usage every time. Set appropriate argument buffer and offsets for new bind group model.
450         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
451         (WebCore::GPURenderPassEncoder::setVertexBuffer):
452         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
453         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
454         (WebCore::GPUTexture::GPUTexture):
455
456 2019-08-13  Antti Koivisto  <antti@apple.com>
457
458         Event region collection should take clipping into account
459         https://bugs.webkit.org/show_bug.cgi?id=200668
460         <rdar://problem/53826561>
461
462         Reviewed by Simon Fraser.
463
464         Test: pointerevents/ios/touch-action-region-clip-and-transform.html
465
466         * rendering/EventRegion.cpp:
467         (WebCore::EventRegionContext::pushClip):
468         (WebCore::EventRegionContext::popClip):
469
470         Maintain clip rect stack.
471
472         (WebCore::EventRegionContext::unite):
473
474         Apply both transforms and clipping.
475
476         * rendering/EventRegion.h:
477         * rendering/RenderBlock.cpp:
478         * rendering/RenderBox.cpp:
479         (WebCore::RenderBox::pushContentsClip):
480         (WebCore::RenderBox::popContentsClip):
481
482         Update clip for non-self-painting layers.
483
484         * rendering/RenderLayer.cpp:
485         (WebCore::RenderLayer::clipToRect):
486         (WebCore::RenderLayer::restoreClip):
487
488         Update clip for self-painting layers.
489
490 2019-08-13  Devin Rousso  <drousso@apple.com>
491
492         Web Inspector: Styles: show @supports CSS groupings
493         https://bugs.webkit.org/show_bug.cgi?id=200419
494         <rdar://problem/53971948>
495
496         Reviewed by Joseph Pecoraro.
497
498         Test: inspector/css/getMatchedStylesForNode.html
499
500         * inspector/InspectorStyleSheet.cpp:
501         (WebCore::buildArrayForGroupings): Added.
502         (WebCore::InspectorStyleSheet::buildObjectForRule):
503         (WebCore::buildMediaObject): Deleted.
504         (WebCore::fillMediaListChain): Deleted.
505
506         * css/MediaList.h:
507         * css/MediaList.cpp:
508         (WebCore::MediaQuerySet::MediaQuerySet):
509         Remove the `lastLine` as it was never set by anyone and wasn't used by Web Inspector.
510
511 2019-08-13  Sihui Liu  <sihui_liu@apple.com>
512
513         Make sure UniqueIDBDatabaseConnection unregister itself from IDBServer
514         https://bugs.webkit.org/show_bug.cgi?id=200650
515         <rdar://problem/54236010>
516
517         Reviewed by Youenn Fablet.
518
519         We register UniqueIDBDatabaseConnection unconditionally to IDBServer but fail to unregister if UniqueIDBDatabase
520         of UniqueIDBDatabaseConnection is gone.
521
522         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
523         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
524         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
525         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
526         (WebCore::IDBServer::UniqueIDBDatabaseConnection::server):
527         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
528         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
529         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
530         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
531
532 2019-08-13  Zalan Bujtas  <zalan@apple.com>
533
534         [LFC][TFC] Introduce TableGrid
535         https://bugs.webkit.org/show_bug.cgi?id=200656
536         <rdar://problem/54240833>
537
538         Reviewed by Antti Koivisto.
539
540         table grid:
541         A matrix containing as many rows and columns as needed to describe the position of all the table-rows
542         and table-cells of a table-root, as determined by the grid-dimensioning algorithm.
543         Each row of the grid might correspond to a table-row, and each column to a table-column.
544
545         slot of the table grid:
546         A slot (r,c) is an available space created by the intersection of a row r and a column c in the table grid.
547
548         https://www.w3.org/TR/css-tables-3/#terminology
549
550         * Sources.txt:
551         * WebCore.xcodeproj/project.pbxproj:
552         * layout/layouttree/LayoutBox.h:
553         (WebCore::Layout::Box::isTableHeader const):
554         (WebCore::Layout::Box::isTableBody const):
555         (WebCore::Layout::Box::isTableFooter const):
556         * layout/layouttree/LayoutTreeBuilder.cpp:
557         (WebCore::Layout::TreeBuilder::createLayoutBox):
558         * layout/tableformatting/TableFormattingContext.cpp:
559         (WebCore::Layout::TableFormattingContext::layout const):
560         (WebCore::Layout::TableFormattingContext::ensureTableGrid const):
561         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns const):
562         (WebCore::Layout::TableFormattingContext::computeTableWidth const):
563         (WebCore::Layout::TableFormattingContext::distributeAvailabeWidth const):
564         (WebCore::Layout::TableFormattingContext::computeTableHeight const):
565         (WebCore::Layout::TableFormattingContext::distributeAvailableHeight const):
566         * layout/tableformatting/TableFormattingContext.h:
567         (WebCore::Layout::TableFormattingContext::formattingState const):
568         * layout/tableformatting/TableFormattingState.h:
569         (WebCore::Layout::TableFormattingState::tableGrid):
570         * layout/tableformatting/TableGrid.cpp: Added.
571         (WebCore::Layout::TableGrid::CellInfo::CellInfo):
572         (WebCore::Layout::TableGrid::SlotInfo::SlotInfo):
573         (WebCore::Layout::TableGrid::TableGrid):
574         (WebCore::Layout::TableGrid::appendCell):
575         (WebCore::Layout::TableGrid::insertCell):
576         (WebCore::Layout::TableGrid::removeCell):
577         * layout/tableformatting/TableGrid.h: Copied from Source/WebCore/layout/tableformatting/TableFormattingContext.h.
578
579 2019-08-13  Zalan Bujtas  <zalan@apple.com>
580
581         [LFC][TFC] Add rowSpan and colSpan to Box
582         https://bugs.webkit.org/show_bug.cgi?id=200654
583         <rdar://problem/54239281>
584
585         Reviewed by Antti Koivisto.
586
587         colSpan and rowSpan are not part of the RenderStyle. We eventually need to find a more appropriate place for the "random DOM things".
588
589         * layout/layouttree/LayoutBox.cpp:
590         (WebCore::Layout::Box::setRowSpan):
591         (WebCore::Layout::Box::setColumnSpan):
592         (WebCore::Layout::Box::rowSpan const):
593         (WebCore::Layout::Box::columnSpan const):
594         * layout/layouttree/LayoutBox.h:
595         * layout/layouttree/LayoutTreeBuilder.cpp:
596         (WebCore::Layout::TreeBuilder::createLayoutBox):
597
598 2019-08-13  Youenn Fablet  <youenn@apple.com>
599
600         Blob registries should be keyed by session IDs
601         https://bugs.webkit.org/show_bug.cgi?id=200567
602         <rdar://problem/54120212>
603
604         Reviewed by Alex Christensen.
605
606         Pass session IDs to all BlobRegistry methods in particular ThreadableLoaderRegistry.
607         The only exception is blobSize which should be dealt with a follow-up patch.
608         blobSize blob registry is retrieved from the connection -> sessionID map in Network Process.
609         Covered by existing tests.
610
611         * Modules/fetch/FetchLoader.cpp:
612         (WebCore::FetchLoader::~FetchLoader):
613         (WebCore::FetchLoader::startLoadingBlobURL):
614         * Modules/fetch/FetchLoader.h:
615         * fileapi/FileReaderLoader.cpp:
616         (WebCore::FileReaderLoader::~FileReaderLoader):
617         (WebCore::FileReaderLoader::start):
618         * fileapi/FileReaderLoader.h:
619         * fileapi/ThreadableBlobRegistry.cpp:
620         (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
621         (WebCore::ThreadableBlobRegistry::registerBlobURL):
622         (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
623         * fileapi/ThreadableBlobRegistry.h:
624         * html/PublicURLManager.cpp:
625         * loader/PolicyChecker.cpp:
626         (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
627         * platform/network/BlobRegistry.h:
628         * platform/network/BlobRegistryImpl.cpp:
629         (WebCore::createBlobResourceHandle):
630         (WebCore::loadBlobResourceSynchronously):
631         (WebCore::BlobRegistryImpl::filesInBlob const):
632         * platform/network/BlobRegistryImpl.h:
633         * platform/network/FormData.cpp:
634         (WebCore::appendBlobResolved):
635         (WebCore::FormData::resolveBlobReferences):
636         * platform/network/FormData.h:
637         * platform/network/cf/FormDataStreamCFNet.cpp:
638         (WebCore::createHTTPBodyCFReadStream):
639         * platform/network/soup/ResourceRequest.h:
640         * platform/network/soup/ResourceRequestSoup.cpp:
641         (WebCore::ResourceRequest::updateSoupMessageBody const):
642         (WebCore::ResourceRequest::updateSoupMessage const):
643
644 2019-08-13  Youenn Fablet  <youenn@apple.com>
645
646         User Agent and SessionID should be given to NetworkRTCProvider to set up the correct proxy information
647         https://bugs.webkit.org/show_bug.cgi?id=200583
648
649         Reviewed by Eric Carlson.
650
651         Use a socket factory that is specific to the user agent and session ID.
652         This factory is stored in the media endpoint.
653         Not testable without proxy infrastructure.
654
655         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
656         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
657         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
658         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
659         (WebCore::LibWebRTCProvider::createPeerConnection):
660         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
661
662 2019-08-12  Ryosuke Niwa  <rniwa@webkit.org>
663
664         FrameLoader::open can execute scritps via style recalc in Frame::setDocument
665         https://bugs.webkit.org/show_bug.cgi?id=200377
666
667         Reviewed by Antti Koivisto.
668
669         Fixed the bug that FrameLoader::open can execute arbitrary author scripts via post style update callbacks
670         by adding PostResolutionCallbackDisabler, WidgetHierarchyUpdatesSuspensionScope, and NavigationDisabler
671         to CachedFrameBase::restore and FrameLoader::open.
672
673         This ensures all frames are restored from the page cache before any of them would start running scripts.
674
675         Test: fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html
676
677         * history/CachedFrame.cpp:
678         (WebCore::CachedFrameBase::restore):
679         * loader/FrameLoader.cpp:
680         (WebCore::FrameLoader::open):
681         * page/FrameViewLayoutContext.cpp:
682         (WebCore::FrameViewLayoutContext::layout): Fixed the debug assertion. The layout of a document may be
683         updated while we're preparing to put a page into the page cache.
684         * rendering/RenderLayerCompositor.cpp:
685         (WebCore::RenderLayerCompositor::updateCompositingLayers): Ditto.
686
687 2019-08-12  Sam Weinig  <weinig@apple.com>
688
689         Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
690         https://bugs.webkit.org/show_bug.cgi?id=200614
691
692         Reviewed by Darin Adler.
693
694         Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and 
695         StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
696         
697         Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to 
698         StringBuilder::appendSubstring(...).
699
700         * dom/Range.cpp:
701         (WebCore::Range::toString const):
702         * editing/Editing.cpp:
703         (WebCore::stringWithRebalancedWhitespace):
704         * editing/MarkupAccumulator.cpp:
705         (WebCore::appendCharactersReplacingEntitiesInternal):
706         * editing/TextIterator.cpp:
707         (WebCore::TextIteratorCopyableText::appendToStringBuilder const):
708         * html/HTMLTextFormControlElement.cpp:
709         (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
710         * html/parser/HTMLTokenizer.cpp:
711         (WebCore::HTMLTokenizer::bufferedCharacters const):
712         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
713         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
714         * platform/text/SegmentedString.cpp:
715         (WebCore::SegmentedString::Substring::appendTo const):
716         * platform/text/TextCodecICU.cpp:
717         (WebCore::TextCodecICU::decode):
718         * xml/XSLTProcessorLibxslt.cpp:
719         (WebCore::writeToStringBuilder):
720         Update for renames.
721
722 2019-08-12  Adrian Perez de Castro  <aperez@igalia.com>
723
724         [WPE][GTK] Fix building without unified sources
725         https://bugs.webkit.org/show_bug.cgi?id=200641
726
727         Reviewed by Žan Doberšek.
728
729         * CMakeLists.txt: Add WebCore as the list of libraries to link into WebCoreTestSupport, to
730         avoid underlinking, which makes it possible to link with LDFLAGS="-Wl,--no-undefined".
731         * editing/WebCorePasteboardFileReader.h: Add missing inclusion of the pal/SessionID.h
732         header.
733
734 2019-08-12  Yusuke Suzuki  <ysuzuki@apple.com>
735
736         [WTF][JSC] Make JSC and WTF aggressively-fast-malloced
737         https://bugs.webkit.org/show_bug.cgi?id=200611
738
739         Reviewed by Saam Barati.
740
741         Changed the accessor since we changed std::unique_ptr to Ref for this field.
742
743         No behavior change.
744
745         * bindings/js/WorkerScriptController.cpp:
746         (WebCore::WorkerScriptController::addTimerSetNotification):
747         (WebCore::WorkerScriptController::removeTimerSetNotification):
748
749 2019-08-12  Youenn Fablet  <youenn@apple.com>
750
751         Make Blob::m_size an Optional
752         https://bugs.webkit.org/show_bug.cgi?id=200617
753
754         Reviewed by Alex Christensen.
755
756         Use an Optional instead of -1 to know that m_size is initialized or not.
757         No change of behavior.
758
759         Refactoring to make all Blob members private.
760         Remove one static Blob create method.
761
762         Covered by existing tests.
763
764         * Modules/fetch/FetchBody.cpp:
765         (WebCore::FetchBody::fromFormData):
766         * fileapi/Blob.cpp:
767         (WebCore::Blob::Blob):
768         (WebCore::Blob::size const):
769         * fileapi/Blob.h:
770         (WebCore::Blob::setInternalURL):
771         * fileapi/File.cpp:
772         (WebCore::File::create):
773         (WebCore::File::File):
774         (WebCore::File::computeNameAndContentType):
775         * fileapi/File.h:
776         * html/FileListCreator.cpp:
777         (WebCore::FileListCreator::createFileList):
778
779 2019-08-12  Chris Dumez  <cdumez@apple.com>
780
781         GPUBuffer seems to be ref'd / deref'd from multiple thread concurrently but is not ThreadSafeRefCounted
782         https://bugs.webkit.org/show_bug.cgi?id=200629
783
784         Reviewed by Geoffrey Garen.
785
786         Make sure GPUBuffer only gets ref'd / deref'd on the main thread, since it is not
787         ThreadSafeRefCounted.
788
789         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
790         (WebCore::GPUBuffer::commandBufferCommitted):
791         (WebCore::GPUBuffer::commandBufferCompleted):
792
793 2019-08-12  Thibault Saunier  <tsaunier@igalia.com>
794
795         [GStreamer][WebRTC] Handle broken data in the libwebrtc GStreamer decoders
796         https://bugs.webkit.org/show_bug.cgi?id=200584
797
798         Reviewed by Philippe Normand.
799
800         Listening to parsers warnings and error messages (synchronously so that we react
801         right away) and requesting keyframes from the peer.
802
803         Also simplify the decoder code by trying to make decoding happen
804         in one single pass, also hiding away GStreamer threading and allowing
805         us to react as soon as the decoder/parser fails.
806
807         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
808         (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
809         (WebCore::GStreamerVideoDecoder::pullSample):
810         (WebCore::H264Decoder::H264Decoder):
811         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
812
813 2019-08-12  Antti Koivisto  <antti@apple.com>
814
815         Only construct ComplexLineLayout when needed
816         https://bugs.webkit.org/show_bug.cgi?id=200625
817
818         Reviewed by Zalan Bujtas.
819
820         * rendering/ComplexLineLayout.cpp:
821         (WebCore::ComplexLineLayout::createInlineBoxForRenderer):
822         (WebCore::ComplexLineLayout::createLineBoxes):
823         (WebCore::ComplexLineLayout::constructLine):
824         (WebCore::ComplexLineLayout::updateLogicalWidthForAlignment):
825
826         Make static so this can be invoked without constructing complex line layout (from startAlignedOffsetForLine).
827
828         (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment):
829         (WebCore::ComplexLineLayout::deleteEllipsisLineBoxes):
830         (WebCore::ComplexLineLayout::checkLinesForTextOverflow):
831         (WebCore::ComplexLineLayout::startAlignedOffsetForLine): Deleted.
832
833         This is also used in block layout to set static positions of positioned objects.
834         Move to RenderBlockFlow where its only caller is.
835
836         * rendering/ComplexLineLayout.h:
837         * rendering/RenderBlockFlow.cpp:
838         (WebCore::RenderBlockFlow::RenderBlockFlow):
839         (WebCore::RenderBlockFlow::willBeDestroyed):
840         (WebCore::RenderBlockFlow::layoutInlineChildren):
841         (WebCore::RenderBlockFlow::updateStaticInlinePositionForChild):
842         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
843         (WebCore::RenderBlockFlow::deleteLines):
844         (WebCore::RenderBlockFlow::hitTestInlineChildren):
845         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
846         (WebCore::RenderBlockFlow::paintInlineChildren):
847         (WebCore::RenderBlockFlow::hasLines const):
848         (WebCore::RenderBlockFlow::layoutSimpleLines):
849         (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
850         (WebCore::RenderBlockFlow::ensureLineBoxes):
851         * rendering/RenderBlockFlow.h:
852         (WebCore::RenderBlockFlow::firstRootBox const):
853         (WebCore::RenderBlockFlow::lastRootBox const):
854         (WebCore::RenderBlockFlow::complexLineLayout):
855         (WebCore::RenderBlockFlow::lineBoxes): Deleted.
856         (WebCore::RenderBlockFlow::lineBoxes const): Deleted.
857         * rendering/RootInlineBox.cpp:
858         (WebCore::RootInlineBox::removeLineBoxFromRenderObject):
859         (WebCore::RootInlineBox::extractLineBoxFromRenderObject):
860         (WebCore::RootInlineBox::attachLineBoxToRenderObject):
861         * rendering/SimpleLineLayoutFunctions.cpp:
862         (WebCore::SimpleLineLayout::generateLineBoxTree):
863
864 2019-08-12  Youenn Fablet  <youenn@apple.com>
865
866         Remove IDBValue::m_sessionID
867         https://bugs.webkit.org/show_bug.cgi?id=199320
868
869         Reviewed by Alex Christensen.
870
871         Remove sessionID from IDBValue.
872         This does not seem to be really used in any way.
873         No change of behavior.
874
875         * Modules/indexeddb/IDBValue.cpp:
876         (WebCore::IDBValue::IDBValue):
877         * Modules/indexeddb/IDBValue.h:
878         (WebCore::IDBValue::blobURLs const):
879         (WebCore::IDBValue::encode const):
880         (WebCore::IDBValue::decode):
881         (WebCore::IDBValue::sessionID const): Deleted.
882         * Modules/indexeddb/shared/IDBRequestData.cpp:
883         (WebCore::IDBRequestData::isolatedCopy):
884         * Modules/indexeddb/shared/IDBRequestData.h:
885         (WebCore::IDBRequestData::databaseIdentifier const):
886         (WebCore::IDBRequestData::decode):
887         * bindings/js/IDBBindingUtilities.cpp:
888         (WebCore::deserializeIDBValueToJSValue):
889         * bindings/js/SerializedScriptValue.cpp:
890         (WebCore::CloneSerializer::serialize):
891         (WebCore::CloneSerializer::CloneSerializer):
892         (WebCore::CloneSerializer::dumpIfTerminal):
893         (WebCore::CloneDeserializer::deserialize):
894         (WebCore::CloneDeserializer::CloneDeserializer):
895         (WebCore::SerializedScriptValue::SerializedScriptValue):
896         (WebCore::SerializedScriptValue::create):
897         (WebCore::SerializedScriptValue::deserialize):
898         (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
899         * bindings/js/SerializedScriptValue.h:
900         (WebCore::SerializedScriptValue::sessionID const): Deleted.
901
902 2019-08-12  Youenn Fablet  <youenn@apple.com>
903
904         Remove IDB-specific quota
905         https://bugs.webkit.org/show_bug.cgi?id=196545
906
907         Reviewed by Alex Christensen.
908
909         No change of behavior as IDB specific quota is no longer used.
910         Instead a global quota is used. This quota currently handles IDB and Cache API.
911
912         * Modules/indexeddb/server/IDBBackingStore.h:
913         * Modules/indexeddb/server/IDBServer.cpp:
914         (WebCore::IDBServer::IDBServer::createBackingStore):
915         (WebCore::IDBServer::IDBServer::setPerOriginQuota): Deleted.
916         * Modules/indexeddb/server/IDBServer.h:
917         (WebCore::IDBServer::IDBServer::perOriginQuota const): Deleted.
918         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
919         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
920         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
921         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
922         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
923         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
924         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
925         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
926         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
927         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
928         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
929         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const): Deleted.
930         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const): Deleted.
931         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
932         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
933         (WebCore::IDBServer::UniqueIDBDatabase::setQuota): Deleted.
934         * Modules/indexeddb/server/UniqueIDBDatabase.h:
935
936 2019-08-11  Alicia Boya García  <aboya@igalia.com>
937
938         [MSE][GStreamer] Don't use vorbisparse
939         https://bugs.webkit.org/show_bug.cgi?id=200622
940
941         Reviewed by Philippe Normand.
942
943         This patch has been splitted from the original WebKitMediaSrc rework
944         patch (https://bugs.webkit.org/show_bug.cgi?id=199719).
945
946         Unlike other parsers, vorbisparse has latency (in the sense that when
947         it gets a chain call with a series of complete frames, it may not emit
948         the parsed frames until another chain in the future), which makes it
949         inappropriate for AppendPipeline, as there is no good way I know to
950         flush it.
951
952         But actually vorbisparse is not known to be necessary and it was only
953         introduced for consistency with other formats. Parsers are used in
954         AppendPipeline to reconstruct information that is lost due to poor
955         muxes. There have been no reported cases of this being a problem with
956         Vorbis in WebM, so I'm just removing the parser.
957
958         Fixes imported/w3c/web-platform-tests/media-source/mediasource-config-change-webm-a-bitrate.html
959
960         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
961         (WebCore::createOptionalParserForFormat):
962
963 2019-08-11  Antti Koivisto  <antti@apple.com>
964
965         Factor complex line layout path out from RenderBlockFlow
966         https://bugs.webkit.org/show_bug.cgi?id=200612
967
968         Reviewed by Zalan Bujtas.
969
970         This patch factors the line layout code that is currently part of the RenderBlockFlow and lives in RenderBlockLineLayout.cpp
971         into a new ComplexLineLayout class. ComplexLineLayout is a member of RenderBlockFlow.
972
973         In the future we can stop constructing ComplexLineLayout at all when using other line layout paths.
974
975         * Sources.txt:
976         * WebCore.xcodeproj/project.pbxproj:
977         * rendering/ComplexLineLayout.cpp: Copied from Source/WebCore/rendering/RenderBlockLineLayout.cpp.
978         (WebCore::ComplexLineLayout::ComplexLineLayout):
979         (WebCore::ComplexLineLayout::appendRunsForObject):
980         (WebCore::ComplexLineLayout::createRootInlineBox):
981         (WebCore::ComplexLineLayout::createAndAppendRootInlineBox):
982         (WebCore::ComplexLineLayout::createInlineBoxForRenderer):
983         (WebCore::ComplexLineLayout::createLineBoxes):
984         (WebCore::ComplexLineLayout::constructLine):
985         (WebCore::ComplexLineLayout::textAlignmentForLine const):
986         (WebCore::ComplexLineLayout::setMarginsForRubyRun):
987         (WebCore::ComplexLineLayout::updateRubyForJustifiedText):
988         (WebCore::ComplexLineLayout::computeExpansionForJustifiedText):
989         (WebCore::ComplexLineLayout::updateLogicalWidthForAlignment):
990         (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForLine):
991         (WebCore::ComplexLineLayout::computeInlineDirectionPositionsForSegment):
992         (WebCore::ComplexLineLayout::removeInlineBox const):
993         (WebCore::ComplexLineLayout::computeBlockDirectionPositionsForLine):
994         (WebCore::ComplexLineLayout::handleTrailingSpaces):
995         (WebCore::ComplexLineLayout::appendFloatingObjectToLastLine):
996         (WebCore::ComplexLineLayout::createLineBoxesFromBidiRuns):
997         (WebCore::ComplexLineLayout::layoutRunsAndFloats):
998         (WebCore::ComplexLineLayout::restartLayoutRunsAndFloatsInRange):
999         (WebCore::ComplexLineLayout::layoutRunsAndFloatsInRange):
1000         (WebCore::ComplexLineLayout::reattachCleanLineFloats):
1001         (WebCore::ComplexLineLayout::linkToEndLineIfNeeded):
1002         (WebCore::ComplexLineLayout::layoutLineBoxes):
1003         (WebCore::ComplexLineLayout::checkFloatInCleanLine):
1004         (WebCore::ComplexLineLayout::determineStartPosition):
1005         (WebCore::ComplexLineLayout::determineEndPosition):
1006         (WebCore::ComplexLineLayout::checkPaginationAndFloatsAtEndLine):
1007         (WebCore::ComplexLineLayout::lineWidthForPaginatedLineChanged const):
1008         (WebCore::ComplexLineLayout::matchedEndLine):
1009         (WebCore::ComplexLineLayout::addOverflowFromInlineChildren):
1010         (WebCore::ComplexLineLayout::deleteEllipsisLineBoxes):
1011         (WebCore::ComplexLineLayout::checkLinesForTextOverflow):
1012         (WebCore::ComplexLineLayout::positionNewFloatOnLine):
1013         (WebCore::ComplexLineLayout::startAlignedOffsetForLine):
1014         (WebCore::ComplexLineLayout::updateFragmentForLine const):
1015         (WebCore::ComplexLineLayout::style const):
1016         (WebCore::ComplexLineLayout::layoutContext const):
1017         (WebCore::RenderBlockFlow::appendRunsForObject): Deleted.
1018         (WebCore::RenderBlockFlow::createRootInlineBox): Deleted.
1019         (WebCore::RenderBlockFlow::createAndAppendRootInlineBox): Deleted.
1020         (WebCore::createInlineBoxForRenderer): Deleted.
1021         (WebCore::RenderBlockFlow::createLineBoxes): Deleted.
1022         (WebCore::RenderBlockFlow::constructLine): Deleted.
1023         (WebCore::RenderBlockFlow::textAlignmentForLine const): Deleted.
1024         (WebCore::RenderBlockFlow::setMarginsForRubyRun): Deleted.
1025         (WebCore::RenderBlockFlow::updateRubyForJustifiedText): Deleted.
1026         (WebCore::RenderBlockFlow::computeExpansionForJustifiedText): Deleted.
1027         (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment): Deleted.
1028         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine): Deleted.
1029         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Deleted.
1030         (WebCore::RenderBlockFlow::removeInlineBox const): Deleted.
1031         (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): Deleted.
1032         (WebCore::RenderBlockFlow::handleTrailingSpaces): Deleted.
1033         (WebCore::RenderBlockFlow::appendFloatingObjectToLastLine): Deleted.
1034         (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns): Deleted.
1035         (WebCore::RenderBlockFlow::layoutRunsAndFloats): Deleted.
1036         (WebCore::RenderBlockFlow::restartLayoutRunsAndFloatsInRange): Deleted.
1037         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Deleted.
1038         (WebCore::RenderBlockFlow::reattachCleanLineFloats): Deleted.
1039         (WebCore::RenderBlockFlow::linkToEndLineIfNeeded): Deleted.
1040         (WebCore::RenderBlockFlow::layoutLineBoxes): Deleted.
1041         (WebCore::RenderBlockFlow::checkFloatInCleanLine): Deleted.
1042         (WebCore::RenderBlockFlow::determineStartPosition): Deleted.
1043         (WebCore::RenderBlockFlow::determineEndPosition): Deleted.
1044         (WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine): Deleted.
1045         (WebCore::RenderBlockFlow::lineWidthForPaginatedLineChanged const): Deleted.
1046         (WebCore::RenderBlockFlow::matchedEndLine): Deleted.
1047         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Deleted.
1048         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren): Deleted.
1049         (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes): Deleted.
1050         (WebCore::RenderBlockFlow::checkLinesForTextOverflow): Deleted.
1051         (WebCore::RenderBlockFlow::positionNewFloatOnLine): Deleted.
1052         (WebCore::RenderBlockFlow::startAlignedOffsetForLine): Deleted.
1053         (WebCore::RenderBlockFlow::updateFragmentForLine const): Deleted.
1054         * rendering/ComplexLineLayout.h: Added.
1055         (WebCore::ComplexLineLayout::lineBoxes):
1056         (WebCore::ComplexLineLayout::lineBoxes const):
1057         (WebCore::ComplexLineLayout::firstRootBox const):
1058         (WebCore::ComplexLineLayout::lastRootBox const):
1059         * rendering/InlineIterator.h:
1060         (WebCore::IsolateTracker::addFakeRunIfNecessary):
1061         (WebCore::InlineBidiResolver::appendRunInternal):
1062         * rendering/RenderBlock.h:
1063         * rendering/RenderBlockFlow.cpp:
1064         (WebCore::RenderBlockFlow::RenderBlockFlow):
1065         (WebCore::RenderBlockFlow::willBeDestroyed):
1066         (WebCore::RenderBlockFlow::layoutInlineChildren):
1067         (WebCore::RenderBlockFlow::updateStaticInlinePositionForChild):
1068         (WebCore::RenderBlockFlow::deleteLines):
1069         (WebCore::RenderBlockFlow::hitTestInlineChildren):
1070         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
1071         (WebCore::RenderBlockFlow::paintInlineChildren):
1072         (WebCore::RenderBlockFlow::layoutSimpleLines):
1073         (WebCore::RenderBlockFlow::ensureLineBoxes):
1074         * rendering/RenderBlockFlow.h:
1075         (WebCore::RenderBlockFlow::lineBoxes):
1076         (WebCore::RenderBlockFlow::lineBoxes const):
1077         (WebCore::RenderBlockFlow::firstRootBox const):
1078         (WebCore::RenderBlockFlow::lastRootBox const):
1079         (WebCore::RenderBlockFlow::floatingObjects):
1080         (WebCore::RenderBlockFlow::complexLineLayout):
1081         (WebCore::RenderBlockFlow::overrideTextAlignmentForLine const):
1082         (WebCore::RenderBlockFlow::adjustInlineDirectionLineBounds const):
1083         * rendering/RenderBlockLineLayout.cpp: Removed.
1084         * rendering/RenderRubyBase.cpp:
1085         (WebCore::RenderRubyBase::overrideTextAlignmentForLine const):
1086         (WebCore::RenderRubyBase::textAlignmentForLine const): Deleted.
1087         * rendering/RenderRubyBase.h:
1088         * rendering/RenderRubyText.cpp:
1089         (WebCore::RenderRubyText::overrideTextAlignmentForLine const):
1090         (WebCore::RenderRubyText::textAlignmentForLine const): Deleted.
1091         * rendering/RenderRubyText.h:
1092         * rendering/SimpleLineLayoutFunctions.cpp:
1093         (WebCore::SimpleLineLayout::generateLineBoxTree):
1094         * rendering/line/LineBreaker.cpp:
1095         (WebCore::LineBreaker::skipLeadingWhitespace):
1096         * rendering/line/LineBreaker.h:
1097         (WebCore::LineBreaker::positionNewFloatOnLine):
1098         * rendering/line/LineInlineHeaders.h:
1099         (WebCore::setStaticPositions):
1100         * rendering/svg/RenderSVGText.cpp:
1101         (WebCore::RenderSVGText::createRootInlineBox): Deleted.
1102         * rendering/svg/RenderSVGText.h:
1103         * rendering/updating/RenderTreeBuilderList.cpp:
1104         (WebCore::generatesLineBoxesForInlineChild):
1105         (WebCore::getParentOfFirstLineBox):
1106
1107 2019-08-10  Simon Fraser  <simon.fraser@apple.com>
1108
1109         REGRESSION (r245974): Missing content on habitburger.com, amazon.com
1110         https://bugs.webkit.org/show_bug.cgi?id=200618
1111         rdar://problem/53920224
1112
1113         Reviewed by Zalan Bujtas.
1114
1115         In r245974 TileController::adjustTileCoverageRect() started to intersect the coverage
1116         rect with the bounds of the layer, which is wrong because this coverage rect is passed down
1117         to descendant layers, and they may project outside the bounds of this tiled layer.
1118         
1119         This caused missing dropdowns on amazon.com, and a missing menu on habitburger.com on iPhone.
1120
1121         The fix is to just not do the intersection with the bounds. TileGrid::getTileIndexRangeForRect()
1122         already ensures that we never make tiles outside the bounds of a TileController.
1123
1124         Test: compositing/backing/layer-outside-tiled-parent.html
1125
1126         * platform/graphics/ca/TileController.cpp:
1127         (WebCore::TileController::adjustTileCoverageRect):
1128         * platform/graphics/ca/TileGrid.cpp:
1129         (WebCore::TileGrid::ensureTilesForRect):
1130
1131 2019-08-10  Andres Gonzalez  <andresg_22@apple.com>
1132
1133         Accessibility client cannot navigate to internal links targets on iOS.
1134         https://bugs.webkit.org/show_bug.cgi?id=200559
1135         <rdar://problem/45242534>
1136
1137         Reviewed by Zalan Bujtas.
1138
1139         The cause of the problem on iOS is that AccessibilityObject::firstAccessibleObjectFromNode
1140         used in AccessibilityRenderObject::linkedUIElements may return an object
1141         that is ignored by accessibility clients on iOS, and thus the client
1142         would not track the target of an internal link. This change ensures that
1143         accessibilityLinkedElement will return a valid accessibility element to
1144         the client, if it is exists.
1145         * accessibility/AccessibilityObject.cpp:
1146         (WebCore::AccessibilityObject::firstAccessibleObjectFromNode):
1147         (WebCore::firstAccessibleObjectFromNode):
1148         * accessibility/AccessibilityObject.h:
1149         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1150         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
1151
1152 2019-08-10  Youenn Fablet  <youenn@apple.com>
1153
1154         Blob should store its session ID
1155         https://bugs.webkit.org/show_bug.cgi?id=200572
1156
1157         Reviewed by Darin Adler.
1158
1159         Blob at creation time now initializes its session ID.
1160         This will allow in the future to call blob registry routines with it.
1161         Update all call sites to provide the session ID.
1162
1163         No observable change.
1164
1165         * Modules/entriesapi/DOMFileSystem.cpp:
1166         (WebCore::DOMFileSystem::getFile):
1167         * Modules/fetch/FetchBody.cpp:
1168         (WebCore::FetchBody::fromFormData):
1169         * Modules/fetch/FetchBody.h:
1170         * Modules/fetch/FetchBodyConsumer.cpp:
1171         (WebCore::blobFromData):
1172         (WebCore::resolveWithTypeAndData):
1173         (WebCore::FetchBodyConsumer::resolve):
1174         (WebCore::FetchBodyConsumer::takeAsBlob):
1175         * Modules/fetch/FetchBodyConsumer.h:
1176         * Modules/fetch/FetchBodyOwner.cpp:
1177         (WebCore::FetchBodyOwner::blob):
1178         * Modules/mediarecorder/MediaRecorder.cpp:
1179         (WebCore::MediaRecorder::createRecordingDataBlob):
1180         * Modules/mediastream/RTCDataChannel.cpp:
1181         (WebCore::RTCDataChannel::didReceiveRawData):
1182         * Modules/websockets/WebSocket.cpp:
1183         (WebCore::WebSocket::didReceiveBinaryData):
1184         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1185         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
1186         * bindings/js/JSDOMPromiseDeferred.h:
1187         (WebCore::DeferredPromise::sessionID const):
1188         * bindings/js/SerializedScriptValue.cpp:
1189         (WebCore::CloneDeserializer::readFile):
1190         (WebCore::CloneDeserializer::readTerminal):
1191         * dom/DataTransfer.cpp:
1192         (WebCore::DataTransfer::DataTransfer):
1193         (WebCore::DataTransfer::createForCopyAndPaste):
1194         (WebCore::DataTransfer::filesFromPasteboardAndItemList const):
1195         (WebCore::DataTransfer::createForInputEvent):
1196         (WebCore::DataTransfer::createForDrag):
1197         (WebCore::DataTransfer::createForDragStartEvent):
1198         (WebCore::DataTransfer::createForDrop):
1199         (WebCore::DataTransfer::createForUpdatingDropTarget):
1200         * dom/DataTransfer.h:
1201         * dom/Document.cpp:
1202         (WebCore::Document::originIdentifierForPasteboard const):
1203         * dom/Document.h:
1204         * editing/ReplaceRangeWithTextCommand.cpp:
1205         (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
1206         * editing/ReplaceSelectionCommand.cpp:
1207         (WebCore::ReplaceSelectionCommand::inputEventDataTransfer const):
1208         * editing/SpellingCorrectionCommand.cpp:
1209         (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
1210         * editing/TypingCommand.cpp:
1211         (WebCore::TypingCommand::inputEventDataTransfer const):
1212         * editing/WebCorePasteboardFileReader.cpp:
1213         (WebCore::WebCorePasteboardFileReader::readFilename):
1214         (WebCore::WebCorePasteboardFileReader::readBuffer):
1215         * editing/WebCorePasteboardFileReader.h:
1216         * editing/cocoa/WebContentReaderCocoa.mm:
1217         (WebCore::createFragmentForImageAttachment):
1218         (WebCore::replaceRichContentWithAttachments):
1219         (WebCore::createFragmentAndAddResources):
1220         (WebCore::sanitizeMarkupWithArchive):
1221         (WebCore::WebContentReader::readImage):
1222         (WebCore::attachmentForFilePath):
1223         (WebCore::attachmentForData):
1224         * editing/markup.cpp:
1225         (WebCore::restoreAttachmentElementsInFragment):
1226         * fileapi/Blob.cpp:
1227         (WebCore::Blob::Blob):
1228         * fileapi/Blob.h:
1229         (WebCore::Blob::create):
1230         (WebCore::Blob::deserialize):
1231         (WebCore::Blob::slice const):
1232         * fileapi/Blob.idl:
1233         * fileapi/File.cpp:
1234         (WebCore::File::createWithRelativePath):
1235         (WebCore::File::File):
1236         * fileapi/File.h:
1237         * fileapi/File.idl:
1238         * html/FileInputType.cpp:
1239         (WebCore::FileInputType::appendFormData const):
1240         (WebCore::FileInputType::filesChosen):
1241         * html/FileListCreator.cpp:
1242         (WebCore::appendDirectoryFiles):
1243         (WebCore::FileListCreator::FileListCreator):
1244         (WebCore::FileListCreator::createFileList):
1245         * html/FileListCreator.h:
1246         (WebCore::FileListCreator::create):
1247         * html/HTMLAttachmentElement.cpp:
1248         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
1249         * html/HTMLCanvasElement.cpp:
1250         (WebCore::HTMLCanvasElement::toBlob):
1251         * page/EventHandler.cpp:
1252         (WebCore::EventHandler::handleDrag):
1253         * testing/Internals.cpp:
1254         (WebCore::Internals::createFile):
1255         * testing/ServiceWorkerInternals.cpp:
1256         (WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
1257         * workers/service/context/ServiceWorkerFetch.cpp:
1258         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1259         * xml/XMLHttpRequest.cpp:
1260         (WebCore::XMLHttpRequest::createResponseBlob):
1261
1262 2019-08-10  Alex Christensen  <achristensen@webkit.org>
1263
1264         Disable ContentChangeObserver TouchEvent adjustment on youtube.com on iOS in mobile browsing mode
1265         https://bugs.webkit.org/show_bug.cgi?id=200609
1266         <rdar://problem/54015403>
1267
1268         Reviewed by Maciej Stachowiak.
1269
1270         When watching a youtube video on iOS with "Autoplay" switched to off,
1271         upon finishing the video all clicks anywhere on the page are effectively ignored.
1272         Disabling ContentChangeObserver's TouchEvent adjustment fixes this bug.  I verified this manually.
1273         This switch was introduced in r242621, and it disables part of a new feature, so there is low risk of fallout.
1274
1275         * loader/DocumentLoader.h:
1276         (WebCore::DocumentLoader::setAllowContentChangeObserverQuirk):
1277         (WebCore::DocumentLoader::allowContentChangeObserverQuirk const):
1278         * page/Quirks.cpp:
1279         (WebCore::Quirks::shouldDisableContentChangeObserverTouchEventAdjustment const):
1280         * page/Quirks.h:
1281         * page/ios/ContentChangeObserver.cpp:
1282         (WebCore::ContentChangeObserver::touchEventDidStart):
1283
1284 2019-08-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
1285
1286         [iOS] Add a quirk for gmail.com messages on iPhone iOS13
1287         https://bugs.webkit.org/show_bug.cgi?id=200605
1288
1289         Reviewed by Maciej Stachowiak.
1290
1291         Add a quirk which sets the user agent for gmail.com messages on iPhone
1292         OS 13 to be iPhone OS 12. This is a workaround for a gmail.com bug till
1293         it is fixed.
1294
1295         * page/Quirks.cpp:
1296         (WebCore::Quirks::shouldAvoidUsingIOS13ForGmail const):
1297         * page/Quirks.h:
1298         * platform/UserAgent.h:
1299         * platform/ios/UserAgentIOS.mm:
1300         (WebCore::osNameForUserAgent):
1301         (WebCore::standardUserAgentWithApplicationName):
1302         * platform/mac/UserAgentMac.mm:
1303         (WebCore::standardUserAgentWithApplicationName):
1304
1305 2019-08-10  Thibault Saunier  <tsaunier@igalia.com>
1306
1307         [GStreamer][WebRTC] Remove unused GstAdapter
1308         https://bugs.webkit.org/show_bug.cgi?id=200585
1309
1310         Reviewed by Philippe Normand.
1311
1312         Minor "refactoring"
1313
1314         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1315         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
1316
1317 2019-08-10  Antti Koivisto  <antti@apple.com>
1318
1319         Can’t sort videos on a YouTube channel page on iPad
1320         https://bugs.webkit.org/show_bug.cgi?id=200573
1321         <rdar://problem/53415195>
1322
1323         Reviewed by Darin Adler.
1324
1325         Add a quirk to make touch events non-cancelable (preventDefault() does nothing).
1326
1327         * page/Quirks.cpp:
1328         (WebCore::Quirks::shouldMakeTouchEventNonCancelableForTarget const):
1329         * page/Quirks.h:
1330
1331 2019-08-10  Devin Rousso  <drousso@apple.com>
1332
1333         Web Inspector: REGRESSION(r248454): WK1 inspector frontend client doesn't queue messages to the frontend before it's loaded
1334         https://bugs.webkit.org/show_bug.cgi?id=200587
1335
1336         Reviewed by Joseph Pecoraro.
1337
1338         WK1 inspector sends messages to the frontend using `WebCore::InspectorClient::doDispatchMessageOnFrontendPage`,
1339         which does not do any sort of queueing to wait until the frontend is loaded (`InspectorFrontendHost.loaded()`).
1340
1341         Now that we are sending messages immediately, we should always queue.
1342
1343         Covered by existing tests (which were failing after r248454, and now won't fail).
1344
1345         * inspector/InspectorFrontendClientLocal.h:
1346         * inspector/InspectorFrontendClientLocal.cpp:
1347         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
1348         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
1349         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled):
1350         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled):
1351         (WebCore::InspectorFrontendClientLocal::startProfilingJavaScript):
1352         (WebCore::InspectorFrontendClientLocal::stopProfilingJavaScript):
1353         (WebCore::InspectorFrontendClientLocal::showConsole):
1354         (WebCore::InspectorFrontendClientLocal::showResources):
1355         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
1356         (WebCore::InspectorFrontendClientLocal::dispatch): Added.
1357         (WebCore::InspectorFrontendClientLocal::dispatchMessage): Added.
1358         (WebCore::InspectorFrontendClientLocal::dispatchMessageAsync): Added.
1359         (WebCore::InspectorFrontendClientLocal::evaluateOnLoad):
1360         Provide additional ways for subclasses to call other `InspectorFrontendAPI` methods using
1361         the "on load" queue.
1362
1363         * testing/Internals.cpp:
1364         (WebCore::InspectorStubFrontend::sendMessageToFrontend):
1365         (WebCore::InspectorStubFrontend::frontendLoaded): Deleted.
1366         Leverage the base `InspectorFrontendClientLocal`'s functions for queueing messages.
1367
1368         * inspector/InspectorClient.h:
1369         * inspector/InspectorClient.cpp: Removed.
1370         (WebCore::InspectorClient::doDispatchMessageOnFrontendPage): Deleted.
1371
1372         * inspector/agents/InspectorTimelineAgent.cpp:
1373         Add missing include.
1374
1375         * Sources.txt:
1376         * WebCore.xcodeproj/project.pbxproj:
1377
1378 2019-08-09  Yusuke Suzuki  <ysuzuki@apple.com>
1379
1380         Universal XSS in JSObject::putInlineSlow and JSValue::putToPrimitive
1381         https://bugs.webkit.org/show_bug.cgi?id=199864
1382
1383         Reviewed by Saam Barati.
1384
1385         Test: http/tests/security/cross-frame-access-object-put-optimization.html
1386
1387         * bindings/js/JSDOMWindowCustom.cpp:
1388         (WebCore::JSDOMWindow::doPutPropertySecurityCheck):
1389         * bindings/js/JSLocationCustom.cpp:
1390         (WebCore::JSLocation::doPutPropertySecurityCheck):
1391         * bindings/scripts/CodeGeneratorJS.pm:
1392         (GenerateHeader):
1393         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1394
1395 2019-08-09  Saam Barati  <sbarati@apple.com>
1396
1397         When I did the devirtualization of the AST in r248488, I needed to
1398         update the various type checks under the Type class hierarchy
1399         operate on Type itself, since we now downcast straight from Type
1400         instead of UnnamedType, ResolvableType, and NamedType.
1401
1402         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1403         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1404         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
1405         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
1406         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
1407         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
1408         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
1409         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h:
1410         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1411         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
1412         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
1413         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
1414         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
1415         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1416         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
1417         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
1418
1419 2019-08-09  Chris Dumez  <cdumez@apple.com>
1420
1421         Possible non-thread safe usage of RefCounted in ~VideoFullscreenControllerContext()
1422         https://bugs.webkit.org/show_bug.cgi?id=200599
1423
1424         Reviewed by Geoffrey Garen.
1425
1426         WebVideoFullscreenControllerAVKit's m_playbackModel & m_fullscreenModel data members are
1427         WebThread objects so we need to make sure we grab the WebThread lock before dereferencing
1428         them in the WebVideoFullscreenControllerAVKit destructor, when destroyed on the UIThread.
1429
1430         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1431         (VideoFullscreenControllerContext::~VideoFullscreenControllerContext):
1432
1433 2019-08-09  Ali Juma  <ajuma@chromium.org>
1434
1435         Don't allow cross-origin iframes to autofocus
1436         https://bugs.webkit.org/show_bug.cgi?id=200515
1437         <rdar://problem/54092988>
1438
1439         Reviewed by Ryosuke Niwa.
1440
1441         According to Step 6 in the WhatWG Spec (https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofocusing-a-form-control:-the-autofocus-attribute),
1442         the 'autofocus' attribute shouldn't work for cross-origin iframes.
1443
1444         This change is based on the Blink change (patch by <mustaq@chromium.org>):
1445         <https://chromium-review.googlesource.com/c/chromium/src/+/1593026>
1446
1447         Also disallow cross-origin iframes from focusing programmatically without ever having
1448         had any user interaction.
1449
1450         * dom/Element.cpp: Check if an invalid frame is trying to grab the focus.
1451         (WebCore::Element::focus):
1452         * html/HTMLFormControlElement.cpp: Check if the focus is moving to an invalid frame.
1453         (WebCore::shouldAutofocus):
1454         * page/DOMWindow.cpp: Check if an invalid frame is trying to grab the focus.
1455         (WebCore::DOMWindow::focus):
1456
1457 2019-08-09  Saam Barati  <sbarati@apple.com>
1458
1459         [WHLSL] Devirtualize the AST
1460         https://bugs.webkit.org/show_bug.cgi?id=200522
1461
1462         Reviewed by Robin Morisset.
1463
1464         This patch devirtualizes the AST for Type, Expression, and Statement.
1465         We now have an enum which represents all the concrete types in the
1466         three hierarchies. Doing dynamic dispatch is implemented as a switch
1467         on that type enum.
1468         
1469         The interesting part of this patch is how to handle destruction. We do
1470         this by defining a custom deleter for all nodes in the AST. This ensures
1471         that when they're used inside UniqueRef, unique_ptr, Ref, and RefPtr,
1472         we do dynamic dispatch when we delete the object. This allows each base
1473         class to define a "destroy" method which does dynamic dispatch on type
1474         and calls the appropriate delete. We also mark all non-concrete nodes
1475         in all type hierarchies with a protected destructor, which ensures it's
1476         never called except from within the concrete child classes. We allow
1477         all concrete classes to have public destructors, as it's valid for
1478         their destructors to be called explicitly since there is no need for
1479         dynamic dispatch in such scenarios. All concrete classes are also marked
1480         as final.
1481         
1482         This is a 3ms speedup on compute_boids, which is about a 10% improvement
1483         in the WHLSL compiler.
1484
1485         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
1486         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
1487         * Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
1488         (WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression): Deleted.
1489         (WebCore::WHLSL::AST::AssignmentExpression::left): Deleted.
1490         (WebCore::WHLSL::AST::AssignmentExpression::right): Deleted.
1491         (WebCore::WHLSL::AST::AssignmentExpression::takeRight): Deleted.
1492         * Modules/webgpu/WHLSL/AST/WHLSLBlock.h:
1493         (WebCore::WHLSL::AST::Block::Block): Deleted.
1494         (WebCore::WHLSL::AST::Block::statements): Deleted.
1495         * Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h:
1496         (WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral): Deleted.
1497         (WebCore::WHLSL::AST::BooleanLiteral::value const): Deleted.
1498         (WebCore::WHLSL::AST::BooleanLiteral::clone const): Deleted.
1499         * Modules/webgpu/WHLSL/AST/WHLSLBreak.h:
1500         (WebCore::WHLSL::AST::Break::Break): Deleted.
1501         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
1502         (WebCore::WHLSL::AST::CallExpression::CallExpression): Deleted.
1503         (WebCore::WHLSL::AST::CallExpression::arguments): Deleted.
1504         (WebCore::WHLSL::AST::CallExpression::name): Deleted.
1505         (WebCore::WHLSL::AST::CallExpression::setCastData): Deleted.
1506         (WebCore::WHLSL::AST::CallExpression::isCast): Deleted.
1507         (WebCore::WHLSL::AST::CallExpression::castReturnType): Deleted.
1508         (WebCore::WHLSL::AST::CallExpression::function): Deleted.
1509         (WebCore::WHLSL::AST::CallExpression::setFunction): Deleted.
1510         * Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h:
1511         (WebCore::WHLSL::AST::CommaExpression::CommaExpression): Deleted.
1512         (WebCore::WHLSL::AST::CommaExpression::list): Deleted.
1513         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
1514         (WebCore::WHLSL::AST::ConstantExpression::ConstantExpression): Deleted.
1515         (WebCore::WHLSL::AST::ConstantExpression::integerLiteral): Deleted.
1516         (WebCore::WHLSL::AST::ConstantExpression::visit): Deleted.
1517         (WebCore::WHLSL::AST::ConstantExpression::visit const): Deleted.
1518         (WebCore::WHLSL::AST::ConstantExpression::clone const): Deleted.
1519         (WebCore::WHLSL::AST::ConstantExpression::matches const): Deleted.
1520         * Modules/webgpu/WHLSL/AST/WHLSLContinue.h:
1521         (WebCore::WHLSL::AST::Continue::Continue): Deleted.
1522         * Modules/webgpu/WHLSL/AST/WHLSLDefaultDelete.h: Added.
1523         * Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
1524         (WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression): Deleted.
1525         (WebCore::WHLSL::AST::DereferenceExpression::pointer): Deleted.
1526         * Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
1527         (WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop): Deleted.
1528         (WebCore::WHLSL::AST::DoWhileLoop::body): Deleted.
1529         (WebCore::WHLSL::AST::DoWhileLoop::conditional): Deleted.
1530         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
1531         (WebCore::WHLSL::AST::DotExpression::DotExpression): Deleted.
1532         (WebCore::WHLSL::AST::DotExpression::fieldName): Deleted.
1533         * Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
1534         (WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement): Deleted.
1535         (WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression): Deleted.
1536         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
1537         (WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition): Deleted.
1538         (WebCore::WHLSL::AST::EnumerationDefinition::type): Deleted.
1539         (WebCore::WHLSL::AST::EnumerationDefinition::add): Deleted.
1540         (WebCore::WHLSL::AST::EnumerationDefinition::memberByName): Deleted.
1541         (WebCore::WHLSL::AST::EnumerationDefinition::enumerationMembers): Deleted.
1542         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
1543         (WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral): Deleted.
1544         (WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap): Deleted.
1545         (WebCore::WHLSL::AST::EnumerationMemberLiteral::left const): Deleted.
1546         (WebCore::WHLSL::AST::EnumerationMemberLiteral::right const): Deleted.
1547         (WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const): Deleted.
1548         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition): Deleted.
1549         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const): Deleted.
1550         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember): Deleted.
1551         (WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const): Deleted.
1552         (WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember): Deleted.
1553         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp: Added.
1554         (WebCore::WHLSL::AST::Expression::destroy):
1555         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunctionName const):
1556         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunctionName const):
1557         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunctionName const):
1558         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1559         (WebCore::WHLSL::AST::Expression::Expression):
1560         (WebCore::WHLSL::AST::Expression::kind const):
1561         (WebCore::WHLSL::AST::Expression::isAssignmentExpression const):
1562         (WebCore::WHLSL::AST::Expression::isBooleanLiteral const):
1563         (WebCore::WHLSL::AST::Expression::isCallExpression const):
1564         (WebCore::WHLSL::AST::Expression::isCommaExpression const):
1565         (WebCore::WHLSL::AST::Expression::isDereferenceExpression const):
1566         (WebCore::WHLSL::AST::Expression::isDotExpression const):
1567         (WebCore::WHLSL::AST::Expression::isGlobalVariableReference const):
1568         (WebCore::WHLSL::AST::Expression::isFloatLiteral const):
1569         (WebCore::WHLSL::AST::Expression::isIndexExpression const):
1570         (WebCore::WHLSL::AST::Expression::isIntegerLiteral const):
1571         (WebCore::WHLSL::AST::Expression::isLogicalExpression const):
1572         (WebCore::WHLSL::AST::Expression::isLogicalNotExpression const):
1573         (WebCore::WHLSL::AST::Expression::isMakeArrayReferenceExpression const):
1574         (WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
1575         (WebCore::WHLSL::AST::Expression::isNullLiteral const):
1576         (WebCore::WHLSL::AST::Expression::isPropertyAccessExpression const):
1577         (WebCore::WHLSL::AST::Expression::isReadModifyWriteExpression const):
1578         (WebCore::WHLSL::AST::Expression::isTernaryExpression const):
1579         (WebCore::WHLSL::AST::Expression::isUnsignedIntegerLiteral const):
1580         (WebCore::WHLSL::AST::Expression::isVariableReference const):
1581         (WebCore::WHLSL::AST::Expression::isEnumerationMemberLiteral const):
1582         (WebCore::WHLSL::AST::Expression::codeLocation const):
1583         (WebCore::WHLSL::AST::Expression::updateCodeLocation):
1584         * Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h:
1585         (WebCore::WHLSL::AST::Fallthrough::Fallthrough): Deleted.
1586         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h:
1587         (WebCore::WHLSL::AST::FloatLiteral::FloatLiteral): Deleted.
1588         (WebCore::WHLSL::AST::FloatLiteral::type): Deleted.
1589         (WebCore::WHLSL::AST::FloatLiteral::value const): Deleted.
1590         (WebCore::WHLSL::AST::FloatLiteral::clone const): Deleted.
1591         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
1592         (WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
1593         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
1594         (WebCore::WHLSL::AST::FloatLiteralType::value const): Deleted.
1595         (WebCore::WHLSL::AST::FloatLiteralType::preferredType): Deleted.
1596         * Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
1597         (WebCore::WHLSL::AST::ForLoop::ForLoop): Deleted.
1598         (WebCore::WHLSL::AST::ForLoop::~ForLoop): Deleted.
1599         (WebCore::WHLSL::AST::ForLoop::initialization): Deleted.
1600         (WebCore::WHLSL::AST::ForLoop::condition): Deleted.
1601         (WebCore::WHLSL::AST::ForLoop::increment): Deleted.
1602         (WebCore::WHLSL::AST::ForLoop::body): Deleted.
1603         * Modules/webgpu/WHLSL/AST/WHLSLGlobalVariableReference.h:
1604         (WebCore::WHLSL::AST::GlobalVariableReference::GlobalVariableReference): Deleted.
1605         (WebCore::WHLSL::AST::GlobalVariableReference::structField): Deleted.
1606         (WebCore::WHLSL::AST::GlobalVariableReference::base): Deleted.
1607         * Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
1608         (WebCore::WHLSL::AST::IfStatement::IfStatement): Deleted.
1609         (WebCore::WHLSL::AST::IfStatement::conditional): Deleted.
1610         (WebCore::WHLSL::AST::IfStatement::body): Deleted.
1611         (WebCore::WHLSL::AST::IfStatement::elseBody): Deleted.
1612         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
1613         (WebCore::WHLSL::AST::IndexExpression::IndexExpression): Deleted.
1614         (WebCore::WHLSL::AST::IndexExpression::indexExpression): Deleted.
1615         (WebCore::WHLSL::AST::IndexExpression::takeIndex): Deleted.
1616         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h:
1617         (WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral): Deleted.
1618         (WebCore::WHLSL::AST::IntegerLiteral::type): Deleted.
1619         (WebCore::WHLSL::AST::IntegerLiteral::value const): Deleted.
1620         (WebCore::WHLSL::AST::IntegerLiteral::clone const): Deleted.
1621         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
1622         (WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
1623         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
1624         (WebCore::WHLSL::AST::IntegerLiteralType::value const): Deleted.
1625         (WebCore::WHLSL::AST::IntegerLiteralType::preferredType): Deleted.
1626         * Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
1627         (WebCore::WHLSL::AST::LogicalExpression::LogicalExpression): Deleted.
1628         (WebCore::WHLSL::AST::LogicalExpression::type const): Deleted.
1629         (WebCore::WHLSL::AST::LogicalExpression::left): Deleted.
1630         (WebCore::WHLSL::AST::LogicalExpression::right): Deleted.
1631         * Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
1632         (WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression): Deleted.
1633         (WebCore::WHLSL::AST::LogicalNotExpression::operand): Deleted.
1634         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
1635         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression): Deleted.
1636         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::leftValue): Deleted.
1637         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::mightEscape const): Deleted.
1638         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
1639         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression): Deleted.
1640         (WebCore::WHLSL::AST::MakePointerExpression::leftValue): Deleted.
1641         (WebCore::WHLSL::AST::MakePointerExpression::mightEscape const): Deleted.
1642         * Modules/webgpu/WHLSL/AST/WHLSLNamedType.h:
1643         (WebCore::WHLSL::AST::NamedType::NamedType):
1644         (WebCore::WHLSL::AST::NamedType::unifyNodeImpl):
1645         (): Deleted.
1646         (WebCore::WHLSL::AST::NamedType::isTypeDefinition const): Deleted.
1647         (WebCore::WHLSL::AST::NamedType::isStructureDefinition const): Deleted.
1648         (WebCore::WHLSL::AST::NamedType::isEnumerationDefinition const): Deleted.
1649         (WebCore::WHLSL::AST::NamedType::isNativeTypeDeclaration const): Deleted.
1650         (WebCore::WHLSL::AST::NamedType::unifyNode const): Deleted.
1651         (WebCore::WHLSL::AST::NamedType::unifyNode): Deleted.
1652         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
1653         (WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration): Deleted.
1654         (WebCore::WHLSL::AST::NativeTypeDeclaration::typeArguments): Deleted.
1655         (WebCore::WHLSL::AST::NativeTypeDeclaration::isInt const): Deleted.
1656         (WebCore::WHLSL::AST::NativeTypeDeclaration::isNumber const): Deleted.
1657         (WebCore::WHLSL::AST::NativeTypeDeclaration::isFloating const): Deleted.
1658         (WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const): Deleted.
1659         (WebCore::WHLSL::AST::NativeTypeDeclaration::isVector const): Deleted.
1660         (WebCore::WHLSL::AST::NativeTypeDeclaration::isMatrix const): Deleted.
1661         (WebCore::WHLSL::AST::NativeTypeDeclaration::isOpaqueType const): Deleted.
1662         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTexture const): Deleted.
1663         (WebCore::WHLSL::AST::NativeTypeDeclaration::isTextureArray const): Deleted.
1664         (WebCore::WHLSL::AST::NativeTypeDeclaration::isDepthTexture const): Deleted.
1665         (WebCore::WHLSL::AST::NativeTypeDeclaration::isWritableTexture const): Deleted.
1666         (WebCore::WHLSL::AST::NativeTypeDeclaration::textureDimension const): Deleted.
1667         (WebCore::WHLSL::AST::NativeTypeDeclaration::isSigned const): Deleted.
1668         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<bool const): Deleted.
1669         (WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<int64_t const): Deleted.
1670         (WebCore::WHLSL::AST::NativeTypeDeclaration::iterateAllValues): Deleted.
1671         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsInt): Deleted.
1672         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsNumber): Deleted.
1673         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsFloating): Deleted.
1674         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsAtomic): Deleted.
1675         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsVector): Deleted.
1676         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsMatrix): Deleted.
1677         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsOpaqueType): Deleted.
1678         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTexture): Deleted.
1679         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTextureArray): Deleted.
1680         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsDepthTexture): Deleted.
1681         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsWritableTexture): Deleted.
1682         (WebCore::WHLSL::AST::NativeTypeDeclaration::setTextureDimension): Deleted.
1683         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIsSigned): Deleted.
1684         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentInteger): Deleted.
1685         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentUnsignedInteger): Deleted.
1686         (WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentFloat): Deleted.
1687         (WebCore::WHLSL::AST::NativeTypeDeclaration::setSuccessor): Deleted.
1688         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromInteger): Deleted.
1689         (WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromUnsignedInteger): Deleted.
1690         (WebCore::WHLSL::AST::NativeTypeDeclaration::setIterateAllValues): Deleted.
1691         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h:
1692         (WebCore::WHLSL::AST::NullLiteral::NullLiteral): Deleted.
1693         (WebCore::WHLSL::AST::NullLiteral::type): Deleted.
1694         (WebCore::WHLSL::AST::NullLiteral::clone const): Deleted.
1695         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h:
1696         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
1697         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
1698         (WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
1699         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
1700         (WebCore::WHLSL::AST::ReadModifyWriteExpression::create): Deleted.
1701         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setNewValueExpression): Deleted.
1702         (WebCore::WHLSL::AST::ReadModifyWriteExpression::setResultExpression): Deleted.
1703         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference): Deleted.
1704         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference): Deleted.
1705         (WebCore::WHLSL::AST::ReadModifyWriteExpression::leftValue): Deleted.
1706         (WebCore::WHLSL::AST::ReadModifyWriteExpression::oldValue): Deleted.
1707         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValue): Deleted.
1708         (WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression): Deleted.
1709         (WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression): Deleted.
1710         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeLeftValue): Deleted.
1711         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeOldValue): Deleted.
1712         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValue): Deleted.
1713         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeNewValueExpression): Deleted.
1714         (WebCore::WHLSL::AST::ReadModifyWriteExpression::takeResultExpression): Deleted.
1715         (WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression): Deleted.
1716         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
1717         (WebCore::WHLSL::AST::ReferenceType::ReferenceType):
1718         * Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
1719         (WebCore::WHLSL::AST::ResolvableType::ResolvableType):
1720         (): Deleted.
1721         (WebCore::WHLSL::AST::ResolvableType::isFloatLiteralType const): Deleted.
1722         (WebCore::WHLSL::AST::ResolvableType::isIntegerLiteralType const): Deleted.
1723         (WebCore::WHLSL::AST::ResolvableType::isNullLiteralType const): Deleted.
1724         (WebCore::WHLSL::AST::ResolvableType::isUnsignedIntegerLiteralType const): Deleted.
1725         * Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
1726         (WebCore::WHLSL::AST::Return::Return): Deleted.
1727         (WebCore::WHLSL::AST::Return::value): Deleted.
1728         * Modules/webgpu/WHLSL/AST/WHLSLStatement.cpp: Added.
1729         (WebCore::WHLSL::AST::Statement::destroy):
1730         * Modules/webgpu/WHLSL/AST/WHLSLStatement.h:
1731         (WebCore::WHLSL::AST::Statement::Statement):
1732         (WebCore::WHLSL::AST::Statement::kind const):
1733         (WebCore::WHLSL::AST::Statement::isBlock const):
1734         (WebCore::WHLSL::AST::Statement::isBreak const):
1735         (WebCore::WHLSL::AST::Statement::isContinue const):
1736         (WebCore::WHLSL::AST::Statement::isDoWhileLoop const):
1737         (WebCore::WHLSL::AST::Statement::isEffectfulExpressionStatement const):
1738         (WebCore::WHLSL::AST::Statement::isFallthrough const):
1739         (WebCore::WHLSL::AST::Statement::isForLoop const):
1740         (WebCore::WHLSL::AST::Statement::isIfStatement const):
1741         (WebCore::WHLSL::AST::Statement::isReturn const):
1742         (WebCore::WHLSL::AST::Statement::isStatementList const):
1743         (WebCore::WHLSL::AST::Statement::isSwitchCase const):
1744         (WebCore::WHLSL::AST::Statement::isSwitchStatement const):
1745         (WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
1746         (WebCore::WHLSL::AST::Statement::isWhileLoop const):
1747         (WebCore::WHLSL::AST::Statement::codeLocation const):
1748         (WebCore::WHLSL::AST::Statement::updateCodeLocation):
1749         * Modules/webgpu/WHLSL/AST/WHLSLStatementList.h:
1750         (WebCore::WHLSL::AST::StatementList::StatementList): Deleted.
1751         (WebCore::WHLSL::AST::StatementList::statements): Deleted.
1752         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
1753         (WebCore::WHLSL::AST::StructureDefinition::StructureDefinition): Deleted.
1754         (WebCore::WHLSL::AST::StructureDefinition::structureElements): Deleted.
1755         (WebCore::WHLSL::AST::StructureDefinition::find): Deleted.
1756         * Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
1757         (WebCore::WHLSL::AST::StructureElement::StructureElement): Deleted.
1758         (WebCore::WHLSL::AST::StructureElement::codeLocation const): Deleted.
1759         (WebCore::WHLSL::AST::StructureElement::type): Deleted.
1760         (WebCore::WHLSL::AST::StructureElement::name): Deleted.
1761         (WebCore::WHLSL::AST::StructureElement::semantic): Deleted.
1762         * Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h:
1763         (WebCore::WHLSL::AST::SwitchCase::SwitchCase): Deleted.
1764         (WebCore::WHLSL::AST::SwitchCase::value): Deleted.
1765         (WebCore::WHLSL::AST::SwitchCase::block): Deleted.
1766         * Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
1767         (WebCore::WHLSL::AST::SwitchStatement::SwitchStatement): Deleted.
1768         (WebCore::WHLSL::AST::SwitchStatement::value): Deleted.
1769         (WebCore::WHLSL::AST::SwitchStatement::switchCases): Deleted.
1770         * Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
1771         (WebCore::WHLSL::AST::TernaryExpression::TernaryExpression): Deleted.
1772         (WebCore::WHLSL::AST::TernaryExpression::predicate): Deleted.
1773         (WebCore::WHLSL::AST::TernaryExpression::bodyExpression): Deleted.
1774         (WebCore::WHLSL::AST::TernaryExpression::elseExpression): Deleted.
1775         * Modules/webgpu/WHLSL/AST/WHLSLType.cpp: Added.
1776         (WebCore::WHLSL::AST::Type::destroy):
1777         (WebCore::WHLSL::AST::Type::unifyNode):
1778         (WebCore::WHLSL::AST::ResolvableType::canResolve const):
1779         (WebCore::WHLSL::AST::ResolvableType::conversionCost const):
1780         (WebCore::WHLSL::AST::UnnamedType::toString const):
1781         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
1782         (WebCore::WHLSL::AST::Type::Type):
1783         (WebCore::WHLSL::AST::Type::kind const):
1784         (WebCore::WHLSL::AST::Type::isUnnamedType const):
1785         (WebCore::WHLSL::AST::Type::isNamedType const):
1786         (WebCore::WHLSL::AST::Type::isResolvableType const):
1787         (WebCore::WHLSL::AST::Type::isTypeReference const):
1788         (WebCore::WHLSL::AST::Type::isPointerType const):
1789         (WebCore::WHLSL::AST::Type::isArrayReferenceType const):
1790         (WebCore::WHLSL::AST::Type::isArrayType const):
1791         (WebCore::WHLSL::AST::Type::isReferenceType const):
1792         (WebCore::WHLSL::AST::Type::isTypeDefinition const):
1793         (WebCore::WHLSL::AST::Type::isStructureDefinition const):
1794         (WebCore::WHLSL::AST::Type::isEnumerationDefinition const):
1795         (WebCore::WHLSL::AST::Type::isNativeTypeDeclaration const):
1796         (WebCore::WHLSL::AST::Type::isFloatLiteralType const):
1797         (WebCore::WHLSL::AST::Type::isIntegerLiteralType const):
1798         (WebCore::WHLSL::AST::Type::isNullLiteralType const):
1799         (WebCore::WHLSL::AST::Type::isUnsignedIntegerLiteralType const):
1800         (WebCore::WHLSL::AST::Type::unifyNode const):
1801         * Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
1802         (WebCore::WHLSL::AST::TypeDefinition::TypeDefinition): Deleted.
1803         (WebCore::WHLSL::AST::TypeDefinition::type): Deleted.
1804         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
1805         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp:
1806         (WebCore::WHLSL::AST::UnnamedType::hash const):
1807         (WebCore::WHLSL::AST::UnnamedType::operator== const):
1808         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
1809         (WebCore::WHLSL::AST::UnnamedType::UnnamedType):
1810         (WebCore::WHLSL::AST::UnnamedType::unifyNodeImpl):
1811         (): Deleted.
1812         (WebCore::WHLSL::AST::UnnamedType::kind const): Deleted.
1813         (WebCore::WHLSL::AST::UnnamedType::isTypeReference const): Deleted.
1814         (WebCore::WHLSL::AST::UnnamedType::isPointerType const): Deleted.
1815         (WebCore::WHLSL::AST::UnnamedType::isArrayReferenceType const): Deleted.
1816         (WebCore::WHLSL::AST::UnnamedType::isArrayType const): Deleted.
1817         (WebCore::WHLSL::AST::UnnamedType::isReferenceType const): Deleted.
1818         (WebCore::WHLSL::AST::UnnamedType::unifyNode const): Deleted.
1819         (WebCore::WHLSL::AST::UnnamedType::unifyNode): Deleted.
1820         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h:
1821         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral): Deleted.
1822         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::type): Deleted.
1823         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::value const): Deleted.
1824         (WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const): Deleted.
1825         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
1826         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
1827         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
1828         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const): Deleted.
1829         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType): Deleted.
1830         * Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h:
1831         (WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement): Deleted.
1832         (WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations): Deleted.
1833         * Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
1834         (WebCore::WHLSL::AST::VariableReference::VariableReference): Deleted.
1835         (WebCore::WHLSL::AST::VariableReference::wrap): Deleted.
1836         (WebCore::WHLSL::AST::VariableReference::name): Deleted.
1837         (WebCore::WHLSL::AST::VariableReference::variable): Deleted.
1838         (WebCore::WHLSL::AST::VariableReference::setVariable): Deleted.
1839         * Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
1840         (WebCore::WHLSL::AST::WhileLoop::WhileLoop): Deleted.
1841         (WebCore::WHLSL::AST::WhileLoop::conditional): Deleted.
1842         (WebCore::WHLSL::AST::WhileLoop::body): Deleted.
1843         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
1844         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
1845         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
1846         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
1847         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
1848         (WebCore::WHLSL::Metal::parent):
1849         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1850         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
1851         (WebCore::WHLSL::Parser::parseSuffixOperator):
1852         (WebCore::WHLSL::Parser::completeAssignment):
1853         (WebCore::WHLSL::Parser::parsePossiblePrefix):
1854         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
1855         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
1856         (WebCore::WHLSL::Visitor::visit):
1857         * Sources.txt:
1858         * WebCore.xcodeproj/project.pbxproj:
1859         * workers/WorkerScriptLoader.h:
1860
1861 2019-08-09  Youenn Fablet  <youenn@apple.com>
1862
1863         Pass a ScriptExecutionContext as input to register/unregister URLRegistry routines
1864         https://bugs.webkit.org/show_bug.cgi?id=200571
1865
1866         Reviewed by Darin Adler.
1867
1868         Passing a ScriptExecutionContext to register/unregister routines will allow
1869         to have session ID based handling for blobs, in particular to use session partitioned blob registries.
1870         No change of behavior.
1871
1872         * Modules/mediasource/MediaSourceRegistry.cpp:
1873         (WebCore::MediaSourceRegistry::registerURL):
1874         (WebCore::MediaSourceRegistry::unregisterURL):
1875         * Modules/mediasource/MediaSourceRegistry.h:
1876         * fileapi/Blob.cpp:
1877         (WebCore::BlobURLRegistry::registerURL):
1878         (WebCore::BlobURLRegistry::unregisterURL):
1879         * html/DOMURL.cpp:
1880         (WebCore::DOMURL::createPublicURL):
1881         * html/PublicURLManager.cpp:
1882         (WebCore::PublicURLManager::registerURL):
1883         (WebCore::PublicURLManager::revoke):
1884         (WebCore::PublicURLManager::stop):
1885         * html/PublicURLManager.h:
1886         * html/URLRegistry.h:
1887
1888 2019-08-09  Alex Christensen  <achristensen@webkit.org>
1889
1890         Disable CSSOM View Scrolling API for IMDb iOS app
1891         https://bugs.webkit.org/show_bug.cgi?id=200586
1892         <rdar://problem/53645833>
1893
1894         Reviewed by Simon Fraser.
1895
1896         They are calling scrollHeight on the HTML element and it is running new code introduced in r235806
1897         Disable this new feature until they update their app to use the iOS13 SDK.
1898
1899         * platform/RuntimeApplicationChecks.h:
1900         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1901         (WebCore::IOSApplication::isIMDb):
1902
1903 2019-08-09  Youenn Fablet  <youenn@apple.com>
1904
1905         Remove MediaStreamRegistry
1906         https://bugs.webkit.org/show_bug.cgi?id=200570
1907
1908         Reviewed by Eric Carlson.
1909
1910         MediaStream cannot be registered as an URL by JavaScript.
1911         Remove MediaStreamRegistry and the 'src' loading specific handling in HTMLMediaElement.
1912         Implement ending of capture track by directly handling MediaStreamTrack which is more accurate.
1913         No change of behavior.
1914
1915         * Modules/mediastream/MediaStream.cpp:
1916         (WebCore::MediaStream::MediaStream):
1917         (WebCore::MediaStream::~MediaStream):
1918         (WebCore::MediaStream::stop):
1919         * Modules/mediastream/MediaStream.h:
1920         * Modules/mediastream/MediaStreamRegistry.cpp: Removed.
1921         * Modules/mediastream/MediaStreamRegistry.h: Removed.
1922         * Modules/mediastream/MediaStreamTrack.cpp:
1923         (WebCore::MediaStreamTrack::MediaStreamTrack):
1924         (WebCore::MediaStreamTrack::~MediaStreamTrack):
1925         (WebCore::MediaStreamTrack::endCapture):
1926         * Modules/mediastream/MediaStreamTrack.h:
1927         * Sources.txt:
1928         * WebCore.xcodeproj/project.pbxproj:
1929         * dom/Document.cpp:
1930         (WebCore::Document::stopMediaCapture):
1931         * html/HTMLMediaElement.cpp:
1932         (WebCore::HTMLMediaElement::loadResource):
1933
1934 2019-08-09  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
1935
1936         [GL][GStreamer] activate wrapped shared context
1937         https://bugs.webkit.org/show_bug.cgi?id=196966
1938
1939         Reviewed by Žan Doberšek.
1940
1941         This patch consists in four parts:
1942
1943         1\ When the media player is instantiated, and it is intended to
1944         render textures, it will create a wrapped object of the
1945         application's GL context, and in order to populate the wrapped
1946         object with the GL vtable, the context has to be current. Thus,
1947         this patch makes current the shared WebKit application context,
1948         and populate the wrapped GstGLContext by activating it and filling
1949         in it. Afterwards, the wrapped context is deactivated.
1950
1951         2\ This patch makes GL texture use the RGBA color space, thus the
1952         color transformation is done in GStreamer, and no further color
1953         transformation is required in WebKit.
1954
1955         3\ Since it is not necessary to modify behavior if the decoder is
1956         imxvpudecoder, its identification and label were removed.
1957
1958         4\ As only RGBA is used, the old color conversions when rendering
1959         using Cairo (fallback) were changed to convert the RGBA, as in
1960         GStreamer's format, to ARGB32, as in Cairo format -which depends
1961         on endianness.
1962
1963         No new tests because there is no behavior change.
1964
1965         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
1966         (WebCore::ImageGStreamer::ImageGStreamer): Only convert GStreamer
1967         RGBA to Cairo RGB32.
1968         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1969         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Removes
1970         the IMX VPU identification.
1971         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1972         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1973         Intializes the wrapped GL Context.
1974         (WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
1975         Removes frame's color conversion.
1976         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
1977         Instead of parsing a string, the GstCaps are created manually, and
1978         it is set to appsink, rather than a filtered linking.
1979         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1980         Removes ImxVPU enumeration value.
1981         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
1982         Adds NoConvert option to texture copier, setting an identity
1983         matrix.
1984         (WebCore::VideoTextureCopierGStreamer::updateColorConversionMatrix):
1985         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Adds
1986         NoConvert enumeration value.
1987
1988 2019-08-09  Ryosuke Niwa  <rniwa@webkit.org>
1989
1990         REGRESSION (iOS 13): united.com web forms do not respond to taps
1991         https://bugs.webkit.org/show_bug.cgi?id=200531
1992
1993         Reviewed by Antti Koivisto and Wenson Hsieh.
1994
1995         The bug is caused by the content change observer detecting “Site Feedback” link at the bottom of
1996         the page (https://www.united.com/ual/en/US/account/enroll/default) constantly getting re-generated
1997         in every frame via requestAnimationFrame when the page is opened with iPhone UA string.
1998         Note that the content re-generation can be reproduced even in Chrome if iPhone UA string is used.
1999
2000         Ignore this constant content change in ContentChangeObserver as a site specific quirk.
2001
2002         In the future, we should make ContentChangeObserver observe the final location of each element
2003         being observed so that we can ignore content that like this which is placed outside the viewport,
2004         and/or far away from where the user tapped.
2005
2006         * page/Quirks.cpp:
2007         (WebCore::Quirks::shouldIgnoreContentChange const): Added.
2008         * page/Quirks.h:
2009         * page/ios/ContentChangeObserver.cpp:
2010         (WebCore::ContentChangeObserver::shouldObserveVisibilityChangeForElement):
2011
2012 2019-08-08  Devin Rousso  <drousso@apple.com>
2013
2014         Web Inspector: Page: don't allow the domain to be disabled
2015         https://bugs.webkit.org/show_bug.cgi?id=200109
2016
2017         Reviewed by Brian Burg.
2018
2019         The `PageAgent` is relied on by many of the other agents, so much so that it doesn't make
2020         sense to support the ability to "disable" (as well as "enable") the agent.
2021
2022         When the first frontend connects, we should treat the `PageAgent` as active and available.
2023
2024         * inspector/agents/InspectorPageAgent.h:
2025         * inspector/agents/InspectorPageAgent.cpp:
2026         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
2027         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
2028         (WebCore::InspectorPageAgent::timestamp):
2029         (WebCore::InspectorPageAgent::enable): Deleted.
2030         (WebCore::InspectorPageAgent::disable): Deleted.
2031
2032         * inspector/agents/InspectorApplicationCacheAgent.cpp:
2033         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
2034         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
2035         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
2036         * inspector/agents/InspectorCSSAgent.cpp:
2037         (WebCore::InspectorCSSAgent::createStyleSheet):
2038         * inspector/agents/InspectorDOMAgent.cpp:
2039         (WebCore::InspectorDOMAgent::highlightSelector):
2040         (WebCore::InspectorDOMAgent::highlightFrame):
2041         (WebCore::InspectorDOMAgent::buildObjectForNode):
2042         * inspector/agents/InspectorTimelineAgent.cpp:
2043         (WebCore::InspectorTimelineAgent::setFrameIdentifier):
2044         * inspector/agents/page/PageNetworkAgent.cpp:
2045         (WebCore::PageNetworkAgent::loaderIdentifier):
2046         (WebCore::PageNetworkAgent::frameIdentifier):
2047         (WebCore::PageNetworkAgent::scriptExecutionContext):
2048         * inspector/agents/page/PageRuntimeAgent.cpp:
2049         (WebCore::PageRuntimeAgent::didCreateMainWorldContext):
2050         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
2051
2052         * testing/Internals.cpp:
2053         (WebCore::InspectorStubFrontend::InspectorStubFrontend):
2054         (WebCore::InspectorStubFrontend::frontendLoaded): Added.
2055         (WebCore::InspectorStubFrontend::closeWindow):
2056         (WebCore::InspectorStubFrontend::sendMessageToFrontend):
2057         (WebCore::InspectorStubFrontend::frontendPage): Deleted.
2058         Ensure that the backend always gets notified via `InspectorFrontendHost.loaded` so that
2059         messages being sent to the frontend are batched.
2060
2061 2019-08-08  Chris Lord  <clord@igalia.com>
2062
2063         Short-cut WebGLRenderingContext::getParameter() for ALPHA_BITS when alpha channel is disabled
2064         https://bugs.webkit.org/show_bug.cgi?id=200499
2065
2066         Reviewed by Darin Adler.
2067
2068         This patch adds a shortcut when a framebuffer isn't bound on WebGL
2069         canvases when retrieving ALPHA_BITS.
2070
2071         No new tests, covered by existing tests.
2072
2073         * html/canvas/WebGLRenderingContext.cpp:
2074         (WebCore::WebGLRenderingContext::getParameter):
2075         Return 0 for ALPHA_BITS if canvas has no alpha component.
2076         * html/canvas/WebGL2RenderingContext.cpp:
2077         (WebCore::WebGLRenderingContext::getParameter):
2078         Return 0 for ALPHA_BITS if canvas has no alpha component.
2079
2080 2019-08-08  Chris Dumez  <cdumez@apple.com>
2081
2082         ScrollingStateNode is not ThreadSafeRefCounted but is ref'd / deref'd from several threads
2083         https://bugs.webkit.org/show_bug.cgi?id=200545
2084
2085         Reviewed by Antti Koivisto.
2086
2087         The ScrollingStateTree and its ScrollingStateNodes are being passed to the scrolling thread.
2088         ScrollingStateNode is not ThreadSafeRefCounted, which is potentially unsafe. Make it
2089         ThreadSafeRefCounted for safety in this patch given that using RefCounted here is either
2090         wrong or fragile.
2091
2092         * page/scrolling/ScrollingStateNode.h:
2093
2094 2019-08-08  Brent Fulgham  <bfulgham@apple.com>
2095
2096         [FTW] Get WebKit, WebKit2, and MiniBrowser building and executing
2097         https://bugs.webkit.org/show_bug.cgi?id=200539
2098         <rdar://problem/54082550>
2099
2100         Reviewed by Dean Jackson.
2101
2102         * platform/graphics/win/BackingStoreBackendDirect2D.h:
2103         (WebCore::BackingStoreBackendDirect2D::renderTarget const):
2104         (WebCore::BackingStoreBackendDirect2D::surface const):
2105         (): Deleted.
2106         * platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
2107         (WebCore::BackingStoreBackendDirect2DImpl::~BackingStoreBackendDirect2DImpl):
2108         (WebCore::BackingStoreBackendDirect2DImpl::scroll):
2109         (WebCore::createDirect2DImageSurfaceWithFastMalloc): Deleted.
2110         * platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
2111         * platform/graphics/win/DIBPixelData.cpp:
2112         (WebCore::DIBPixelData::DIBPixelData):
2113         * platform/graphics/win/DIBPixelData.h:
2114         * platform/graphics/win/Direct2DOperations.cpp:
2115         (WebCore::Direct2D::fillRectWithRoundedHole):
2116         (WebCore::Direct2D::fillRectWithGradient):
2117         (WebCore::Direct2D::drawGlyphs):
2118         (WebCore::Direct2D::PlatformContextStateSaver::PlatformContextStateSaver): Deleted.
2119         (WebCore::Direct2D::PlatformContextStateSaver::~PlatformContextStateSaver): Deleted.
2120         (WebCore::Direct2D::PlatformContextStateSaver::save): Deleted.
2121         (WebCore::Direct2D::PlatformContextStateSaver::restore): Deleted.
2122         (WebCore::Direct2D::PlatformContextStateSaver::didSave const): Deleted.
2123         * platform/graphics/win/Direct2DOperations.h:
2124         * platform/graphics/win/Direct2DUtilities.cpp:
2125         (WebCore::Direct2D::bitmapSize):
2126         (WebCore::Direct2D::bitmapResolution):
2127         (WebCore::Direct2D::createWicBitmap):
2128         (WebCore::Direct2D::createBitmap):
2129         (WebCore::Direct2D::createGDIRenderTarget):
2130         (WebCore::Direct2D::copyRectFromOneSurfaceToAnother):
2131         * platform/graphics/win/Direct2DUtilities.h:
2132         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2133         (WebCore::GraphicsContext::GraphicsContext):
2134         (WebCore::GraphicsContext::platformContext const):
2135         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
2136         (WebCore::GraphicsContext::savePlatformState):
2137         (WebCore::GraphicsContext::restorePlatformState):
2138         (WebCore::GraphicsContext::releaseWindowsContext):
2139         (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
2140         (WebCore::GraphicsContextPlatformPrivate::beginDraw):
2141         (WebCore::GraphicsContextPlatformPrivate::endDraw):
2142         (WebCore::GraphicsContext::beginDraw):
2143         (WebCore::GraphicsContext::endDraw):
2144         (WebCore::GraphicsContext::setCTM):
2145         (WebCore::GraphicsContext::isAcceleratedContext const):
2146         * platform/graphics/win/GraphicsContextImplDirect2D.cpp:
2147         (WebCore::GraphicsContextImplDirect2D::fillRect):
2148         (WebCore::GraphicsContextImplDirect2D::fillRectWithRoundedHole):
2149         (WebCore::GraphicsContextImplDirect2D::drawGlyphs):
2150         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
2151         (WebCore::GraphicsContextPlatformPrivate::platformContext):
2152         * platform/graphics/win/PathDirect2D.cpp:
2153         (WebCore::Path::transform):
2154         * platform/graphics/win/PlatformContextDirect2D.cpp:
2155         (WebCore::PlatformContextDirect2D::beginDraw):
2156         (WebCore::PlatformContextDirect2D::endDraw):
2157         * platform/graphics/win/PlatformContextDirect2D.h:
2158         (WebCore::PlatformContextStateSaver::PlatformContextStateSaver):
2159         (WebCore::PlatformContextStateSaver::~PlatformContextStateSaver):
2160         (WebCore::PlatformContextStateSaver::save):
2161         (WebCore::PlatformContextStateSaver::restore):
2162         (WebCore::PlatformContextStateSaver::didSave const):
2163
2164 2019-08-08  Chris Dumez  <cdumez@apple.com>
2165
2166         Unreviewed, address post-landing review comments for r248431.
2167
2168         * Modules/indexeddb/IDBRequest.h:
2169
2170 2019-08-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
2171
2172         [iOS] Position image information should respect the image orientation
2173         https://bugs.webkit.org/show_bug.cgi?id=200487
2174
2175         Reviewed by Simon Fraser.
2176
2177         Re-factor CachedImage::imageSizeForRenderer() into another overriding
2178         function which does not scale the imageSize. Therefore the new function
2179         returns FloatSize while the original function returns LayoutSize.
2180
2181         * loader/cache/CachedImage.cpp:
2182         (WebCore::CachedImage::imageSizeForRenderer const):
2183         * loader/cache/CachedImage.h:
2184         * rendering/RenderElement.h:
2185
2186 2019-08-08  Devin Rousso  <drousso@apple.com>
2187
2188         Web Inspector: rename `queryObjects` to `queryInstances` for clarity
2189         https://bugs.webkit.org/show_bug.cgi?id=200520
2190
2191         Reviewed by Brian Burg.
2192
2193         Test: inspector/console/queryInstances.html
2194
2195         * inspector/CommandLineAPIModuleSource.js:
2196         (CommandLineAPIImpl.prototype.queryInstances): Added.
2197         (CommandLineAPIImpl.prototype.queryObjects):
2198
2199 2019-08-08  Chris Dumez  <cdumez@apple.com>
2200
2201         Fix thread safety bug in AudioSourceProviderAVFObjC::prepare()
2202         https://bugs.webkit.org/show_bug.cgi?id=200542
2203
2204         Reviewed by Jer Noble.
2205
2206         Fix thread safety bug in AudioSourceProviderAVFObjC::prepare(). It calls callOnMainThread()
2207         from a background thread and captures makeRef(*this) in the lambda, even though |this| is a
2208         AudioSourceProviderAVFObjC, which subclasses RefCounted, not ThreadSafeRefCounted.
2209
2210         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
2211
2212 2019-08-08  Chris Dumez  <cdumez@apple.com>
2213
2214         Make IDBRequest ThreadSafeRefCounted
2215         https://bugs.webkit.org/show_bug.cgi?id=200540
2216
2217         Reviewed by Alex Christensen.
2218
2219         Make IDBRequest ThreadSafeRefCounted, as it looks like it is being ref'd / deref'd
2220         from several threads, in IDBConnectionProxy::notifyOpenDBRequestBlocked() for
2221         example.
2222
2223         * Modules/indexeddb/IDBRequest.h:
2224
2225 2019-08-08  Brady Eidson  <beidson@apple.com>
2226
2227         Do not allow navigations of frames about to get replaced by the result of evaluating javascript: URLs
2228         <rdar://problem/53788893> and https://bugs.webkit.org/show_bug.cgi?id=198786
2229
2230         Reviewed by Geoff Garen.
2231
2232         Covered by API Test
2233
2234         Add a "willReplaceWithResultOfExecutingJavascriptURL" flag which is respected inside FrameLoader::isNavigationAllowed
2235
2236         * bindings/js/ScriptController.cpp:
2237         (WebCore::ScriptController::executeIfJavaScriptURL):
2238         * bindings/js/ScriptController.h:
2239         (WebCore::ScriptController::willReplaceWithResultOfExecutingJavascriptURL const):
2240
2241         * loader/FrameLoader.cpp:
2242         (WebCore::FrameLoader::isNavigationAllowed const):
2243
2244 2019-08-08  Rob Buis  <rbuis@igalia.com>
2245
2246         Add runtime flag for lazy image loading
2247         https://bugs.webkit.org/show_bug.cgi?id=199794
2248
2249         Reviewed by Darin Adler.
2250
2251         Add loading attribute and expose it on HTMLImageElement.
2252
2253         * html/HTMLAttributeNames.in:
2254         * html/HTMLImageElement.idl:
2255         * page/RuntimeEnabledFeatures.h:
2256         (WebCore::RuntimeEnabledFeatures::setLazyImageLoadingEnabled):
2257         (WebCore::RuntimeEnabledFeatures::lazyImageLoadingEnabled const):
2258
2259 2019-08-08  Miguel Gomez  <magomez@igalia.com>
2260
2261         [GTK][WPE] Remove the reference to WebCore::Animation from TextureMapperAnimation
2262         https://bugs.webkit.org/show_bug.cgi?id=200533
2263
2264         Reviewed by Žan Doberšek.
2265
2266         Pass the relevant parameters to TextureMapperAnimation instead of creating a new WebCore::Animation
2267         inside it.
2268
2269         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2270         (WebCore::timingFunctionForAnimationValue):
2271         (WebCore::TextureMapperAnimation::TextureMapperAnimation):
2272         (WebCore::TextureMapperAnimation::apply):
2273         (WebCore::TextureMapperAnimation::isActive const):
2274         * platform/graphics/texmap/TextureMapperAnimation.h:
2275         (WebCore::TextureMapperAnimation::keyframes const):
2276         (WebCore::TextureMapperAnimation::timingFunction const):
2277         (WebCore::TextureMapperAnimation::animation const): Deleted.
2278
2279 2019-08-08  Charlie Turner  <cturner@igalia.com>
2280
2281         [GTK] WebKitWebProcess crashes when viewing an HTML with a <video> element referencing unknown file
2282         https://bugs.webkit.org/show_bug.cgi?id=200530
2283
2284         Reviewed by Xabier Rodriguez-Calvar.
2285
2286         Not amenable to unit testing.
2287
2288         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2289         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
2290
2291 2019-08-07  Saam Barati  <sbarati@apple.com>
2292
2293         [WHLSL] Prune unreachable stdlib functions after the Checker runs
2294         https://bugs.webkit.org/show_bug.cgi?id=200518
2295
2296         Reviewed by Robin Morisset.
2297
2298         We now prune unreachable stdlib functions after the checker runs. We must
2299         do this after the checker runs because that's when we resolve all remaining
2300         function calls. While we can't prune unreachable user code, because we must
2301         still report errors in it, we can prune unreachable standard library code
2302         because we know a priori that it has no errors. This is a 10ms end-to-end
2303         speedup in compute_boids.
2304
2305         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2306         (WebCore::WHLSL::prepareShared):
2307         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp: Added.
2308         (WebCore::WHLSL::pruneUnreachableStandardLibraryFunctions):
2309         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.h: Added.
2310         * Sources.txt:
2311         * WebCore.xcodeproj/project.pbxproj:
2312
2313 2019-08-07  Kate Cheney  <katherine_cheney@apple.com>
2314
2315         Adopt non-deprecated CGColorSpace API
2316         https://bugs.webkit.org/show_bug.cgi?id=184358
2317
2318         Reviewed by Darin Adler.
2319
2320         * platform/ScreenProperties.h:
2321         (WebCore::ScreenData::decode):
2322
2323         We changed the deprecated CGColorSpaceCreateWithICCProfile function to 
2324         CGColorSpaceCreateWithICCData. 
2325  
2326 2019-08-07  Sam Weinig  <weinig@apple.com>
2327
2328         [WHLSL] Metal code generation takes a long time uniquing UnnamedTypes
2329         https://bugs.webkit.org/show_bug.cgi?id=200512
2330
2331         Reviewed by Saam Barati.
2332
2333         Instead of using a trie for unnamed type uniquing, use the same technique used
2334         in SynthesizeConstructors and use a HashMap of UnnamedTypeKeys. To make this
2335         profitable, we also need to devirtualize the hash and equality functions on
2336         UnnamedType, instead using an enum + switch. While this change only devirtualizes
2337         the UnnamedType subtree, we should probably do it for the entire AST in a future
2338         change.
2339
2340         * Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h:
2341         * Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
2342         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2343         * Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
2344         * Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
2345         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.cpp: Added.
2346         (WebCore::WHLSL::AST::UnnamedType::hash const):
2347         (WebCore::WHLSL::AST::UnnamedType::operator== const):
2348          * Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h:
2349         Devirtualize hash, operator== and type predicates.
2350
2351         * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: Added.
2352         (WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey):
2353         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2354         (WebCore::WHLSL::UnnamedTypeKey::UnnamedTypeKey): Deleted.
2355         Moved UnnamedTypeKey into it's own header from WHLSLSynthesizeConstructors.cpp
2356         
2357         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
2358         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
2359         (WebCore::WHLSL::Metal::BaseTypeNameNode::kind):
2360         (WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
2361         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
2362         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
2363         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
2364         Devirtualize BaseTypeNameNode as well. In a future change, we should consider removing
2365         this class entirely and instead mapping directly to a parent/mangled name pair.
2366  
2367         (WebCore::WHLSL::Metal::TypeNamer::visit):
2368         (WebCore::WHLSL::Metal::TypeNamer::find):
2369         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
2370         (WebCore::WHLSL::Metal::parent):
2371         (WebCore::WHLSL::Metal::TypeNamer::insert):
2372         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
2373         (WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
2374         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
2375         (WebCore::WHLSL::Metal::findInVector): Deleted.
2376         (WebCore::WHLSL::Metal::find): Deleted.
2377         (WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions): Deleted.
2378         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
2379         Switch from a Vector based trie to a HashMap for UnnamedType uniquing. Also
2380         use UnnamedType::Kind where possible with switch statements to clarify code.
2381
2382         * WebCore.xcodeproj/project.pbxproj:
2383         Add new files.
2384
2385 2019-08-07  Devin Rousso  <drousso@apple.com>
2386
2387         Web Inspector: Uncaught Exception: TimelineAgent already enabled
2388         https://bugs.webkit.org/show_bug.cgi?id=200513
2389
2390         Reviewed by Joseph Pecoraro.
2391
2392         Call `disable` when the last frontend disconnects, so that if Web Inspector is reopened the
2393         `TimelineAgent` is back to being in a disabled state.
2394
2395         * inspector/agents/InspectorTimelineAgent.cpp:
2396         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
2397
2398 2019-08-07  Jer Noble  <jer.noble@apple.com>
2399
2400         Muted <video> elements can block display from sleeping.
2401         https://bugs.webkit.org/show_bug.cgi?id=200511
2402
2403         Reviewed by Eric Carlson.
2404
2405         Test: media/video-muted-holds-sleep-assertion.html
2406
2407         Modify the shouldDisableSleep() method to take muting into account.
2408
2409         * html/HTMLMediaElement.cpp:
2410         (WebCore::HTMLMediaElement::shouldDisableSleep const):
2411
2412 2019-08-07  Robin Morisset  <rmorisset@apple.com>
2413
2414         [WHLSL] Simplify and eliminate redundant work in WHLSLFunctionWriter.cpp
2415         https://bugs.webkit.org/show_bug.cgi?id=200460
2416
2417         Reviewed by Myles Maxfield.
2418
2419         2 trivial simplifications:
2420         - Replace FunctionDeclarationWriter by a standalone function, there was no reason to make it a subclass of Visitor
2421         - Avoid an exponential blow-up in the computation of reachable functions.
2422
2423         I have way too much noise on my system (swings back and forth between 7 and 12ms for this phase) to measure a performance win,
2424         but since this patch simplifies things without adding complexity I think it is worth it.
2425
2426         No new test as there is no functional change intended.
2427
2428         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2429         (WebCore::WHLSL::Metal::declareFunction):
2430         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
2431         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
2432         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
2433         (WebCore::WHLSL::Metal::sharedMetalFunctions):
2434         (WebCore::WHLSL::Metal::metalFunctions):
2435
2436 2019-08-07  Saam Barati  <sbarati@apple.com>
2437
2438         [WHLSL] checkRecursion, checkTextureReferences, and EscapedVariableCollector should skip stdlib functions
2439         https://bugs.webkit.org/show_bug.cgi?id=200510
2440
2441         Reviewed by Myles C. Maxfield.
2442
2443         We can skip walking the stdlib part of the AST in various semantic checking phases:
2444         - checkRecursion: the stdlib does not have recursion
2445         - checkTextureReferences: the stdlib does not have references to textures
2446         - EscapedVariableCollector: this is used inside preserveVariableLifetimes, and
2447           the stdlib never escapes any variables.
2448         
2449         This patch speeds up checkRecursion, checkTextureReferences, and preserveVariableLifetimes
2450         by about 1ms each, leading to a 3ms compile time speedup in compute_boids.
2451
2452         * Modules/webgpu/WHLSL/WHLSLCheckTextureReferences.cpp:
2453         (WebCore::WHLSL::TextureReferencesChecker::visit):
2454         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
2455         (WebCore::WHLSL::preserveVariableLifetimes):
2456         (WebCore::WHLSL::EscapedVariableCollector::escapeVariableUse): Deleted.
2457         (WebCore::WHLSL::EscapedVariableCollector::takeEscapedVariables): Deleted.
2458         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp:
2459
2460 2019-08-08  Simon Fraser  <simon.fraser@apple.com>
2461
2462         Add to InteractionInformationAtPosition information about whether the element is in a subscrollable region
2463         https://bugs.webkit.org/show_bug.cgi?id=200374
2464         rdar://problem/54095519
2465
2466         Reviewed by Tim Horton.
2467
2468         Add to InteractionInformationAtPosition a ScrollingNodeID which represents the enclosing scrolling
2469         node that affects the targeted element's position. We use this to find a UIScrollView in the UI process.
2470         
2471         The entrypoint to finding the enclosing scrolling node is ScrollingCoordinator::scrollableContainerNodeID(),
2472         which calls RenderLayerCompositor::asyncScrollableContainerNodeID() to look for a scrolling ancestor in
2473         the current frame, and then looks for an enclosing scrollable frame, or a scrolling ancestor in
2474         the enclosing frame.
2475         
2476         There's a bit of subtlety in RenderLayerCompositor::asyncScrollableContainerNodeID() because if you're asking
2477         for the node that scrolls the renderer, if the renderer itself has a layer and is scrollable, you want
2478         its enclosing scroller.
2479
2480         * page/scrolling/AsyncScrollingCoordinator.cpp:
2481         (WebCore::AsyncScrollingCoordinator::scrollableContainerNodeID const):
2482         * page/scrolling/AsyncScrollingCoordinator.h:
2483         * page/scrolling/ScrollingCoordinator.cpp:
2484         (WebCore::scrollableContainerNodeID const):
2485         * page/scrolling/ScrollingCoordinator.h:
2486         * rendering/RenderLayer.h:
2487         * rendering/RenderLayerCompositor.cpp:
2488         (WebCore::RenderLayerCompositor::asyncScrollableContainerNodeID):
2489         * rendering/RenderLayerCompositor.h:
2490
2491 2019-08-07  Saam Barati  <sbarati@apple.com>
2492
2493         [WHLSL] cache results of argumentTypeForAndOverload inside Checker
2494         https://bugs.webkit.org/show_bug.cgi?id=200462
2495
2496         Reviewed by Robin Morisset.
2497
2498         When I profiled the time we spent in the checker, it turned out that 
2499         argumentTypeForAndOverload is one of the most expensive functions. If
2500         we just cache the results of that function, we can avoid 99% of the
2501         duplicate allocations that function does in compute_boids. This patch
2502         is a ~4ms speedup in the checker on compute_boids.
2503
2504         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2505         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2506         (WebCore::WHLSL::AndOverloadTypeKey::AndOverloadTypeKey):
2507         (WebCore::WHLSL::AndOverloadTypeKey::isEmptyValue const):
2508         (WebCore::WHLSL::AndOverloadTypeKey::isHashTableDeletedValue const):
2509         (WebCore::WHLSL::AndOverloadTypeKey::hash const):
2510         (WebCore::WHLSL::AndOverloadTypeKey::operator== const):
2511         (WebCore::WHLSL::AndOverloadTypeKey::Hash::hash):
2512         (WebCore::WHLSL::AndOverloadTypeKey::Hash::equal):
2513         (WebCore::WHLSL::AndOverloadTypeKey::Traits::isEmptyValue):
2514         (WebCore::WHLSL::Checker::argumentTypeForAndOverload):
2515         (WebCore::WHLSL::Checker::finishVisiting):
2516         (WebCore::WHLSL::argumentTypeForAndOverload): Deleted.
2517
2518 2019-08-07  Youenn Fablet  <youenn@apple.com>
2519
2520         Remove IDBDatabaseIdentifier::m_sessionID
2521         https://bugs.webkit.org/show_bug.cgi?id=200489
2522
2523         Reviewed by Darin Adler.
2524
2525         IDBDatabaseIdentifier can be created without a valid session ID.
2526         Its session ID is only used in NetworkProcess where it can be retrieved from the IDBServer.
2527         In WebProcess, session ID is also known from the IDB connection.
2528         Update SQLiteIDBBackingStore to store a session ID which is given from its IDBServer.
2529         No observable change of behavior.
2530
2531         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2532         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
2533         (WebCore::IDBDatabaseIdentifier::isolatedCopy const):
2534         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2535         (WebCore::IDBDatabaseIdentifier::hash const):
2536         (WebCore::IDBDatabaseIdentifier::databaseName const):
2537         (WebCore::IDBDatabaseIdentifier::encode const):
2538         (WebCore::IDBDatabaseIdentifier::decode):
2539         (WebCore::IDBDatabaseIdentifier::sessionID const): Deleted.
2540         * Modules/indexeddb/IDBFactory.cpp:
2541         (WebCore::IDBFactory::openInternal):
2542         (WebCore::IDBFactory::deleteDatabase):
2543         * Modules/indexeddb/server/IDBServer.cpp:
2544         (WebCore::IDBServer::IDBServer::createBackingStore):
2545         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2546         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
2547         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
2548         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2549         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2550         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
2551         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2552         (WebCore::IDBServer::SQLiteIDBBackingStore::sessionID const):
2553         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2554         (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
2555
2556 2019-08-07  Chris Dumez  <cdumez@apple.com>
2557
2558         Fix thread safety issue under JSHistory::visitAdditionalChildren()
2559         https://bugs.webkit.org/show_bug.cgi?id=200504
2560
2561         Reviewed by Darin Adler.
2562
2563         JSHistory::visitAdditionalChildren() is called from a GC thread and was calling
2564         History::cachedState() whose implementation goes deep into WebCore
2565         (FrameLoader / HistoryController). Among other things, it null checks m_window
2566         which is a WeakPtr and then later dereferences it to get the Frame object, which
2567         is not safe from the non-main thread.
2568
2569         To address the issue, introduce a simpler cachedStateForGC() getter which is
2570         thread safe, and use it in JSHistory::visitAdditionalChildren().
2571
2572         * bindings/js/JSHistoryCustom.cpp:
2573         (WebCore::JSHistory::visitAdditionalChildren):
2574         * page/History.h:
2575
2576 2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
2577
2578         Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
2579         a yellow auto-filled appearance
2580         https://bugs.webkit.org/show_bug.cgi?id=200037
2581         rdar://problem/51900961
2582
2583         Reviewed by Daniel Bates.
2584
2585         Tests: fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
2586                fast/forms/auto-fill-button/input-strong-password-viewable.html
2587
2588         * css/CSSSelector.cpp:
2589         (WebCore::CSSSelector::selectorText const):
2590         Adding CSSSelector case for new pseudo class of AutofillStrongPasswordViewable.
2591
2592         * css/CSSSelector.h: Added PseudoClassAutofillStrongPasswordViewable
2593
2594         * css/SelectorChecker.cpp:
2595         (WebCore::SelectorChecker::checkOne const): Added handling for SelectorChecker.cpp
2596
2597         * css/SelectorCheckerTestFunctions.h:
2598         (WebCore::isAutofilledStrongPasswordViewable):
2599         Checking if the element is an input element and considered to be
2600         AutoFilled and Viewable. Returns a boolean accordingly.
2601
2602         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2603         Add -webkit-autofill-strong-password-viewable css class.
2604
2605         * css/html.css:
2606         (input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable):
2607         (input:-webkit-autofill-strong-password-viewable):
2608         (input:-webkit-autofill, input:-webkit-autofill-strong-password): Deleted. Updated to include viewable pseudo class.
2609
2610         * cssjit/SelectorCompiler.cpp:
2611         (WebCore::SelectorCompiler::addPseudoClassType):
2612         Add case handling for PseudoClassAutofillStrongPasswordViewable.
2613
2614         * html/HTMLInputElement.cpp:
2615         (WebCore::HTMLInputElement::HTMLInputElement):
2616         Add boolean m_isAutoFilledAndViewable for representing if the
2617         input element is both AutoFilled and should be viewable.
2618         Don't update the viewable treatment in setValueFromRenderer() because even if the user makes edits to the input field
2619         the visual treatment should still be applied.
2620
2621         (WebCore::HTMLInputElement::resignStrongPasswordAppearance):
2622         Updates boolean representing if input element is autofilled and viewable to false.
2623
2624         (WebCore::HTMLInputElement::reset):
2625         Updates boolean representing if input element is autofilled and viewable to false.
2626
2627         (WebCore::HTMLInputElement::setAutoFilledAndViewable):
2628         Setter function for the boolean of m_isAutoFilledAndViewable.
2629
2630         * html/HTMLInputElement.h:
2631         (WebCore::HTMLInputElement::isAutoFilledAndViewable const):
2632         Creating boolean value for m_isAutoFilledAndViewable.
2633
2634         * testing/Internals.cpp:
2635         (WebCore::Internals::setAutoFilledAndViewable): Adding for testing purposes.
2636         * testing/Internals.h: Adding for testing purposes.
2637         * testing/Internals.idl:
2638
2639 2019-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2640
2641         Declarations and implementations of findCaret(Min|Max)imumOffset have inconsistent signatures
2642         https://bugs.webkit.org/show_bug.cgi?id=200503
2643
2644         Reviewed by Darin Adler.
2645
2646         No change in behavior.
2647
2648         * rendering/SimpleLineLayoutFunctions.h:
2649
2650         Update these function declarations to take "const RenderText&", which matches the signatures of their inline
2651         implementations below.
2652
2653 2019-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2654
2655         Extra space inserted at start of line when inserting a newline in Mail compose
2656         https://bugs.webkit.org/show_bug.cgi?id=200490
2657         <rdar://problem/53501354>
2658
2659         Reviewed by Antti Koivisto.
2660
2661         This started happening after r244494, which deferred editor state computation until the next layer tree flush
2662         when changing selection. After inserting a paragraph, the act of computing an editor state ensured that the text
2663         node containing the caret drops out of simple line layout, while grabbing the characters near the selection
2664         (i.e., calling charactersAroundPosition). This meant that when we subsequently ask positionAfterSplit whether it
2665         isRenderedCharacter() at the end of the command, we are guaranteed to have line boxes, so we get a meaningful
2666         answer and avoid inserting an extra non-breaking space.
2667
2668         However, after r244494, we defer the editor state computation until the end of the edit command; this means that
2669         we may not have line boxes for positionAfterSplit's text node renderer, due to remaining in simple line layout.
2670         In turn, this means that we end up hitting the assertion in containsRenderedCharacterOffset in debug builds; on
2671         release builds, we simply return false from containsRenderedCharacterOffset, which causes us to insert an extra
2672         space.
2673
2674         To fix this, we educate RenderText::containsRenderedCharacterOffset about simple line layout.
2675
2676         Test: editing/inserting/insert-paragraph-in-designmode-document.html
2677
2678         * rendering/RenderText.cpp:
2679         (WebCore::RenderText::containsRenderedCharacterOffset const):
2680         (WebCore::RenderText::containsCaretOffset const):
2681
2682         Changed to use SimpleLineLayout::containsOffset.
2683
2684         * rendering/SimpleLineLayoutFunctions.h:
2685         (WebCore::SimpleLineLayout::containsOffset):
2686
2687         I first contrasted the behavior of RenderTextLineBoxes::containsOffset in the cases where the OffsetType is
2688         CaretOffset or CharacterOffset, and found that the only interesting differences were:
2689
2690         1. The caret offset type case has special handling for line breaks.
2691         2. Both offset types have handling for reversed text.
2692         3. The end offset of a line box contains a caret offset, but not a character offset.
2693
2694         For the purposes of OffsetType CharacterOffset, (1) is irrelevant; furthermore, (2) is already not handled by
2695         logic in containsCaretOffset(). Thus, the only major difference in the CharacterOffset case should be (3), which
2696         we handle by only allowing the case where the given offset is equal to the very end of a text run for caret
2697         offsets, and not character offsets.
2698
2699         (WebCore::SimpleLineLayout::containsCaretOffset): Deleted.
2700
2701         Renamed to just containsOffset.
2702
2703 2019-08-07  Youenn Fablet  <youenn@apple.com>
2704
2705         ASSERT that a sessionID is valid when encoding it
2706         https://bugs.webkit.org/show_bug.cgi?id=199302
2707
2708         Reviewed by Darin Adler.
2709
2710         For IDBValue, instead of encoding an invalid session ID, encode a boolean that tells there is no sessionID.
2711         For IDBRequestData, keep track of whether there is an IDBDatabaseIdentifier
2712         and encode/decode accordingly to not encode an invalid sessionID.
2713         No observable change of behavior.
2714
2715         * Modules/indexeddb/IDBValue.h:
2716         (WebCore::IDBValue::sessionID const):
2717         (WebCore::IDBValue::encode const):
2718         (WebCore::IDBValue::decode):
2719         * Modules/indexeddb/shared/IDBRequestData.cpp:
2720         (WebCore::IDBRequestData::isolatedCopy):
2721         * Modules/indexeddb/shared/IDBRequestData.h:
2722         (WebCore::IDBRequestData::databaseIdentifier const):
2723         (WebCore::IDBRequestData::decode):
2724
2725 2019-08-07  Zalan Bujtas  <zalan@apple.com>
2726
2727         [LFC] Rename FormattingContext::layoutOutOfFlowDescendants to layoutOutOfFlowContent
2728         https://bugs.webkit.org/show_bug.cgi?id=200502
2729         <rdar://problem/54032534>
2730
2731         Reviewed by Antti Koivisto.
2732
2733         The layoutOutOfFlowDescendants name is not entirely accurate. In a formatting context we only
2734         lay out the out-of-flow boxes that actually belong to the current formatting context.
2735
2736         <div style="float: left">
2737           <div id=outer style="position: absolute">
2738             <div id=inner style="position: absolute"></div>
2739           </div>
2740         </div>
2741
2742         The float's formatting context only lays out the outer absolutely positioned box. The inner box
2743         (which is also an out-of-flow descendant of the float box) is taken care of by the outer box.
2744
2745         * layout/FormattingContext.cpp:
2746         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent const):
2747         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2748         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): Deleted.
2749         * layout/FormattingContext.h:
2750         * layout/LayoutState.cpp:
2751         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2752         * layout/blockformatting/BlockFormattingContext.cpp:
2753         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2754         * layout/inlineformatting/InlineFormattingContext.cpp:
2755         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2756
2757 2019-08-07  Zalan Bujtas  <zalan@apple.com>
2758
2759         [LFC] Introduce Layout::Phase class
2760         https://bugs.webkit.org/show_bug.cgi?id=200473
2761         <rdar://problem/53996061>
2762
2763         Reviewed by Antti Koivisto.
2764
2765         It helps to check whether we could run certain actions like layout while constructing the tree.
2766
2767         * Sources.txt:
2768         * WebCore.xcodeproj/project.pbxproj:
2769         * layout/LayoutState.h:
2770         * layout/floats/FloatingContext.cpp:
2771         * layout/inlineformatting/InlineLine.cpp:
2772         * layout/layouttree/LayoutBox.cpp:
2773         (WebCore::Layout::Box::establishesFormattingContext const):
2774         (WebCore::Layout::Box::containingBlock const):
2775         (WebCore::Layout::Box::formattingContextRoot const):
2776         * layout/layouttree/LayoutTreeBuilder.cpp:
2777         (WebCore::Layout::TreeBuilder::createLayoutTree):
2778
2779 2019-08-07  Chris Lord  <clord@igalia.com>
2780
2781         context-attributes-alpha-depth-stencil-antialias fails on WPE WebKit
2782         https://bugs.webkit.org/show_bug.cgi?id=200434
2783
2784         Reviewed by Žan Doberšek.
2785
2786         This patch fixes 16-bit surfaces being used for FBOs with no
2787         alpha component when using the GLES implementation of GraphicsContext3D.
2788
2789         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
2790         (WebCore::GraphicsContext3D::reshapeFBOs):
2791         Use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_SHORT_5_6_5 for surfaces with no alpha.
2792
2793 2019-08-06  Saam Barati  <sbarati@apple.com>
2794
2795         [WHLSL] Make resolveFunction in Checker faster
2796         https://bugs.webkit.org/show_bug.cgi?id=200287
2797
2798         Reviewed by Robin Morisset.
2799
2800         This patch makes compute_boids faster by making function overload
2801         resolution faster inside the Checker. It's a ~6ms speedup in the
2802         checker. The main idea is to limit the number of overloads we need
2803         to look for by using a hash table that describes a function's type
2804         instead of just using a hash table keyed by a function's name.
2805         
2806         The interesting implementation detail here is we must construct entries
2807         in the hash table such that they still allow constants to be resolved to
2808         various types. This means that the key in the hash table must normalize
2809         the vector of types it uses to express a function's identity. The normalization
2810         rules are:
2811         - int => float
2812         - uint => float
2813         - T* => float*
2814         - T[] => float*
2815         
2816         The first two rules are because int constants can be matched against
2817         the float and uint types. The latter two rules are because the null
2818         literal can be matched against any pointer or any array reference
2819         (we pick float* arbitrarily). Even though it seems like these
2820         normalization rules would drastically broaden the efficacy of the hash
2821         table, we still see a 100x reduction in the number of overloads we must
2822         resolve inside compute_boids. We go from having to resolve 400,000
2823         overloads to just resolving 4,000.
2824
2825         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2826         (WebCore::WHLSL::FunctionKey::FunctionKey):
2827         (WebCore::WHLSL::FunctionKey::isEmptyValue const):
2828         (WebCore::WHLSL::FunctionKey::isHashTableDeletedValue const):
2829         (WebCore::WHLSL::FunctionKey::hash const):
2830         (WebCore::WHLSL::FunctionKey::operator== const):
2831         (WebCore::WHLSL::FunctionKey::Hash::hash):
2832         (WebCore::WHLSL::FunctionKey::Hash::equal):
2833         (WebCore::WHLSL::FunctionKey::Traits::isEmptyValue):
2834         (WebCore::WHLSL::Checker::Checker):
2835         (WebCore::WHLSL::Checker::wrappedFloatType):
2836         (WebCore::WHLSL::Checker::genericPointerType):
2837         (WebCore::WHLSL::Checker::normalizedTypeForFunctionKey):
2838         (WebCore::WHLSL::Checker::resolveFunction):
2839         (WebCore::WHLSL::Checker::finishVisiting):
2840         (WebCore::WHLSL::Checker::visit):
2841         (WebCore::WHLSL::resolveFunction): Deleted.
2842
2843 2019-08-06  Loïc Yhuel  <loic.yhuel@softathome.com>
2844
2845         Fix 32-bit Linux build after r248282
2846         https://bugs.webkit.org/show_bug.cgi?id=200491
2847
2848         Reviewed by Youenn Fablet.
2849
2850         minInterToneGapMs must be a size_t like interToneGap for std::max call.
2851         The other constants are updated for consistency, even if the compiler
2852         was able to cast them automatically.
2853
2854         * Modules/mediastream/RTCDTMFSender.cpp:
2855
2856 2019-08-06  Commit Queue  <commit-queue@webkit.org>
2857
2858         Unreviewed, rolling out r248289.
2859         https://bugs.webkit.org/show_bug.cgi?id=200488
2860
2861         Broke internal builds (Requested by drousso on #webkit).
2862
2863         Reverted changeset:
2864
2865         "Web Inspector: Styles: show @supports CSS groupings"
2866         https://bugs.webkit.org/show_bug.cgi?id=200419
2867         https://trac.webkit.org/changeset/248289
2868
2869 2019-08-06  Chris Dumez  <cdumez@apple.com>
2870
2871         Fix inefficiency in HTTPHeaderMap::set(CFStringRef, const String&)
2872         https://bugs.webkit.org/show_bug.cgi?id=200475
2873
2874         Reviewed by Darin Adler.
2875
2876         In the case where CFStringGetCStringPtr() succeeds in returning us a pointer
2877         to the CFStringRef underlying characters but it is not a common header, we
2878         would fall back to calling HTTPHeaderMap::set(const String&, const String&)
2879         which would unecessarily call findHTTPHeaderName() again to try and determine
2880         if it is a common header. Avoid this by introducing a new setUncommonHeader()
2881         private method and calling this one instead. Also got rid of some code
2882         duplication at the same time.
2883
2884         * platform/network/HTTPHeaderMap.cpp:
2885         (WebCore::HTTPHeaderMap::set):
2886         (WebCore::HTTPHeaderMap::setUncommonHeader):
2887         * platform/network/HTTPHeaderMap.h:
2888         * platform/network/HTTPParsers.cpp:
2889         (WebCore::parseHTTPHeader):
2890         * testing/MockCDMFactory.cpp:
2891         (WebCore::MockCDMInstance::setServerCertificate):
2892
2893 2019-08-06  Saam Barati  <sbarati@apple.com>
2894
2895         [WHLSL] Remove the auto initialize variables pass
2896         https://bugs.webkit.org/show_bug.cgi?id=200472
2897
2898         Reviewed by Robin Morisset.
2899
2900         From a separation of concerns perspective, it's a bit nicer to make variables
2901         without initializers call their default constructors as a transformation over the AST.
2902         This removes the need for the lowering to need to worry about such things. However,
2903         changing metal lowering to deal with this is trivial. It means we need to change one
2904         line of code in Metal code generation, and we get to remove a ~50 LOC AST pass.
2905         Also, in this case, it saves us from the compile time hit of having to run the
2906         auto initialize variables phase, which takes ~1.2ms on compute_boids.
2907
2908         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2909         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2910         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.cpp: Removed.
2911         * Modules/webgpu/WHLSL/WHLSLAutoInitializeVariables.h: Removed.
2912         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2913         (WebCore::WHLSL::prepareShared):
2914         * Sources.txt:
2915         * WebCore.xcodeproj/project.pbxproj:
2916
2917 2019-08-06  Sam Weinig  <weinig@apple.com>
2918
2919         WHLSL Metal code generation unnecessarily does string copies by passing partial results as Strings
2920         https://bugs.webkit.org/show_bug.cgi?id=200471
2921
2922         Reviewed by Saam Barati.
2923
2924         Avoid string copies by passing a single StringBuilder all the way through Metal code
2925         generation and only converting to a String when passing the constructed shader to Metal
2926         API.
2927         
2928         Where possible, use StringView in lieu of String for temporary strings being passed to
2929         the StringBuilder to avoid the allocation overhead of StringImpl. 
2930
2931         * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
2932         (WebCore::WHLSL::AST::toString):
2933         Switch to StringView.
2934
2935         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
2936         (WebCore::WHLSL::AST::BuiltInSemantic::toString const):
2937         Switch to StringView.
2938
2939         * Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h:
2940         (WebCore::WHLSL::AST::toString):
2941         Switch to StringView.
2942
2943         * Modules/webgpu/WHLSL/AST/WHLSLPointerType.h:
2944         Remove unnecessary "private:".
2945     
2946         * Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
2947         (WebCore::WHLSL::AST::ResourceSemantic::toString):
2948         Switch to StringView.
2949
2950         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2951         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
2952         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceSignature):
2953         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitBuiltInsSignature):
2954         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitMangledInputPath):
2955         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitMangledOutputPath):
2956         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitUnpackResourcesAndNamedBuiltIns):
2957         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
2958         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitSignature):
2959         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitUnpack):
2960         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitPack):
2961         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
2962         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitSignature):
2963         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitUnpack):
2964         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitPack):
2965         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
2966         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitSignature):
2967         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitUnpack):
2968         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitPack):
2969         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes): Deleted.
2970         (WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature): Deleted.
2971         (WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature): Deleted.
2972         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath): Deleted.
2973         (WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath): Deleted.
2974         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns): Deleted.
2975         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes): Deleted.
2976         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature): Deleted.
2977         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack): Deleted.
2978         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Deleted.
2979         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes): Deleted.
2980         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature): Deleted.
2981         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack): Deleted.
2982         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Deleted.
2983         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes): Deleted.
2984         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature): Deleted.
2985         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack): Deleted.
2986         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack): Deleted.
2987         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2988         Rather than have scaffolding return strings, pass in StringBuilders everywhere. 
2989
2990         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
2991         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
2992         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
2993         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitConstantExpressionString):
2994         (WebCore::WHLSL::Metal::generateMetalFunctionsMapping):
2995         (WebCore::WHLSL::Metal::emitSharedMetalFunctions):
2996         (WebCore::WHLSL::Metal::emitMetalFunctions):
2997         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter): Deleted.
2998         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString): Deleted.
2999         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString): Deleted.
3000         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString): Deleted.
3001         (WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter): Deleted.
3002         (WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter): Deleted.
3003         (WebCore::WHLSL::Metal::sharedMetalFunctions): Deleted.
3004         (WebCore::WHLSL::Metal::metalFunctions): Deleted.
3005         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
3006         Rather than returning Strings from function generation functions, pass in StringBuilders everywhere.
3007
3008         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
3009         (WebCore::WHLSL::Metal::metalCodeProlog):
3010         (WebCore::WHLSL::Metal::dumpMetalCodeIfNeeded):
3011         (WebCore::WHLSL::Metal::generateMetalCode):
3012         (WebCore::WHLSL::Metal::generateMetalCodeShared): Deleted.
3013         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
3014         Switch RenderMetalCode and ComputeMetalCode to contain StringBuilders to allow
3015         delaying conversion to String to the latest point possible.
3016         
3017         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp:
3018         (WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDeclarations):
3019         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
3020         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
3021         (WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions):
3022         (WebCore::WHLSL::Metal::TypeNamer::emitMetalTypeDefinitions):
3023         (WebCore::WHLSL::Metal::TypeNamer::emitMetalTypes):
3024         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter): Deleted.
3025         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString): Deleted.
3026         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit): Deleted.
3027         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations): Deleted.
3028         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions): Deleted.
3029         (WebCore::WHLSL::Metal::TypeNamer::metalTypes): Deleted.
3030         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
3031         Rather than returning Strings from function generation functions, pass in StringBuilders everywhere.
3032
3033         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3034         (WebCore::WHLSL::Parser::parseResourceSemantic):
3035         Remove use of _str, which allocates a String, and just use a StringView directly.
3036
3037         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
3038         Switch RenderPrepareResult and ComputePrepareResult to contain StringBuilders to allow
3039         delaying conversion to String to the latest point possible.
3040
3041         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
3042         (WebCore::trySetFunctions):
3043         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3044         (WebCore::trySetFunctions):
3045         Convert StringBuilders to String at the last moment necessary. Adds a FIXME to improve
3046         in the future by adding direct conversion from StringBuilder to NSString to avoid another
3047         copy.
3048
3049 2019-08-06  Saam Barati  <sbarati@apple.com>
3050
3051         [WHLSL] Reduce the number of variables that make it into the global struct by skipping stdlib functions and internal uses of MakePointerExpression/MakeArrayReference
3052         https://bugs.webkit.org/show_bug.cgi?id=200463
3053
3054         Reviewed by Myles C. Maxfield.
3055
3056         This patch makes it so that we put fewer variables in the global struct.
3057         This decreases end-to-end running time in compute_boids by 30% (with p = 0.0001).
3058         
3059         We achieve this in two ways:
3060         1. We track if each function is user code or "standard library" code. We also
3061         count native functions as the standard library. We know a priori that the
3062         standard library never escapes any variables. So the preserve variable
3063         lifetimes phase skips analyzing all standard library functions and also
3064         skips passing the global struct to any standard library functions.
3065         
3066         2. We internally emit MakePointerExpression/MakeArrayReferenceExpression nodes in
3067         the compiler in various phases. We sometimes emit these nodes in such a way
3068         that we know that this address-of expression does not cause the variable to
3069         escape. We now mark each address-of expressions as either:
3070         - Conservatively escaping. We conservatively do this for all user code.
3071         - Not escaping. This means that this address-of operation definitely does
3072         not escape the variable. If a variable never has an escaping use, we will
3073         omit putting this variable in the struct.
3074
3075         * Modules/webgpu/WHLSL/AST/WHLSLAddressEscapeMode.h: Added.
3076         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
3077         (WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
3078         (WebCore::WHLSL::AST::FunctionDeclaration::parsingMode const):
3079         * Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
3080         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
3081         (WebCore::WHLSL::AST::MakeArrayReferenceExpression::mightEscape const):
3082         * Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
3083         (WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
3084         (WebCore::WHLSL::AST::MakePointerExpression::mightEscape const):
3085         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3086         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
3087         (WebCore::WHLSL::resolveWithOperatorLength):
3088         (WebCore::WHLSL::resolveWithReferenceComparator):
3089         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3090         (WebCore::WHLSL::Parser::parse):
3091         (WebCore::WHLSL::Parser::parseComputeFunctionDeclaration):
3092         (WebCore::WHLSL::Parser::parseVertexOrFragmentFunctionDeclaration):
3093         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
3094         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
3095         (WebCore::WHLSL::Parser::parsePossiblePrefix):
3096         * Modules/webgpu/WHLSL/WHLSLParser.h:
3097         * Modules/webgpu/WHLSL/WHLSLParsingMode.h: Added.
3098         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3099         (WebCore::WHLSL::prepareShared):
3100         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
3101         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3102         (WebCore::WHLSL::wrapAnderCallArgument):
3103         (WebCore::WHLSL::modify):
3104         (WebCore::WHLSL::PropertyResolver::visit):
3105         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
3106         (WebCore::WHLSL::includeStandardLibrary):
3107         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
3108         (WebCore::WHLSL::synthesizeArrayOperatorLength):
3109         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
3110         (WebCore::WHLSL::synthesizeConstructors):
3111         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
3112         (WebCore::WHLSL::synthesizeEnumerationFunctions):
3113         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
3114         (WebCore::WHLSL::synthesizeStructureAccessors):
3115         * WebCore.xcodeproj/project.pbxproj:
3116
3117 2019-08-06  Jer Noble  <jer.noble@apple.com>
3118
3119         Adopt -expectMinimumUpcomingSampleBufferPresentationTime:
3120         https://bugs.webkit.org/show_bug.cgi?id=200457
3121         <rdar://problem/53961130>
3122
3123         Reviewed by Eric Carlson.
3124
3125         Test: media/media-source/media-source-minimumupcomingpresentationtime.html
3126
3127         Adopt a new API vended by AVSampleBufferDisplayLayer, piped from SourceBuffer down
3128         through SourceBufferPrivate to SourceBufferPrivateAVFObjC. This value should be
3129         reset and updated when new samples are appended.
3130
3131         * Modules/mediasource/SourceBuffer.cpp:
3132         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3133         (WebCore::SourceBuffer::provideMediaData):
3134         (WebCore::SourceBuffer::updateMinimumUpcomingPresentationTime):
3135         (WebCore::SourceBuffer::resetMinimumUpcomingPresentationTime):
3136         (WebCore::SourceBuffer::minimumUpcomingPresentationTimeForTrackID):
3137         (WebCore::SourceBuffer::setMaximumQueueDepthForTrackID):
3138         * Modules/mediasource/SourceBuffer.h:
3139         * platform/graphics/SourceBufferPrivate.h:
3140         (WebCore::SourceBufferPrivate::canSetMinimumUpcomingPresentationTime const):
3141         (WebCore::SourceBufferPrivate::setMinimumUpcomingPresentationTime):
3142         (WebCore::SourceBufferPrivate::clearMinimumUpcomingPresentationTime):
3143         (WebCore::SourceBufferPrivate::enqueuedSamplesForTrackID):
3144         (WebCore::SourceBufferPrivate::minimumUpcomingPresentationTimeForTrackID):
3145         (WebCore::SourceBufferPrivate::setMaximumQueueDepthForTrackID):
3146         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3147         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3148         (WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const):
3149         (WebCore::SourceBufferPrivateAVFObjC::setMinimumUpcomingPresentationTime):
3150         (WebCore::SourceBufferPrivateAVFObjC::clearMinimumUpcomingPresentationTime):
3151         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
3152         (WebCore::MockSourceBufferPrivate::minimumUpcomingPresentationTimeForTrackID):
3153         (WebCore::MockSourceBufferPrivate::setMaximumQueueDepthForTrackID):
3154         (WebCore::MockSourceBufferPrivate::canSetMinimumUpcomingPresentationTime const):
3155         (WebCore::MockSourceBufferPrivate::setMinimumUpcomingPresentationTime):
3156         (WebCore::MockSourceBufferPrivate::clearMinimumUpcomingPresentationTime):
3157         * platform/mock/mediasource/MockSourceBufferPrivate.h:
3158         * testing/Internals.cpp:
3159         (WebCore::Internals::minimumUpcomingPresentationTimeForTrackID):
3160         (WebCore::Internals::setMaximumQueueDepthForTrackID):
3161         * testing/Internals.h:
3162         * testing/Internals.idl:
3163
3164 2019-08-06  Antti Koivisto  <antti@apple.com>
3165
3166         Add release assert against InvalidationRuleSet mutation during invalidation
3167         https://bugs.webkit.org/show_bug.cgi?id=200467
3168
3169         Reviewed by Chris Dumez.
3170
3171         Try to get a more informative stack for rdar://problem/53413013
3172
3173         * css/DocumentRuleSets.cpp:
3174         (WebCore::DocumentRuleSets::~DocumentRuleSets):
3175         (WebCore::DocumentRuleSets::collectFeatures const):
3176         * css/DocumentRuleSets.h:
3177         * style/AttributeChangeInvalidation.cpp:
3178         (WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
3179         * style/ClassChangeInvalidation.cpp:
3180         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
3181
3182 2019-08-06  Antti Koivisto  <antti@apple.com>
3183
3184         REGRESSION: Cannot tap on any buttons on m.naver.com home screen on iPad
3185         https://bugs.webkit.org/show_bug.cgi?id=200466
3186
3187         Reviewed by Zalan Bujtas.
3188
3189         The page calls preventDefault() for a mouse event generated by a site specific quirk.
3190
3191         * page/Quirks.cpp:
3192         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
3193
3194         Disable the quirk for the "m." subdomain. This is a mobile site that don't need or expect them.
3195
3196 2019-08-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3197
3198         [iPadOS] Unable to increase zoom level on Google using the Aa menu
3199         https://bugs.webkit.org/show_bug.cgi?id=200453
3200         <rdar://problem/52278579>
3201
3202         Reviewed by Tim Horton.
3203
3204         Makes a couple of minor adjustments to how layout size scale factor is handled in ViewportConfiguration, to
3205         address some scenarios in which adjusting WKWebView's _viewScale does not have any apparent effect on the page.
3206         See changes below for more detail.
3207
3208         Tests: fast/viewport/ios/non-responsive-viewport-after-changing-view-scale.html
3209                fast/viewport/ios/responsive-viewport-with-minimum-width-after-changing-view-scale.html
3210
3211         * page/ViewportConfiguration.cpp:
3212         (WebCore::ViewportConfiguration::initialScaleFromSize const):
3213
3214         When the page is either zoomed in or zoomed out using _viewScale, let the specified initial scale take
3215         precedence over the scale computed by fitting the content width to the view width, or the scale computed by
3216         fitting the content height to the view height.
3217
3218         This avoids a scenario in which nothing happens when increasing view scale in a responsively designed web page
3219         that has a fixed minimum width. Before this change, when computing the initial scale at a view scale that would
3220         not allow the entire content width of the page to fit within the viewport, the new initial scale would remain
3221         unchanged if the initial scale in the meta viewport is not also set to 1, because a new initial scale would be
3222         computed in ViewportConfiguration::initialScaleFromSize to accomodate for the entire content width.
3223
3224         Our new behavior allows us to zoom into the page, even if doing so would cause horizontal scrolling.
3225
3226         (WebCore::ViewportConfiguration::updateConfiguration):
3227
3228         When the page is either zoomed in or zoomed out using _viewScale and the default viewport configuration has a
3229         fixed width (e.g. on iPhone), then adjust the width of the default viewport configuration to account for the
3230         _viewScale. For example, the default width of a viewport-less web page is 980px on iPhone; at a view scale of 2,
3231         this would become 490px instead, and at 0.5 view scale, it would become 1960px.
3232
3233         This ensures that on iPhone, for web pages without a meta viewport, changing the view scale still changes the
3234         layout and initial scale of the web page.
3235
3236         * page/ViewportConfiguration.h:
3237         (WebCore::ViewportConfiguration::layoutSizeIsExplicitlyScaled const):
3238
3239 2019-08-05  Zalan Bujtas  <zalan@apple.com>
3240
3241         [LFC] Remove out-of-flow descendants from Container
3242         https://bugs.webkit.org/show_bug.cgi?id=200430
3243         <rdar://problem/53923980>
3244
3245         Reviewed by Antti Koivisto.
3246
3247         The out-of-flow descendant list is the last "formatting context type" bit in the layout tree.
3248         Let's cached them in the FormattingStates instead for now. 
3249
3250         * layout/FormattingContext.cpp:
3251         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
3252         * layout/FormattingContext.h:
3253         * layout/FormattingState.h:
3254         (WebCore::Layout::FormattingState::addOutOfFlowBox):
3255         (WebCore::Layout::FormattingState::outOfFlowBoxes const):
3256         * layout/LayoutState.cpp:
3257         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
3258         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
3259         (WebCore::Layout::LayoutState::run):
3260         * layout/LayoutState.h:
3261         * layout/blockformatting/BlockFormattingContext.cpp:
3262         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3263         * layout/inlineformatting/InlineFormattingContext.cpp:
3264         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
3265         * layout/layouttree/LayoutBox.h:
3266         * layout/layouttree/LayoutContainer.cpp:
3267         (WebCore::Layout::Container::addOutOfFlowDescendant): Deleted.
3268         * layout/layouttree/LayoutContainer.h:
3269         * layout/layouttree/LayoutTreeBuilder.cpp:
3270         (WebCore::Layout::TreeBuilder::createLayoutTree):
3271         * page/FrameViewLayoutContext.cpp:
3272         (WebCore::layoutUsingFormattingContext):
3273
3274 2019-08-05  Devin Rousso  <drousso@apple.com>
3275
3276         Web Inspector: Styles: show @supports CSS groupings
3277         https://bugs.webkit.org/show_bug.cgi?id=200419
3278
3279         Reviewed by Joseph Pecoraro.
3280
3281         Test: inspector/css/getMatchedStylesForNode.html
3282
3283         * inspector/InspectorStyleSheet.cpp:
3284         (WebCore::buildArrayForGroupings): Added.
3285         (WebCore::InspectorStyleSheet::buildObjectForRule):
3286         (WebCore::buildMediaObject): Deleted.
3287         (WebCore::fillMediaListChain): Deleted.
3288
3289         * css/MediaList.h:
3290         * css/MediaList.cpp:
3291         (WebCore::MediaQuerySet::MediaQuerySet):
3292         Remove the `lastLine` as it was never set by anyone and wasn't used by Web Inspector.
3293
3294 2019-08-05  Youenn Fablet  <youenn@apple.com>
3295
3296         Make Logger::log thread safe so that it can be used from background threads
3297         https://bugs.webkit.org/show_bug.cgi?id=200448
3298
3299         Reviewed by Eric Carlson.
3300
3301         No change of behavior.
3302
3303         * dom/Document.cpp:
3304         (WebCore::crossThreadCopy):
3305         (WebCore::Document::didLogMessage):
3306         Make sure to hop to the main thread if needed.
3307         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
3308         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
3309         Remove hopping to the main thread.
3310         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
3311         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
3312         Remove hopping to the main thread.
3313
3314 2019-08-05  Devin Rousso  <drousso@apple.com>
3315
3316         Can't use $0, $1 etc when inspecting Google Docs pages because the content uses these for function names
3317         https://bugs.webkit.org/show_bug.cgi?id=195834
3318
3319         Reviewed by Joseph Pecoraro.
3320
3321         Allow the user to alias saved results by providing a different prefix (e.g. "$") from within
3322         Web Inspector. When changing the alias, all existing saved results will update to be
3323         reference-able from the new alias.
3324
3325         Test: inspector/runtime/setSavedResultAlias.html
3326
3327         * inspector/CommandLineAPIModuleSource.js:
3328         (CommandLineAPI):
3329
3330 2019-08-05  Devin Rousso  <drousso@apple.com>
3331
3332         Web Inspector: Timelines: disable related agents when the tab is closed
3333         https://bugs.webkit.org/show_bug.cgi?id=200118
3334
3335         Reviewed by Joseph Pecoraro.
3336
3337         Rework how `enable`/`disable` is used for timeline-related agents so that events are not sent
3338         and data isn't kept alive when the Timelines tab isn't enabled.
3339
3340         * inspector/agents/InspectorTimelineAgent.h:
3341         * inspector/agents/InspectorTimelineAgent.cpp:
3342         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
3343         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3344         (WebCore::InspectorTimelineAgent::enable):
3345         (WebCore::InspectorTimelineAgent::disable):
3346         (WebCore::InspectorTimelineAgent::start):
3347         (WebCore::InspectorTimelineAgent::stop):
3348         (WebCore::InspectorTimelineAgent::internalStart):
3349         (WebCore::InspectorTimelineAgent::internalStop):
3350         (WebCore::InspectorTimelineAgent::startFromConsole):
3351         (WebCore::InspectorTimelineAgent::stopFromConsole):
3352         (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
3353         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
3354         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
3355         Rename `m_enabled*` to `m_tracking*` to match other timeline-related agents.
3356
3357         * inspector/agents/InspectorMemoryAgent.h:
3358         * inspector/agents/InspectorMemoryAgent.cpp:
3359         (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
3360         (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
3361         (WebCore::InspectorMemoryAgent::enable):
3362         (WebCore::InspectorMemoryAgent::disable):
3363         (WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
3364
3365         * inspector/InstrumentingAgents.h:
3366         (WebCore::InstrumentingAgents::trackingInspectorTimelineAgent): Added.
3367         (WebCore::InstrumentingAgents::setTrackingInspectorTimelineAgent): Added.
3368         (WebCore::InstrumentingAgents::persistentInspectorTimelineAgent): Added.
3369         (WebCore::InstrumentingAgents::setPersistentInspectorTimelineAgent): Added.
3370        &n