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