7a4dc103d3f9bad99bdb23c421f6a706d4ba8990
[WebKit.git] / Source / WebCore / ChangeLog
1 2019-09-12  Mark Lam  <mark.lam@apple.com>
2
3         Harden JSC against the abuse of runtime options.
4         https://bugs.webkit.org/show_bug.cgi?id=201597
5         <rdar://problem/55167068>
6
7         Reviewed by Filip Pizlo.
8
9         No new tests.  Covered by existing tests.
10
11         Enable Options::useDollarVM before we tell the JSGlobalObject to exposeDollarVM().
12         The $vm utility is now hardened to require that Options::useDollarVM be
13         enabled in order for it to be used.
14
15         * testing/js/WebCoreTestSupport.cpp:
16         (WebCoreTestSupport::injectInternalsObject):
17
18 2019-09-12  Youenn Fablet  <youenn@apple.com>
19
20         Use typed identifiers for IDB connection identifiers
21         https://bugs.webkit.org/show_bug.cgi?id=201682
22
23         Reviewed by Chris Dumez.
24
25         Migrate from uint64_t to a typed identifier for IDB connection identifiers.
26         The identifier is reusing the process identifier type.
27         No change of behavior.
28
29         * Modules/indexeddb/client/IDBConnectionProxy.h:
30         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier const):
31         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
32         (WebCore::IDBClient::IDBConnectionToServer::identifier const):
33         * Modules/indexeddb/client/IDBConnectionToServer.h:
34         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
35         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
36         (WebCore::IDBServer::IDBConnectionToClient::identifier const):
37         * Modules/indexeddb/server/IDBConnectionToClient.h:
38         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
39         * Modules/indexeddb/server/IDBServer.cpp:
40         (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
41         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
42         (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
43         * Modules/indexeddb/server/IDBServer.h:
44         * Modules/indexeddb/shared/IDBRequestData.cpp:
45         (WebCore::IDBRequestData::serverConnectionIdentifier const):
46         * Modules/indexeddb/shared/IDBRequestData.h:
47         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
48         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
49         (WebCore::IDBResourceIdentifier::emptyValue):
50         (WebCore::IDBResourceIdentifier::deletedValue):
51         (WebCore::IDBResourceIdentifier::isHashTableDeletedValue const):
52         (WebCore::IDBResourceIdentifier::loggingString const):
53         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
54         (WebCore::IDBResourceIdentifier::hash const):
55         (WebCore::IDBResourceIdentifier::connectionIdentifier const):
56         (WTF::crossThreadCopy):
57         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
58         (WebCore::InProcessIDBServer::identifier const):
59         * Modules/indexeddb/shared/InProcessIDBServer.h:
60
61 2019-09-12  Youenn Fablet  <youenn@apple.com>
62
63         Use WebProcess processIdentifier to identify Service Worker connections
64         https://bugs.webkit.org/show_bug.cgi?id=201459
65
66         Reviewed by Chris Dumez.
67
68         No observable change of behavior.
69
70         * workers/service/ServiceWorkerClient.cpp:
71         (WebCore::ServiceWorkerClient::postMessage):
72         Pass sessionID to ease NetworkProcess selection of the client process connection.
73         * workers/service/ServiceWorkerTypes.h:
74         Mark server connection identifier be process identifier based.
75         * workers/service/context/SWContextManager.h:
76         * workers/service/server/SWServer.cpp:
77         (WebCore::SWServer::Connection::Connection):
78         * workers/service/server/SWServer.h:
79         Let connection identifier be set in constructor instead of generated.
80
81 2019-09-11  Youenn Fablet  <youenn@apple.com>
82
83         Disable DTLS1.0
84         https://bugs.webkit.org/show_bug.cgi?id=201679
85
86         Reviewed by Alex Christensen.
87
88         Add an option to force to use DTLS1.0 and nothing else.
89         Add internals API to enter in that mode to verify that normal configurations cannot communicate with DTLS1.0.
90
91         Test: webrtc/datachannel/dtls10.html
92
93         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
94         (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
95         (WebCore::LibWebRTCProvider::setUseDTLS10):
96         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
97         * testing/Internals.cpp:
98         (WebCore::Internals::setUseDTLS10):
99         * testing/Internals.h:
100         * testing/Internals.idl:
101
102 2019-09-11  Keith Rollin  <krollin@apple.com>
103
104         Log timeoutValue passed on to CFNetwork
105         https://bugs.webkit.org/show_bug.cgi?id=201701
106         <rdar://problem/55279683>
107
108         Reviewed by Chris Dumez.
109
110         Export ResourceRequest::timeoutValue for use in WebKit.
111
112         No new tests -- no new or changed functionality.
113
114         * platform/network/ResourceRequestBase.h:
115
116 2019-09-11  Saam Barati  <sbarati@apple.com>
117
118         [WHLSL] Remove null from the standard library
119         https://bugs.webkit.org/show_bug.cgi?id=201672
120
121         Reviewed by Robin Morisset.
122
123         I meant to remove `null` from the standard library in r249351, but
124         I had omitted the code I wrote to do that when I rebased that patch.
125         This patch removes it and ensures all tests pass when parsing the entire
126         standard library.
127
128         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
129
130 2019-09-11  Chris Dumez  <cdumez@apple.com>
131
132         Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header
133         https://bugs.webkit.org/show_bug.cgi?id=201694
134
135         Reviewed by Alex Christensen.
136
137         Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header. This aligns
138         our behavior with Blink and makes us more compliant on web-platform-tests. This also
139         simplifies our code.
140
141         No new tests, rebaselined existing test.
142
143         * loader/FrameLoader.cpp:
144         (WebCore::FrameLoader::receivedFirstData):
145         * platform/network/HTTPParsers.cpp:
146         (WebCore::parseHTTPRefresh): Deleted.
147         * platform/network/HTTPParsers.h:
148
149 2019-09-11  Saam Barati  <sbarati@apple.com>
150
151         [WHLSL] Ensure structs/arrays with pointers as fields are disallowed
152         https://bugs.webkit.org/show_bug.cgi?id=201525
153
154         Reviewed by Robin Morisset.
155
156         This patch adds a pass which both ensures that references are always initialized with
157         concrete values and that we support logical mode validation by disallowing nested references.
158         
159         Specifically, the pass:
160         
161         1. Disallows structs to have fields which are references. This prevents us from having to
162         figure out how to default initialize such a struct. We could relax this in the future if we
163         did an analysis on which structs contain reference fields, and ensure such struct variables
164         always have initializers. This would also require us to create constructors for structs which
165         initialize each field.
166         2. We also do the same for arrays.
167         3. References can only be one level deep. So no pointers to pointers. No references to
168         references, etc. This is to support logical mode validation rules.
169
170         Test: webgpu/whlsl/ensure-proper-pointer-usage.html
171
172         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Added.
173         (WebCore::WHLSL::checkReferenceTypes):
174         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Added.
175         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
176         (WebCore::WHLSL::Checker::visit):
177         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
178         (WebCore::WHLSL::prepareShared):
179         * Sources.txt:
180         * WebCore.xcodeproj/project.pbxproj:
181
182 2019-09-11  Devin Rousso  <drousso@apple.com>
183
184         Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
185         https://bugs.webkit.org/show_bug.cgi?id=201650
186
187         Reviewed by Joseph Pecoraro.
188
189         Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
190
191         A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
192         required (e.g. compute pipeline).  We should treat the `GPUCanvasContext` almost like a
193         `-webkit-canvas` client of a `WebGPUDevice`.
194
195         Tests: inspector/canvas/create-context-webgpu.html
196                inspector/canvas/requestClientNodes-webgpu.html
197                inspector/canvas/resolveContext-webgpu.html
198
199         * Modules/webgpu/WebGPUAdapter.cpp:
200         (WebCore::WebGPUAdapter::requestDevice const):
201         Notify web inspector after a device is created.
202
203         * Modules/webgpu/WebGPUDevice.idl:
204         * Modules/webgpu/WebGPUDevice.h:
205         * Modules/webgpu/WebGPUDevice.cpp:
206         (WebCore::WebGPUDevice::instances): Added.
207         (WebCore::WebGPUDevice::instancesMutex): Added.
208         (WebCore::WebGPUDevice::~WebGPUDevice): Added.
209         Notify web inspector when the device is about to be destructed.
210
211         * Modules/webgpu/GPUCanvasContext.h:
212         * Modules/webgpu/GPUCanvasContext.cpp:
213         (WebCore::GPUCanvasContext::create):
214         (WebCore::GPUCanvasContext::configureSwapChain):
215
216         * inspector/InspectorCanvas.h:
217         * inspector/InspectorCanvas.cpp:
218         (WebCore::canvasIfContextMatchesDevice): Added.
219         (WebCore::InspectorCanvas::create):
220         (WebCore::InspectorCanvas::InspectorCanvas):
221         (WebCore::InspectorCanvas::canvasContext const): Added.
222         (WebCore::InspectorCanvas::canvasElement const): Added.
223         (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Added.
224         (WebCore::InspectorCanvas::deviceContext const): Added.
225         (WebCore::InspectorCanvas::scriptExecutionContext const): Added.
226         (WebCore::InspectorCanvas::resolveContext const): Added.
227         (WebCore::InspectorCanvas::clientNodes const): Added.
228         (WebCore::InspectorCanvas::canvasChanged):
229         (WebCore::InspectorCanvas::resetRecordingData):
230         (WebCore::InspectorCanvas::recordAction):
231         (WebCore::InspectorCanvas::buildObjectForCanvas):
232         (WebCore::InspectorCanvas::releaseObjectForRecording):
233         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
234         (WebCore::InspectorCanvas::buildInitialState):
235         (WebCore::InspectorCanvas::canvasElement): Deleted.
236         * inspector/InspectorInstrumentation.cpp:
237         (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Added.
238         (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Added.
239         (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Added.
240         * inspector/InspectorInstrumentation.h:
241         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Added.
242         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Added.
243         (WebCore::InspectorInstrumentation::willConfigureSwapChain): Added.
244
245         * inspector/agents/InspectorCanvasAgent.h:
246         * inspector/agents/InspectorCanvasAgent.cpp:
247         (WebCore::InspectorCanvasAgent::enable):
248         (WebCore::InspectorCanvasAgent::requestClientNodes): Added.
249         (WebCore::InspectorCanvasAgent::resolveContext): Added.
250         (WebCore::InspectorCanvasAgent::startRecording):
251         (WebCore::InspectorCanvasAgent::stopRecording):
252         (WebCore::InspectorCanvasAgent::frameNavigated):
253         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
254         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
255         (WebCore::InspectorCanvasAgent::canvasDestroyed):
256         (WebCore::InspectorCanvasAgent::recordCanvasAction):
257         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
258         (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Added.
259         (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Added.
260         (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Added.
261         (WebCore::InspectorCanvasAgent::clearCanvasData):
262         (WebCore::InspectorCanvasAgent::bindCanvas):
263         (WebCore::InspectorCanvasAgent::unbindCanvas):
264         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
265         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): Deleted.
266         (WebCore::contextAsScriptValue): Deleted.
267         (WebCore::InspectorCanvasAgent::resolveCanvasContext): Deleted.
268
269         * inspector/InspectorShaderProgram.cpp:
270         (WebCore::InspectorShaderProgram::context const):
271
272 2019-09-11  Chris Dumez  <cdumez@apple.com>
273
274         Posting a message to a redundant service worker should fail silently instead of throwing
275         https://bugs.webkit.org/show_bug.cgi?id=201696
276
277         Reviewed by Geoffrey Garen.
278
279         Posting a message to a redundant service worker should fail silently instead of throwing:
280         - https://w3c.github.io/ServiceWorker/#dom-serviceworker-postmessage-message-options
281         - https://w3c.github.io/ServiceWorker/#run-service-worker (step 2)
282
283         No new tests, rebaselined existing test.
284
285         * workers/service/ServiceWorker.cpp:
286         (WebCore::ServiceWorker::postMessage):
287         * workers/service/server/SWServer.cpp:
288         (WebCore::SWServer::runServiceWorkerIfNecessary):
289
290 2019-09-11  Chris Dumez  <cdumez@apple.com>
291
292         Align our XPath API with the specification and other browsers
293         https://bugs.webkit.org/show_bug.cgi?id=201660
294
295         Reviewed by Geoffrey Garen.
296
297         Align our XPath API with the specification and other browsers:
298         - Document/XPathEvaluator.createExpression()'s first parameter should be mandatory
299         - Document/XPathEvaluator.evaluate()'s first 2 parameters should be mandatory
300         - XPathExpression.evaluate()'s first parameter should be mandatory
301
302         I have confirmed in the latest Chrome and Firefox that they match the specification.
303         
304         No new tests, rebaselined existing test.
305
306         * dom/Document.cpp:
307         (WebCore::Document::evaluate):
308         * dom/Document.h:
309         * dom/Document.idl:
310         * inspector/InspectorNodeFinder.cpp:
311         (WebCore::InspectorNodeFinder::searchUsingXPath):
312         * xml/XPathEvaluator.cpp:
313         (WebCore::XPathEvaluator::evaluate):
314         * xml/XPathEvaluator.h:
315         * xml/XPathEvaluator.idl:
316         * xml/XPathExpression.cpp:
317         (WebCore::XPathExpression::evaluate):
318         * xml/XPathExpression.h:
319         * xml/XPathExpression.idl:
320         * xml/XPathUtil.cpp:
321         (WebCore::XPath::isValidContextNode):
322         * xml/XPathUtil.h:
323
324 2019-09-11  Truitt Savell  <tsavell@apple.com>
325
326         Unreviewed, rolling out r249753.
327
328         caused inspector/canvas/shaderProgram-add-remove-webgl.html to
329         crash on all Mac platforms.
330
331         Reverted changeset:
332
333         "Web Inspector: Canvas: instrument WebGPUDevice instead of
334         GPUCanvasContext"
335         https://bugs.webkit.org/show_bug.cgi?id=201650
336         https://trac.webkit.org/changeset/249753
337
338 2019-09-11  Antti Koivisto  <antti@apple.com>
339
340         REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
341         https://bugs.webkit.org/show_bug.cgi?id=201683
342         <rdar://problem/54582602>
343
344         Reviewed by Simon Fraser.
345
346         * platform/RuntimeApplicationChecks.h:
347         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
348         (WebCore::IOSApplication::isEventbrite):
349
350 2019-09-11  Ryan Haddad  <ryanhaddad@apple.com>
351
352         Unreviewed, rolling out r249758.
353
354         Breaks the watchOS build.
355
356         Reverted changeset:
357
358         "[WHLSL] Ensure structs/arrays with pointers as fields are
359         disallowed"
360         https://bugs.webkit.org/show_bug.cgi?id=201525
361         https://trac.webkit.org/changeset/249758
362
363 2019-09-11  Ali Juma  <ajuma@chromium.org>
364
365         Prevent reentrancy FrameLoader::dispatchUnloadEvents()
366         https://bugs.webkit.org/show_bug.cgi?id=200738
367
368         Reviewed by Brady Eidson.
369
370         Reentrancy causes m_pageDismissalEventBeingDispatched to be incorrectly
371         updated, so don't allow reentrancy.
372
373         Since this prevents m_pageDismissalEventBeingDispatched from being reset
374         inside a reentrant call, it can have the unintended effect of causing
375         FrameLoader::stopAllLoaders to early-out when called from
376         FrameLoader::detachFromParent while a frame's unload event handler
377         calls document.open() on a parent frame and causes itself to become
378         detached. Allowing a load to continue in a detached frame will lead to
379         a crash. To prevent this, add a new argument to FrameLoader::stopAllLoaders
380         that FrameLoader::detachFromParent can use to prevent an early-out.
381
382         * loader/FrameLoader.cpp:
383         (WebCore::FrameLoader::stopAllLoaders):
384         (WebCore::FrameLoader::detachFromParent):
385         (WebCore::FrameLoader::dispatchUnloadEvents):
386         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
387         Ensure that m_pageDismissalEventBeingDispatched is reset to its previous value, even if this is not None.
388         * loader/FrameLoader.h:
389         * loader/FrameLoaderTypes.h:
390         Add a StopLoadingPolicy enum.
391
392 2019-09-11  Charlie Turner  <cturner@igalia.com>
393
394         [GStreamer] Do not adopt floating references.
395         https://bugs.webkit.org/show_bug.cgi?id=201685
396
397         Reviewed by Carlos Garcia Campos.
398
399         Covered by existing tests.
400
401         * platform/graphics/gstreamer/GStreamerCommon.cpp:
402         (WebCore::initializeGStreamer): gst_element_factory_make returns
403         floating references, you do not adopt such references, rather you
404         sink them.
405
406 2019-09-11  Saam Barati  <sbarati@apple.com>
407
408         [WHLSL] Ensure structs/arrays with pointers as fields are disallowed
409         https://bugs.webkit.org/show_bug.cgi?id=201525
410
411         Reviewed by Robin Morisset.
412
413         This patch adds a pass which both ensures that references are always initialized with
414         concrete values and that we support logical mode validation by disallowing nested references.
415         
416         Specifically, the pass:
417         
418         1. Disallows structs to have fields which are references. This prevents us from having to
419         figure out how to default initialize such a struct. We could relax this in the future if we
420         did an analysis on which structs contain reference fields, and ensure such struct variables
421         always have initializers. This would also require us to create constructors for structs which
422         initialize each field.
423         2. We also do the same for arrays.
424         3. References can only be one level deep. So no pointers to pointers. No references to
425         references, etc. This is to support logical mode validation rules.
426
427         Test: webgpu/whlsl/ensure-proper-pointer-usage.html
428
429         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Added.
430         (WebCore::WHLSL::checkReferenceTypes):
431         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Added.
432         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
433         (WebCore::WHLSL::Checker::visit):
434         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
435         (WebCore::WHLSL::prepareShared):
436         * Sources.txt:
437         * WebCore.xcodeproj/project.pbxproj:
438
439 2019-09-10  Devin Rousso  <drousso@apple.com>
440
441         Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
442         https://bugs.webkit.org/show_bug.cgi?id=201650
443
444         Reviewed by Joseph Pecoraro.
445
446         Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
447
448         A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
449         required (e.g. compute pipeline).  We should treat the `GPUCanvasContext` almost like a
450         `-webkit-canvas` client of a `WebGPUDevice`.
451
452         Tests: inspector/canvas/create-context-webgpu.html
453                inspector/canvas/requestClientNodes-webgpu.html
454                inspector/canvas/resolveContext-webgpu.html
455
456         * Modules/webgpu/WebGPUAdapter.cpp:
457         (WebCore::WebGPUAdapter::requestDevice const):
458         Notify web inspector after a device is created.
459
460         * Modules/webgpu/WebGPUDevice.idl:
461         * Modules/webgpu/WebGPUDevice.h:
462         * Modules/webgpu/WebGPUDevice.cpp:
463         (WebCore::WebGPUDevice::instances): Added.
464         (WebCore::WebGPUDevice::instancesMutex): Added.
465         (WebCore::WebGPUDevice::~WebGPUDevice): Added.
466         Notify web inspector when the device is about to be destructed.
467
468         * Modules/webgpu/GPUCanvasContext.h:
469         * Modules/webgpu/GPUCanvasContext.cpp:
470         (WebCore::GPUCanvasContext::create):
471         (WebCore::GPUCanvasContext::configureSwapChain):
472
473         * inspector/InspectorCanvas.h:
474         * inspector/InspectorCanvas.cpp:
475         (WebCore::canvasIfContextMatchesDevice): Added.
476         (WebCore::InspectorCanvas::create):
477         (WebCore::InspectorCanvas::InspectorCanvas):
478         (WebCore::InspectorCanvas::canvasContext const): Added.
479         (WebCore::InspectorCanvas::canvasElement const): Added.
480         (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Added.
481         (WebCore::InspectorCanvas::deviceContext const): Added.
482         (WebCore::InspectorCanvas::scriptExecutionContext const): Added.
483         (WebCore::InspectorCanvas::resolveContext const): Added.
484         (WebCore::InspectorCanvas::clientNodes const): Added.
485         (WebCore::InspectorCanvas::canvasChanged):
486         (WebCore::InspectorCanvas::resetRecordingData):
487         (WebCore::InspectorCanvas::recordAction):
488         (WebCore::InspectorCanvas::buildObjectForCanvas):
489         (WebCore::InspectorCanvas::releaseObjectForRecording):
490         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
491         (WebCore::InspectorCanvas::buildInitialState):
492         (WebCore::InspectorCanvas::canvasElement): Deleted.
493         * inspector/InspectorInstrumentation.cpp:
494         (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Added.
495         (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Added.
496         (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Added.
497         * inspector/InspectorInstrumentation.h:
498         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Added.
499         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Added.
500         (WebCore::InspectorInstrumentation::willConfigureSwapChain): Added.
501
502         * inspector/agents/InspectorCanvasAgent.h:
503         * inspector/agents/InspectorCanvasAgent.cpp:
504         (WebCore::InspectorCanvasAgent::enable):
505         (WebCore::InspectorCanvasAgent::requestClientNodes): Added.
506         (WebCore::InspectorCanvasAgent::resolveContext): Added.
507         (WebCore::InspectorCanvasAgent::startRecording):
508         (WebCore::InspectorCanvasAgent::stopRecording):
509         (WebCore::InspectorCanvasAgent::frameNavigated):
510         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
511         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
512         (WebCore::InspectorCanvasAgent::canvasDestroyed):
513         (WebCore::InspectorCanvasAgent::recordCanvasAction):
514         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
515         (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Added.
516         (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Added.
517         (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Added.
518         (WebCore::InspectorCanvasAgent::clearCanvasData):
519         (WebCore::InspectorCanvasAgent::bindCanvas):
520         (WebCore::InspectorCanvasAgent::unbindCanvas):
521         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
522         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): Deleted.
523         (WebCore::contextAsScriptValue): Deleted.
524         (WebCore::InspectorCanvasAgent::resolveCanvasContext): Deleted.
525
526         * inspector/InspectorShaderProgram.cpp:
527         (WebCore::InspectorShaderProgram::context const):
528
529 2019-09-10  Chris Dumez  <cdumez@apple.com>
530
531         Nullptr crash in Page::sessionID() via WebKit::WebFrameLoaderClient::detachedFromParent2()
532         https://bugs.webkit.org/show_bug.cgi?id=201625
533
534         Reviewed by Ryosuke Niwa.
535
536         This is based on a patch from Ryosuke Niwa.
537
538         Drop setHasFrameSpecificStorageAccess() in WebCore and call it from the WebKit layer instead.
539
540         * dom/DocumentStorageAccess.cpp:
541         (WebCore::DocumentStorageAccess::requestStorageAccess):
542         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess): Deleted.
543         * dom/DocumentStorageAccess.h:
544         * loader/EmptyFrameLoaderClient.h:
545         * loader/FrameLoaderClient.h:
546
547 2019-09-10  Brady Eidson  <beidson@apple.com>
548
549         Add SPI to save a PDF from the contents of a WKWebView.
550         <rdar://problem/48955900> and https://bugs.webkit.org/show_bug.cgi?id=195765
551
552         Reviewed by Tim Horton.
553
554         Covered by API tests.
555
556         * page/FrameView.cpp:
557         (WebCore::FrameView::paintContents): Don't paint the debug color outside of the FrameRect.
558
559         * platform/graphics/cg/GraphicsContextCG.cpp:
560         (WebCore::GraphicsContext::setURLForRect):
561
562         * rendering/PaintPhase.h: Add "AnnotateLinks" option to always gather and annotation links.
563
564         * rendering/RenderElement.cpp:
565         (WebCore::RenderElement::hasOutlineAnnotation const): Also return true when the PaintOptions include "AnnotateLinks"
566
567 2019-09-10  Jiewen Tan  <jiewen_tan@apple.com>
568
569         REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
570         https://bugs.webkit.org/show_bug.cgi?id=201620
571         <rdar://problem/51524958>
572
573         Reviewed by Alex Christensen.
574
575         Covered by existing tests.
576
577         * Modules/webauthn/fido/U2fResponseConverter.cpp:
578         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
579         Change the way how the aaguid is initialized to see if that fixes the issue.
580
581 2019-09-10  Chris Dumez  <cdumez@apple.com>
582
583         Add missing origin check for Service-Worker-Allowed header
584         https://bugs.webkit.org/show_bug.cgi?id=201653
585
586         Reviewed by Geoffrey Garen.
587
588         Add missing origin check for Service-Worker-Allowed header:
589         - https://w3c.github.io/ServiceWorker/#update-algorithm (step 15. 2.)
590
591         * workers/service/ServiceWorkerJob.cpp:
592         (WebCore::ServiceWorkerJob::didReceiveResponse):
593
594 2019-09-10  Sihui Liu  <sihui_liu@apple.com>
595
596         IndexedDB: cache prepared SQLiteStatement in SQLiteIDBCursor
597         https://bugs.webkit.org/show_bug.cgi?id=201548
598
599         Reviewed by Alex Christensen.
600
601         This should be a performance improvement as we don't compile the same SQLiteStatement everytime it is used.
602
603         No new tests, no behavior change.
604
605         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
606         (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
607         * Modules/indexeddb/server/SQLiteIDBCursor.h:
608
609 2019-09-10  Youenn Fablet  <youenn@apple.com>
610
611         RTCPeerConnection can only be instantiated in documents
612         https://bugs.webkit.org/show_bug.cgi?id=201639
613
614         Reviewed by Alex Christensen.
615
616         Make it clear that RTCDataChannel expects Document since peer connections
617         and data channels can only be instantiated in document environments.
618         We keep one downcast in RTCPeerConnection constructor due to a limitation
619         in binding generator for JS built-ins.
620         No change of behavior.
621
622         * Modules/mediastream/RTCDataChannel.cpp:
623         (WebCore::RTCDataChannel::create):
624         (WebCore::RTCDataChannel::RTCDataChannel):
625         * Modules/mediastream/RTCDataChannel.h:
626         * Modules/mediastream/RTCPeerConnection.cpp:
627         (WebCore::RTCPeerConnection::create):
628         (WebCore::RTCPeerConnection::RTCPeerConnection):
629         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
630         (WebCore::RTCPeerConnection::createDataChannel):
631         (WebCore::RTCPeerConnection::document):
632         * Modules/mediastream/RTCPeerConnection.h:
633         * Modules/mediastream/RTCPeerConnection.idl:
634         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
635         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
636         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
637         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
638         (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
639
640 2019-09-10  Youenn Fablet  <youenn@apple.com>
641
642         Remove MediaStreamPrivate::scheduleDeferredTask
643         https://bugs.webkit.org/show_bug.cgi?id=200975
644
645         Reviewed by Eric Carlson.
646
647         All calls to scheduleDeferredTask are done on the main thread.
648         This was initially done to trigger less reconfiguration.
649         But this makes the implementation significantly more complex.
650
651         For instance, we have to wait for the document to update its media state
652         and send it to UIProcess before calling the allow completion handler.
653
654         Covered by existing tests.
655
656         * Modules/mediastream/MediaStream.cpp:
657         (WebCore::MediaStream::MediaStream):
658         Make sure to update the document media state once the tracks have been added, similarly to the other constructor.
659         This ensures the document media state is computed with the new MediaStreamTrack.
660         * Modules/mediastream/UserMediaRequest.cpp:
661         (WebCore::isMediaStreamCorrectlyStarted):
662         (WebCore::UserMediaRequest::allow):
663         (WebCore::UserMediaRequest::stop):
664         (WebCore::UserMediaRequest::mediaStreamDidFail):
665         * Modules/mediastream/UserMediaRequest.h:
666         * page/MediaProducer.h:
667         (WebCore::MediaProducer::isCapturing):
668         Make sure to include getDisplayMedia as part of capture check.
669         * platform/mediastream/MediaStreamPrivate.cpp:
670         (WebCore::MediaStreamPrivate::trackMutedChanged):
671         (WebCore::MediaStreamPrivate::trackEnabledChanged):
672         (WebCore::MediaStreamPrivate::trackStarted):
673         (WebCore::MediaStreamPrivate::trackEnded):
674         * platform/mediastream/MediaStreamPrivate.h:
675
676 2019-09-10  Youenn Fablet  <youenn@apple.com>
677
678         Audio sometimes fail to capture in WebRTC
679         https://bugs.webkit.org/show_bug.cgi?id=180748
680         <rdar://problem/36032346>
681
682         Reviewed by Eric Carlson.
683
684         In some cases, Safari is not receiving unsuspend notifications.
685         In that case, the capture unit might stay in suspend state forever.
686         To work around that, we force to unsuspend whenever there is a new capture happening.
687         This will make it so that reloading the page will unsuspend the page.
688
689         Manually tested by triggering Siri, starting to use the microphone and quickly going back to a capturing page.
690
691         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
692         (WebCore::CoreAudioSharedUnit::provideSpeakerData):
693         When suspension happens, the buffer size might change.
694         Since this is only an issue if there are some references data, we now do not fail the capture when there
695         is no reference data.
696         (WebCore::CoreAudioSharedUnit::resume):
697         (WebCore::CoreAudioSharedUnit::prepareForNewCapture):
698         Make sure to start with a clean slate by setting suspend state to false for the shared unit.
699         And failing all previous sources in case we are going back from suspension.
700         (WebCore::CoreAudioSharedUnit::startInternal):
701         (WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager):
702         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
703
704 2019-09-10  Adrian Perez de Castro  <aperez@igalia.com>
705
706         [GTK][WPE] Fixes for non-unified builds after r249022
707         https://bugs.webkit.org/show_bug.cgi?id=201610
708
709         Reviewed by Joseph Pecoraro.
710
711         No new tests needed.
712
713         * fileapi/NetworkSendQueue.h: Add missing inclusion of wtf/WeakPtr.h; add the namespace to WTF::WeakPtr
714         which is needed because there is no "using" clause.
715         * inspector/InspectorInstrumentation.cpp: Add missing inclusion of the PageDOMDebuggerAgent.h header.
716         * inspector/agents/WebDebuggerAgent.cpp: Add missing inclusion of the ScriptExecutionContext.h header.
717         * inspector/agents/page/PageDOMDebuggerAgent.cpp: Add missing inclusion of the InstrumentingAgents.h header.
718
719 2019-09-10  Youenn Fablet  <youenn@apple.com>
720
721         Add support to RTCDataChannel.send(Blob)
722         https://bugs.webkit.org/show_bug.cgi?id=201377
723
724         Reviewed by Chris Dumez.
725
726         Make use of NetworkSendQueue to enqueue and send properly messages.
727         Test: imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-blob-order.html
728
729         * Modules/mediastream/RTCDataChannel.cpp:
730         (WebCore::RTCDataChannel::createMessageQueue):
731         (WebCore::RTCDataChannel::RTCDataChannel):
732         (WebCore::RTCDataChannel::send):
733         (WebCore::RTCDataChannel::close):
734         * Modules/mediastream/RTCDataChannel.h:
735
736 2019-09-10  Ryosuke Niwa  <rniwa@webkit.org>
737
738         Option + arrow moves caret past whitespace on iOS
739         https://bugs.webkit.org/show_bug.cgi?id=201575
740
741         Reviewed by Wenson Hsieh.
742
743         The bug was caused by findNextWordFromIndex on iOS behaving differently from macOS and UIKit by skipping
744         trailing whitespace after a word when moving forward and not skipping leading whitespace when moving backward.
745
746         This patch introduces a new mode (StopAfterWord) of findNextWordFromIndex in iOS that better matches
747         the behavior of findNextWordFromIndex on macOS and UIKit, and use it in various modify* functions of
748         FrameSelection when the selection update is triggered by user.
749
750         The legacy mode (LegacyStopBeforeWord) is used in all other call sites as well as when modify* functions
751         are invoked from author scripts.
752
753         Test: editing/selection/ios/move-by-word-with-keyboard.html
754
755         * editing/FrameSelection.cpp:
756         (WebCore::nextWordWhitespaceModeInIOS): Added. A helper to convert EUserTriggered to NextWordModeInIOS.
757         (WebCore::FrameSelection::nextWordPositionForPlatform):
758         (WebCore::FrameSelection::modifyExtendingRight):
759         (WebCore::FrameSelection::modifyExtendingForward):
760         (WebCore::FrameSelection::modifyMovingRight):
761         (WebCore::FrameSelection::modifyMovingForward):
762         (WebCore::FrameSelection::modifyExtendingLeft):
763         (WebCore::FrameSelection::modifyExtendingBackward):
764         (WebCore::FrameSelection::modifyMovingLeft):
765         (WebCore::FrameSelection::modifyMovingBackward):
766         (WebCore::FrameSelection::modify):
767         (WebCore::FrameSelection::updateAppearance):
768         * editing/FrameSelection.h:
769         * editing/TextIterator.cpp:
770         (WebCore::SearchBuffer::isWordStartMatch const):
771         * editing/VisibleUnits.cpp:
772         (WebCore::previousWordPositionBoundary):
773         (WebCore::previousWordPosition):
774         (WebCore::nextWordPositionBoundary):
775         (WebCore::nextWordPosition):
776         * editing/VisibleUnits.h:
777         * platform/text/TextBoundaries.cpp:
778         (WebCore::findNextWordFromIndex):
779         * platform/text/TextBoundaries.h:
780         * platform/text/mac/TextBoundaries.mm:
781         (WebCore::findNextWordFromIndex): Added a new mode.
782
783 2019-09-09  Chris Dumez  <cdumez@apple.com>
784
785         REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
786         https://bugs.webkit.org/show_bug.cgi?id=201550
787
788         Reviewed by Alex Christensen.
789
790         * loader/ResourceLoadObserver.h:
791         (WebCore::ResourceLoadObserver::hasStatistics const):
792
793 2019-09-09  Timothy Hatcher  <timothy@apple.com>
794
795         Tap and hold on Facebook sometimes creates a tall empty selection.
796         https://bugs.webkit.org/show_bug.cgi?id=201618
797         rdar://53630145
798
799         Reviewed by Megan Gardner.
800
801         API Test: SelectionTests.ByWordAtEndOfDocument
802
803         * editing/VisibleUnits.cpp:
804         (WebCore::wordRangeFromPosition):
805         Remove special case code for the possibility of an empty paragraph and at the end
806         of the document. This is no longer needed and was causing a large selection to be
807         created on Facebook due to large areas of non-selectable content on the page.
808
809 2019-09-09  Joonghun Park  <jh718.park@samsung.com>
810
811         getComputedStyle for line-height: normal should return the keyword instead of a length
812         https://bugs.webkit.org/show_bug.cgi?id=201296
813
814         Reviewed by Ryosuke Niwa.
815
816         Per https://github.com/w3c/csswg-drafts/issues/3749,
817         Gecko and Blink has this behavior already.
818
819         This patch makes WebKit has the same behavior with them.
820
821         Tests: imported/w3c/web-platform-tests/css/css-inline/parsing/line-height-computed.html
822                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-line-height.html
823                imported/w3c/web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height.html
824
825         * css/CSSComputedStyleDeclaration.cpp:
826         (WebCore::lineHeightFromStyle):
827
828 2019-09-09  Alex Christensen  <achristensen@webkit.org>
829
830         Disable TLS 1.0 and 1.1 in WebSockets
831         https://bugs.webkit.org/show_bug.cgi?id=201573
832
833         Reviewed by Youenn Fablet.
834
835         This expands on what I started in r249019 when I disabled legacy TLS for our use of NSURLSession.
836         Since our WebSocket implementation uses a different network interface, disable legacy TLS for them, too.
837         I use the same temporary default to re-enable legacy TLS.  I also add a unit test for both WebSockets and NSURLSession use.
838
839         * platform/network/cf/SocketStreamHandleImpl.h:
840         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
841         (WebCore::Function<bool):
842         (WebCore::SocketStreamHandleImpl::setLegacyTLSEnabledCheck):
843         (WebCore::SocketStreamHandleImpl::createStreams):
844
845 2019-09-09  Saam Barati  <sbarati@apple.com>
846
847         Unreviewed follow up to r249630. We need padding for ADDRESS32 CPUs to allow replaceWith to work on the intended types.
848
849         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
850
851 2019-09-09  Zalan Bujtas  <zalan@apple.com>
852
853         [LFC][TFC] Introduce cell spacing.
854         https://bugs.webkit.org/show_bug.cgi?id=201605
855         <rdar://problem/55184009>
856
857         Reviewed by Antti Koivisto.
858
859         This patch adds support for horizontal and vertical cell spacing (border-spacing). Now LFC matches table geometry for simple table content with multiple columns and rows. 
860
861         * layout/FormattingContextGeometry.cpp:
862         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): Now we can use the generic, check the inflow content logic for table height.
863         * layout/LayoutUnits.h:
864         (WebCore::Layout::HorizontalEdges::width const):
865         (WebCore::Layout::VerticalEdges::height const):
866         * layout/Verification.cpp:
867         (WebCore::Layout::verifyAndOutputSubtree):
868         * layout/tableformatting/TableFormattingContext.cpp:
869         (WebCore::Layout::TableFormattingContext::layout):
870         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
871         (WebCore::Layout::TableFormattingContext::positionTableCells):
872         (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
873         (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
874         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
875         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
876         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
877         (WebCore::Layout::TableFormattingContext::computedTableWidth):
878         (WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth):
879         * layout/tableformatting/TableFormattingContext.h:
880         * layout/tableformatting/TableFormattingContextGeometry.cpp:
881         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
882         * layout/tableformatting/TableGrid.cpp:
883         (WebCore::Layout::TableGrid::appendCell):
884         (WebCore::Layout::TableGrid::widthConstraints const):
885         (WebCore::Layout::TableGrid::ColumnsContext::useAsLogicalWidth): Deleted.
886         * layout/tableformatting/TableGrid.h:
887         (WebCore::Layout::TableGrid::setHorizontalSpacing):
888         (WebCore::Layout::TableGrid::horizontalSpacing const):
889         (WebCore::Layout::TableGrid::setVerticalSpacing):
890         (WebCore::Layout::TableGrid::verticalSpacing const):
891         (WebCore::Layout::TableGrid::ColumnsContext::logicalWidth const):
892
893 2019-09-09  Ryan Haddad  <ryanhaddad@apple.com>
894
895         Unreviewed, rolling out r249574.
896
897         Caused fast/mediastream/media-stream-track-source-failure.html
898         to become flaky.
899
900         Reverted changeset:
901
902         "Remove MediaStreamPrivate::scheduleDeferredTask"
903         https://bugs.webkit.org/show_bug.cgi?id=200975
904         https://trac.webkit.org/changeset/249574
905
906 2019-09-09  Rob Buis  <rbuis@igalia.com>
907
908         [GTK][WPE] Remove attributes deprecated from MathML3
909         https://bugs.webkit.org/show_bug.cgi?id=197492
910
911         Reviewed by Frédéric Wang.
912
913         Remove some MathML3 deprecated attributes:
914         https://github.com/mathml-refresh/mathml/issues/5#issuecomment-475506856
915
916         This change also maps the dir attribute to direction for MathML Core.
917
918         Test: imported/w3c/web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html
919
920         * mathml/MathMLElement.cpp:
921         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
922
923 2019-09-09  Youenn Fablet  <youenn@apple.com>
924
925         Move checkProcessLocalPortForActivity from provider to registry
926         https://bugs.webkit.org/show_bug.cgi?id=201400
927
928         Reviewed by Alex Christensen.
929
930         Update the registry to take a callback that is used to implement checkProcessLocalPortForActivity.
931         This allows WK1 and WK2 to have their own implementation.
932
933         Make the call to checkProcessLocalPortForActivity directly on the registry.
934         Remove unneeded worker checkProcessLocalPortForActivity method.
935         No change of behavior.
936
937         * dom/messageports/MessagePortChannel.cpp:
938         (WebCore::MessagePortChannel::checkRemotePortForActivity):
939         * dom/messageports/MessagePortChannelProvider.h:
940         * dom/messageports/MessagePortChannelProviderImpl.cpp:
941         (WebCore::createMessagePortChannelRegistry):
942         (WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl):
943         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity): Deleted.
944         * dom/messageports/MessagePortChannelProviderImpl.h:
945         * dom/messageports/MessagePortChannelRegistry.cpp:
946         (WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry):
947         (WebCore::MessagePortChannelRegistry::checkProcessLocalPortForActivity):
948         * dom/messageports/MessagePortChannelRegistry.h:
949         (WebCore::MessagePortChannelRegistry::provider): Deleted.
950         * dom/messageports/WorkerMessagePortChannelProvider.cpp:
951         (WebCore::WorkerMessagePortChannelProvider::checkProcessLocalPortForActivity): Deleted.
952         * dom/messageports/WorkerMessagePortChannelProvider.h:
953
954 2019-09-08  Saam Barati  <sbarati@apple.com>
955
956         [WHLSL] Add back a version of the property resolver
957         https://bugs.webkit.org/show_bug.cgi?id=201251
958
959         Reviewed by Robin Morisset.
960
961         This patch adds back the property resolver to aid in how we emit metal code.
962         The goal of the new property resolver phase is to allow two things:
963         1. For property access expressions, metal codegen should be allowed to evaluate
964         the base, and if it's an index expression, the index, as many times as needed.
965         So this patch ensures that if Metal evaluates such things, effects aren't performed
966         more than once.
967         
968         2. For ReadModifyWrite expressions, metal codegen should be able to evaluate the
969         leftValueExpression as many times as it'd like without performing the effects of
970         leftValueExpression more than once.
971         
972         Here are a couple examples of this transformation:
973         `a()[b()]` -> `(temp1 = a(), temp2 = b(), temp1[temp2])`
974         `(*a())[b()] += 42;` -> `(temp1 = &*a(), temp2 = b(), (*temp1)[temp2] += 42)`
975         
976         The interesting rules break down like:
977         - When the base is an lvalue, we take its address and replace the old base
978         with a dereference of the new pointer variable.
979         - When the base is an rvalue, we evaluate it and store it in a temporary
980         variable, and switch the base to be a reference of that variable.
981         - All indices are evaluated before the property access instruction and
982         replaced with a reference to the temporary variable.
983
984         Test: webgpu/whlsl/property-evaluation-order.html
985
986         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
987         (WebCore::WHLSL::AST::Expression::mayBeEffectful const):
988         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
989         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
990         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
991         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
992         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
993         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
994         (WebCore::WHLSL::findHighZombies):
995         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
996         (WebCore::WHLSL::PropertyResolver::handleLeftHandSideBase):
997         (WebCore::WHLSL::PropertyResolver::handlePropertyAccess):
998         (WebCore::WHLSL::resolveProperties):
999
1000 2019-09-07  Chris Dumez  <cdumez@apple.com>
1001
1002         Add support for postMessage buffering between the service worker and window
1003         https://bugs.webkit.org/show_bug.cgi?id=201169
1004
1005         Reviewed by Youenn Fablet.
1006
1007         As per the Service Worker specification, a service worker client's message
1008         queue is initially disabled and only gets enabled after:
1009         - The DOMContentLoaded event has been fired
1010         or
1011         - The client sets the navigator.serviceWorker.onmessage event handler
1012         or
1013         - navigator.serviceWorker.startMessages() is called
1014
1015         While the message queue is disabled, messages posted by the service worker
1016         to the client simply get queued and only get processed once the queue gets
1017         enabled.
1018
1019         No new tests, rebaselined existing test.
1020
1021         * dom/Document.cpp:
1022         (WebCore::Document::finishedParsing):
1023         Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
1024         been fired.
1025
1026         * dom/ScriptExecutionContext.cpp:
1027         (WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
1028         * dom/ScriptExecutionContext.h:
1029         * workers/service/SWClientConnection.cpp:
1030         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
1031         Fix a bug where a service worker would not be able to post a message to a client until
1032         that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
1033         lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
1034         when a message is received from the service worker. Previously, messages were just
1035         getting dropped.
1036
1037         * workers/service/ServiceWorkerContainer.cpp:
1038         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
1039         When the ServiceWorkerContainer is constructed, suspend its message queue if its context
1040         document is still parsing.
1041
1042         (WebCore::ServiceWorkerContainer::startMessages):
1043         Resume the message queue when startMessages() is called.
1044
1045         (WebCore::ServiceWorkerContainer::postMessage):
1046         Enqueue the event instead of firing it right away.
1047
1048         (WebCore::ServiceWorkerContainer::addEventListener):
1049         if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
1050         startMessages().
1051
1052         * workers/service/ServiceWorkerContainer.h:
1053
1054 2019-09-07  Chris Dumez  <cdumez@apple.com>
1055
1056         [Service Workers] Drop support for registration resurrection
1057         https://bugs.webkit.org/show_bug.cgi?id=201584
1058
1059         Reviewed by Alex Christensen.
1060
1061         Drop support for registration resurrection (Unregistering then quickly re-registering would resurrect
1062         the original registration instead of creating a new one). This behavior is no longer in the
1063         specification (No more "isUninstalling" flag on the registration, and the registration is removed
1064         from the "scope to registration map" right away upon unregistering).
1065
1066         This resurrection behavior was causing a lot of flakiness in the tests so it is likely we will be able
1067         to unskip some tests. This is also what was causing the flakiness that caused Bug 201169 to be rolled
1068         out.
1069
1070         No new tests, updated existing tests.
1071
1072         * workers/service/server/SWServer.cpp:
1073         (WebCore::SWServer::activeWorkerFromRegistrationID):
1074         (WebCore::SWServer::getRegistration):
1075         (WebCore::SWServer::addRegistration):
1076         (WebCore::SWServer::removeRegistration):
1077         (WebCore::SWServer::getRegistrations):
1078         (WebCore::SWServer::clearAll):
1079         (WebCore::SWServer::clear):
1080         (WebCore::SWServer::terminatePreinstallationWorker):
1081         (WebCore::SWServer::didFinishActivation):
1082         (WebCore::SWServer::claim):
1083         (WebCore::SWServer::addClientServiceWorkerRegistration):
1084         (WebCore::SWServer::removeClientServiceWorkerRegistration):
1085         (WebCore::SWServer::installContextData):
1086         (WebCore::SWServer::runServiceWorker):
1087         (WebCore::SWServer::doRegistrationMatching):
1088         (WebCore::SWServer::registrationFromServiceWorkerIdentifier):
1089         (WebCore::SWServer::registerServiceWorkerClient):
1090         (WebCore::SWServer::unregisterServiceWorkerClient):
1091         (WebCore::SWServer::removeFromScopeToRegistrationMap):
1092         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
1093         * workers/service/server/SWServer.h:
1094         * workers/service/server/SWServerJobQueue.cpp:
1095         (WebCore::SWServerJobQueue::runRegisterJob):
1096         (WebCore::SWServerJobQueue::runUnregisterJob):
1097         (WebCore::SWServerJobQueue::runUpdateJob):
1098         * workers/service/server/SWServerRegistration.cpp:
1099         (WebCore::SWServerRegistration::clear):
1100         (WebCore::SWServerRegistration::handleClientUnload):
1101         (WebCore::SWServerRegistration::isUnregistered const):
1102         * workers/service/server/SWServerRegistration.h:
1103         (WebCore::SWServerRegistration::scopeURLWithoutFragment const):
1104         * workers/service/server/SWServerWorker.cpp:
1105         (WebCore::SWServerWorker::SWServerWorker):
1106         (WebCore::m_scriptResourceMap):
1107         (WebCore::SWServerWorker::contextData const):
1108         (WebCore::SWServerWorker::skipWaiting):
1109         (WebCore::SWServerWorker::setHasPendingEvents):
1110         (WebCore::SWServerWorker::setState):
1111         (WebCore::SWServerWorker::registration const):
1112         * workers/service/server/SWServerWorker.h:
1113
1114 2019-09-07  Ryan Haddad  <ryanhaddad@apple.com>
1115
1116         Unreviewed, rolling out r249353.
1117
1118         The test for this change is a flaky failure.
1119
1120         Reverted changeset:
1121
1122         "Add support for postMessage buffering between the service
1123         worker and window"
1124         https://bugs.webkit.org/show_bug.cgi?id=201169
1125         https://trac.webkit.org/changeset/249353
1126
1127 2019-09-07  Alex Christensen  <achristensen@webkit.org>
1128
1129         Deprecate WKContextGetWebsiteDataStore
1130         https://bugs.webkit.org/show_bug.cgi?id=200050
1131
1132         Reviewed by Geoff Garen.
1133
1134         * platform/network/CacheValidation.cpp:
1135         (WebCore::collectVaryingRequestHeaders):
1136         (WebCore::verifyVaryingRequestHeaders):
1137         * platform/network/CacheValidation.h:
1138         Replace a few NetworkStorageSession& with NetworkStorageSession*
1139         so I can replace defaultStorageSession with the correct NetworkStorageSession in NetworkCache.cpp.
1140
1141 2019-09-06  Brent Fulgham  <bfulgham@apple.com>
1142
1143         [FTW] Minor cleanups to avoid crashes during web browsing
1144         https://bugs.webkit.org/show_bug.cgi?id=201572
1145
1146         Reviewed by Alexey Proskuryakov.
1147
1148         This patch addresses a few crashes seen when doing general web browsing using
1149         the FTW build of WebKit:
1150
1151         1. ImageBuffer::sinkIntoImage was attempting to use a render target after WTFMoving it elsewhere.
1152         2. ImageBuffer::copyNativeImage was not properly checking the type of the render
1153            target to make sure it was suitable for Bitmap operations.
1154         3. BackingStoreBackendDirect2DImpl::scroll would crash if the scroll offset was
1155            outside the bounds of the current view. In that case, it would attempt to allocate
1156            a zero-size texture, which triggered a crash.
1157
1158         * platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
1159         (WebCore::BackingStoreBackendDirect2DImpl::scroll):
1160         * platform/graphics/win/ImageBufferDirect2D.cpp:
1161         (WebCore::ImageBuffer::sinkIntoImage):
1162         (WebCore::ImageBuffer::copyNativeImage const):
1163
1164 2019-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
1165
1166         Incorrect selection rect revealed after pasting images in a contenteditable element
1167         https://bugs.webkit.org/show_bug.cgi?id=201549
1168         <rdar://problem/50956429>
1169
1170         Reviewed by Simon Fraser.
1171
1172         Editor::replaceSelectionWithFragment currently scrolls to reveal the selection after inserting the given
1173         DocumentFragment. However, this scrolling occurs before any inserted images have loaded yet, which causes the
1174         wrong caret rect to be revealed, since all image elements inserted during paste will be empty.
1175
1176         To fix this, we defer revealing the selection after inserting the fragment until after all images that have
1177         been inserted are done loading. While waiting for images to load, if any layers which may be scrolled as a
1178         result of revealing the selection are scrolled, we additionally cancel the deferred selection reveal. See
1179         comments below for more detail.
1180
1181         Tests: editing/pasteboard/do-not-reveal-selection-after-programmatic-scroll.html
1182                editing/pasteboard/reveal-selection-after-pasting-images.html
1183                PasteImage.RevealSelectionAfterPastingImage
1184
1185         * editing/Editing.cpp:
1186         (WebCore::visibleImageElementsInRangeWithNonLoadedImages):
1187
1188         Add a new helper to iterate through a range and collect all image elements in that range, that contain cached
1189         images that have not finished loading yet.
1190
1191         * editing/Editing.h:
1192         * editing/Editor.cpp:
1193         (WebCore::Editor::replaceSelectionWithFragment):
1194
1195         Instead of always immediately revealing the selection after applying the ReplaceSelectionCommand, collect the
1196         image elements that were just inserted, and avoid immediately revealing the selection if any of these images
1197         have non-null cached images, but are not loaded yet. Instead, hold on to these images in a set, remove them once
1198         they finish loading using the new method below, and once all images are removed, reveal the selection.
1199
1200         (WebCore::Editor::revealSelectionIfNeededAfterLoadingImageForElement):
1201         (WebCore::Editor::renderLayerDidScroll):
1202
1203         Called whenever a scrollable RenderLayer is scrolled (or in the case of FrameView, the root layer). In the case
1204         where Editor is waiting to reveal the selection, we check to see if the scrolled layer is an ancestor of the
1205         layer enclosing the start of the selection.
1206
1207         (WebCore::Editor::respondToChangedSelection):
1208
1209         If the selection changes between pasting and waiting for pasted images to load, just cancel waiting to reveal
1210         the selection after pasting.
1211
1212         * editing/Editor.h:
1213         * editing/ReplaceSelectionCommand.cpp:
1214         (WebCore::ReplaceSelectionCommand::insertedContentRange const):
1215
1216         Add a helper method to grab the Range of content inserted after applying the command.
1217
1218         * editing/ReplaceSelectionCommand.h:
1219         * page/FrameView.cpp:
1220         (WebCore::FrameView::scrollPositionChanged):
1221         * page/FrameView.h:
1222         * page/Page.cpp:
1223         (WebCore::Page::didFinishLoadingImageForElement):
1224
1225         Notify Editor after an image finishes loading.
1226
1227         * rendering/RenderLayer.cpp:
1228         (WebCore::RenderLayer::scrollTo):
1229
1230 2019-09-06  Brent Fulgham  <bfulgham@apple.com>
1231
1232         PathDirect2D Cleanups
1233         https://bugs.webkit.org/show_bug.cgi?id=201534
1234
1235         Reviewed by Fujii Hironori.
1236
1237         1. Add a COMPtr<> move operator.
1238         2. Reduce copying ID2D1Geometry objects.
1239         3. Protect against using the ID2D1PathGeometry after the
1240            ID2D1GeometrySink's Close operation is used.
1241         4. Add a debug-only 'refCount' function to COMPtr to help
1242            track down memory errors.
1243
1244         * platform/graphics/Path.h:
1245         (WebCore::Path::activePath const): Deleted.
1246         * platform/graphics/win/Direct2DOperations.cpp:
1247         (WebCore::Direct2D::fillPath):
1248         (WebCore::Direct2D::drawPath):
1249         * platform/graphics/win/PathDirect2D.cpp:
1250         * platform/win/COMPtr.h:
1251         (COMPtr::COMPtr):
1252         (=):
1253         (refCount):
1254
1255 2019-09-06  Chris Dumez  <cdumez@apple.com>
1256
1257         Move the ResourceLoadObserver logic to WebKit2
1258         https://bugs.webkit.org/show_bug.cgi?id=201517
1259
1260         Reviewed by Brent Fulgham.
1261
1262         Move the ResourceLoadObserver logic to WebKit2 since it is not used by WebKit1. This allows us to simplify
1263         code.
1264
1265         In a follow-up patch, I will simplify the code even further by leveraging the fact that a WebContent process
1266         is always associated with a single WebsiteDataStore / sessionID:
1267         - No need for a HashMap of sessionIDs
1268         - No need to even allocate the ResourceLoadObserver if the WebProcess is associated with an ephemeral session.
1269
1270         * dom/Document.h:
1271         * loader/ResourceLoadObserver.cpp:
1272         (WebCore::sharedObserver):
1273         (WebCore::ResourceLoadObserver::setShared):
1274         (WebCore::ResourceLoadObserver::shared):
1275         * loader/ResourceLoadObserver.h:
1276         (WebCore::ResourceLoadObserver::~ResourceLoadObserver):
1277         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1278         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1279         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1280         (WebCore::ResourceLoadObserver::logFontLoad):
1281         (WebCore::ResourceLoadObserver::logCanvasRead):
1282         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1283         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1284         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1285         (WebCore::ResourceLoadObserver::statisticsForURL):
1286         (WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
1287         (WebCore::ResourceLoadObserver::clearState):
1288         (WebCore::ResourceLoadObserver::setShouldLogUserInteraction):
1289         * page/DeprecatedGlobalSettings.h:
1290
1291 2019-09-06  Justin Fan  <justin_fan@apple.com>
1292
1293         [WebGPU] Update several interface and enum names to match spec
1294         https://bugs.webkit.org/show_bug.cgi?id=201564
1295
1296         Reviewed by Dean Jackson.
1297
1298         Rename GPUShaderStageBit -> GPUShaderStage.
1299         Rename GPUColorWriteBits -> GPUColorWrite.
1300         Rename TRANSFER_SRC/DST -> COPY_SRC/DST.
1301         Rename GPUPipelineStageDescriptor -> GPUProgrammableStageDescriptor.
1302
1303         Existing tests trivially updated to match.
1304
1305         * CMakeLists.txt:
1306         * DerivedSources-input.xcfilelist:
1307         * DerivedSources-output.xcfilelist:
1308         * DerivedSources.make:
1309         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
1310         * Modules/webgpu/GPUBufferUsage.idl:
1311         * Modules/webgpu/GPUColorStateDescriptor.idl:
1312         * Modules/webgpu/GPUColorWrite.idl: Renamed from Source/WebCore/Modules/webgpu/GPUColorWriteBits.idl.
1313         * Modules/webgpu/GPUShaderStage.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderStageBit.h.
1314         * Modules/webgpu/GPUShaderStage.idl: Renamed from Source/WebCore/Modules/webgpu/GPUShaderStageBit.idl.
1315         * Modules/webgpu/GPUTextureUsage.idl:
1316         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
1317         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
1318         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
1319         * Modules/webgpu/WebGPUComputePipelineDescriptor.idl:
1320         * Modules/webgpu/WebGPUDevice.cpp:
1321         * Modules/webgpu/WebGPUProgrammableStageDescriptor.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPUPipelineStageDescriptor.cpp.
1322         (WebCore::WebGPUProgrammableStageDescriptor::tryCreateGPUProgrammableStageDescriptor const):
1323         * Modules/webgpu/WebGPUProgrammableStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUPipelineStageDescriptor.h.
1324         * Modules/webgpu/WebGPUProgrammableStageDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUPipelineStageDescriptor.idl.
1325         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
1326         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
1327         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
1328         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
1329         * Sources.txt:
1330         * WebCore.xcodeproj/project.pbxproj:
1331         * bindings/js/WebCoreBuiltinNames.h:
1332         * platform/graphics/gpu/GPUBuffer.h:
1333         (WebCore::GPUBuffer::isCopySource const):
1334         (WebCore::GPUBuffer::isCopyDestination const):
1335         (WebCore::GPUBuffer::isTransferSource const): Deleted.
1336         (WebCore::GPUBuffer::isTransferDestination const): Deleted.
1337         * platform/graphics/gpu/GPUBufferUsage.h:
1338         * platform/graphics/gpu/GPUColorStateDescriptor.h:
1339         * platform/graphics/gpu/GPUColorWrite.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUColorWriteBits.h.
1340         * platform/graphics/gpu/GPUComputePipelineDescriptor.h:
1341         (WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
1342         * platform/graphics/gpu/GPUPipelineDescriptorBase.h:
1343         * platform/graphics/gpu/GPUProgrammableStageDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUPipelineStageDescriptor.h.
1344         (WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):
1345         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
1346         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
1347         * platform/graphics/gpu/GPUTexture.h:
1348         (WebCore::GPUTexture::isCopySource const):
1349         (WebCore::GPUTexture::isCopyDestination const):
1350         (WebCore::GPUTexture::isReadOnly const):
1351         (WebCore::GPUTexture::isTransferSource const): Deleted.
1352         (WebCore::GPUTexture::isTransferDestination const): Deleted.
1353         * platform/graphics/gpu/GPUTextureUsage.h:
1354         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1355         (WebCore::GPUBindGroupLayout::tryCreate):
1356         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
1357         (WebCore::GPUBindGroup::tryCreate):
1358         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
1359         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1360         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
1361         (WebCore::GPUCommandBuffer::copyBufferToTexture):
1362         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
1363         (WebCore::GPUCommandBuffer::copyTextureToTexture):
1364         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
1365         (WebCore::trySetFunctions):
1366         * platform/graphics/gpu/cocoa/GPUPipelineMetalConvertLayout.cpp:
1367         (WebCore::convertShaderStageFlags):
1368         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1369         (WebCore::mtlColorWriteMaskForGPUColorWriteFlags):
1370         (WebCore::trySetFunctions):
1371         * platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
1372         (WebCore::mtlTextureUsageForGPUTextureUsageFlags):
1373
1374 2019-09-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1375
1376         REGRESSION (r249367): m_decodingPromises grows indefinitely until ImageLoader destruction
1377         https://bugs.webkit.org/show_bug.cgi?id=201402
1378
1379         Reviewed by Youenn Fablet and Daniel Bates.
1380
1381         Add the static functions resolvePromises() and rejectPromises(). These 
1382         functions take an lvalue reference to a Vector of promises. Inside them,
1383         the lvalue reference argument are exchanged with an empty Vector of
1384         promises then the promises are processed. This clears m_decodingPromises
1385         and fixes the leak.
1386
1387         Add an internal API which returns the count of the pending promises of
1388         an HTMLImageElement. This internal API will be used in the attached test.
1389
1390         Test: fast/images/decode-resolve-reject-no-leak.html
1391
1392         * html/HTMLImageElement.h:
1393         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const):
1394         * loader/ImageLoader.cpp:
1395         (WebCore::resolvePromises):
1396         ImageLoader::decode() calls BitmapImage::decode() and moves m_decodingPromises
1397         in capture. When decoding finishes, this function is called to resolve the
1398         promises. But ImageLoader might get deleted before the image decoding
1399         finishes. So this function has to be static.
1400
1401         (WebCore::rejectPromises):
1402         (WebCore::ImageLoader::resolveDecodePromises):
1403         (WebCore::ImageLoader::rejectDecodePromises):
1404         (WebCore::ImageLoader::notifyFinished):
1405         (WebCore::ImageLoader::decode):
1406         (WebCore::resolveDecodePromises): Deleted.
1407         (WebCore::rejectDecodePromises): Deleted.
1408         * loader/ImageLoader.h:
1409         (WebCore::ImageLoader::pendingDecodePromisesCountForTesting const):
1410         * testing/Internals.cpp:
1411         (WebCore::Internals::imagePendingDecodePromisesCountForTesting):
1412         * testing/Internals.h:
1413         * testing/Internals.idl:
1414
1415 2019-09-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1416
1417         Prefer null namespace 'href' over 'xlink:href' on SVG elements
1418         https://bugs.webkit.org/show_bug.cgi?id=195802
1419
1420         Reviewed by Youenn Fablet.
1421
1422         -- When the attribute "href" is set, its value is always reflected in
1423            SVGURIReference::m_href.
1424
1425         -- When the attribute "href" is removed, the value of the attribute
1426            "xlink:href" is always reflected in SVGURIReference::m_href.
1427
1428         -- When the "xlink:href" is set, its value is reflected in
1429            SVGURIReference::m_href only if the attribute "href" is not set.
1430
1431         Tests: svg/custom/href-xlink-href-gradient-element-expected.svg
1432                svg/custom/href-xlink-href-gradient-element.svg
1433                svg/custom/href-xlink-href-use-element-expected.svg
1434                svg/custom/href-xlink-href-use-element.svg
1435
1436         * svg/SVGURIReference.cpp:
1437         (WebCore::SVGURIReference::parseAttribute):
1438
1439 2019-09-06  Zalan Bujtas  <zalan@apple.com>
1440
1441         [LFC][TFC] Set computed row width.
1442         https://bugs.webkit.org/show_bug.cgi?id=201533
1443         <rdar://problem/55098828>
1444
1445         Reviewed by Antti Koivisto.
1446
1447         Decouple cell box layout/display box setup and set the computed row width.    
1448
1449         * layout/Verification.cpp:
1450         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
1451         * layout/tableformatting/TableFormattingContext.cpp:
1452         (WebCore::Layout::TableFormattingContext::layout):
1453
1454 2019-09-06  Zalan Bujtas  <zalan@apple.com>
1455
1456         [LFC] A formatting context root is always a containing block for relative: static boxes.
1457         https://bugs.webkit.org/show_bug.cgi?id=201554
1458         <rdar://problem/55123295>
1459
1460         Reviewed by Antti Koivisto.
1461
1462         "For other elements, if the element's position is 'relative' or 'static', the containing block is formed by the content
1463         edge of the nearest ancestor box that is a block container or which establishes a formatting context."
1464
1465         * layout/layouttree/LayoutBox.cpp:
1466         (WebCore::Layout::Box::containingBlock const):
1467         * page/FrameViewLayoutContext.cpp:
1468         (WebCore::layoutUsingFormattingContext):
1469
1470 2019-09-06  Sihui Liu  <sihui_liu@apple.com>
1471
1472         IndexedDB: use SQL COUNT statement for count operation
1473         https://bugs.webkit.org/show_bug.cgi?id=201465
1474
1475         Reviewed by Geoffrey Garen.
1476
1477         We did count operation by moving objectStore/index iterator from begin to end and counting the steps. We can
1478         utilize the SQL COUNT statement, and improve the performance further by caching the statement.
1479
1480         Tested on release build minibrowser. Without the change, the mean time to complete one iteration in 
1481         PerformanceTests/IndexedDB/basic/index-count.html and PerformanceTests/IndexedDB/basic/objectStore-count.html is
1482         about 50ms. With the change it is about 2ms.
1483
1484         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1485         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
1486         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatement):
1487         (WebCore::IDBServer::SQLiteIDBBackingStore::closeSQLiteDB):
1488         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1489
1490 2019-09-06  Alex Christensen  <achristensen@webkit.org>
1491
1492         When disabling legacy private browsing for testing, change the SessionID back to what it was, not the defaultSessionID
1493         https://bugs.webkit.org/show_bug.cgi?id=201480
1494
1495         Reviewed by Youenn Fablet.
1496
1497         No change in behavior, but this blocks bug 200050 which will make WebKitTestRunner use a persistent, non-default session.
1498         Without this change, that change causes lots of test failures because we are switching from the legacy private browsing session
1499         to the default session instead of the session we were using.
1500
1501         * page/Page.cpp:
1502         (WebCore::Page::enableLegacyPrivateBrowsing): Deleted.
1503         * page/Page.h:
1504         * page/PageGroup.cpp:
1505         (WebCore::PageGroup::addPage):
1506         (WebCore::PageGroup::setSessionIDForTesting):
1507         (WebCore::PageGroup::enableLegacyPrivateBrowsingForTesting): Deleted.
1508         * page/PageGroup.h:
1509         * storage/StorageNamespaceProvider.cpp:
1510         (WebCore::StorageNamespaceProvider::setSessionIDForTesting):
1511         (WebCore::StorageNamespaceProvider::enableLegacyPrivateBrowsingForTesting): Deleted.
1512         * storage/StorageNamespaceProvider.h:
1513
1514 2019-09-06  Youenn Fablet  <youenn@apple.com>
1515
1516         Remove MediaStreamPrivate::scheduleDeferredTask
1517         https://bugs.webkit.org/show_bug.cgi?id=200975
1518
1519         Reviewed by Eric Carlson.
1520
1521         All calls to scheduleDeferredTask are done on the main thread.
1522         This was initially done to trigger less reconfiguration.
1523         But this makes the implementation significantly more complex.
1524
1525         For instance, we have to wait for the document to update its media state
1526         and send it to UIProcess before calling the allow completion handler.
1527
1528         Covered by existing tests.
1529
1530         * Modules/mediastream/MediaStream.cpp:
1531         (WebCore::MediaStream::MediaStream):
1532         Make sure to update the document media state once the tracks have been added, similarly to the other constructor.
1533         This ensures the document media state is computed with the new MediaStreamTrack.
1534         * Modules/mediastream/UserMediaRequest.cpp:
1535         (WebCore::isMediaStreamCorrectlyStarted):
1536         (WebCore::UserMediaRequest::allow):
1537         (WebCore::UserMediaRequest::stop):
1538         (WebCore::UserMediaRequest::mediaStreamDidFail):
1539         * Modules/mediastream/UserMediaRequest.h:
1540         * page/MediaProducer.h:
1541         (WebCore::MediaProducer::isCapturing):
1542         Make sure to include getDisplayMedia as part of capture check.
1543         * platform/mediastream/MediaStreamPrivate.cpp:
1544         (WebCore::MediaStreamPrivate::trackMutedChanged):
1545         (WebCore::MediaStreamPrivate::trackEnabledChanged):
1546         (WebCore::MediaStreamPrivate::trackStarted):
1547         (WebCore::MediaStreamPrivate::trackEnded):
1548         * platform/mediastream/MediaStreamPrivate.h:
1549
1550 2019-09-06  Rob Buis  <rbuis@igalia.com>
1551
1552         Implement MathML DOM
1553         https://bugs.webkit.org/show_bug.cgi?id=200470
1554
1555         Reviewed by Ryosuke Niwa.
1556
1557         Expose MathML DOM as specified here [1].
1558
1559         [1] https://mathml-refresh.github.io/mathml-core/#dom-mathmlelement
1560
1561         Tests: imported/w3c/web-platform-tests/mathml/relations/html5-tree/clipboard-event-handlers.tentative.html
1562                imported/w3c/web-platform-tests/mathml/relations/html5-tree/css-inline-style-dynamic.tentative.html
1563                imported/w3c/web-platform-tests/mathml/relations/html5-tree/css-inline-style-interface.tentative.html
1564                imported/w3c/web-platform-tests/mathml/relations/html5-tree/html-or-foreign-element-interfaces.tentative.html
1565                imported/w3c/web-platform-tests/mathml/relations/html5-tree/integration-point-4.html
1566                imported/w3c/web-platform-tests/mathml/relations/html5-tree/math-global-event-handlers.tentative.html
1567                mathml/focus-event-handling.html
1568                mathml/tabindex-order.html
1569
1570         * CMakeLists.txt:
1571         * DerivedSources-input.xcfilelist:
1572         * DerivedSources-output.xcfilelist:
1573         * DerivedSources.make:
1574         * Sources.txt:
1575         * WebCore.xcodeproj/project.pbxproj:
1576         * bindings/js/JSElementCustom.cpp:
1577         (WebCore::createNewElementWrapper):
1578         * bindings/js/JSNodeCustom.cpp:
1579         (WebCore::createWrapperInline):
1580         * mathml/MathMLElement.cpp:
1581         (WebCore::MathMLElement::parseAttribute):
1582         * mathml/MathMLElement.idl: Copied from Source/WebCore/html/HTMLOrForeignElement.idl.
1583         * mathml/MathMLMathElement.idl: Copied from Source/WebCore/html/HTMLOrForeignElement.idl.
1584         * mathml/mathtags.in:
1585
1586 2019-09-06  Zan Dobersek  <zdobersek@igalia.com>
1587
1588         [GStreamer] YUV buffers on iMX platforms have to be treated as RGBA
1589         https://bugs.webkit.org/show_bug.cgi?id=201537
1590
1591         Reviewed by Philippe Normand.
1592
1593         The imxvpudecoder element on iMX platforms decodes YUV data in a
1594         platform-specific way, gathering the YUV data in a single texture and
1595         then relying on the sampler in the Vivante graphics drivers to
1596         automagically decode that YUV data into RGBA values.
1597
1598         To correctly display such decoded data, we have to represent that
1599         single texture as an RGBA texture, even when the GStreamer buffer is
1600         crafted as containing planar YUV data.
1601
1602         * platform/graphics/gstreamer/GStreamerCommon.h:
1603         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1604         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1605         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1606         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
1607         (WebCore::GstVideoFrameHolder::platformLayerBuffer):
1608         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
1609         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1610         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
1611         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1612         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1613         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1614
1615 2019-09-06  Andres Gonzalez  <andresg_22@apple.com>
1616
1617         AccessibilityRenderObject::setSelectedTextRange fails to set the selection passed an empty line.
1618         https://bugs.webkit.org/show_bug.cgi?id=201518
1619         <rdar://problem/54835122>
1620
1621         Reviewed by Ryosuke Niwa.
1622
1623         Test: accessibility/set-selected-text-range-after-newline.html
1624
1625         In the case of an empty line, the CharacterIterator range start and end
1626         were not equal, thus we were not advancing the iterator and returning
1627         the iterator range end, which is not correct. With this change we are
1628         always advancing the iterator if its text is just '\n'. This covers all
1629         the cases we fixed before plus empty lines.
1630
1631         * editing/Editing.cpp:
1632         (WebCore::visiblePositionForIndexUsingCharacterIterator):
1633
1634 2019-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>
1635
1636         [Win] Add support for MouseEvent.buttons
1637         https://bugs.webkit.org/show_bug.cgi?id=201445
1638
1639         Reviewed by Brent Fulgham.
1640
1641         Spec: <https://www.w3.org/TR/uievents/#dom-mouseevent-buttons>
1642
1643         * platform/win/GDIUtilities.h:
1644         (buttonsForEvent): Added.
1645         * platform/win/PlatformMouseEventWin.cpp:
1646         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1647         Set m_buttons.
1648
1649 2019-09-05  Fujii Hironori  <Hironori.Fujii@sony.com>
1650
1651         [Win] Support Per-Monitor (V2) DPI Awareness
1652         https://bugs.webkit.org/show_bug.cgi?id=201450
1653
1654         Reviewed by Don Olmstead.
1655
1656         * platform/win/GDIUtilities.cpp:
1657         (WebCore::deviceScaleFactorForWindow): Use GetDpiForWindow if available by using soft linking.
1658
1659 2019-09-05  Charlie Turner  <cturner@igalia.com>
1660
1661         [EME] Introduce a Proxy CDM for thread-safe access to CDM instances from background decryption threads
1662         https://bugs.webkit.org/show_bug.cgi?id=201339
1663
1664         Reviewed by Xabier Rodriguez-Calvar.
1665
1666         Covered by existing tests.
1667
1668         * platform/encryptedmedia/CDMInstance.h:
1669         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1670         (WebCore::isolatedKey):
1671         (WebCore::ProxyCDMClearKey::isolatedKeys const):
1672         (WebCore::CDMInstanceClearKey::CDMInstanceClearKey):
1673         * platform/encryptedmedia/clearkey/CDMClearKey.h:
1674         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1675         (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
1676         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1677         (handleKeyResponse):
1678         (findAndSetKey):
1679         (decrypt):
1680         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1681         (isCDMInstanceAvailable):
1682         (sinkEventHandler):
1683         (setContext):
1684         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
1685         * testing/MockCDMFactory.cpp:
1686         (WebCore::MockCDMInstance::proxyCDM const):
1687         * testing/MockCDMFactory.h:
1688
1689 2019-09-05  Zalan Bujtas  <zalan@apple.com>
1690
1691         [LFC] LayoutState should not need the initial containing block
1692         https://bugs.webkit.org/show_bug.cgi?id=201511
1693         <rdar://problem/55079241>
1694
1695         Reviewed by Antti Koivisto.
1696
1697         Throw-away layouts should just be able to initialize a dedicated LayoutState without passing in the ICB.
1698
1699         * layout/LayoutState.cpp:
1700         (WebCore::Layout::LayoutState::markNeedsUpdate):
1701         (WebCore::Layout::LayoutState::run):
1702         (WebCore::Layout::LayoutState::LayoutState): Deleted.
1703         * layout/LayoutState.h:
1704         (WebCore::Layout::LayoutState::initialContainingBlock const): Deleted.
1705         * layout/Verification.cpp:
1706         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
1707         * layout/floats/FloatingContext.cpp: Fix a (very sad)typo.
1708         (WebCore::Layout::FloatingContext::constraints const):
1709         * layout/layouttree/LayoutTreeBuilder.cpp:
1710         (WebCore::Layout::printLayoutTreeForLiveDocuments):
1711
1712 2019-09-05  Justin Fan  <justin_fan@apple.com>
1713
1714         [WebGPU] Implement GPUUncapturedErrorEvent
1715         https://bugs.webkit.org/show_bug.cgi?id=199676
1716
1717         Reviewed by Dean Jackson.
1718
1719         Implement GPUUncapturedErrorEvent and "uncapturederror" event name.
1720         Add the onuncapturederror EventHandler attribute to GPUDevice.
1721
1722         Test: webgpu/uncaptured-errors.html
1723
1724         * CMakeLists.txt:
1725         * DerivedSources-input.xcfilelist:
1726         * DerivedSources-output.xcfilelist:
1727         * DerivedSources.make:
1728         * Modules/webgpu/GPUUncapturedErrorEvent.cpp:
1729         (WebCore::GPUUncapturedErrorEvent::create):
1730         (WebCore::GPUUncapturedErrorEvent::GPUUncapturedErrorEvent):
1731         (WebCore::GPUUncapturedErrorEvent::eventInterface const):
1732         * Modules/webgpu/GPUUncapturedErrorEvent.h:
1733         * Modules/webgpu/GPUUncapturedErrorEvent.idl:
1734         * Modules/webgpu/WebGPUAdapter.cpp: Must now provide ScriptExecutionContext to any created GPUDevice.
1735         (WebCore::WebGPUAdapter::requestDevice const):
1736         * Modules/webgpu/WebGPUAdapter.h:
1737         * Modules/webgpu/WebGPUAdapter.idl:
1738         * Modules/webgpu/WebGPUDevice.cpp: Is now an EventTarget.
1739         (WebCore::WebGPUDevice::tryCreate):
1740         (WebCore::WebGPUDevice::WebGPUDevice):
1741         (WebCore::printValidationErrorToConsole):
1742         (WebCore::WebGPUDevice::dispatchUncapturedError): Events should only be fired from the main thread.
1743         * Modules/webgpu/WebGPUDevice.h:
1744         * Modules/webgpu/WebGPUDevice.idl:
1745         * Modules/webgpu/WebGPUDeviceEventHandler.idl:
1746         * Sources.txt:
1747         * WebCore.xcodeproj/project.pbxproj:
1748         * bindings/js/WebCoreBuiltinNames.h:
1749         * dom/EventNames.h:
1750         * dom/EventNames.in:
1751         * dom/EventTargetFactory.in:
1752         * platform/graphics/gpu/GPUError.cpp: GPUErrors can only be created internally; creation should never fail.
1753         (WebCore::createError):
1754         * platform/graphics/gpu/GPUError.h:
1755         * platform/graphics/gpu/GPUErrorScopes.cpp:
1756         (WebCore::GPUErrorScopes::create):
1757         (WebCore::GPUErrorScopes::GPUErrorScopes):
1758         (WebCore::GPUErrorScopes::generateError): Use a callback for now, since GPUErrorScopes is still under platform.
1759         * platform/graphics/gpu/GPUErrorScopes.h:
1760         (WebCore::GPUErrorScopes::create): Deleted.
1761
1762 2019-09-05  Antti Koivisto  <antti@apple.com>
1763
1764         Generate event region for both the main graphics layer and the scrolled contents layer
1765         https://bugs.webkit.org/show_bug.cgi?id=201487
1766
1767         Reviewed by Simon Fraser.
1768
1769         We currently generate region for one of them only. With borders both need it.
1770         
1771         Also share more code with painting paths.
1772
1773         * rendering/RenderLayerBacking.cpp:
1774         (WebCore::RenderLayerBacking::updateEventRegion):
1775
1776         Generate region for both layers.
1777
1778         (WebCore::RenderLayerBacking::paintIntoLayer):
1779
1780         Add event region context parameter so we can use this function for event region update too.
1781
1782         * rendering/RenderLayerBacking.h:
1783
1784 2019-09-05  Ryosuke Niwa  <rniwa@webkit.org>
1785
1786         REGRESSION (iOS 13): Bulleted list copied from Notes to Mail results in Times New Roman
1787         https://bugs.webkit.org/show_bug.cgi?id=201490
1788
1789         Reviewed by Daniel Bates.
1790
1791         The bug was caused by an element in the pasted content not having any explicit font name resolving
1792         to use the font-family value of `-webkit-standard`. When such an inline style is inserted into
1793         Mail's WKWebView which sets a different font family, ReplaceSelectionCommand would fail to strip away,
1794         making the pasted content using the default font family of Times New Roman.
1795
1796         Fixed the bug by stripping away font-family set to -webkit-standard in the sanitization document
1797         since that's indicative of the pasted content not having any font family being specified.
1798
1799         In the future, we should consider making regular copy (as opposed to the copy for sanitization)
1800         resolve generic font family names to concrete font names since different WKWebView might be using
1801         different concrete font names. Unfortuantely, such a change is quite involved and risky since various
1802         paste side code in EditingStyle that removes redundant inline styles (i.e. redundant `font-family`)
1803         need to be aware of this special font family resolution.
1804
1805         Tests: editing/pasteboard/paste-cocoa-writer-markup-with-webkit-standard-font-family.html
1806                PasteHTML.DoesNotAddStandardFontFamily
1807
1808         * editing/EditingStyle.cpp:
1809         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
1810         (WebCore::EditingStyle::wrappingStyleForSerialization):
1811         (WebCore::familyNameFromCSSPrimitiveValue): Added.
1812         (WebCore::loneFontFamilyName): Extracted from usesForbiddenSystemFontAsOnlyFontFamilyName. Fixed
1813         a bug that it was not handling the case when `font-family` property's value is a CSSPrimitiveValue
1814         instead of a CSSValueList.
1815         (WebCore::usesForbiddenSystemFontAsOnlyFontFamilyName): Deleted.
1816         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): Remove `font-family` property when
1817         StandardFontFamilySerializationMode::Strip is specified and its value is `-webkit-standard`.
1818         * editing/EditingStyle.h:
1819         * editing/markup.cpp:
1820         (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Added
1821         StandardFontFamilySerializationMode as an argument.
1822         (WebCore::StyledMarkupAccumulator::appendStartTag):
1823         (WebCore::StyledMarkupAccumulator::serializeNodes):
1824         (WebCore::serializePreservingVisualAppearanceInternal): Ditto.
1825         (WebCore::serializePreservingVisualAppearance): Use StandardFontFamilySerializationMode::Keep
1826         to preserve the pre-existing behavior.
1827         (WebCore::sanitizedMarkupForFragmentInDocument): Use StandardFontFamilySerializationMode::Strip
1828         as this is the code used by sanitization code.
1829
1830 2019-09-05  Chris Fleizach  <cfleizach@apple.com>
1831
1832         AX: children cache are not re-computed if tab index is removed
1833         https://bugs.webkit.org/show_bug.cgi?id=201502
1834
1835         Reviewed by Zalan Bujtas.
1836
1837         Test: accessibility/tabindex-removed.html
1838
1839         If the tabindex changes, it can potentially affect whether an element is accessible. If we don't update the children cache
1840         information can be stale and lead to incorrect navigation with VoiceOver.
1841
1842         * accessibility/AXObjectCache.cpp:
1843         (WebCore::AXObjectCache::handleAttributeChange):
1844
1845 2019-09-05  Konstantin Tokarev  <annulen@yandex.ru>
1846
1847         Don't call PlatformMediaSessionManager methods when neither VIDEO nor WEB_AUDIO is enabled
1848         https://bugs.webkit.org/show_bug.cgi?id=201508
1849
1850         Reviewed by Jer Noble.
1851
1852         Definitions of these methods are guarded with #if ENABLE(VIDEO) || ENABLE(WEB_AUDIO),
1853         so calling them causes linking errors.
1854
1855         * testing/InternalSettings.cpp:
1856         (WebCore::InternalSettings::Backup::Backup):
1857         (WebCore::InternalSettings::Backup::restoreTo):
1858         (WebCore::InternalSettings::setShouldDeactivateAudioSession):
1859         * testing/Internals.cpp:
1860         (WebCore::Internals::resetToConsistentState):
1861         (WebCore::Internals::processWillSuspend):
1862         (WebCore::Internals::processDidResume):
1863         (WebCore::Internals::setIsPlayingToAutomotiveHeadUnit):
1864
1865 2019-09-05  Keith Rollin  <krollin@apple.com>
1866
1867         Fix implicit conversion that loses precision
1868         https://bugs.webkit.org/show_bug.cgi?id=201476
1869         <rdar://problem/55043129>
1870
1871         Reviewed by Youenn Fablet, Alex Christensen.
1872
1873         Building for watchOS results in the following error:
1874
1875             .../Source/WebCore/fileapi/NetworkSendQueue.cpp:66:42: error: implicit conversion loses integer precision: 'unsigned long long' to 'unsigned int' [-Werror,-Wshorten-64-to-32]
1876                     enqueue(JSC::ArrayBuffer::create(byteLength, 1), 0, 0);
1877
1878         Fix this by replacing byteLength (which is known to be zero at this
1879         point) with 0U.
1880
1881         No new tests -- no new or changed functionality.
1882
1883         * fileapi/NetworkSendQueue.cpp:
1884         (WebCore::NetworkSendQueue::enqueue):
1885
1886 2019-09-05  Youenn Fablet  <youenn@apple.com>
1887
1888         Introduce WorkerSWClientConnection to make SWClientConnection mono-thread
1889         https://bugs.webkit.org/show_bug.cgi?id=201430
1890
1891         Reviewed by Alex Christensen.
1892
1893         Make SWClientConnection RefCounted.
1894         Add a WorkerSWClientConnection dedicated to be used by worker/service worker contexts.
1895         Simplify ServiceWorkerContainer logic based on this refactoring.
1896
1897         Covered by existing tests.
1898
1899         * Sources.txt:
1900         * WebCore.xcodeproj/project.pbxproj:
1901         * workers/WorkerGlobalScope.cpp:
1902         (WebCore::WorkerGlobalScope::swClientConnection):
1903         * workers/WorkerGlobalScope.h:
1904         * workers/service/SWClientConnection.cpp:
1905         (WebCore::SWClientConnection::scheduleJob):
1906         (WebCore::SWClientConnection::failedFetchingScript):
1907         (WebCore::SWClientConnection::postTaskForJob):
1908         * workers/service/SWClientConnection.h:
1909         * workers/service/ServiceWorkerContainer.cpp:
1910         (WebCore::mainThreadConnection):
1911         (WebCore::ServiceWorkerContainer::ready):
1912         (WebCore::ServiceWorkerContainer::scheduleJob):
1913         (WebCore::ServiceWorkerContainer::getRegistration):
1914         (WebCore::ServiceWorkerContainer::updateRegistrationState):
1915         (WebCore::ServiceWorkerContainer::getRegistrations):
1916         (WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
1917         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1918         (WebCore::ServiceWorkerContainer::notifyFailedFetchingScript):
1919         (WebCore::ServiceWorkerContainer::ensureSWClientConnection):
1920         (WebCore::ServiceWorkerContainer::stop):
1921         * workers/service/ServiceWorkerContainer.h:
1922         * workers/service/ServiceWorkerFetchResult.h:
1923         (WebCore::ServiceWorkerFetchResult::isolatedCopy const):
1924         * workers/service/WorkerSWClientConnection.cpp: Added.
1925         (WebCore::WorkerSWClientConnection::WorkerSWClientConnection):
1926         (WebCore::WorkerSWClientConnection::~WorkerSWClientConnection):
1927         (WebCore::WorkerSWClientConnection::matchRegistration):
1928         (WebCore::WorkerSWClientConnection::getRegistrations):
1929         (WebCore::WorkerSWClientConnection::whenRegistrationReady):
1930         (WebCore::WorkerSWClientConnection::addServiceWorkerRegistrationInServer):
1931         (WebCore::WorkerSWClientConnection::removeServiceWorkerRegistrationInServer):
1932         (WebCore::WorkerSWClientConnection::didResolveRegistrationPromise):
1933         (WebCore::WorkerSWClientConnection::postMessageToServiceWorker):
1934         (WebCore::WorkerSWClientConnection::serverConnectionIdentifier const):
1935         (WebCore::WorkerSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
1936         (WebCore::WorkerSWClientConnection::syncTerminateWorker):
1937         (WebCore::WorkerSWClientConnection::registerServiceWorkerClient):
1938         (WebCore::WorkerSWClientConnection::unregisterServiceWorkerClient):
1939         (WebCore::WorkerSWClientConnection::finishFetchingScriptInServer):
1940         (WebCore::WorkerSWClientConnection::isThrottleable const):
1941         (WebCore::WorkerSWClientConnection::updateThrottleState):
1942         (WebCore::WorkerSWClientConnection::scheduleJob):
1943         (WebCore::WorkerSWClientConnection::scheduleJobInServer):
1944         * workers/service/WorkerSWClientConnection.h: Added.
1945
1946 2019-09-04  Fujii Hironori  <Hironori.Fujii@sony.com>
1947
1948         [Win][Clang] InspectorNetworkAgent.cpp(1122,20): error: cannot decompose this type; 'std::tuple_size<const WTF::KeyValuePair<WTF::String, WTF::RefPtr<WTF::JSONImpl::Value, WTF::DumbPtrTraits<WTF::JSONImpl::Value> > >>::value' is not a valid integral const
1949         https://bugs.webkit.org/show_bug.cgi?id=201489
1950
1951         Unreviewed build fix for clang-cl.
1952
1953         clang-cl 8 can't use a structured binding for a const struct.
1954
1955         No behavior change.
1956
1957         * inspector/agents/InspectorNetworkAgent.cpp:
1958         (WebCore::InspectorNetworkAgent::interceptWithResponse): Not to use a structured binding for a const struct.
1959
1960 2019-09-04  Chris Dumez  <cdumez@apple.com>
1961
1962         Unreviewed, another build fix after r249501.
1963
1964         * loader/EmptyFrameLoaderClient.h:
1965
1966 2019-09-04  Timothy Hatcher  <timothy@apple.com>
1967
1968         Mail appears to be double inverting code copied from Notes, Xcode, or Terminal.
1969         https://bugs.webkit.org/show_bug.cgi?id=201368
1970         rdar://problem/40529867
1971
1972         Reviewed by Ryosuke Niwa.
1973
1974         Dark mode content that is pasted should have the inline styles inverse color
1975         transformed by the color filter to match the color filtered document contents.
1976
1977         Layout Test: editing/pasteboard/paste-dark-mode-color-filtered.html
1978         API Tests: PasteHTML.TransformColorsOfDarkContent, PasteHTML.DoesNotTransformColorsOfLightContent,
1979             PasteRTFD.TransformColorsOfDarkContent, PasteRTFD.DoesNotTransformColorsOfLightContent
1980
1981         * editing/EditingStyle.cpp:
1982         (WebCore::EditingStyle::inverseTransformColorIfNeeded): Added caret-color to the transformed properties.
1983         * editing/ReplaceSelectionCommand.cpp:
1984         (WebCore::fragmentNeedsColorTransformed): Added.
1985         (WebCore::ReplaceSelectionCommand::inverseTransformColor): Added.
1986         (WebCore::ReplaceSelectionCommand::doApply): Call fragmentNeedsColorTransformed() and inverseTransformColor().
1987         * editing/ReplaceSelectionCommand.h:
1988
1989 2019-09-04  Chris Dumez  <cdumez@apple.com>
1990
1991         Unreviewed, drop extra whitespace added in r249515.
1992
1993         * loader/EmptyFrameLoaderClient.h:
1994
1995 2019-09-04  Chris Dumez  <cdumez@apple.com>
1996
1997         Unreviewed build fix after r249501.
1998
1999         r249501 seems to have exposed the fact that EmptyFrameLoaderClient.h is missing a #pragma once.
2000
2001         * loader/EmptyFrameLoaderClient.h:
2002
2003 2019-09-06  Simon Fraser  <simon.fraser@apple.com>
2004
2005         REGRESSION (iOS 13): If an overflow:hidden with a non-zero scroll position is toggled to overflow:scroll, some other scroll causes its scroll position to get reset
2006         https://bugs.webkit.org/show_bug.cgi?id=201528
2007         rdar://problem/55044885
2008
2009         Reviewed by Frédéric Wang.
2010         
2011         If, when an overflow scrolling node is created, the scroller has non-zero scroll
2012         position (for example, via toggling to overflow:hidden, setting scrollTop, then toggling
2013         to overflow:scroll), then on the next update its scroll position will reset back to zero.
2014
2015         The bug was that newly created ScrollingTreeScrollingNodes didn't set m_currentScrollPosition
2016         to the scroll position coming from the state node, so a subsequent update could cause
2017         the 0,0 currentScrollPosition to get applied. If we're making a new node, and there's no
2018         requestedScrollPosition, then initialize m_currentScrollPosition.
2019
2020         Test: scrollingcoordinator/ios/scroller-initial-scroll-position.html
2021
2022         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2023         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2024         (WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
2025         * page/scrolling/ScrollingTreeScrollingNode.h:
2026
2027 2019-09-04  Yusuke Suzuki  <ysuzuki@apple.com>
2028
2029         [JSC] Make Promise implementation faster
2030         https://bugs.webkit.org/show_bug.cgi?id=200898
2031
2032         Reviewed by Saam Barati.
2033
2034         * Modules/streams/ReadableStream.js:
2035         (pipeThrough):
2036         * Modules/streams/ReadableStreamInternals.js:
2037         (readableStreamError):
2038         (readableStreamReaderGenericRelease):
2039
2040 2019-09-04  Tim Horton  <timothy_horton@apple.com>
2041
2042         Line artifacts in note body after viewing note with <attachment>s
2043         https://bugs.webkit.org/show_bug.cgi?id=201474
2044         <rdar://problem/51306108>
2045
2046         Reviewed by Simon Fraser.
2047
2048         Test: fast/attachment/attachment-border-should-stay-inside-attachment.html
2049
2050         * rendering/RenderThemeIOS.mm:
2051         (WebCore::attachmentBorderPath):
2052         (WebCore::paintAttachmentBorder):
2053         Inset the border rect by half the width, so that <attachment> doesn't
2054         paint out-of-bounds.
2055
2056 2019-09-04  Joseph Pecoraro  <pecoraro@apple.com>
2057
2058         Web Inspector: Local Overrides - Provide substitution content for resource loads (URL based)
2059         https://bugs.webkit.org/show_bug.cgi?id=201262
2060         <rdar://problem/13108764>
2061
2062         Reviewed by Devin Rousso.
2063
2064         Tests: http/tests/inspector/network/local-resource-override-basic.html
2065                http/tests/inspector/network/local-resource-override-main-resource.html
2066                http/tests/inspector/network/local-resource-override-script-tag.html
2067                http/tests/inspector/network/resource-response-inspector-override.html
2068
2069         * Sources.txt:
2070         * WebCore.xcodeproj/project.pbxproj:
2071         * Headers.cmake:
2072         New files.
2073
2074         * inspector/InspectorInstrumentation.cpp:
2075         (WebCore::InspectorInstrumentation::willInterceptRequestImpl):
2076         (WebCore::InspectorInstrumentation::shouldInterceptResponseImpl):
2077         (WebCore::InspectorInstrumentation::interceptResponseImpl):
2078         * inspector/InspectorInstrumentation.h:
2079         (WebCore::InspectorInstrumentation::hasFrontends):
2080         (WebCore::InspectorInstrumentation::willInterceptRequest):
2081         (WebCore::InspectorInstrumentation::shouldInterceptResponse):
2082         (WebCore::InspectorInstrumentation::interceptResponse):
2083         (WebCore::InspectorInstrumentation::frontendCreated):
2084         (WebCore::InspectorInstrumentation::frontendDeleted):
2085         * inspector/InspectorInstrumentationPublic.cpp:
2086         * inspector/InspectorInstrumentationPublic.h:
2087         * inspector/InspectorInstrumentationWebKit.cpp:
2088         (WebCore::InspectorInstrumentationWebKit::shouldInterceptResponseInternal):
2089         (WebCore::InspectorInstrumentationWebKit::interceptResponseInternal):
2090         * inspector/InspectorInstrumentationWebKit.h: Added.
2091         (WebCore::InspectorInstrumentationWebKit::shouldInterceptResponse):
2092         (WebCore::InspectorInstrumentationWebKit::interceptResponse):
2093         Provide a slim InspectorInstrumentation API that can be used in the WebKit
2094         layer without a ton of includes.
2095
2096         * inspector/agents/InspectorNetworkAgent.cpp:
2097         (WebCore::responseSource):
2098         (WebCore::InspectorNetworkAgent::disable):
2099         (WebCore::InspectorNetworkAgent::continuePendingResponses):
2100         (WebCore::InspectorNetworkAgent::setInterceptionEnabled):
2101         (WebCore::InspectorNetworkAgent::addInterception):
2102         (WebCore::InspectorNetworkAgent::removeInterception):
2103         (WebCore::InspectorNetworkAgent::willInterceptRequest):
2104         (WebCore::InspectorNetworkAgent::shouldInterceptResponse):
2105         (WebCore::InspectorNetworkAgent::interceptResponse):
2106         (WebCore::InspectorNetworkAgent::interceptContinue):
2107         (WebCore::InspectorNetworkAgent::interceptWithResponse):
2108         Manage a list of URLs that will be intercepted and send
2109         intercepts to an active frontend for response content.
2110
2111         * inspector/agents/InspectorNetworkAgent.h:
2112         (WebCore::InspectorNetworkAgent::PendingInterceptResponse::PendingInterceptResponse):
2113         (WebCore::InspectorNetworkAgent::PendingInterceptResponse::~PendingInterceptResponse):
2114         (WebCore::InspectorNetworkAgent::PendingInterceptResponse::originalResponse):
2115         (WebCore::InspectorNetworkAgent::PendingInterceptResponse::respondWithOriginalResponse):
2116         (WebCore::InspectorNetworkAgent::PendingInterceptResponse::respond):
2117         Callback for an eventual intercept response.
2118
2119         * platform/network/ResourceResponseBase.h:
2120         New ResponseSource - Inspector Override.
2121
2122         * loader/DocumentLoader.cpp:
2123         (WebCore::logResourceResponseSource):
2124         * testing/Internals.cpp:
2125         (WebCore::responseSourceToString):
2126         Handle new response sources.
2127
2128         * loader/cache/CachedResourceLoader.cpp:
2129         (WebCore::CachedResourceLoader::requestResource):
2130         (WebCore::CachedResourceLoader::preload):
2131         Avoid preloading or using the cache for URLs that would be intercepted
2132         by an active Inspector frontend.
2133
2134         * loader/cache/MemoryCache.cpp:
2135         (WebCore::MemoryCache::remove):
2136         Assertion to help detect if we ever get override content into the MemoryCache.
2137
2138         * loader/ResourceLoader.h:
2139         (WebCore::DocumentLoader::responseReceived):
2140         * loader/ResourceLoader.cpp:
2141         Fix typos.
2142
2143 2019-09-04  Chris Dumez  <cdumez@apple.com>
2144
2145         Expose WebPageProxy identifier to the Network Process
2146         https://bugs.webkit.org/show_bug.cgi?id=201467
2147
2148         Reviewed by Geoffrey Garen.
2149
2150         * loader/EmptyFrameLoaderClient.h:
2151         (isType):
2152         * loader/FrameLoaderClient.h:
2153
2154 2019-09-04  Alex Christensen  <achristensen@webkit.org>
2155
2156         Remove unused SPI that accesses MemoryCache directly
2157         https://bugs.webkit.org/show_bug.cgi?id=201468
2158
2159         Reviewed by Tim Horton.
2160
2161         * loader/cache/MemoryCache.cpp:
2162         (WebCore::dummyCachedImageClient): Deleted.
2163         (WebCore::MemoryCache::addImageToCache): Deleted.
2164         (WebCore::MemoryCache::removeImageFromCache): Deleted.
2165         * loader/cache/MemoryCache.h:
2166
2167 2019-09-04  Zalan Bujtas  <zalan@apple.com>
2168
2169         [LFC] Assert on FormattingContext escaping
2170         https://bugs.webkit.org/show_bug.cgi?id=201464
2171         <rdar://problem/55029574>
2172
2173         Reviewed by Antti Koivisto.
2174
2175         This patch asserts on accidental formatting context escaping. This is only a correctness issue at the moment,
2176         since we don't support multithreaded subtree layout yet.
2177         Normally we should not need to access display boxes in different formatting contexts during layout, but there are a few, justified cases when it is required.
2178
2179         * layout/FormattingContext.cpp:
2180         (WebCore::Layout::FormattingContext::displayBoxForLayoutBox const):
2181         * layout/FormattingContext.h:
2182         (WebCore::Layout::FormattingContext::displayBoxForLayoutBox const): Deleted.
2183         * layout/FormattingContextGeometry.cpp:
2184         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
2185         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
2186         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
2187         * layout/FormattingContextQuirks.cpp:
2188         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
2189         * layout/floats/FloatingContext.cpp:
2190         (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
2191         (WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
2192         (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
2193         (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
2194         * page/FrameViewLayoutContext.cpp:
2195         (WebCore::layoutUsingFormattingContext):
2196
2197 2019-09-04  Zalan Bujtas  <zalan@apple.com>
2198
2199         [LFC] FormattingContext::map* functions are too generic.
2200         https://bugs.webkit.org/show_bug.cgi?id=201447
2201         <rdar://problem/55005733>
2202
2203         Reviewed by Antti Koivisto.
2204
2205         We don't need such generic mapping functions yet. This patch is also in preparation for
2206         asserting on formatting context escaping. 
2207
2208         * layout/FormattingContext.cpp:
2209         (WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
2210         (WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
2211         (WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
2212         (WebCore::Layout::FormattingContext::mapLeftToAncestor const): Deleted.
2213         (WebCore::Layout::FormattingContext::mapRightToAncestor const): Deleted.
2214         (WebCore::Layout::FormattingContext::mapBoxToAncestor const): Deleted.
2215         (WebCore::Layout::FormattingContext::mapTopToAncestor const): Deleted.
2216         (WebCore::Layout::FormattingContext::mapPointToAncestor const): Deleted.
2217         (WebCore::Layout::FormattingContext::mapPointToDescendent const): Deleted.
2218         * layout/FormattingContext.h:
2219         * layout/blockformatting/BlockFormattingContext.cpp:
2220         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2221         * layout/floats/FloatingContext.cpp:
2222         (WebCore::Layout::FloatingContext::positionForFloat const):
2223         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2224         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2225         (WebCore::Layout::FloatingContext::constraints const):
2226         (WebCore::Layout::FloatingContext::append):
2227         (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
2228         (WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
2229         (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
2230         (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
2231         (WebCore::Layout::mapToFormattingContextRoot): Deleted.
2232         * layout/floats/FloatingContext.h:
2233         * page/FrameViewLayoutContext.cpp:
2234         (WebCore::layoutUsingFormattingContext):
2235
2236 2019-09-04  Antoine Quint  <graouts@apple.com>
2237
2238         [iPadOS] Unable to change sheets on Airtable.com
2239         https://bugs.webkit.org/show_bug.cgi?id=201456
2240         <rdar://problem/51557377>
2241
2242         Reviewed by Dean Jackson.
2243
2244         Simulated mouse events are required to be able to manipulate cells and and columns on Airtable.com. However, dispatching a "mousedown" event on
2245         tabs allowing to pick a different sheet ends up calling preventDefault() and prevent "click" events from being dispatched, which makes it
2246         impossible to change sheet. We now limit the dispatch of simulated mouse events to the grid.
2247
2248         * page/Quirks.cpp:
2249         (WebCore::Quirks::simulatedMouseEventTypeForTarget const):
2250
2251 2019-09-04  Youenn Fablet  <youenn@apple.com>
2252
2253         Abstract out WebSocketChannel message queue
2254         https://bugs.webkit.org/show_bug.cgi?id=201359
2255
2256         Reviewed by Alex Christensen.
2257
2258         Move BlobLoader in its own file.
2259         Introduce NetworkSendQueue class to handle the sending of messages, some of them being blobs.
2260         This class ensures that messages will be sent in order, even though blob data is resolved asynchronously.
2261
2262         Covered by existing tests.
2263
2264         * Headers.cmake:
2265         * Sources.txt:
2266         * WebCore.xcodeproj/project.pbxproj:
2267         * fileapi/BlobLoader.h: Added.
2268         (WebCore::BlobLoader::BlobLoader):
2269         (WebCore::BlobLoader::~BlobLoader):
2270         (WebCore::BlobLoader::didFinishLoading):
2271         (WebCore::BlobLoader::didFail):
2272         (WebCore::BlobLoader::complete):
2273         * fileapi/NetworkSendQueue.cpp: Added.
2274         (WebCore::NetworkSendQueue::NetworkSendQueue):
2275         (WebCore::NetworkSendQueue::enqueue):
2276         (WebCore::NetworkSendQueue::clear):
2277         (WebCore::NetworkSendQueue::processMessages):
2278         * fileapi/NetworkSendQueue.h: Added.
2279
2280 2019-09-04  Rob Buis  <rbuis@igalia.com>
2281
2282         Allow checking whether image was created from JavaScript
2283         https://bugs.webkit.org/show_bug.cgi?id=200662
2284
2285         Reviewed by Darin Adler.
2286
2287         No behavior change.
2288
2289         * html/HTMLImageElement.cpp:
2290         (WebCore::HTMLImageElement::HTMLImageElement):
2291         (WebCore::HTMLImageElement::create):
2292         * html/HTMLImageElement.h:
2293         (WebCore::HTMLImageElement::createdByParser const):
2294         * html/HTMLTagNames.in:
2295
2296 2019-09-04  Zan Dobersek  <zdobersek@igalia.com>
2297
2298         Remove unused ScrollingTreeOverflowScrollProxyNode implementation
2299         https://bugs.webkit.org/show_bug.cgi?id=201376
2300
2301         Reviewed by Simon Fraser.
2302
2303         Remove the unused ScrollingTreeOverflowScrollProxyNode implementation
2304         and header files that were added in r246723 but are not included in any
2305         build. Cocoa-specific implementation remains untouched, and other
2306         scrolling systems should be providing their own (as is the case with
2307         other types of nodes).
2308
2309         * page/scrolling/ScrollingTreeOverflowScrollProxyNode.cpp: Removed.
2310         * page/scrolling/ScrollingTreeOverflowScrollProxyNode.h: Removed.
2311
2312 2019-09-04  Philippe Normand  <pnormand@igalia.com>
2313
2314         [GStreamer] Sound is down-pitched when playing video from YLE Areena
2315         https://bugs.webkit.org/show_bug.cgi?id=201399
2316
2317         Reviewed by Xabier Rodriguez-Calvar.
2318
2319         If the FDK-AAC decoder is available, promote it and downrank the
2320         libav AAC decoders, due to their broken LC support, as reported in:
2321         https://ffmpeg.org/pipermail/ffmpeg-devel/2019-July/247063.html
2322
2323         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2324         (WebCore::initializeGStreamer):
2325
2326 2019-09-04  Pablo Saavedra  <psaavedra@igalia.com>
2327
2328         [GTK] Build failure in Debian Stable and Ubuntu LTS bots after r249427
2329         https://bugs.webkit.org/show_bug.cgi?id=201434
2330
2331         Reviewed by Xabier Rodriguez-Calvar.
2332
2333         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2334         (WebCore::GstVideoFrameHolder::waitForCPUSync):
2335
2336 2019-09-03  Wenson Hsieh  <wenson_hsieh@apple.com>
2337
2338         [macCatalyst] Unable to upload non-image files using drag and drop
2339         https://bugs.webkit.org/show_bug.cgi?id=201438
2340
2341         Reviewed by Tim Horton.
2342
2343         On recent builds of macOS 10.15, NSItemProviders that are produced when dropping files from Finder into a
2344         macCatalyst app no longer contain `kUTTypeFileURL` as a registered type identifier. This means that the current
2345         heuristic for figuring out whether or not an item provider can be represented as a file upload is broken, since
2346         it thinks all dropped content is inline data.
2347
2348         On iOS, we treat an NSItemProvider as an "uploaded" file as long as it hasn't been explicitly marked as inline
2349         data, such as a dragged selection from a native text field. However, on macCatalyst, all item providers return
2350         preferredPresentationStyle of UIPreferredPresentationStyleUnspecified, regardless of the source, so this check
2351         is useless on macCatalyst since it would consider all dropped content as a file upload (text selections, plain
2352         URLs, etc.).
2353
2354         Luckily, NSItemProvider's -suggestedName is now populated in recent macOS builds, which means we have a much
2355         stronger (and more robust) hint that a dropped item provider is actually a file. For the time being, use this
2356         instead of always returning `NO`.
2357
2358         * platform/ios/WebItemProviderPasteboard.mm:
2359         (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
2360
2361         Make a minor tweak to move the UIPreferredPresentationStyleInline check to shared code, such that when
2362         <rdar://55002929> is fixed, our code will automatically correctly treat inline item providers that have been
2363         explicitly marked as such.
2364
2365 2019-09-03  Antti Koivisto  <antti@apple.com>
2366
2367         Remove redundant painting phase arguments from GraphicsLayerClient functions
2368         https://bugs.webkit.org/show_bug.cgi?id=201443
2369
2370         Reviewed by Simon Fraser.
2371
2372         It is available from the GraphicsLayer.
2373
2374         * page/PageOverlayController.cpp:
2375         (WebCore::PageOverlayController::paintContents):
2376         * page/PageOverlayController.h:
2377         * page/mac/ServicesOverlayController.h:
2378         * page/mac/ServicesOverlayController.mm:
2379         (WebCore::ServicesOverlayController::Highlight::paintContents):
2380         * platform/graphics/GraphicsLayer.cpp:
2381         (WebCore::GraphicsLayer::paintGraphicsLayerContents):
2382         * platform/graphics/GraphicsLayerClient.h:
2383         (WebCore::GraphicsLayerClient::paintContents):
2384         * rendering/RenderLayerBacking.cpp:
2385         (WebCore::RenderLayerBacking::paintIntoLayer):
2386         (WebCore::RenderLayerBacking::paintFlagsForLayer const):
2387
2388         Factor into a function.
2389
2390         (WebCore::RenderLayerBacking::paintContents):
2391         * rendering/RenderLayerBacking.h:
2392         * rendering/RenderLayerCompositor.cpp:
2393         (WebCore::RenderLayerCompositor::paintContents):
2394         * rendering/RenderLayerCompositor.h:
2395
2396 2019-09-03  Myles C. Maxfield  <mmaxfield@apple.com>
2397
2398         [WHLSL] Implement SampleLevel(), SampleBias(), and SampleGrad()
2399         https://bugs.webkit.org/show_bug.cgi?id=201385
2400
2401         Reviewed by Dean Jackson.
2402
2403         These are used in the Babylon.js demo.
2404
2405         Tests: webgpu/whlsl/textures-sample-bias.html
2406                webgpu/whlsl/textures-sample-grad.html
2407                webgpu/whlsl/textures-sample-level.html
2408
2409         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
2410         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
2411         (WebCore::WHLSL::Metal::sampleType):
2412         (WebCore::WHLSL::Metal::inlineNativeFunction):
2413         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
2414         (WebCore::WHLSL::Intrinsics::addFullTexture):
2415         (WebCore::WHLSL::Intrinsics::addDepthTexture):
2416         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2417
2418 2019-09-03  Chris Dumez  <cdumez@apple.com>
2419
2420         FrameLoader::FrameProgressTracker::progressCompleted() does not need a pageID
2421         https://bugs.webkit.org/show_bug.cgi?id=201431
2422
2423         Reviewed by Antti Koivisto.
2424
2425         FrameLoader::FrameProgressTracker::progressCompleted() does not need to request a pageID
2426         from the client. It can merely pass the Page object and the upper layers can very easily
2427         get the identifier of that page.
2428
2429         * loader/FrameLoader.cpp:
2430         (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
2431         * loader/LoaderStrategy.h:
2432
2433 2019-09-03  Devin Rousso  <drousso@apple.com>
2434
2435         REGRESSION (r249078): Flaky crash in com.apple.JavaScriptCore: Inspector::InjectedScriptModule::ensureInjected
2436         https://bugs.webkit.org/show_bug.cgi?id=201201
2437         <rdar://problem/54771560>
2438
2439         Reviewed by Joseph Pecoraro.
2440
2441         Tests: inspector/debugger/tail-deleted-frames-this-value.html
2442                inspector/heap/getRemoteObject.html
2443
2444         * inspector/CommandLineAPIModuleSource.js:
2445         Avoid executing functions when injecting. Instead, modify the `CommandLineAPI` directly.
2446
2447 2019-09-03  Zalan Bujtas  <zalan@apple.com>
2448
2449         [LFC][TFC] Initialize <thead><tbody><tfoot> display boxes.
2450         https://bugs.webkit.org/show_bug.cgi?id=201235
2451         <rdar://problem/54807060>
2452
2453         Reviewed by Antti Koivisto.
2454
2455         Set them as blank for now.
2456
2457         * layout/tableformatting/TableFormattingContext.cpp:
2458         (WebCore::Layout::TableFormattingContext::layout const):
2459
2460 2019-09-03  Zalan Bujtas  <zalan@apple.com>
2461
2462         [LFC][Floating] Replace all LayoutState::displayBoxForLayoutBox() calls with FormattingContext::displayBoxForLayoutBox()
2463         https://bugs.webkit.org/show_bug.cgi?id=201414
2464         <rdar://problem/54963302>
2465
2466         Reviewed by Antti Koivisto.
2467
2468         Fix the final LayoutState::displayBoxForLayoutBox() callsites. Now all displayBoxForLayoutBox() calls are directed to the
2469         established FormattingContext.
2470
2471         * layout/FormattingContext.cpp:
2472         (WebCore::Layout::mapHorizontalPositionToAncestor):
2473         (WebCore::Layout::FormattingContext::mapLeftToAncestor const):
2474         (WebCore::Layout::FormattingContext::mapRightToAncestor const):
2475         (WebCore::Layout::FormattingContext::mapBoxToAncestor const):
2476         (WebCore::Layout::FormattingContext::mapTopToAncestor const):
2477         (WebCore::Layout::FormattingContext::mapPointToAncestor const):
2478         (WebCore::Layout::FormattingContext::mapPointToDescendent const):
2479         (WebCore::Layout::FormattingContext::mapLeftToAncestor): Deleted.
2480         (WebCore::Layout::FormattingContext::mapRightToAncestor): Deleted.
2481         (WebCore::Layout::FormattingContext::mapBoxToAncestor): Deleted.
2482         (WebCore::Layout::FormattingContext::mapTopToAncestor): Deleted.
2483         (WebCore::Layout::FormattingContext::mapPointToAncestor): Deleted.
2484         (WebCore::Layout::FormattingContext::mapPointToDescendent): Deleted.
2485         * layout/FormattingContext.h:
2486         (WebCore::Layout::FormattingContext::root const):
2487         (WebCore::Layout::FormattingContext::formattingState const):
2488         * layout/blockformatting/BlockFormattingContext.cpp:
2489         (WebCore::Layout::BlockFormattingContext::layout):
2490         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2491         * layout/floats/FloatingContext.cpp:
2492         (WebCore::Layout::mapToFormattingContextRoot):
2493         (WebCore::Layout::FloatingContext::FloatingContext):
2494         (WebCore::Layout::FloatingContext::positionForFloat const):
2495         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2496         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2497         (WebCore::Layout::FloatingContext::constraints const):
2498         (WebCore::Layout::FloatingContext::append):
2499         * layout/floats/FloatingContext.h:
2500         (WebCore::Layout::FloatingContext::formattingContext const):
2501         (WebCore::Layout::FloatingContext::root const):
2502         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2503         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
2504         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2505
2506 2019-09-04  Simon Fraser  <simon.fraser@apple.com>
2507
2508         Cancelled transitions on Google image search leave content with opacity 0 sometimes
2509         https://bugs.webkit.org/show_bug.cgi?id=201482
2510         rdar://problem/54921036
2511
2512         Reviewed by Tim Horton.
2513         
2514         If, in a single rendering update, we started an accelerated opacity transition, and then removed
2515         it, we'd still push the transition onto the CALayer with fillForwards and never remove it, so its
2516         effects would last forever.
2517
2518         Fix by making GraphicsLayerCA::removeAnimation() remove animations from the uncomittedAnimations
2519         list as well.
2520         
2521         Also fix layer names in debug; if a layer's primaryLayerID changed, we'd fail to rename the
2522         CALayer, causing confusion when logging at layer dumps. Fix by adding the layer ID just
2523         before pushing the name to the platform layer.
2524
2525         Some drive-by logging cleanup.
2526
2527         Test: legacy-animation-engine/compositing/transitions/add-remove-transition.html
2528
2529         * platform/graphics/GraphicsLayer.cpp:
2530         (WebCore::GraphicsLayer::debugName const):
2531         * platform/graphics/GraphicsLayer.h:
2532         * platform/graphics/ca/GraphicsLayerCA.cpp:
2533         (WebCore::GraphicsLayerCA::setName):
2534         (WebCore::GraphicsLayerCA::debugName const):
2535         (WebCore::GraphicsLayerCA::addAnimation):
2536         (WebCore::GraphicsLayerCA::pauseAnimation):
2537         (WebCore::GraphicsLayerCA::seekAnimation):
2538         (WebCore::GraphicsLayerCA::removeAnimation):
2539         (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
2540         (WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
2541         (WebCore::GraphicsLayerCA::updateNames):
2542         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2543         * platform/graphics/ca/GraphicsLayerCA.h:
2544         * rendering/RenderLayerCompositor.cpp:
2545         (WebCore::RenderLayerCompositor::logLayerInfo):
2546
2547 2019-09-03  Zalan Bujtas  <zalan@apple.com>
2548
2549         [LFC] FloatingState should not need to query for display boxes.
2550         https://bugs.webkit.org/show_bug.cgi?id=201408
2551         <rdar://problem/54958348>
2552
2553         Reviewed by Antti Koivisto.
2554
2555         This is in preparation for transitioning the floating codebase to use the formatting context for
2556         retrieving display boxes.
2557         FloatingContext should be responsible for adding/removing the new/existing float boxes to the state.
2558
2559         * layout/blockformatting/BlockFormattingContext.cpp:
2560         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
2561         * layout/floats/FloatingContext.cpp:
2562         (WebCore::Layout::FloatingContext::append):
2563         (WebCore::Layout::FloatingContext::remove):
2564         * layout/floats/FloatingContext.h:
2565         * layout/floats/FloatingState.cpp:
2566         (WebCore::Layout::FloatingState::append):
2567         (WebCore::Layout::belongsToThisFloatingContext): Deleted.
2568         * layout/floats/FloatingState.h:
2569         (WebCore::Layout::FloatingState::FloatItem::horizontalMargin const):
2570         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2571         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2572
2573 2019-09-03  Zalan Bujtas  <zalan@apple.com>
2574
2575         [LFC][Floats] Do not pass FloatingState to FloatItem
2576         https://bugs.webkit.org/show_bug.cgi?id=201406
2577         <rdar://problem/54957097>
2578
2579         Reviewed by Antti Koivisto.
2580
2581         This is in preparation for transitioning the floating codebase to use the formatting context for
2582         retrieving display boxes. Now FloatItems don't need the FloatingState to compute absolute display boxes.  
2583
2584         * layout/floats/FloatingState.cpp:
2585         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2586         (WebCore::Layout::FloatingState::append):
2587         * layout/floats/FloatingState.h:
2588
2589 2019-09-03  Zalan Bujtas  <zalan@apple.com>
2590
2591         [LFC][Floats] Do not pass FloatingState to FloatAvoider/FloatBox
2592         https://bugs.webkit.org/show_bug.cgi?id=201405
2593         <rdar://problem/54956381>
2594
2595         Reviewed by Antti Koivisto.
2596
2597         This is in preparation for transitioning the floating codebase to use the formatting context for
2598         retrieving display boxes. Now FloatAvoiders/FloatBoxes don't need the FloatingState to compute absolute display boxes.
2599
2600         * layout/floats/FloatAvoider.cpp:
2601         (WebCore::Layout::FloatAvoider::FloatAvoider):
2602         (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
2603         (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
2604         (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
2605         (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
2606         * layout/floats/FloatAvoider.h:
2607         (WebCore::Layout::FloatAvoider::floatingState const): Deleted.
2608         * layout/floats/FloatBox.cpp:
2609         (WebCore::Layout::FloatBox::FloatBox):
2610         (WebCore::Layout::FloatBox::initialVerticalPosition const):
2611         * layout/floats/FloatBox.h:
2612         * layout/floats/FloatingContext.cpp:
2613         (WebCore::Layout::mapToFormattingContextRoot):
2614         (WebCore::Layout::FloatingContext::positionForFloat const):
2615         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2616         * platform/graphics/LayoutPoint.h:
2617         (WebCore::LayoutPoint::isZero const):
2618
2619 2019-09-03  Jiewen Tan  <jiewen_tan@apple.com>
2620
2621         [WebAuthn] Enable WebAuthn by default for MobileSafari and SafariViewService
2622         https://bugs.webkit.org/show_bug.cgi?id=201369
2623         <rdar://problem/54903724>
2624
2625         Reviewed by Brent Fulgham.
2626
2627         * platform/RuntimeApplicationChecks.h:
2628         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2629         (WebCore::IOSApplication::isSafariViewService):
2630         Adds a way to detect SafariViewService.
2631
2632 2019-09-03  Simon Fraser  <simon.fraser@apple.com>
2633
2634         Cache "compositingAncestor" during the compositing updateBackingAndHierarchy() tree walk
2635         https://bugs.webkit.org/show_bug.cgi?id=201403
2636
2637         Reviewed by Antti Koivisto.
2638
2639         Finding a layer's compositingAncestor requires an ancestor tree walk. We can avoid this during
2640         compositing updates, since we're already in the middle of a paint-order tree walk, and can just
2641         keep track of the current compositingAncestor on the way down.
2642
2643         Shaves a few % off time in updateCompositingLayers().
2644
2645         * rendering/RenderLayerBacking.cpp:
2646         (WebCore::RenderLayerBacking::updateConfiguration):
2647         (WebCore::ComputedOffsets::ComputedOffsets):
2648         (WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
2649         (WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect const):
2650         (WebCore::RenderLayerBacking::updateGeometry):
2651         * rendering/RenderLayerBacking.h:
2652         * rendering/RenderLayerCompositor.cpp:
2653         (WebCore::RenderLayerCompositor::UpdateBackingTraversalState::UpdateBackingTraversalState):
2654         (WebCore::RenderLayerCompositor::UpdateBackingTraversalState::stateForDescendants const):
2655         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2656         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2657         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2658         (WebCore::RenderLayerCompositor::updateLayerCompositingState):
2659         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2660         (WebCore::RenderLayerCompositor::coordinatedScrollingRolesForLayer const):
2661         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2662         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
2663         * rendering/RenderLayerCompositor.h:
2664
2665 2019-09-03  Simon Fraser  <simon.fraser@apple.com>
2666
2667         Make "clips compositing descendants" an indirect compositing reason
2668         https://bugs.webkit.org/show_bug.cgi?id=201381
2669
2670         Reviewed by Antti Koivisto.
2671
2672         Whether a layer has to composite to clip composited descendants is an "indirect" reason,
2673         just like having to composite for filters if there's a composited descendant. So add
2674         IndirectCompositingReason::Clipping, and have computeIndirectCompositingReason() compute this,
2675         replacing the code that ran in computeCompositingRequirements().
2676
2677         This is some preparatory cleanup for webkit.org/b/201330.
2678
2679         * rendering/RenderLayer.cpp:
2680         (WebCore::RenderLayer::calculateClipRects const):
2681         * rendering/RenderLayer.h:
2682         * rendering/RenderLayerCompositor.cpp:
2683         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2684         (WebCore::RenderLayerCompositor::requiresCompositingLayer const):
2685         (WebCore::RenderLayerCompositor::reasonsForCompositing const):
2686         (WebCore::RenderLayerCompositor::computeIndirectCompositingReason const):
2687         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const): Deleted.
2688         * rendering/RenderLayerCompositor.h:
2689
2690 2019-09-03  Zalan Bujtas  <zalan@apple.com>
2691
2692         [LFC][Floats] Move FloatingState::constraints to FloatingContext
2693         https://bugs.webkit.org/show_bug.cgi?id=201393
2694         <rdar://problem/54939361>
2695
2696         Reviewed by Antti Koivisto.
2697
2698         This is in preparation for transitioning the floating codebase to use the formatting context for
2699         retrieving display boxes. Now FloatingContext (just like any other formatting context) holds on to the formatting
2700         context root.
2701
2702         * layout/blockformatting/BlockFormattingContext.cpp:
2703         (WebCore::Layout::BlockFormattingContext::layout):
2704         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
2705         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
2706         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
2707         * layout/floats/FloatingContext.cpp:
2708         (WebCore::Layout::FloatingContext::FloatingContext):
2709         (WebCore::Layout::FloatingContext::positionForFloat const):
2710         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2711         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2712         (WebCore::Layout::FloatingContext::constraints const):
2713         * layout/floats/FloatingContext.h:
2714         (WebCore::Layout::FloatingContext::isEmpty const):
2715         (WebCore::Layout::FloatingContext::root const):
2716         * layout/floats/FloatingState.cpp:
2717         (WebCore::Layout::FloatingState::constraints const): Deleted.
2718         * layout/floats/FloatingState.h:
2719         (WebCore::Layout::FloatingState::last const):
2720         (WebCore::Layout::FloatingState::isEmpty const): Deleted.
2721         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2722         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
2723         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
2724
2725 2019-09-03  Chris Lord  <clord@igalia.com>
2726
2727         [GStreamer] Add support to copy YUV video textures into images
2728         https://bugs.webkit.org/show_bug.cgi?id=200922
2729
2730         Reviewed by Philippe Normand and Xabier Rodriguez-Calvar.
2731
2732         Use gst_gl_color_convert to convert to RGB before using ImageGStreamer
2733         with gstreamer-gl.
2734
2735         No new tests, not changing behavior.
2736
2737         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2738         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2739         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2740
2741 2019-09-03  Chris Lord  <clord@igalia.com>
2742
2743         [GStreamer] Add support to copy YUV video textures into platform textures
2744         https://bugs.webkit.org/show_bug.cgi?id=200914
2745
2746         Reviewed by Xabier Rodriguez-Calvar and Miguel Gomez.
2747
2748         Enable YUV (including planar and semi-planar) video texture to platform
2749         texture copy in VideoTextureCopierGStreamer.
2750
2751         No new tests, not changing behavior.
2752
2753         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2754         (WebCore::GstVideoFrameHolder::platformLayerBuffer):
2755         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2756         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
2757         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2758         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2759         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2760         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2761         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2762         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2763         (WebCore::TextureMapperPlatformLayerBuffer::textureVariant):
2764
2765 2019-09-03  Zan Dobersek  <zdobersek@igalia.com>  and  Chris Lord  <clord@igalia.com>
2766
2767         [Texmap][GStreamer] Add support to upload more color formats into the texture
2768         https://bugs.webkit.org/show_bug.cgi?id=132869
2769
2770         Reviewed by Xabier Rodriguez-Calvar.
2771
2772         Support non-interleaved YUV color for gstreamer-gl
2773
2774         This adds direct support for rendering I420, I444, YV12, YV21, Y42B,
2775         NV12, NV21 and VUYA color formats using GLGL shaders when using
2776         gstreamer-gl for video rendering. This avoids a surface copy on the GPU
2777         in those cases.
2778
2779         No new tests, not changing behavior.
2780
2781         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2782         (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
2783         (WebCore::GstVideoFrameHolder::waitForCPUSync):
2784         (WebCore::GstVideoFrameHolder::hasMappedTextures const):
2785         (WebCore::GstVideoFrameHolder::videoFrame const):
2786         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2787         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSinkGL):
2788         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2789         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2790         * platform/graphics/texmap/TextureMapperGL.cpp:
2791         (WebCore::optionsForFilterType):
2792         (WebCore::TextureMapperGL::drawTexture):
2793         (WebCore::prepareTransformationMatrixWithFlags):
2794         (WebCore::TextureMapperGL::drawTexturePlanarYUV):
2795         (WebCore::TextureMapperGL::drawTextureSemiPlanarYUV):
2796         (WebCore::TextureMapperGL::drawTexturePackedYUV):
2797         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
2798         * platform/graphics/texmap/TextureMapperGL.h:
2799         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2800         (WebCore::TextureMapperPlatformLayerBuffer::TextureMapperPlatformLayerBuffer):
2801         (WebCore::TextureMapperPlatformLayerBuffer::~TextureMapperPlatformLayerBuffer):
2802         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2803         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2804         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
2805         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2806         (WebCore::TextureMapperShaderProgram::create):
2807         * platform/graphics/texmap/TextureMapperShaderProgram.h:
2808
2809 2019-09-03  Rob Buis  <rbuis@igalia.com>
2810
2811         Remove support for load/error on link=prefetch
2812         https://bugs.webkit.org/show_bug.cgi?id=201348
2813
2814         Reviewed by Youenn Fablet.
2815
2816         Remove support for firing load/error on link=prefetch
2817         to address tracking concerns.
2818
2819         Tests: http/wpt/prefetch/load-events-dynamic.html
2820                http/wpt/prefetch/load-events.html
2821
2822         * html/HTMLLinkElement.cpp:
2823         (WebCore::HTMLLinkElement::linkLoaded):
2824         (WebCore::HTMLLinkElement::linkLoadingErrored):
2825         * html/HTMLLinkElement.h:
2826         * testing/Internals.cpp:
2827         (WebCore::Internals::addPrefetchLoadEventListener):
2828
2829 2019-09-02  Yusuke Suzuki  <ysuzuki@apple.com>
2830
2831         [WebCore] Resource usage accounting should accept non KERN_SUCCESS
2832         https://bugs.webkit.org/show_bug.cgi?id=201409
2833
2834         Reviewed by Andreas Kling.
2835
2836         While iterating threads, we are not suspending these threads. Underlying threads can have gone
2837         at any time and we will get non KERN_SUCCESS error code when a thread has gone. We should ignore
2838         these threads.
2839
2840         * page/cocoa/ResourceUsageThreadCocoa.mm:
2841         (WebCore::threadInfos):
2842
2843 2019-09-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2844
2845         [SVG] fragment-only url 'url(#fragment)' should be resolved against the current document with regardless to HTML <base> element
2846         https://bugs.webkit.org/show_bug.cgi?id=189499
2847         <rdar://problem/44466206>
2848
2849         Reviewed by Said Abou-Hallawa.
2850
2851         Fragment-only URL 'url(#fragment)' should be resolved against the
2852         current document even if HTML <base> element is specified.
2853         Spec: <https://drafts.csswg.org/css-values/#local-urls>
2854
2855         Tests: css3/filters/effect-reference-local-url-with-base.html
2856                css3/masking/clip-path-reference-local-url-with-base.html
2857                http/tests/svg/local-url-with-valid-base-and-resource.html
2858                svg/animations/local-url-target-reference.html
2859                svg/custom/local-url-reference-clip-path.html
2860                svg/custom/local-url-reference-fill.html
2861                svg/custom/local-url-reference-filter.html
2862                svg/custom/local-url-reference-marker.html
2863                svg/custom/local-url-reference-mask.html
2864                svg/custom/local-url-reference-pattern.html
2865                svg/custom/local-url-reference-radial-gradient.html
2866                svg/custom/local-url-reference-srcdoc.html
2867                svg/custom/local-url-reference-stroke.html
2868                svg/custom/local-url-reference-use.html
2869                svg/text/textpath-local-url-reference.html
2870
2871         * svg/SVGURIReference.cpp:
2872         (WebCore::SVGURIReference::fragmentIdentifierFromIRIString): Return the fragment if the URL starts with '#'.
2873
2874 2019-09-02  Fujii Hironori  <Hironori.Fujii@sony.com>
2875
2876         [Win] Remove a unused PlatformWheelEvent constructor
2877         https://bugs.webkit.org/show_bug.cgi?id=201398
2878
2879         Reviewed by Don Olmstead.
2880
2881         No behavior change.
2882
2883         * platform/PlatformWheelEvent.h:
2884         * platform/win/WheelEventWin.cpp:
2885         Removed a unused PlatformWheelEvent constructor.
2886
2887 2019-09-02  Brent Fulgham  <bfulgham@apple.com>
2888
2889         [FTW] NativeImagePtr is drawn with invalid scaling
2890         https://bugs.webkit.org/show_bug.cgi?id=201391
2891
2892         Reviewed by Don Olmstead.
2893
2894         The current implementation of FTW improperly applies scaling factors to native images,
2895         resulting in blocky images (in some cases).
2896
2897         This patch corrects the handling of native images, corrects a bug in bitmap render
2898         context scaling, and retrieves more data from the ImageDecoder's metadata system.
2899
2900         * platform/graphics/win/Direct2DUtilities.cpp:
2901         (WebCore::Direct2D::createBitmapRenderTargetOfSize): Supply an appropriately sized
2902         pixel dimension for non-unity scale factors.
2903         * platform/graphics/win/ImageBufferDirect2D.cpp:
2904         (WebCore::ImageBuffer::ImageBuffer): Include the scale factor when creating a
2905         bitmap render target.
2906         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2907         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const): Read the orientation
2908         data form the image metadata.
2909         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const): Always return
2910         true, to match the CG implementation.
2911         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const): Correct to match the
2912         behavior of CG.
2913         * platform/graphics/win/NativeImageDirect2D.cpp:
2914         (WebCore::drawNativeImage): Pass through the Direct2DOperations helper method, which
2915         handles scaling and subsampling properly.
2916
2917 2019-09-02  Youenn Fablet  <youenn@apple.com>
2918
2919         Introduce WorkerMessagePortChannelRegistry
2920         https://bugs.webkit.org/show_bug.cgi?id=201333
2921
2922         Reviewed by Alex Christensen.
2923
2924         This patch introduces a dedicated registry for workers.
2925         This registry will hop to the main thread and use the
2926         regular main thread registry to do the actual processing.
2927
2928         Covered by existing tests.
2929
2930         * Sources.txt:
2931         * WebCore.xcodeproj/project.pbxproj:
2932         * dom/Document.cpp:
2933         (WebCore::Document::messagePortChannelProvider):
2934         * dom/Document.h:
2935         * dom/MessageChannel.cpp:
2936         (WebCore::MessageChannel::MessageChannel):
2937         * dom/MessagePort.cpp:
2938         (WebCore::MessagePort::entangle):
2939         (WebCore::MessagePort::postMessage):
2940         (WebCore::MessagePort::disentangle):
2941         (WebCore::MessagePort::close):
2942         (WebCore::MessagePort::dispatchMessages):
2943         (WebCore::MessagePort::hasPendingActivity const):
2944         * dom/messageports/MessagePortChannel.cpp:
2945         (WebCore::MessagePortChannel::takeAllMessagesForPort):
2946         (WebCore::MessagePortChannel::checkRemotePortForActivity):
2947         * dom/messageports/MessagePortChannel.h:
2948         * dom/messageports/MessagePortChannelProvider.cpp:
2949         (WebCore::MessagePortChannelProvider::singleton):
2950         (WebCore::MessagePortChannelProvider::fromContext):
2951         * dom/messageports/MessagePortChannelProvider.h:
2952         * dom/messageports/MessagePortChannelProviderImpl.cpp:
2953         (WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
2954         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
2955         * dom/messageports/MessagePortChannelProviderImpl.h:
2956         * dom/messageports/MessagePortChannelRegistry.cpp:
2957         (WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
2958         (WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
2959         * dom/messageports/MessagePortChannelRegistry.h:
2960         * dom/messageports/WorkerMessagePortChannelProvider.cpp: Added.
2961         (WebCore::WorkerMessagePortChannelProvider::WorkerMessagePortChannelProvider):
2962         (WebCore::WorkerMessagePortChannelProvider::~WorkerMessagePortChannelProvider):
2963         (WebCore::WorkerMessagePortChannelProvider::createNewMessagePortChannel):
2964         (WebCore::WorkerMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
2965         (WebCore::WorkerMessagePortChannelProvider::messagePortDisentangled):
2966         (WebCore::WorkerMessagePortChannelProvider::messagePortClosed):
2967         (WebCore::WorkerMessagePortChannelProvider::postMessageToRemote):
2968         (WebCore::WorkerMessagePortChannelProvider::takeAllMessagesForPort):
2969         (WebCore::WorkerMessagePortChannelProvider::checkRemotePortForActivity):
2970         (WebCore::WorkerMessagePortChannelProvider::checkProcessLocalPortForActivity):
2971         * dom/messageports/WorkerMessagePortChannelProvider.h: Added.
2972         * workers/WorkerGlobalScope.cpp:
2973         (WebCore::WorkerGlobalScope::messagePortChannelProvider):
2974         * workers/WorkerGlobalScope.h:
2975
2976 2019-09-01  Myles C. Maxfield  <mmaxfield@apple.com>
2977
2978         [WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
2979         https://bugs.webkit.org/show_bug.cgi?id=201383
2980
2981         Reviewed by Dean Jackson.
2982
2983         Bind groups correspond to argument buffers in Metal. Both the Metal API and Metal Shading Language
2984         have to agree on the layout of exactly which resources lie at which byte offsets within an argument
2985         buffer.
2986
2987         Before this patch, we only emitted code for the items in the argument buffer that were actually
2988         referenced by the shader source code. However, because these items are held inside a struct, if
2989         we omit one item from the middle of the struct, the byte offets of all the successive items would
2990         be wrong. This means that the Metal API and the shader would disagree about how to access these
2991         resources, making the resources inaccessible (and causing security problems).
2992
2993         Tests: webgpu/whlsl/sparse-bind-group-2.html
2994                webgpu/whlsl/sparse-bind-group-3.html
2995                webgpu/whlsl/sparse-bind-group.html
2996
2997         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2998         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
2999         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
3000         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
3001         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
3002         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
3003         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
3004         (WebCore::WHLSL::matchResources):
3005         (WebCore::WHLSL::matchVertexAttributes):
3006         (WebCore::WHLSL::matchColorAttachments):
3007
3008 2019-09-01  Commit Queue  <commit-queue@webkit.org>
3009
3010         Unreviewed, rolling out r249369.
3011         https://bugs.webkit.org/show_bug.cgi?id=201394
3012
3013         broke WHLSL tests (Requested by litherum on #webkit).
3014
3015         Reverted changeset:
3016
3017         "[WHLSL] Resources don't work when only a subset of a bind
3018         group is referenced by a shader"
3019         https://bugs.webkit.org/show_bug.cgi?id=201383
3020         https://trac.webkit.org/changeset/249369
3021
3022 2019-09-01  Fujii Hironori  <Hironori.Fujii@sony.com>
3023
3024         Unreviewed, rolling out r249366.
3025
3026         WinCairo WebKit2 crashes in some websites and the device scale
3027         factor is not correct in high DPI.
3028
3029         Reverted changeset:
3030
3031         "[WinCairo, FTW] Properly handle device scale factor"
3032         https://bugs.webkit.org/show_bug.cgi?id=201361
3033         https://trac.webkit.org/changeset/249366
3034
3035 2019-09-01  Myles C. Maxfield  <mmaxfield@apple.com>
3036
3037         [WHLSL] Resources don't work when only a subset of a bind group is referenced by a shader
3038         https://bugs.webkit.org/show_bug.cgi?id=201383
3039
3040         Reviewed by Dean Jackson.
3041
3042         Bind groups correspond to argument buffers in Metal. Both the Metal API and Metal Shading Language
3043         have to agree on the layout of exactly which resources lie at which byte offsets within an argument
3044         buffer.
3045
3046         Before this patch, we only emitted code for the items in the argument buffer that were actually
3047         referenced by the shader source code. However, because these items are held inside a struct, if
3048         we omit one item from the middle of the struct, the byte offets of all the successive items would
3049         be wrong. This means that the Metal API and the shader would disagree about how to access these
3050         resources, making the resources inaccessible (and causing security problems).
3051
3052         Tests: webgpu/whlsl/sparse-bind-group-2.html
3053                webgpu/whlsl/sparse-bind-group-3.html
3054                webgpu/whlsl/sparse-bind-group.html
3055
3056         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
3057         (WebCore::WHLSL::Metal::EntryPointScaffolding::emitResourceHelperTypes):
3058         (WebCore::WHLSL::Metal::VertexEntryPointScaffolding::emitHelperTypes):
3059         (WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::emitHelperTypes):
3060         (WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::emitHelperTypes):
3061         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
3062         * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
3063         (WebCore::WHLSL::matchResources):
3064         (WebCore::WHLSL::matchVertexAttributes):
3065         (WebCore::WHLSL::matchColorAttachments):
3066
3067 2019-09-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
3068
3069         HTMLImageElement::decode() should return a resolved promise for decoding non bitmap images
3070         https://bugs.webkit.org/show_bug.cgi?id=201243
3071
3072         Reviewed by Youenn Fablet.
3073
3074         The specs: https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-decode
3075         states that, decode() should resolve the pending promise if the decoding
3076         was requested for a non bitmap image.
3077
3078         Test: fast/images/decode-non-bitmap-image-resolve.html
3079
3080         * loader/ImageLoader.cpp:
3081         (WebCore::resolveDecodePromises):
3082         (WebCore::rejectDecodePromises):
3083         (WebCore::ImageLoader::notifyFinished):
3084         (WebCore::ImageLoader::decode):
3085         (WebCore::ImageLoader::decodeError): Deleted.
3086         * loader/ImageLoader.h:
3087         (WebCore::ImageLoader::hasPendingDecodePromises const):
3088
3089 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
3090
3091         [WinCairo, FTW] Properly handle device scale factor
3092         https://bugs.webkit.org/show_bug.cgi?id=201361
3093
3094         Reviewed by Don Olmstead.
3095
3096         Update the Direct2D ImageBuffer/ImageBufferData classes to correctly handle
3097         the device scale factor.
3098
3099         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
3100         (WebCore::ImageBufferData::putData):
3101         * platform/graphics/win/ImageBufferDirect2D.cpp:
3102         (WebCore::ImageBuffer::putByteArray):
3103
3104 2019-08-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
3105
3106         EXIF orientation should be respected when rendering images 
3107         https://bugs.webkit.org/show_bug.cgi?id=201123
3108
3109         Reviewed by Simon Fraser.
3110
3111         -- Image::size() will return the rendered size based on the image
3112            orientation. If image orientation is FromImage, ImageSource will query
3113            the actual image orientation from the ImageDecoder. The low level APIs
3114            might transpose the size just before calling the system API to draw
3115            the image.
3116
3117         -- RenderElement::imageOrientation() will return ImageOrientation::FromImage
3118            for all images and for all ports till the CSS image-orientation specs
3119            is finalized.
3120
3121         -- The default of ImagePaintingOptions argument of GraphicsContext::drawImage()
3122            will be changed to { ImageOrientation::FromImage }.
3123
3124         -- Image element: RenderImage::paintIntoRect() will pass imageOrientation()
3125            which returns ImageOrientation::FromImage to GraphicsContext::drawImage().
3126
3127         -- CSS background image: RenderBoxModelObject::paintFillLayerExtended will
3128            pass ImageOrientation::FromImage by default to GraphicsContext::drawTiledImage().
3129
3130         -- Images on canvas: CanvasRenderingContext2DBase::drawImage() will pass
3131            ImageOrientation::FromImage by default to GraphicsContext::drawImage().
3132
3133         -- SVG images: RenderSVGImage::paintForeground() calls GraphicsContext::drawImage()
3134            with the default ImagePaintingOptions which is now { ImageOrientation::FromImage }.
3135
3136         -- SVG feImage filters: FEImage::platformApplySoftware() calls
3137            GraphicsContext::drawImage() with the default ImagePaintingOptions
3138            which is now { ImageOrientation::FromImage }.
3139
3140         -- ImageDocument: RenderElement::imageOrientation() returns FromImage
3141            always and for all ports.
3142
3143         Tests: fast/images/exif-orientation-background.html
3144                fast/images/exif-orientation-canvas.html
3145                fast/images/exif-orientation-content.html
3146                fast/images/exif-orientation-element-object-fit.html
3147                fast/images/exif-orientation-element.html
3148                fast/images/exif-orientation-image-object.html
3149                fast/images/exif-orientation-svg-feimage.html
3150                fast/images/exif-orientation-svg-image.html
3151
3152         * html/canvas/CanvasRenderingContext2DBase.cpp:
3153         (WebCore::CanvasRenderingContext2DBase::drawImage):
3154         * loader/cache/CachedImage.cpp:
3155         (WebCore::CachedImage::imageSizeForRenderer const):
3156         * platform/graphics/BitmapImage.h:
3157         * platform/graphics/CrossfadeGeneratedImage.h:
3158         * platform/graphics/GeneratedImage.h:
3159         * platform/graphics/GraphicsContext.h:
3160         (WebCore::GraphicsContext::drawImage):
3161         * platform/graphics/Image.h:
3162         * platform/graphics/ImageFrame.h:
3163         (WebCore::ImageFrame::sizeRespectingOrientation const): Deleted.
3164         * platform/graphics/ImageSource.cpp:
3165         (WebCore::ImageSource::ImageSource):
3166         (WebCore::ImageSource::orientation):
3167         (WebCore::ImageSource::size):
3168         (WebCore::ImageSource::sizeRespectingOrientation): Deleted.
3169         * platform/graphics/ImageSource.h:
3170         * platform/graphics/cg/PDFDocumentImage.cpp:
3171         (WebCore::PDFDocumentImage::size const):
3172         * platform/graphics/cg/PDFDocumentImage.h:
3173         * platform/mac/DragImageMac.mm:
3174         (WebCore::createDragImageFromImage):
3175         * rendering/RenderBoxModelObject.cpp:
3176         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3177         * rendering/RenderElement.cpp:
3178         (WebCore::RenderElement::imageOrientation const):
3179         * rendering/RenderImage.cpp:
3180         (WebCore::RenderImage::paintIntoRect):
3181         * svg/graphics/SVGImage.h:
3182         * svg/graphics/SVGImageForContainer.cpp:
3183         (WebCore::SVGImageForContainer::size const):
3184         * svg/graphics/SVGImageForContainer.h:
3185
3186 2019-08-31  Rob Buis  <rbuis@igalia.com>
3187
3188         XMLHttpRequest: responseXML returns null if the Content-Type is valid (end in +xml) in some cases
3189         https://bugs.webkit.org/show_bug.cgi?id=46146
3190
3191         Reviewed by Youenn Fablet.
3192
3193         Make response MIME type fallback to text/xml in case mimeType could
3194         not be extracted [1] and use the stricter ParsedContentType for that.
3195
3196         Behavior matches Firefox.
3197
3198         Test: web-platform-tests/xhr/responsexml-media-type.htm
3199
3200         [1] https://xhr.spec.whatwg.org/#response-mime-type
3201
3202         * xml/XMLHttpRequest.cpp:
3203         (WebCore::XMLHttpRequest::responseMIMEType const):
3204
3205 2019-08-31  Frederic Wang  <fwang@igalia.com>
3206
3207         Fix interpretation of fraction shifts
3208         https://bugs.webkit.org/show_bug.cgi?id=201242
3209
3210         Reviewed by Rob Buis.
3211
3212         In fractions, numerator/denominator shifts are currently interpreted relative to the math
3213         axis while they should be relative to the baseline [1]. This patch refactors the
3214         RenderMathMLFraction to do that and aligns more on MathML Core [2] [3]. This fixes serious
3215         rendering bugs in fractions.
3216
3217         [1] https://github.com/mathml-refresh/mathml/issues/123
3218         [2] https://mathml-refresh.github.io/mathml-core/#fraction-with-nonzero-line-thickness
3219         [3] https://mathml-refresh.github.io/mathml-core/#fraction-with-zero-line-thickness
3220
3221         No new tests, existing tests updated.
3222
3223         * rendering/mathml/RenderMathMLFraction.h: ascentOverHorizontalAxis() is replaced with
3224         fractionAscent() which gives the actual baseline position rather than the math axis position.
3225         fractionParameters() and stackParameters() are modified so that they only return the shifts,
3226         now stored in a shared FractionParameters struct.
3227         * rendering/mathml/RenderMathMLFraction.cpp:
3228         (WebCore::RenderMathMLFraction::fractionParameters const): Store existing parameters in local
3229         variables and perform adjustments to the shift values so that the minimal gap constraints
3230         are satisfied. Return them as a FractionParameters.
3231         (WebCore::RenderMathMLFraction::stackParameters const): Ditto.
3232         (WebCore::RenderMathMLFraction::fractionAscent const): This calculates the ascent above
3233         the baseline as described in [2] [3] and replaces ascentOverHorizontalAxis. To minimize
3234         changeset, this continues to ignore contribution of denominator size and not to distinguish
3235         ink or non-ink metrics.
3236         (WebCore::RenderMathMLFraction::layoutBlock): The position of the denominator is now just
3237         calculated as a shift from the baseline. The height is given by the bottom of the
3238         denominator. The old "ascent + mathAxisHeight() + denominatorDescent" does not make any
3239         sense.
3240         (WebCore::RenderMathMLFraction::paint): Use fractionAscent() instead of
3241         ascentOverHorizontalAxis().
3242         (WebCore::RenderMathMLFraction::firstLineBaseline const): Ditto.
3243
3244 2019-08-31  Chris Dumez  <cdumez@apple.com>
3245
3246         DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID
3247         https://bugs.webkit.org/show_bug.cgi?id=201364
3248
3249         Reviewed by John Wilander.
3250
3251         DocumentStorageAccess::hasStorageAccess() / requestStorageAccess() don't need to know about pageID / frameID. pageID is
3252         redundant since it is being ignored by the callee. For the frame, simply pass the frame object in.
3253
3254         * dom/DocumentStorageAccess.cpp:
3255         (WebCore::DocumentStorageAccess::hasStorageAccess):
3256         (WebCore::DocumentStorageAccess::requestStorageAccess):
3257         * page/ChromeClient.h:
3258         (WebCore::ChromeClient::hasStorageAccess):
3259         (WebCore::ChromeClient::requestStorageAccess):
3260
3261 2019-08-30  Zalan Bujtas  <zalan@apple.com>
3262
3263         [LFC] Transition from Geometry(formattingContext()) to formattingContext().quirks()
3264         https://bugs.webkit.org/show_bug.cgi?id=201372
3265         <rdar://problem/54905514>
3266
3267         Reviewed by Antti Koivisto.
3268
3269         * layout/FormattingContextGeometry.cpp:
3270         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
3271         * layout/FormattingContextQuirks.cpp:
3272         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3273         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3274         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3275         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3276         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
3277         * layout/blockformatting/BlockMarginCollapse.cpp:
3278         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
3279         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
3280         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
3281         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3282         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
3283         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3284         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
3285         * layout/inlineformatting/InlineLine.cpp:
3286         (WebCore::Layout::Line::close):
3287
3288 2019-08-30  Zalan Bujtas  <zalan@apple.com>
3289
3290         [LFC] Proxy LayoutState::displayBoxForLayoutBox() calls through FormattingContext
3291         https://bugs.webkit.org/show_bug.cgi?id=201365
3292         <rdar://problem/54900815>
3293
3294         Reviewed by Antti Koivisto.
3295
3296         This patch is in preparation for enforcing displayBoxForLayoutBox() calls to stay within the current formatting context.
3297         (There are a few odd cases left (floats and coordinate mapping) and they are going to be addressed in a separate patch.)
3298
3299         * layout/FormattingContext.cpp:
3300         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
3301         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
3302         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
3303         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3304         * layout/FormattingContext.h:
3305         (WebCore::Layout::FormattingContext::displayBoxForLayoutBox const):
3306         (WebCore::Layout::FormattingContext::hasDisplayBox const):
3307         * layout/FormattingContextGeometry.cpp:
3308         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
3309         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
3310         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
3311         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
3312         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
3313         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3314         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
3315         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
3316         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
3317         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
3318         * layout/FormattingContextQuirks.cpp:
3319         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3320         * layout/blockformatting/BlockFormattingContext.cpp:
3321         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
3322         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
3323         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
3324         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
3325         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
3326         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
3327         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
3328         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
3329         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
3330         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
3331         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
3332         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3333         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3334         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
3335         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
3336         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
3337         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3338         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3339         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
3340         * layout/blockformatting/BlockMarginCollapse.cpp:
3341         (WebCore::Layout::hasClearance):
3342         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
3343         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
3344         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
3345         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
3346         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
3347         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
3348         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
3349         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
3350         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
3351         * layout/inlineformatting/InlineFormattingContext.cpp:
3352         (WebCore::Layout::InlineFormattingContext::layout):
3353         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
3354         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
3355         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
3356         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
3357         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
3358         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
3359         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
3360         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
3361         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3362         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
3363         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3364         (WebCore::Layout::inlineItemWidth):
3365         (WebCore::Layout::LineLayout::formattingContext const):
3366         (WebCore::Layout::LineLayout::LineLayout):
3367         (WebCore::Layout::LineLayout::placeInlineItem):
3368         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
3369         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3370         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
3371         (WebCore::Layout::LineLayout::layoutState const): Deleted.
3372         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3373         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3374         * layout/inlineformatting/InlineLine.cpp:
3375         (WebCore::Layout::isInlineContainerConsideredEmpty):
3376         (WebCore::Layout::Line::isVisuallyEmpty const):
3377         (WebCore::Layout::Line::close):
3378         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3379         (WebCore::Layout::Line::inlineItemContentHeight const):
3380         * layout/tableformatting/TableFormattingContext.cpp:
3381         (WebCore::Layout::TableFormattingContext::layout):
3382         (WebCore::Layout::TableFormattingContext::computedTableWidth):
3383
3384 2019-08-30  Chris Dumez  <cdumez@apple.com>
3385
3386         WebPage::fromCorePage() to take and return a C++ reference
3387         https://bugs.webkit.org/show_bug.cgi?id=201367
3388
3389         Reviewed by Antti Koivisto.
3390
3391         * page/Chrome.cpp:
3392         (WebCore::Chrome::createWindow const):
3393
3394 2019-08-30  Chris Dumez  <cdumez@apple.com>
3395
3396         Add support for postMessage buffering between the service worker and window
3397         https://bugs.webkit.org/show_bug.cgi?id=201169
3398
3399         Reviewed by Youenn Fablet.
3400
3401         As per the Service Worker specification, a service worker client's message
3402         queue is initially disabled and only gets enabled after:
3403         - The DOMContentLoaded event has been fired
3404         or
3405         - The client sets the navigator.serviceWorker.onmessage event handler
3406         or
3407         - navigator.serviceWorker.startMessages() is called
3408
3409         While the message queue is disabled, messages posted by the service worker
3410         to the client simply get queued and only get processed once the queue gets
3411         enabled.
3412
3413         No new tests, rebaselined existing test.
3414
3415         * dom/Document.cpp:
3416         (WebCore::Document::finishedParsing):
3417         Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
3418         been fired.
3419
3420         * dom/ScriptExecutionContext.cpp:
3421         (WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
3422         * dom/ScriptExecutionContext.h:
3423         * workers/service/SWClientConnection.cpp:
3424         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3425         Fix a bug where a service worker would not be able to post a message to a client until
3426         that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
3427         lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
3428         when a message is received from the service worker. Previously, messages were just
3429         getting dropped.
3430
3431         * workers/service/ServiceWorkerContainer.cpp:
3432         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
3433         When the ServiceWorkerContainer is constructed, suspend its message queue if its context
3434         document is still parsing.
3435
3436         (WebCore::ServiceWorkerContainer::startMessages):
3437         Resume the message queue when startMessages() is called.
3438
3439         (WebCore::ServiceWorkerContainer::postMessage):
3440         Enqueue the event instead of firing it right away.
3441
3442         (WebCore::ServiceWorkerContainer::addEventListener):
3443         if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
3444         startMessages().
3445
3446         * workers/service/ServiceWorkerContainer.h:
3447
3448 2019-08-30  Simon Fraser  <simon.fraser@apple.com>
3449
3450         Minor optimization in determineNonLayerDescendantsPaintedContent()
3451         https://bugs.webkit.org/show_bug.cgi?id=201352
3452
3453         Reviewed by Antti Koivisto.
3454
3455         It's cheaper to call renderText.hasRenderedText() than renderText.linesBoundingBox(), because
3456         the latter has to traverse all the InlineTextBoxes. This code path is fairly hot when
3457         scrolling twitter feeds, since it's called from RenderLayer::updateLayerPositionsAfterScroll()
3458         which calls RenderLayer::isVisuallyNonEmpty().
3459
3460         * rendering/RenderLayer.cpp:
3461         (WebCore::RenderLayer::calculateClipRects const):
3462
3463 2019-08-30  Saam Barati  <sbarati@apple.com>
3464
3465         [WHLSL] Remove getters/setters/anders
3466         https://bugs.webkit.org/show_bug.cgi?id=201008
3467
3468         Reviewed by Robin Morisset.
3469
3470         This patch changes WHLSL in a significant way. This patch removes getters/setters/anders
3471         from the language. In our experience writing WHLSL shaders, these parts of the language
3472         went unused, and they added a lot of complexity to the implementation of the compiler.
3473         
3474         This patch now treats field accesses and array indexes as intrinsics inside the compiler.
3475         This patch removes all notions of named operators, anders, and indexed operators
3476         from the compiler and the standard library. The checker now intrinsically knows the
3477         return type for property accesses and indexed expressions based on what the
3478         base type is.
3479         
3480         To make this work in practice was difficult, since getters/setters/anders
3481         solved a lot of the difficult problems we had in generating metal code. For
3482         example, all swizzle operators were getters and setters, so assigning to a
3483         swizzle fell out naturally from implementing setters. However, during metal
3484         codegen, all we see is a dot expression with "xy" as a property. Our previous
3485         architecture of emitting Metal code using pointers which represent lvalues
3486         doesn't work because you can't take the address of a swizzle. For example,
3487         "auto* x = &vector.yz" is invalid metal code.
3488         
3489         So, this patch changes the entire metal code generator to emit WHLSL expressions
3490         as Metal expressions. To do this, I had to change a lot about how the compiler
3491         was implemented:
3492         - I changed the indexed accesses of matrices to return columns instead of
3493         rows. This allowed WHLSL code like `mat[0].xy = 42` to be compiled into
3494         the equivalent metal code of `mat[0].xy = 42`.
3495         - I changed the native function inliner to emit expressions instead of
3496         statements.
3497         - We also simplify the language by removing null and requiring all
3498         reference type variables to have an initializer. This means that
3499         null is no longer a valid value, which allows us to omit null checks
3500         inside the metal code generator. To make this work with array
3501         accesses, we now clamp accesses instead of returning null for OOB
3502         accesses.
3503         
3504         I've also filed one required bug as a followup. I didn't include it in this
3505         patch to make it easier to review along. Currently, there are two places in
3506         metal codegen where we evaluate effects twice. That will be fixed in:
3507         https://bugs.webkit.org/show_bug.cgi?id=201251
3508
3509         Tests: webgpu/whlsl/address-of-swizzle.html
3510                webgpu/whlsl/array-oob-alias.html
3511                webgpu/whlsl/matrix-index-assign.html
3512                webgpu/whlsl/matrix-index-order.html
3513                webgpu/whlsl/oob-access-2.html
3514                webgpu/whlsl/operator-syntax.html
3515
3516         * Modules/webgpu/WHLSL/AST/WHLSLAST.h:
3517         * Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
3518         * Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h:
3519         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
3520         (WebCore::WHLSL::AST::Expression::destroy):
3521         (WebCore::WHLSL::AST::Expression::destruct):
3522         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunctionName const): Deleted.
3523         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunctionName const): Deleted.
3524         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunctionName const): Deleted.
3525         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3526         (WebCore::WHLSL::AST::Expression::copyTypeTo const):
3527         (WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
3528         (WebCore::WHLSL::AST::Expression::isNullLiteral const): Deleted.
3529         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
3530         * Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
3531         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Removed.
3532         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Removed.
3533         * Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Removed.
3534         * Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
3535         (WebCore::WHLSL::AST::PropertyAccessExpression::getterFunction): Deleted.
3536         (WebCore::WHLSL::AST::PropertyAccessExpression::anderFunction): Deleted.
3537         (WebCore::WHLSL::AST::PropertyAccessExpression::threadAnderFunction): Deleted.
3538         (WebCore::WHLSL::AST::PropertyAccessExpression::setterFunction): Deleted.
3539         (WebCore::WHLSL::AST::PropertyAccessExpression::setGetterFunction): Deleted.
3540         (WebCore::WHLSL::AST::PropertyAccessExpression::setAnderFunction): Deleted.
3541         (WebCore::WHLSL::AST::PropertyAccessExpression::setThreadAnderFunction): Deleted.
3542         (WebCore::WHLSL::AST::PropertyAccessExpression::setSetterFunction): Deleted.
3543         (): Deleted.
3544         * Modules/webgpu/WHLSL/AST/WHLSLType.cpp:
3545         (WebCore::WHLSL::AST::Type::destroy):
3546         (WebCore::WHLSL::AST::Type::destruct):
3547         (WebCore::WHLSL::AST::ResolvableType::canResolve const):
3548         (WebCore::WHLSL::AST::ResolvableType::conversionCost const):
3549         * Modules/webgpu/WHLSL/AST/WHLSLType.h:
3550         (WebCore::WHLSL::AST::Type::isIntegerLiteralType const):
3551         (WebCore::WHLSL::AST::Type::isNullLiteralType const): Deleted.
3552         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3553         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::HoistedVariableCollector::HoistedVariableCollector):
3554         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3555         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitLoop):
3556         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::emitConstantExpressionString):
3557         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValueWithNullability): Deleted.
3558         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendRightValue): Deleted.
3559         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::appendLeftValue): Deleted.
3560         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValue): Deleted.
3561         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastValueAndNullability): Deleted.
3562         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::takeLastLeftValue): Deleted.
3563         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
3564         (WebCore::WHLSL::Metal::metalCodePrologue):
3565         (WebCore::WHLSL::Metal::generateMetalCode):
3566         (WebCore::WHLSL::Metal::metalCodeProlog): Deleted.
3567         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
3568         (WebCore::WHLSL::Metal::inlineNativeFunction):
3569         (WebCore::WHLSL::Metal::vectorInnerType): Deleted.
3570         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
3571         * Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
3572         (WebCore::WHLSL::Metal::writeNativeType):
3573         * Modules/webgpu/WHLSL/WHLSLASTDumper.cpp:
3574         (WebCore::WHLSL::ASTDumper::visit):
3575         * Modules/webgpu/WHLSL/WHLSLASTDumper.h:
3576         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
3577         (WebCore::WHLSL::checkDuplicateFunctions):
3578         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3579         (WebCore::WHLSL::resolveByInstantiation):
3580         (WebCore::WHLSL::checkOperatorOverload):
3581         (WebCore::WHLSL::Checker::wrappedUintType):
3582         (WebCore::WHLSL::Checker::normalizedTypeForFunctionKey):
3583         (WebCore::WHLSL::Checker::visit):
3584         (WebCore::WHLSL::matchAndCommit):
3585         (WebCore::WHLSL::Checker::resolveFunction):
3586         (WebCore::WHLSL::Checker::assignConcreteType):
3587         (WebCore::WHLSL::resolveWithOperatorLength): Deleted.
3588         (WebCore::WHLSL::Checker::genericPointerType): Deleted.
3589         (WebCore::WHLSL::Checker::finishVisiting): Deleted.
3590         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
3591         (WebCore::WHLSL::findHighZombies):
3592         (): Deleted.
3593         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
3594         (WebCore::WHLSL::matchAndCommit):
3595         (WebCore::WHLSL::commit):
3596         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
3597         (WebCore::WHLSL::Intrinsics::boolVectorTypeForSize const):
3598         (WebCore::WHLSL::Intrinsics::uintVectorTypeForSize const):
3599         (WebCore::WHLSL::Intrinsics::intVectorTypeForSize const):
3600         (WebCore::WHLSL::Intrinsics::floatVectorTypeForSize const):
3601         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
3602         (WebCore::WHLSL::Lexer::consumeTokenFromStream):
3603         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
3604         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
3605         (WebCore::WHLSL::Parser::parseConstantExpression):
3606         (WebCore::WHLSL::Parser::parseEnumerationMember):
3607         (WebCore::WHLSL::Parser::parseTerm):
3608         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
3609         (WebCore::WHLSL::prepareShared):
3610         * Modules/webgpu/WHLSL/WHLSLProgram.cpp: Added.
3611         (WebCore::WHLSL::Program::isValidVectorProperty):
3612         * Modules/webgpu/WHLSL/WHLSLProgram.h:
3613         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3614         (WebCore::WHLSL::resolveProperties):
3615         (WebCore::WHLSL::PropertyResolver::visit): Deleted.
3616         (WebCore::WHLSL::wrapAnderCallArgument): Deleted.
3617         (WebCore::WHLSL::anderCallArgument): Deleted.
3618         (WebCore::WHLSL::setterCall): Deleted.
3619         (WebCore::WHLSL::getterCall): Deleted.
3620         (WebCore::WHLSL::modify): Deleted.
3621         (WebCore::WHLSL::PropertyResolver::simplifyRightValue): Deleted.
3622         (WebCore::WHLSL::LeftValueSimplifier::finishVisiting): Deleted.
3623         (WebCore::WHLSL::LeftValueSimplifier::visit): Deleted.
3624         (WebCore::WHLSL::PropertyResolver::simplifyLeftValue): Deleted.
3625         * Modules/webgpu/WHLSL/WHLSLPruneUnreachableStandardLibraryFunctions.cpp:
3626         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
3627         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
3628         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Removed.
3629         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Removed.
3630         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
3631         (WebCore::WHLSL::synthesizeEnumerationFunctions):
3632         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
3633         (WebCore::WHLSL::Visitor::visit):
3634         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
3635         * Sources.txt:
3636         * WebCore.xcodeproj/project.pbxproj:
3637
3638 2019-08-30  Zalan Bujtas  <zalan@apple.com>
3639
3640         [LFC] Pass FormattingContext to Geometry/Quirks/BlockMarginCollapsing classes
3641         https://bugs.webkit.org/show_bug.cgi?id=201355
3642         <rdar://problem/54895959>
3643
3644         Reviewed by Antti Koivisto.
3645
3646         This is in preparation for enforcing LFC to not call outside of the formatting context.
3647         LayoutState::displayBoxForLayoutBox calls will be forced to go through the FormattingContext class to
3648         check LFC escaping.
3649
3650
3651         * layout/FormattingContext.h:
3652         (WebCore::Layout::FormattingContext::isBlockFormattingContext const):
3653         (WebCore::Layout::FormattingContext::isInlineFormattingContext const):
3654         (WebCore::Layout::FormattingContext::isTableFormattingContext const):
3655         (WebCore::Layout::FormattingContext::Geometry::layoutState const):
3656         (WebCore::Layout::FormattingContext::Geometry::layoutState):
3657         (WebCore::Layout::FormattingContext::Geometry::formattingContext const):
3658         (WebCore::Layout::FormattingContext::geometry const):
3659         (WebCore::Layout::FormattingContext::Quirks::layoutState const):
3660         (WebCore::Layout::FormattingContext::Quirks::layoutState):
3661         (WebCore::Layout::FormattingContext::Quirks::formattingContext const):
3662         (WebCore::Layout::FormattingContext::quirks const):
3663         (WebCore::Layout::FormattingContext::Geometry::Geometry):
3664         (WebCore::Layout::FormattingContext::Quirks::Quirks):
3665         * layout/FormattingContextGeometry.cpp:
3666         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
3667         * layout/FormattingContextQuirks.cpp:
3668         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3669         * layout/blockformatting/BlockFormattingContext.h:
3670         (WebCore::Layout::BlockFormattingContext::Geometry::formattingContext const):
3671         (WebCore::Layout::BlockFormattingContext::geometry const):
3672         (WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState):
3673         (WebCore::Layout::BlockFormattingContext::MarginCollapse::layoutState const):
3674         (WebCore::Layout::BlockFormattingContext::MarginCollapse::formattingContext const):
3675         (WebCore::Layout::BlockFormattingContext::marginCollapse const):
3676         (WebCore::Layout::BlockFormattingContext::Quirks::formattingContext const):
3677         (WebCore::Layout::BlockFormattingContext::quirks const):
3678         (WebCore::Layout::BlockFormattingContext::Geometry::Geometry):
3679         (WebCore::Layout::BlockFormattingContext::Quirks::Quirks):
3680         (WebCore::Layout::BlockFormattingContext::MarginCollapse::MarginCollapse):
3681         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3682         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3683         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3684         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3685         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
3686         * layout/blockformatting/BlockMarginCollapse.cpp:
3687         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
3688         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
3689         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
3690         * layout/inlineformatting/InlineFormattingContext.h:
3691         (WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const):
3692         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const):
3693         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const):
3694         (WebCore::Layout::InlineFormattingContext::Quirks::formattingContext const):
3695         (WebCore::Layout::InlineFormattingContext::quirks const):
3696         (WebCore::Layout::InlineFormattingContext::Geometry::formattingContext const):
3697         (WebCore::Layout::InlineFormattingContext::geometry const):
3698         (WebCore::Layout::InlineFormattingContext::Geometry::Geometry):
3699         (WebCore::Layout::InlineFormattingContext::Quirks::Quirks):
3700         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3701         (WebCore::Layout::LineLayout::LineLayout):
3702         (WebCore::Layout::InlineFormattingContext::InlineLayout::InlineLayout):
3703         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
3704         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3705         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
3706         * layout/inlineformatting/InlineLine.cpp:
3707         (WebCore::Layout::Line::Line):
3708         (WebCore::Layout::Line::isVisuallyEmpty const):
3709         (WebCore::Layout::Line::close):
3710         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3711         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
3712         (WebCore::Layout::Line::inlineItemContentHeight const):
3713         (WebCore::Layout::Line::layoutState const):
3714         (WebCore::Layout::Line::formattingContext const):
3715         * layout/inlineformatting/InlineLine.h:
3716         * layout/tableformatting/TableFormattingContext.h:
3717         (WebCore::Layout::TableFormattingContext::Geometry::formattingContext const):
3718         (WebCore::Layout::TableFormattingContext::geometry const):
3719         (WebCore::Layout::TableFormattingContext::Geometry::Geometry):
3720         * page/FrameViewLayoutContext.cpp:
3721         (WebCore::layoutUsingFormattingContext):
3722
3723 2019-08-30  Ryan Haddad  <ryanhaddad@apple.com>
3724
3725         Unreviewed, rolling out r249338.
3726
3727         Caused 500+ layout test failures on WK1
3728
3729         Reverted changeset:
3730
3731         "Add support for postMessage buffering between the service
3732         worker and window"
3733         https://bugs.webkit.org/show_bug.cgi?id=201169
3734         https://trac.webkit.org/changeset/249338
3735
3736 2019-08-30  Alex Christensen  <achristensen@webkit.org>
3737
3738         Remove HAVE_CFNETWORK_WITH_IGNORE_HSTS conditional
3739         https://bugs.webkit.org/show_bug.cgi?id=201279
3740
3741         Reviewed by Darin Adler.
3742
3743         * platform/network/mac/WebCoreURLResponse.mm:
3744         (WebCore::synthesizeRedirectResponseIfNecessary):
3745         (WebCore::schemeWasUpgradedDueToDynamicHSTS): Deleted.
3746
3747 2019-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
3748
3749         Caret does not appear in text field inside a transformed, overflow: hidden container
3750         https://bugs.webkit.org/show_bug.cgi?id=201317
3751         <rdar://problem/54859264>
3752
3753         Reviewed by Simon Fraser.
3754
3755         This patch refactors the heuristic for determining whether to suppress selection gestures and UI in a way that
3756         fixes the corner case encountered in this bug. To understand why this test case fails with our existing
3757         heuristic, consider the below test case.
3758
3759         Let's say we have an input field inside an "overflow: hidden;" container, which is positioned in such a way that
3760         it is completely clipped by its enclosing container which is also "overflow: hidden". Our existing logic would
3761         appropriately identify this as a hidden editable element.
3762
3763         However, let's now apply a transform to the input field's closest "overflow: hidden" ancestor, such that the
3764         field is now visible. Since RenderLayer::offsetFromAncestor doesn't take transforms into account when we try to
3765         find the offset of the "overflow: hidden" layer relative to the root view, we end up passing an offsetFromRoot
3766         of (0, 100vw) to RenderLayer::calculateClipRects, which computes a background clip rect of (0, 0, 100vw, 100vh).
3767
3768         This means that at the end of RenderLayer::calculateClipRects, we end up intersecting the background clip rect
3769         (0, 0, 100vw, 100vh) against (100vw, 0, 100vw, 100vh), which results in the empty rect, and subsequently makes
3770         us believe we're editing a hidden editable element.
3771
3772         Instead of tacking on more logic to isTransparentOrFullyClippedRespectingParentFrames, we can fix this by using
3773         RenderObject::computeVisibleRectInContainer instead, performing a similar walk up the render tree to compute the
3774         visible rect of each focused element or subframe relative to its root. This is capable of taking transforms into
3775         account. See comments below for more details.
3776
3777         Test: editing/selection/ios/show-selection-in-transformed-container-2.html
3778
3779         * rendering/RenderLayer.cpp:
3780         (WebCore::RenderLayer::isTransparentRespectingParentFrames const):
3781
3782         Split out isTransparentOrFullyClippedRespectingParentFrames into two methods: RenderLayer's
3783         isTransparentRespectingParentFrames, and RenderObject's hasNonEmptyVisibleRectRespectingParentFrames. The
3784         transparency check starts at the enclosing layer and walks up the layer tree, while the non-empty visible rect
3785         check looks for renderers that are completely empty relative to their root views.
3786
3787         * rendering/RenderLayer.h:
3788         * rendering/RenderObject.cpp:
3789         (WebCore::RenderObject::hasNonEmptyVisibleRectRespectingParentFrames const):
3790
3791         Rewrite logic for detecting completely clipped editable areas (that formerly lived in
3792         isTransparentOrFullyClippedRespectingParentFrames) to use computeVisibleRectInContainer instead.
3793
3794         * rendering/RenderObject.h:
3795
3796 2019-08-30  Chris Dumez  <cdumez@apple.com>
3797
3798         Add support for postMessage buffering between the service worker and window
3799         https://bugs.webkit.org/show_bug.cgi?id=201169
3800
3801         Reviewed by Youenn Fablet.
3802
3803         As per the Service Worker specification, a service worker client's message
3804         queue is initially disabled and only gets enabled after:
3805         - The DOMContentLoaded event has been fired
3806         or
3807         - The client sets the navigator.serviceWorker.onmessage event handler
3808         or
3809         - navigator.serviceWorker.startMessages() is called
3810
3811         While the message queue is disabled, messages posted by the service worker
3812         to the client simply get queued and only get processed once the queue gets
3813         enabled.
3814
3815         No new tests, rebaselined existing test.
3816
3817         * dom/Document.cpp:
3818         (WebCore::Document::finishedParsing):
3819         Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
3820         been fired.
3821
3822         * dom/ScriptExecutionContext.cpp:
3823         (WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
3824         * dom/ScriptExecutionContext.h:
3825         * workers/service/SWClientConnection.cpp:
3826         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3827         Fix a bug where a service worker would not be able to post a message to a client until
3828         that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
3829         lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
3830         when a message is received from the service worker. Previously, messages were just
3831         getting dropped.
3832
3833         * workers/service/ServiceWorkerContainer.cpp:
3834         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
3835         When the ServiceWorkerContainer is constructed, suspend its message queue if its context
3836         document is still parsing.
3837
3838         (WebCore::ServiceWorkerContainer::startMessages):
3839         Resume the message queue when startMessages() is called.
3840
3841         (WebCore::ServiceWorkerContainer::postMessage):
3842         Enqueue the event instead of firing it right away.
3843
3844         (WebCore::ServiceWorkerContainer::addEventListener):
3845         if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
3846         startMessages().
3847
3848         * workers/service/ServiceWorkerContainer.h:
3849
3850 2019-08-30  Simon Fraser  <simon.fraser@apple.com>
3851
3852         Add system tracing points for compositing updates, and touch-event dispatching
3853         https://bugs.webkit.org/show_bug.cgi?id=201327
3854
3855         Reviewed by Alex Christensen.
3856
3857         TraceScope in RenderLayerCompositor::updateCompositingLayers().
3858
3859         * rendering/RenderLayerCompositor.cpp:
3860         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3861
3862 2019-08-30  Brent Fulgham  <bfulgham@apple.com>
3863
3864         [FTW] Use DirectX SharedResource as basis for SharedBitmap
3865         https://bugs.webkit.org/show_bug.cgi?id=201157
3866
3867         Reviewed by Alex Christensen.
3868
3869         Currently an ID2D1Bitmap is used as the backing store for the SharedBitmap that is the
3870         base type for sharing data between the WebContent Process and the UIProcess. However, this
3871         involves moving GPU memory to local memory, copying that memory into the SharedMemory member
3872         of the SharedBitmap, then building a new GPU bitmap on the UIProcess side from that SharedMemory.
3873
3874         Profiling indicates that this is the single largest place FTW WebKit spends its time.
3875
3876         Instead, we should use Direct2D's ability to render to an IDXGISurface, which can be shared
3877         between multiple processes. This should avoid the GPU->CPU copy, the Direct2D-allocated
3878         CPU->Shared Memory copy, and the shared memory to GPU copy.
3879  
3880         * platform/graphics/win/BackingStoreBackendDirect2D.h:
3881         (WebCore::BackingStoreBackendDirect2D::renderTarget const): Change type.
3882         (WebCore::BackingStoreBackendDirect2D::dxSurface const): Added.
3883         (WebCore::BackingStoreBackendDirect2D::BackingStoreBackendDirect2D): Require a DXD11 device.
3884         * platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
3885         (WebCore::BackingStoreBackendDirect2DImpl::BackingStoreBackendDirect2DImpl): Use Direct2D's
3886         IDXGISurface to make a render target we can use to support our fast cross-process sharing.
3887         (WebCore::BackingStoreBackendDirect2DImpl::scroll):
3888         * platform/graphics/win/BackingStoreBackendDirect2DImpl.h:
3889         * platform/graphics/win/Direct2DOperations.cpp:
3890         (WebCore::Direct2D::fillRect): Remove unneeded PlatformContextStateSaver.
3891         (WebCore::Direct2D::fillRoundedRect): Ditto.
3892         (WebCore::Direct2D::fillRectWithGradient): Ditto.
3893         (WebCore::Direct2D::fillPath): Ditto.
3894         (WebCore::Direct2D::strokePath): Ditto.
3895         * platform/graphics/win/Direct2DUtilities.cpp:
3896         (WebCore::Direct2D::pixelFormat): Switch to constants for bitmap format.
3897         (WebCore::Direct2D::createDXGISurfaceOfSize): Added.
3898         (WebCore::Direct2D::createSurfaceRenderTarget): Added.
3899         (WebCore::Direct2D::writeDiagnosticPNGToPath):
3900         (WebCore::Direct2D::dxgiImmediateContext): Added.
3901         (WebCore::Direct2D::defaultDirectXDevice): Added.
3902         (WebCore::Direct2D::createDeviceAndContext): Added.
3903         (WebCore::Direct2D::toDXGIDevice): Added.
3904         (WebCore::Direct2D::factoryForDXGIDevice): Added.
3905         * platform/graphics/win/Direct2DUtilities.h:
3906
3907 2019-08-30  Sihui Liu  <sihui_liu@apple.com>
3908
3909         IndexedDB: update size of database when database operation is completed
3910         https://bugs.webkit.org/show_bug.cgi?id=201057
3911
3912         Reviewed by Youenn Fablet.
3913
3914         Currently when a database operation was completed, we re-computed the disk usage of the origin. This computation 
3915         listed all databases in the origin directory and read the size of each database file, which was very inefficient 
3916         because the completed operation should only affect one database.
3917
3918         This patch makes UniqueIDBDatabase keep track of database size and reports size change to QuotaUser.
3919
3920         Tested PerformanceTests/IndexedDB/basic/objectstore-add.html on release build minibrowser. This change makes
3921         the test over 50% faster.
3922
3923         * Modules/indexeddb/server/IDBBackingStore.h:
3924         * Modules/indexeddb/server/IDBServer.cpp:
3925         (WebCore::IDBServer::IDBServer::QuotaUser::increaseSpaceUsed):
3926         (WebCore::IDBServer::IDBServer::QuotaUser::decreaseSpaceUsed):
3927         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
3928         (WebCore::IDBServer::IDBServer::increaseSpaceUsed):
3929         (WebCore::IDBServer::IDBServer::decreaseSpaceUsed):
3930         (WebCore::IDBServer::IDBServer::setSpaceUsed): Deleted.
3931         * Modules/indexeddb/server/IDBServer.h:
3932         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3933         (WebCore::IDBServer::MemoryIDBBackingStore::databaseSize const):
3934         (WebCore::IDBServer::MemoryIDBBackingStore::close):
3935         (WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const): Deleted.
3936         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3937         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3938         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForDirectory):
3939         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseSize const):
3940         (WebCore::IDBServer::SQLiteIDBBackingStore::close):
3941         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder): Deleted.
3942         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const): Deleted.
3943         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3944         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3945         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
3946         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
3947         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
3948         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3949         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
3950         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
3951         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
3952         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
3953         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3954
3955 2019-08-30  Alicia Boya García  <aboya@igalia.com>
3956
3957         [MSE][GStreamer] Replaying the video should update currentTime
3958         https://bugs.webkit.org/show_bug.cgi?id=201307
3959
3960         Reviewed by Xabier Rodriguez-Calvar.
3961
3962         While writing a test to confirm that https://bugs.webkit.org/show_bug.cgi?id=190050
3963         has indeed been fixed I noticed a non-conformity: when the video has
3964         ended, right after calling .play() for a second playback currentTime
3965         did not return zero, but the video duration.
3966
3967         This turned to be due to the m_isEndReached flag not being reseted on
3968         seeks (replaying a video incurs in a seek done from multi-platform
3969         code).
3970
3971         Test: imported/w3c/web-platform-tests/media-source/mediasource-replay.html
3972
3973         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3974         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
3975
3976 2019-08-30  Zalan Bujtas  <zalan@apple.com>
3977
3978         [LFC] Make Geometry/Quirk/MarginCollapse subclasses stateful.
3979         https://bugs.webkit.org/show_bug.cgi?id=201343
3980         <rdar://problem/54883787>
3981
3982         Reviewed by Antti Koivisto.
3983
3984         This is in preparation for enforcing LFC to not call outside of the formatting context.
3985
3986         * layout/FormattingContext.cpp:
3987         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
3988         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
3989         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
3990         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
3991         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): Deleted.
3992         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): Deleted.
3993         (WebCore::Layout::FormattingContext::computeBorderAndPadding const): Deleted.
3994         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent const): Deleted.
3995         * layout/FormattingContext.h:
3996         (WebCore::Layout::FormattingContext::Geometry::layoutState const):
3997         (WebCore::Layout::FormattingContext::Geometry::layoutState):
3998         (WebCore::Layout::FormattingContext::geometry const):
3999         (WebCore::Layout::FormattingContext::Quirks::layoutState const):
4000         (WebCore::Layout::FormattingContext::Quirks::layoutState):
4001         (WebCore::Layout::FormattingContext::quirks const):
4002         (WebCore::Layout::FormattingContext::Geometry::Geometry):
4003         (WebCore::Layout::FormattingContext::Quirks::Quirks):
4004         * layout/FormattingContextGeometry.cpp:
4005         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
4006         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
4007         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto const):
4008         (WebCore::Layout::FormattingContext::Geometry::fixedValue const):
4009         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
4010         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
4011         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
4012         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
4013         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
4014         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
4015         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
4016         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
4017         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
4018         (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
4019         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
4020         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
4021         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
4022         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
4023         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
4024         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
4025         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
4026         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
4027         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
4028         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
4029         (WebCore::Layout::FormattingContext::Geometry::computedBorder const):
4030         (WebCore::Layout::FormattingContext::Geometry::computedPadding const):
4031         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
4032         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
4033         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth const):
4034         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): Deleted.
4035         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot): Deleted.
4036         (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto): Deleted.
4037         (WebCore::Layout::FormattingContext::Geometry::fixedValue): Deleted.
4038         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight): Deleted.
4039         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight): Deleted.
4040         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned): Deleted.
4041         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned): Deleted.
4042         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
4043         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
4044         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
4045         (WebCore