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