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