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