Change Response's statusText's default
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-07  Rob Buis  <rbuis@igalia.com>
2
3         Change Response's statusText's default
4         https://bugs.webkit.org/show_bug.cgi?id=191879
5
6         Reviewed by Youenn Fablet.
7
8         Change Response's statusText's default to "".
9
10         Tests: web-platform-tests/fetch/api/response/response-clone.html
11                web-platform-tests/fetch/api/response/response-init-001.html
12
13         * Modules/fetch/FetchResponse.h:
14         * Modules/fetch/FetchResponse.idl:
15
16 2019-10-07  Chris Dumez  <cdumez@apple.com>
17
18         DOMCache should not prevent pages from entering the back/forward cache
19         https://bugs.webkit.org/show_bug.cgi?id=202590
20
21         Reviewed by Youenn Fablet.
22
23         Allow DOMCache to suspend in the back/forward cache unconditionally, by
24         appending all promise resolutions to a SuspendableTaskQueue. This guarantees
25         that any asynchronous promise resolution is delayed while in the page cache,
26         until the page gets resumed.
27
28         Test: http/tests/navigation/page-cache-domcache-pending-promise.html
29
30         * Modules/cache/DOMCache.cpp:
31         (WebCore::DOMCache::DOMCache):
32         (WebCore::DOMCache::match):
33         (WebCore::DOMCache::matchAll):
34         (WebCore::DOMCache::addAll):
35         (WebCore::DOMCache::putWithResponseData):
36         (WebCore::DOMCache::put):
37         (WebCore::DOMCache::remove):
38         (WebCore::DOMCache::keys):
39         (WebCore::DOMCache::canSuspendForDocumentSuspension const):
40         * Modules/cache/DOMCache.h:
41
42 2019-10-07  Chris Dumez  <cdumez@apple.com>
43
44         PendingImageBitmap should not prevent entering the back/forward cache
45         https://bugs.webkit.org/show_bug.cgi?id=202585
46
47         Reviewed by Tim Horton.
48
49         Add PageCache support to PendingImageBitmap by doing the promise resolution on a
50         SuspendableTimer (which properly gets paused while in PageCache).
51
52         Test: fast/history/page-cache-createImageBitmap.html
53
54         * html/ImageBitmap.cpp:
55
56 2019-10-07  Dirk Schulze  <krit@webkit.org>
57
58         clip-path: <geometry-box> mapping incorrect
59         https://bugs.webkit.org/show_bug.cgi?id=202075
60
61         Reviewed by Simon Fraser.
62
63         For HTML elements:
64         - stroke-box, view-box consistently compute to border-box
65         - fill-box computes to content-box
66
67         Tests: css3/masking/clip-path-border-radius-fill-box-001.html
68                css3/masking/clip-path-border-radius-stroke-box-000.html
69                css3/masking/clip-path-border-radius-view-box-000.html
70
71         * rendering/RenderBlock.cpp:
72         (WebCore::RenderBlock::nodeAtPoint):
73         * rendering/shapes/BoxShape.cpp:
74         (WebCore::computeRoundedRectForBoxShape):
75
76 2019-10-07  Tim Horton  <timothy_horton@apple.com>
77
78         Fix the Windows build
79
80         * html/ImageBitmap.h:
81
82 2019-10-07  Zalan Bujtas  <zalan@apple.com>
83
84         [LFC] Add const version of LayoutState::displayBoxForLayoutBox
85         https://bugs.webkit.org/show_bug.cgi?id=202623
86         <rdar://problem/56025259>
87
88         Reviewed by Antti Koivisto.
89
90         * layout/LayoutState.cpp:
91         (WebCore::Layout::LayoutState::displayBoxForLayoutBox):
92         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
93         * layout/LayoutState.h:
94         * layout/layouttree/LayoutTreeBuilder.cpp:
95         (WebCore::Layout::outputLayoutTree):
96
97 2019-10-07  youenn fablet  <youenn@apple.com>
98
99         [iOS] Unmuting capture of a page is not working
100         https://bugs.webkit.org/show_bug.cgi?id=202627
101
102         Reviewed by Eric Carlson.
103
104         Before the patch, we were muting the capture tracks but never unmuting them.
105         The patch updates the code to make sure we unmute capture tracks based on the document state.
106         In addition, the iOS code wass process-wide while capture might happen between two documents in the same process.
107         The patch updates the capturestate computation and muting logic to be Document based.
108         A follow-up refactoring will merge back iOS and MacOS code paths.
109         Covered by API test.
110
111         * Modules/mediastream/MediaStreamTrack.cpp:
112         (WebCore::MediaStreamTrack::captureState):
113         (WebCore::MediaStreamTrack::updateCaptureAccordingMutedState):
114         (WebCore::MediaStreamTrack::muteCapture): Deleted.
115         * Modules/mediastream/MediaStreamTrack.h:
116         * dom/Document.cpp:
117         (WebCore::Document::updateIsPlayingMedia):
118         (WebCore::Document::pageMutedStateDidChange):
119
120 2019-10-06  Ryosuke Niwa  <rniwa@webkit.org>
121
122         attachShadow should support attaching a shadow root to a main element
123         https://bugs.webkit.org/show_bug.cgi?id=197726
124
125         Reviewed by Antti Koivisto.
126
127         Added main element to the list of elements that support an author shadow root.
128
129         Test: fast/shadow-dom/attach-shadow-to-elements.html
130
131         * dom/Element.cpp:
132         (WebCore::canAttachAuthorShadowRoot):
133
134 2019-10-06  Zalan Bujtas  <zalan@apple.com>
135
136         [LFC][Painting] Introduce Display::Painter
137         https://bugs.webkit.org/show_bug.cgi?id=202614
138         <rdar://problem/56010347>
139
140         Reviewed by Antti Koivisto.
141
142         Display::Painter is responsible for rendering the nodes in the display tree. Testing purposes/WK1 only at this point.
143
144         * Sources.txt:
145         * WebCore.xcodeproj/project.pbxproj:
146         * layout/LayoutContext.cpp:
147         (WebCore::Layout::initializeLayoutState):
148         (WebCore::Layout::LayoutContext::runLayout):
149         (WebCore::Layout::LayoutContext::runLayoutAndVerify):
150         (WebCore::Layout::LayoutContext::runLayoutAndPaint):
151         (WebCore::Layout::LayoutContext::run): Deleted.
152         * layout/LayoutContext.h:
153         * layout/LayoutState.cpp:
154         (WebCore::Layout::LayoutState::LayoutState):
155         * layout/LayoutState.h:
156         (WebCore::Layout::LayoutState::root const):
157         * layout/Verification.cpp:
158         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
159         * layout/displaytree/DisplayPainter.cpp: Added.
160         (WebCore::Display::Painter::paint):
161         * layout/displaytree/DisplayPainter.h: Added.
162         * layout/layouttree/LayoutTreeBuilder.cpp:
163         (WebCore::Layout::printLayoutTreeForLiveDocuments):
164         * page/FrameView.cpp:
165         (WebCore::FrameView::paintContents):
166         * page/FrameViewLayoutContext.cpp:
167         (WebCore::layoutUsingFormattingContext):
168
169 2019-10-06  Antti Koivisto  <antti@apple.com>
170
171         Node::ref/deref should be const
172         https://bugs.webkit.org/show_bug.cgi?id=202562
173
174         Reviewed by Ryosuke Niwa.
175
176         This enables RefPtr<const Element> and matches RefCounted.
177
178         * css/ElementRuleCollector.cpp:
179         (WebCore::ElementRuleCollector::collectMatchingRules):
180         (WebCore::ElementRuleCollector::matchAuthorRules):
181         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
182         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
183         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
184         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
185         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
186         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
187         (WebCore::ElementRuleCollector::matchUARules):
188         (WebCore::ElementRuleCollector::ruleMatches):
189         (WebCore::ElementRuleCollector::matchAllRules):
190
191         Use it to ref elements in ElementRuleCollector.
192
193         * css/ElementRuleCollector.h:
194         (WebCore::ElementRuleCollector::element const):
195         * dom/Node.h:
196         (WebCore::Node::ref const):
197         (WebCore::Node::deref const):
198         (WebCore::Node::ref): Deleted.
199         (WebCore::Node::deref): Deleted.
200
201 2019-10-05  Zalan Bujtas  <zalan@apple.com>
202
203         [LFC] LayoutChildtIteratorAdapter -> LayoutChildIteratorAdapter
204         https://bugs.webkit.org/show_bug.cgi?id=202612
205         <rdar://problem/56007611>
206
207         Reviewed by Anders Carlsson.
208
209         * layout/layouttree/LayoutChildIterator.h:
210         (WebCore::Layout::LayoutChildIterator<T>::LayoutChildIterator):
211         (WebCore::Layout::LayoutChildIterator<T>::operator):
212         (WebCore::Layout::LayoutChildIteratorAdapter<T>::LayoutChildIteratorAdapter):
213         (WebCore::Layout::LayoutChildIteratorAdapter<T>::begin const):
214         (WebCore::Layout::LayoutChildIteratorAdapter<T>::end const):
215         (WebCore::Layout::LayoutChildIteratorAdapter<T>::first const):
216         (WebCore::Layout::LayoutChildIteratorAdapter<T>::last const):
217         (WebCore::Layout::childrenOfType):
218         (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator): Deleted.
219         (WebCore::Layout::LayoutChildtIterator<T>::operator): Deleted.
220         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter): Deleted.
221         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const): Deleted.
222         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const): Deleted.
223         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const): Deleted.
224         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const): Deleted.
225
226 2019-10-05  Zalan Bujtas  <zalan@apple.com>
227
228         [LFC] Remove redundant includes.
229         https://bugs.webkit.org/show_bug.cgi?id=202610
230         <rdar://problem/56003250>
231
232         Reviewed by Tim Horton.
233
234         * layout/FormattingContext.h:
235         * layout/FormattingContextGeometry.cpp:
236         * layout/FormattingContextQuirks.cpp:
237         * layout/FormattingState.h:
238         * layout/LayoutContext.h:
239         * layout/LayoutState.h:
240         * layout/LayoutUnits.h:
241         * layout/blockformatting/BlockFormattingContext.cpp:
242         * layout/blockformatting/BlockFormattingContext.h:
243         * layout/blockformatting/BlockFormattingState.cpp:
244         * layout/blockformatting/BlockFormattingState.h:
245         * layout/blockformatting/BlockInvalidation.h:
246         * layout/displaytree/DisplayRect.h:
247         * layout/displaytree/DisplayRun.h:
248         * layout/floats/FloatAvoider.cpp:
249         * layout/floats/FloatAvoider.h:
250         * layout/floats/FloatBox.h:
251         * layout/floats/FloatingContext.cpp:
252         * layout/floats/FloatingContext.h:
253         * layout/floats/FloatingState.h:
254         * layout/inlineformatting/InlineFormattingContext.cpp:
255         * layout/inlineformatting/InlineFormattingContext.h:
256         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
257         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
258         * layout/inlineformatting/InlineInvalidation.h:
259         * layout/inlineformatting/InlineLine.h:
260         * layout/inlineformatting/InlineLineBreaker.cpp:
261         * layout/inlineformatting/InlineLineLayout.cpp:
262         * layout/layouttree/LayoutBox.h:
263         * layout/tableformatting/TableFormattingContext.h:
264         * layout/tableformatting/TableFormattingContextGeometry.cpp:
265         * layout/tableformatting/TableGrid.h:
266         * layout/tableformatting/TableInvalidation.h:
267
268 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
269
270         Change "InvalidStateError" to "NotSupportedError" for attachShadow()
271         https://bugs.webkit.org/show_bug.cgi?id=197948
272
273         Reviewed by Wenson Hsieh.
274
275         Match the latest spec. See https://github.com/whatwg/dom/pull/761
276
277         * dom/Element.cpp:
278         (WebCore::Element::attachShadow): Throw NotSupportedError when there is already a shadow tree.
279
280 2019-10-04  Chris Dumez  <cdumez@apple.com>
281
282         Allow pages using EventSource to enter the back/forward cache
283         https://bugs.webkit.org/show_bug.cgi?id=202370
284         <rdar://problem/55853142>
285
286         Reviewed by Geoffrey Garen.
287
288         Allow pages using EventSource to enter the back/forward cache. If the EventSource is
289         connecting at the time it enters PageCache, it will resume connecting after restoring
290         from PageCache (by making m_connectTimer a SuspendableTimer, which is PageCache-aware).
291         If the EventSource is was open upon navigating, it gets closed upon navigating (since
292         all pending loads get cancelled on navigation). To help the page recover, we fire an
293         error event and attempt to reconnect automatically when restoring the page from page
294         cache. It is allowed by the specification to attempt reconnection in case of non-fatal
295         network errors.
296
297         Tests: http/tests/eventsource/eventsource-page-cache-connected.html
298                http/tests/eventsource/eventsource-page-cache-connecting.html
299
300         * page/EventSource.cpp:
301         (WebCore::EventSource::EventSource):
302         (WebCore::EventSource::scheduleReconnect):
303         (WebCore::EventSource::close):
304         (WebCore::EventSource::didReceiveResponse):
305         (WebCore::EventSource::dispatchErrorEvent):
306         (WebCore::EventSource::didReceiveData):
307         (WebCore::EventSource::didFinishLoading):
308         (WebCore::EventSource::didFail):
309         (WebCore::EventSource::abortConnectionAttempt):
310         (WebCore::EventSource::doExplicitLoadCancellation):
311         (WebCore::EventSource::canSuspendForDocumentSuspension const):
312         (WebCore::EventSource::suspend):
313         (WebCore::EventSource::resume):
314         (WebCore::EventSource::dispatchMessageEvent):
315         * page/EventSource.h:
316
317 2019-10-04  Chris Dumez  <cdumez@apple.com>
318
319         ServiceWorkerContainer should never prevent a page from entering the back/forward cache
320         https://bugs.webkit.org/show_bug.cgi?id=202603
321
322         Reviewed by Geoff Garen.
323
324         Make it so that ServiceWorkerContainer can suspend, even if they have pending promises.
325         We now queue all promise resolutions to a SuspendableTaskQueue to make sure that those
326         promises do not get resolved while in the page cache.
327
328         Test: http/tests/workers/service/page-cache-service-worker-pending-promise.https.html
329
330         * workers/service/ServiceWorkerContainer.cpp:
331         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
332         (WebCore::ServiceWorkerContainer::ready):
333         (WebCore::ServiceWorkerContainer::getRegistration):
334         (WebCore::ServiceWorkerContainer::getRegistrations):
335         (WebCore::ServiceWorkerContainer::jobFailedWithException):
336         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
337         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
338         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
339         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const):
340         * workers/service/ServiceWorkerContainer.h:
341
342 2019-10-04  Chris Dumez  <cdumez@apple.com>
343
344         Allow pages using IDBIndex to enter the PageCache
345         https://bugs.webkit.org/show_bug.cgi?id=202430
346         <rdar://problem/55887918>
347
348         Reviewed by Geoffrey Garen.
349
350         There is no reason to prevent PageCaching when an IDBIndex object is alive.
351         No events are fired by IDBIndex and its API returns IDBRequest objects, which
352         are already PageCache-aware.
353
354         I have seen Yahoo.com failing to enter the back/forward cache because of this.
355
356         No new tests, updated existing test.
357
358         * Modules/indexeddb/IDBIndex.cpp:
359         (WebCore::IDBIndex::canSuspendForDocumentSuspension const):
360
361 2019-10-04  Heiko Becker  <heirecka@exherbo.org>
362
363         Fix build with icu 65.1
364         https://bugs.webkit.org/show_bug.cgi?id=202600
365
366         Reviewed by Konstantin Tokarev.
367
368         * dom/Document.cpp:
369         (WebCore::isValidNameNonASCII):
370         (WebCore::Document::parseQualifiedName):
371
372 2019-10-04  James Darpinian  <jdarpinian@chromium.org>
373
374         Allow using WebGL 2 when USE_ANGLE=1
375         https://bugs.webkit.org/show_bug.cgi?id=202593
376
377         Reviewed by Alex Christensen.
378
379         * html/canvas/WebGLRenderingContextBase.cpp:
380         (WebCore::WebGLRenderingContextBase::create):
381             Disable irrelevant extension check.
382         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
383         (WebCore::GraphicsContext3D::GraphicsContext3D):
384             Use ES3 ANGLE context when WebGL 2 is requested.
385
386 2019-10-04  Alex Christensen  <achristensen@webkit.org>
387
388         Stop sending list of display-isolated schemes to NetworkProcess
389         https://bugs.webkit.org/show_bug.cgi?id=202557
390
391         Reviewed by Youenn Fablet.
392
393         They are only ever used in the WebProcess in SecurityOrigin::canDisplay.
394         If someone adds code that uses them in the NetworkProcess, they will hit my new assertion.
395
396         No change in behavior.
397
398         * page/SecurityOrigin.cpp:
399         (WebCore::SecurityOrigin::canDisplay const):
400         * platform/RuntimeApplicationChecks.h:
401         (WebCore::isInNetworkProcess):
402         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
403         (WebCore::isInNetworkProcess):
404
405 2019-10-04  Alex Christensen  <achristensen@webkit.org>
406
407         Rename SchemeRegistry to LegacySchemeRegistry
408         https://bugs.webkit.org/show_bug.cgi?id=202586
409
410         Reviewed by Tim Horton.
411
412         SchemeRegistry is process-global.  We need to replace it with a non-process-global registry, but Rome wasn't built in a day.
413         This rename allows me to call the replacement object that will have ownership and configuration "SchemeRegistry"
414         and it also indicates that new development should use the owned object instead of the global object.
415
416         * Headers.cmake:
417         * Modules/mediastream/UserMediaController.cpp:
418         (WebCore::isSecure):
419         * Modules/mediastream/UserMediaRequest.cpp:
420         * Modules/webauthn/AuthenticatorCoordinator.cpp:
421         (WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
422         * Modules/webdatabase/DatabaseContext.cpp:
423         (WebCore::DatabaseContext::allowDatabaseAccess const):
424         * Sources.txt:
425         * WebCore.xcodeproj/project.pbxproj:
426         * dom/Document.cpp:
427         (WebCore::Document::setDomain):
428         * dom/ScriptExecutionContext.cpp:
429         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
430         * html/HTMLPlugInImageElement.cpp:
431         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
432         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
433         * loader/CrossOriginAccessControl.cpp:
434         (WebCore::isValidCrossOriginRedirectionURL):
435         * loader/DocumentLoader.cpp:
436         (WebCore::DocumentLoader::matchRegistration):
437         (WebCore::DocumentLoader::disallowWebArchive const):
438         (WebCore::DocumentLoader::commitData):
439         (WebCore::DocumentLoader::maybeLoadEmpty):
440         * loader/DocumentThreadableLoader.cpp:
441         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
442         (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
443         * loader/archive/mhtml/MHTMLArchive.cpp:
444         (WebCore::MHTMLArchive::create):
445         * loader/cache/CachedResource.cpp:
446         (WebCore::CachedResource::freshnessLifetime const):
447         * page/Page.cpp:
448         (WebCore::Page::userStyleSheetLocationChanged):
449         * page/SecurityOrigin.cpp:
450         (WebCore::shouldTreatAsUniqueOrigin):
451         (WebCore::shouldTreatAsPotentiallyTrustworthy):
452         (WebCore::SecurityOrigin::SecurityOrigin):
453         (WebCore::SecurityOrigin::isSecure):
454         (WebCore::SecurityOrigin::canDisplay const):
455         (WebCore::SecurityOrigin::domainForCachePartition const):
456         * page/csp/ContentSecurityPolicy.cpp:
457         (WebCore::ContentSecurityPolicy::allowObjectFromSource const):
458         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
459         (WebCore::ContentSecurityPolicy::allowResourceFromSource const):
460         (WebCore::ContentSecurityPolicy::allowConnectToSource const):
461         (WebCore::ContentSecurityPolicy::allowBaseURI const):
462         * platform/LegacySchemeRegistry.cpp: Copied from Source/WebCore/platform/SchemeRegistry.cpp.
463         (WebCore::allBuiltinSchemes):
464         (WebCore::LegacySchemeRegistry::registerURLSchemeAsLocal):
465         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsLocal):
466         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
467         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNoAccess):
468         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
469         (WebCore::LegacySchemeRegistry::registerURLSchemeAsDisplayIsolated):
470         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
471         (WebCore::LegacySchemeRegistry::registerURLSchemeAsSecure):
472         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
473         (WebCore::LegacySchemeRegistry::registerURLSchemeAsEmptyDocument):
474         (WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
475         (WebCore::LegacySchemeRegistry::setDomainRelaxationForbiddenForURLScheme):
476         (WebCore::LegacySchemeRegistry::isDomainRelaxationForbiddenForURLScheme):
477         (WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
478         (WebCore::LegacySchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
479         (WebCore::LegacySchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs):
480         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs):
481         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing):
482         (WebCore::LegacySchemeRegistry::allowsDatabaseAccessInPrivateBrowsing):
483         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
484         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
485         (WebCore::LegacySchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
486         (WebCore::LegacySchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
487         (WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
488         (WebCore::LegacySchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
489         (WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
490         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCachePartitioned):
491         (WebCore::LegacySchemeRegistry::shouldPartitionCacheForURLScheme):
492         (WebCore::LegacySchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
493         (WebCore::LegacySchemeRegistry::canServiceWorkersHandleURLScheme):
494         (WebCore::LegacySchemeRegistry::isServiceWorkerContainerCustomScheme):
495         (WebCore::LegacySchemeRegistry::isUserExtensionScheme):
496         (WebCore::LegacySchemeRegistry::isBuiltinScheme):
497         (WebCore::SchemeRegistry::registerURLSchemeAsLocal): Deleted.
498         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Deleted.
499         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal): Deleted.
500         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess): Deleted.
501         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess): Deleted.
502         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated): Deleted.
503         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated): Deleted.
504         (WebCore::SchemeRegistry::registerURLSchemeAsSecure): Deleted.
505         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure): Deleted.
506         (WebCore::SchemeRegistry::registerURLSchemeAsEmptyDocument): Deleted.
507         (WebCore::SchemeRegistry::shouldLoadURLSchemeAsEmptyDocument): Deleted.
508         (WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme): Deleted.
509         (WebCore::SchemeRegistry::isDomainRelaxationForbiddenForURLScheme): Deleted.
510         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest): Deleted.
511         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest): Deleted.
512         (WebCore::SchemeRegistry::registerURLSchemeAsNotAllowingJavascriptURLs): Deleted.
513         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNotAllowingJavascriptURLs): Deleted.
514         (WebCore::SchemeRegistry::registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing): Deleted.
515         (WebCore::SchemeRegistry::allowsDatabaseAccessInPrivateBrowsing): Deleted.
516         (WebCore::SchemeRegistry::registerURLSchemeAsCORSEnabled): Deleted.
517         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsCORSEnabled): Deleted.
518         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy): Deleted.
519         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy): Deleted.
520         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy): Deleted.
521         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated): Deleted.
522         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme): Deleted.
523         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): Deleted.
524         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): Deleted.
525         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle): Deleted.
526         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme): Deleted.
527         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme): Deleted.
528         (WebCore::SchemeRegistry::isUserExtensionScheme): Deleted.
529         (WebCore::SchemeRegistry::isBuiltinScheme): Deleted.
530         * platform/LegacySchemeRegistry.h: Copied from Source/WebCore/platform/SchemeRegistry.h.
531         * platform/SchemeRegistry.cpp: Removed.
532         * platform/SchemeRegistry.h: Removed.
533         * platform/ios/QuickLook.mm:
534         * storage/Storage.cpp:
535         * testing/Internals.cpp:
536         (WebCore::Internals::registerURLSchemeAsBypassingContentSecurityPolicy):
537         (WebCore::Internals::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
538         * workers/service/ServiceWorkerContainer.cpp:
539         (WebCore::ServiceWorkerContainer::addRegistration):
540         * workers/service/ServiceWorkerProvider.cpp:
541         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
542         * workers/service/server/SWServerJobQueue.cpp:
543         (WebCore::SWServerJobQueue::runRegisterJob):
544
545 2019-10-04  Antoine Quint  <graouts@apple.com>
546
547         Crash in debug build with imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-replacement.html
548         https://bugs.webkit.org/show_bug.cgi?id=202583
549
550         Reviewed by Dean Jackson.
551
552         Ensure we remove the animation from the timeline it's currently associated with since it may have changed since its creation. This caused
553         a crash because we have an assertion in AnimationTimeline::removeAnimation() to check that the animation belonged to the timeline it's called on.
554
555         * animation/DocumentTimeline.cpp:
556         (WebCore::DocumentTimeline::removeReplacedAnimations):
557
558 2019-10-04  Tim Horton  <timothy_horton@apple.com>
559
560         Clean up some includes to make the build a bit faster: DOMPromise
561         https://bugs.webkit.org/show_bug.cgi?id=202570
562
563         Reviewed by Chris Dumez.
564
565         No new tests, just reorganizing.
566
567         Apply some profile-guided optimizations to our headers.
568
569         Get JSDOMPromiseDeferred.h and DOMPromiseProxy.h out of WebCore headers.
570         One remains (FetchBodyConsumer.h); I leave it as an exercise to the reader.
571         In my testing, this is worth a reliable 5-6% on the WebCore Build Benchmark.
572
573         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
574         * Modules/encryptedmedia/MediaKeySession.cpp:
575         * Modules/encryptedmedia/MediaKeySession.h:
576         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
577         * Modules/encryptedmedia/MediaKeySystemAccess.h:
578         * Modules/encryptedmedia/MediaKeys.cpp:
579         * Modules/encryptedmedia/MediaKeys.h:
580         * Modules/encryptedmedia/NavigatorEME.cpp:
581         * Modules/encryptedmedia/NavigatorEME.h:
582         * Modules/fetch/DOMWindowFetch.cpp:
583         * Modules/fetch/DOMWindowFetch.h:
584         * Modules/fetch/FetchBody.cpp:
585         * Modules/fetch/FetchBody.h:
586         * Modules/fetch/FetchLoader.cpp:
587         * Modules/fetch/FetchLoader.h:
588         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
589         * Modules/fetch/WorkerGlobalScopeFetch.h:
590         * Modules/mediacapabilities/MediaCapabilities.cpp:
591         * Modules/mediacapabilities/MediaCapabilities.h:
592         * Modules/mediastream/MediaDevices.cpp:
593         * Modules/mediastream/MediaDevices.h:
594         * Modules/mediastream/MediaStreamTrack.cpp:
595         * Modules/mediastream/MediaStreamTrack.h:
596         * Modules/mediastream/PeerConnectionBackend.cpp:
597         * Modules/mediastream/PeerConnectionBackend.h:
598         * Modules/mediastream/RTCPeerConnection.cpp:
599         * Modules/mediastream/RTCRtpReceiver.h:
600         * Modules/mediastream/RTCRtpSenderBackend.h:
601         * Modules/mediastream/UserMediaRequest.cpp:
602         * Modules/mediastream/UserMediaRequest.h:
603         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
604         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
605         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
606         * Modules/paymentrequest/PaymentRequest.cpp:
607         * Modules/paymentrequest/PaymentRequest.h:
608         * Modules/paymentrequest/PaymentResponse.cpp:
609         * Modules/paymentrequest/PaymentResponse.h:
610         * Modules/streams/ReadableStreamSource.h:
611         * Modules/webaudio/AudioContext.h:
612         * Modules/webauthn/AuthenticatorCoordinator.cpp:
613         * Modules/webauthn/AuthenticatorCoordinator.h:
614         * Modules/webauthn/PublicKeyCredential.h:
615         * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
616         * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
617         * Modules/webgpu/WebGPU.cpp:
618         * Modules/webgpu/WebGPU.h:
619         * Modules/webgpu/WebGPUAdapter.cpp:
620         * Modules/webgpu/WebGPUAdapter.h:
621         * Modules/webgpu/WebGPUBuffer.cpp:
622         * Modules/webgpu/WebGPUBuffer.h:
623         * Modules/webgpu/WebGPUDevice.cpp:
624         * Modules/webgpu/WebGPUDevice.h:
625         * Modules/webvr/NavigatorWebVR.cpp:
626         * Modules/webvr/NavigatorWebVR.h:
627         * Modules/webvr/VRDisplay.cpp:
628         * Modules/webvr/VRDisplay.h:
629         * Sources.txt:
630         * WebCore.xcodeproj/project.pbxproj:
631         * animation/KeyframeEffect.cpp:
632         * animation/WebAnimation.cpp:
633         * animation/WebAnimation.h:
634         * bindings/js/CachedModuleScriptLoader.cpp:
635         * bindings/js/CachedModuleScriptLoaderClient.h:
636         * bindings/js/JSDOMPromiseDeferred.h:
637         * bindings/js/JSHTMLTemplateElementCustom.cpp:
638         * bindings/js/JSImageDataCustom.cpp:
639         * bindings/js/JSReadableStreamSourceCustom.cpp:
640         * bindings/js/JSWebAnimationCustom.cpp:
641         * bindings/js/JSWorkerGlobalScopeBase.cpp:
642         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
643         * bindings/js/JSWorkletGlobalScopeBase.cpp:
644         * bindings/js/ScriptModuleLoader.cpp:
645         * css/FontFace.cpp:
646         * css/FontFace.h:
647         * css/FontFaceSet.cpp:
648         * css/FontFaceSet.h:
649         * dom/CustomElementRegistry.cpp:
650         * dom/DeviceOrientationOrMotionEvent.cpp:
651         * dom/DeviceOrientationOrMotionEvent.h:
652         * dom/MouseEvent.cpp:
653         * dom/MouseEvent.h:
654         * html/CustomPaintCanvas.h:
655         * html/ImageBitmap.cpp:
656         * html/ImageBitmap.h:
657         * html/OffscreenCanvas.cpp:
658         * html/OffscreenCanvas.h:
659         * loader/ImageLoader.cpp:
660         * loader/ImageLoader.h:
661         * page/DOMWindow.cpp:
662         * page/Navigator.h:
663         * platform/graphics/CustomPaintImage.cpp:
664         * testing/Internals.cpp:
665         * testing/Internals.h:
666         * testing/ServiceWorkerInternals.h:
667         * testing/ServiceWorkerInternals.mm:
668         * workers/service/ServiceWorkerContainer.cpp:
669         * workers/service/ServiceWorkerContainer.h:
670         * workers/service/ServiceWorkerJob.h:
671         * workers/service/ServiceWorkerRegistration.cpp:
672         * workers/service/ServiceWorkerRegistration.h:
673         * worklets/PaintWorkletGlobalScope.cpp:
674
675 2019-10-04  Sihui Liu  <sihui_liu@apple.com>
676
677         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a Flaky Failure
678         https://bugs.webkit.org/show_bug.cgi?id=201481
679         <rdar://problem/55046055>
680
681         Reviewed by Alex Christensen.
682
683         We should not schedule timer if we know the timer function will be no-op.
684
685         * Modules/indexeddb/IDBTransaction.cpp:
686         (WebCore::IDBTransaction::removeRequest):
687         (WebCore::IDBTransaction::scheduleOperation):
688         (WebCore::IDBTransaction::trySchedulePendingOperationTimer):
689         (WebCore::IDBTransaction::pendingOperationTimerFired):
690         (WebCore::IDBTransaction::didStart):
691         (WebCore::IDBTransaction::operationCompletedOnClient):
692         (WebCore::IDBTransaction::deactivate):
693         (WebCore::IDBTransaction::schedulePendingOperationTimer): Deleted.
694         * Modules/indexeddb/IDBTransaction.h:
695
696 2019-10-04  Chris Dumez  <cdumez@apple.com>
697
698         Unreviewed follow-up fix for r250693 to address assertion hits in debug.
699
700         * css/FontFaceSet.cpp:
701         (WebCore::FontFaceSet::didFirstLayout):
702         (WebCore::FontFaceSet::completedLoading):
703         Make sure the ready promise is not already resolved before resolving it.
704
705         * platform/SuspendableTaskQueue.cpp:
706         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
707         * platform/SuspendableTaskQueue.h:
708         (WebCore::SuspendableTaskQueue::create):
709         Add a new constructor that takes in a Document since the ActiveDOMObject's
710         constructor taking a Document has some useful logic.
711
712 2019-10-04  Joonghun Park  <jh718.park@samsung.com>
713
714         Negative radii in radial gradients should be rejected.
715         https://bugs.webkit.org/show_bug.cgi?id=202412
716
717         Per the spec, https://drafts.csswg.org/css-images-3/#radial-gradients
718         "Negative values are invalid.",
719         we reject negative radii values in radial-gradient.
720
721         This patch rejects negative radii during radial-gradient parsing
722         for both webkit prefixed and non-prefixed ones.
723
724         Reviewed by Antti Koivisto.
725
726         Tests: imported/blink/css-parser/webkit-gradient.html
727                imported/w3c/web-platform-tests/compat/webkit-radial-gradient-radii.html
728                imported/w3c/web-platform-tests/css/css-backgrounds/parsing/background-image-invalid.html
729
730         * css/parser/CSSPropertyParserHelpers.cpp:
731         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
732         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
733         (WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
734
735 2019-10-04  Alex Christensen  <achristensen@webkit.org>
736
737         Move WKProcessPool._registerURLSchemeServiceWorkersCanHandle to _WKWebsiteDataStoreConfiguration
738         https://bugs.webkit.org/show_bug.cgi?id=202553
739
740         Reviewed by Youenn Fablet.
741
742         * workers/service/server/SWServer.cpp:
743         (WebCore::SWServer::SWServer):
744         * workers/service/server/SWServer.h:
745         (WebCore::SWServer::registeredSchemes const):
746         * workers/service/server/SWServerJobQueue.cpp:
747         (WebCore::SWServerJobQueue::runRegisterJob):
748
749 2019-10-04  youenn fablet  <youenn@apple.com>
750
751         AbortSignal does not always emit the abort signal
752         https://bugs.webkit.org/show_bug.cgi?id=201871
753         <rdar://problem/55451712>
754
755         Reviewed by Chris Dumez.
756
757         Make sure a JSAbortSignal is not GCed until objects that can abort it are gone.
758         This includes a followed signal and an AbortController.
759         Current WebKit implementation only uses following of one signal at a time.
760
761         Test: http/tests/fetch/abort-signal-gc.html
762
763         * Sources.txt:
764         * WebCore.xcodeproj/project.pbxproj:
765         * bindings/js/JSAbortControllerCustom.cpp: Added.
766         (WebCore::JSAbortController::visitAdditionalChildren):
767         * bindings/js/JSAbortSignalCustom.cpp: Added.
768         (WebCore::JSAbortSignalOwner::isReachableFromOpaqueRoots):
769         * bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
770         * dom/AbortController.idl:
771         * dom/AbortSignal.cpp:
772         (WebCore::AbortSignal::follow):
773         * dom/AbortSignal.h:
774         * dom/AbortSignal.idl:
775
776 2019-10-04  youenn fablet  <youenn@apple.com>
777
778         Allow to suspend RTCPeerConnection when not connected
779         https://bugs.webkit.org/show_bug.cgi?id=202403
780
781         Reviewed by Chris Dumez.
782
783         Implement suspend/resume in RTCPeerConnection by sending suspend/resume to the libwebrtc media endpoint,
784         which suspends/resumes its socket factory.
785
786         We allow suspension when the connection is not connected.
787         Pages with connected connections will not go in page cache yet.
788
789         Tests: webrtc/datachannel/datachannel-page-cache-send.html
790                webrtc/datachannel/datachannel-page-cache.html
791
792         * Modules/mediastream/PeerConnectionBackend.h:
793         (WebCore::PeerConnectionBackend::suspend):
794         (WebCore::PeerConnectionBackend::resume):
795         * Modules/mediastream/RTCPeerConnection.cpp:
796         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const):
797         (WebCore::RTCPeerConnection::suspend):
798         (WebCore::RTCPeerConnection::resume):
799         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
800         (WebCore::LibWebRTCMediaEndpoint::suspend):
801         (WebCore::LibWebRTCMediaEndpoint::resume):
802         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
803         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
804         (WebCore::LibWebRTCPeerConnectionBackend::suspend):
805         (WebCore::LibWebRTCPeerConnectionBackend::resume):
806         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
807         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
808
809 2019-10-04  Truitt Savell  <tsavell@apple.com>
810
811         Unreviewed, rolling out r250583.
812
813         Broke multiple internal API tests
814
815         Reverted changeset:
816
817         "[JSC] Place VM* in TLS"
818         https://bugs.webkit.org/show_bug.cgi?id=202391
819         https://trac.webkit.org/changeset/250583
820
821 2019-10-04  Alex Christensen  <achristensen@webkit.org>
822
823         Simplify sandbox enabling macros
824         https://bugs.webkit.org/show_bug.cgi?id=202536
825
826         Reviewed by Brent Fulgham.
827
828         * Configurations/FeatureDefines.xcconfig:
829
830 2019-10-04  Chris Lord  <clord@igalia.com>
831
832         ImageBitmap should be serializable
833         https://bugs.webkit.org/show_bug.cgi?id=202394
834
835         Reviewed by Žan Doberšek.
836
837         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable.html
838
839         * bindings/js/SerializedScriptValue.cpp:
840         (WebCore::CloneSerializer::dumpImageBitmap):
841         (WebCore::CloneDeserializer::readTransferredImageBitmap):
842         (WebCore::CloneDeserializer::readImageBitmap):
843         (WebCore::CloneDeserializer::readTerminal):
844
845 2019-10-03  Antoine Quint  <graouts@apple.com>
846
847         AppleTV named as XSS-payloads trigger when AirPlay is used
848         https://bugs.webkit.org/show_bug.cgi?id=202534
849         <rdar://55931262>
850
851         Reviewed by Eric Carlson.
852
853         Ensure we escape an AirPlay's device name before inserting its name into the DOM.
854
855         * Modules/modern-media-controls/media/placard-support.js:
856         (PlacardSupport.prototype._updateAirPlayPlacard):
857         (PlacardSupport):
858         (escapeHTML):
859
860 2019-10-04  Oriol Brufau  <obrufau@igalia.com>
861
862         [css-grid] Preserve auto repeat() in getComputedStyle() for non-grids
863         https://bugs.webkit.org/show_bug.cgi?id=202258
864
865         Reviewed by Javier Fernandez.
866
867         Tests: imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-nogrid.html
868                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed.html
869                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-nogrid.html
870                imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed.html
871
872         Usually, the resolved value of grid-template-rows/columns is the used
873         value, expanding the repeat() notation. But for elements with a non-grid
874         display, the resolved value is just the computed value, with repeat(),
875         since the used value doesn't exist.
876         Before this patch, the repeat() was dropped, and line names after it
877         appeared at the wrong position or were also dropped. There was also an
878         assert failure in debug. This patch fixes the serialization for auto
879         repeat(). Integer repeat() is still expanded at computed-value time, so
880         it's not preserved in getComputedStyle().
881
882         * css/CSSComputedStyleDeclaration.cpp:
883         (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector):
884         (WebCore::OrderedNamedLinesCollectorInsideRepeat::OrderedNamedLinesCollectorInsideRepeat):
885         (WebCore::OrderedNamedLinesCollectorInGridLayout::OrderedNamedLinesCollectorInGridLayout):
886         (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex const):
887         (WebCore::OrderedNamedLinesCollectorInsideRepeat::collectLineNamesForIndex const):
888         (WebCore::OrderedNamedLinesCollectorInGridLayout::collectLineNamesForIndex const):
889         (WebCore::populateGridTrackList):
890         (WebCore::valueForGridTrackList):
891
892 2019-10-04  Antti Koivisto  <antti@apple.com>
893
894         [CSS Shadow Parts] Support 'exportparts' attribute
895         https://bugs.webkit.org/show_bug.cgi?id=202520
896
897         Reviewed by Ryosuke Niwa.
898
899         Support 'exportparts' attribute for exporting part mappings from subcomponents.
900
901         * css/ElementRuleCollector.cpp:
902         (WebCore::ElementRuleCollector::matchAuthorRules):
903         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
904
905         Recurse to containing scopes to collect part rules if there are exported mappings.
906
907         (WebCore::ElementRuleCollector::ruleMatches):
908         * css/ElementRuleCollector.h:
909         * css/SelectorChecker.cpp:
910         (WebCore::SelectorChecker::matchRecursively const):
911
912         Make ShadowDescendant fake combinator skip directly to the scope where the part rules are coming from.
913
914         (WebCore::SelectorChecker::checkOne const):
915
916         Resolve names via mappings if needed.
917
918         * css/SelectorChecker.h:
919         * dom/Element.cpp:
920         (WebCore::Element::attributeChanged):
921
922         Invalidate mappings as needed.
923
924         * dom/ShadowRoot.cpp:
925         (WebCore::parsePartMappings):
926
927         Parse the mappings microsyntax.
928
929         (WebCore::ShadowRoot::partMappings const):
930         (WebCore::ShadowRoot::invalidatePartMappings):
931         * dom/ShadowRoot.h:
932         * html/HTMLAttributeNames.in:
933
934 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
935
936         A newly inserted element doesn't get assigned to a named slot if slot assignments had already happened
937         https://bugs.webkit.org/show_bug.cgi?id=199733
938
939         Reviewed by Antti Koivisto.
940
941         The bug was caused by addSlotElementByName not invalidating slot assignments when a new slot element
942         is inserted after corresponding elements with the slot content attribute had already been inserted.
943
944         Fixed the bug by always invalidating the slot assignment when a new slot element is inserted.
945
946         Tests: fast/shadow-dom/add-slotted-element-after-assignment-1.html
947                fast/shadow-dom/add-slotted-element-after-assignment-2.html
948                fast/shadow-dom/add-slotted-element-after-assignment-3.html
949
950         * dom/SlotAssignment.cpp:
951         (WebCore::SlotAssignment::addSlotElementByName):
952
953 2019-10-04  Ryosuke Niwa  <rniwa@webkit.org>
954
955         Radio button groups are not scoped by shadow boundaries
956         https://bugs.webkit.org/show_bug.cgi?id=199568
957
958         Reviewed by Antti Koivisto.
959
960         Fixed the bug that radio button groups are not scoped to each shadow tree by moving
961         RadioButtonGroups from FormController, which is a per-document object, to TreeScope.
962
963         Test: imported/w3c/web-platform-tests/shadow-dom/input-type-radio.html
964
965         * dom/RadioButtonGroups.h:
966         (WebCore::RadioButtonGroups): Made this bmalloc'ed now that it's allocated standalone.
967         * dom/TreeScope.cpp:
968         (WebCore::TreeScope::radioButtonGroups): Added.
969         * dom/TreeScope.h:
970         * html/FormController.h:
971         (WebCore::FormController::radioButtonGroups): Deleted.
972         * html/HTMLInputElement.cpp:
973         (WebCore::HTMLInputElement::~HTMLInputElement):
974         (WebCore::HTMLInputElement::removedFromAncestor): Update the radio button group here.
975         (WebCore::HTMLInputElement::didMoveToNewDocument): Removed the code to update radio
976         button group here since it's done in removedFromAncestor now. Note that insertion case
977         is alrady taken care of by HTMLInputElement::didFinishInsertingNode.
978         (WebCore::HTMLInputElement::radioButtonGroups const): Ditto.
979
980 2019-10-03  Antti Koivisto  <antti@apple.com>
981
982         [CSS Shadow Parts] Correct interaction with other pseudo elements
983         https://bugs.webkit.org/show_bug.cgi?id=202526
984
985         Reviewed by Ryosuke Niwa.
986
987         Cases like foo::part(bar)::before should work.
988
989         This patch doesn't cover ::placeholder which is implemented as PseudoElementWebKitCustom (like internal -webkit-* properties).
990
991         * css/CSSSelector.h:
992         (WebCore::isTreeStructuralPseudoClass):
993
994         Add a helper.
995
996         * css/parser/CSSSelectorParser.cpp:
997
998         Allow non-structural pseudo classes after ::part().
999         Allow other pseudo elements after ::part().
1000
1001         (WebCore::CSSSelectorParser::consumePseudo):
1002
1003         No need for DisallowPseudoElementsScope, we are just parsing identifiers.
1004
1005 2019-10-03  James Darpinian  <jdarpinian@chromium.org>
1006
1007         Fix WebGL 1 conformance regressions when USE_ANGLE=1
1008         https://bugs.webkit.org/show_bug.cgi?id=202545
1009
1010         Prevent ANGLE from automatically using ES3 when ES2 is requested.
1011
1012         WEBGL_debug_shaders extension should not accept or return null.
1013
1014         Enable ANGLE's new support for emulating RGB on RGBA IOSurfaces.
1015
1016         Reviewed by Alex Christensen.
1017
1018         * html/canvas/WebGLDebugShaders.cpp:
1019         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
1020         * html/canvas/WebGLDebugShaders.h:
1021         * html/canvas/WebGLDebugShaders.idl:
1022         * html/canvas/WebGLRenderingContextBase.cpp:
1023         (WebCore::WebGLRenderingContextBase::validateVertexAttributes):
1024         * platform/graphics/angle/Extensions3DANGLE.cpp:
1025         (WebCore::Extensions3DANGLE::getTranslatedShaderSourceANGLE):
1026         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1027         (WebCore::GraphicsContext3D::GraphicsContext3D):
1028         * platform/graphics/cocoa/WebGLLayer.mm:
1029         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
1030
1031 2019-10-03  Jer Noble  <jer.noble@apple.com>
1032
1033     [iOS] WebContent process can be interrupted during suspension; loses "Now Playing" status
1034     https://bugs.webkit.org/show_bug.cgi?id=202537
1035     <rdar://problem/55952707>
1036
1037     Reviewed by Eric Carlson.
1038
1039     Always deactivate the AVAudioSession when the last playing PlatformAudioSession ends playback and the application is in the background.
1040
1041     * platform/audio/PlatformMediaSessionManager.cpp:
1042     (WebCore::PlatformMediaSessionManager::removeSession):
1043     (WebCore::PlatformMediaSessionManager::processWillSuspend):
1044     (WebCore::PlatformMediaSessionManager::maybeDeactivateAudioSession):
1045     * platform/audio/PlatformMediaSessionManager.h:
1046     (WebCore::PlatformMediaSessionManager::isApplicationInBackground const):
1047     * platform/audio/ios/MediaSessionManagerIOS.h:
1048     * platform/audio/ios/MediaSessionManagerIOS.mm:
1049     (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
1050
1051 2019-10-03  Chris Dumez  <cdumez@apple.com>
1052
1053         Allow pages using FontFaceSet to enter the back/forward cache
1054         https://bugs.webkit.org/show_bug.cgi?id=202476
1055
1056         Reviewed by Myles C. Maxfield.
1057
1058         Allow pages using FontFaceSet to enter the back/forward cache by updating its
1059         implementation to queue all its tasks that run script to a SuspendableTaskQueue.
1060         The SuspendableTaskQueue makes sure to properly suspend while in PageCache and
1061         run the tasks when resuming from PageCache.
1062
1063         Test: http/tests/navigation/page-cache-fontfaceset.html
1064
1065         * PlatformWin.cmake:
1066         * Sources.txt:
1067         * WebCore.xcodeproj/project.pbxproj:
1068         * css/CSSFontFace.cpp:
1069         (WebCore::CSSFontFace::fontLoadEventOccurred):
1070         * css/FontFaceSet.cpp:
1071         (WebCore::FontFaceSet::FontFaceSet):
1072         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const):
1073         (WebCore::FontFaceSet::didFirstLayout):
1074         (WebCore::FontFaceSet::completedLoading):
1075         (WebCore::FontFaceSet::faceFinished):
1076         * css/FontFaceSet.h:
1077
1078         * platform/SuspendableTaskQueue.cpp: Added.
1079         (WebCore::SuspendableTaskQueue::SuspendableTaskQueue):
1080         (WebCore::SuspendableTaskQueue::close):
1081         (WebCore::SuspendableTaskQueue::cancelAllTasks):
1082         (WebCore::SuspendableTaskQueue::enqueueTask):
1083         (WebCore::SuspendableTaskQueue::runOneTask):
1084         (WebCore::SuspendableTaskQueue::activeDOMObjectName const):
1085         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const):
1086         (WebCore::SuspendableTaskQueue::stop):
1087         (WebCore::SuspendableTaskQueue::suspend):
1088         (WebCore::SuspendableTaskQueue::resume):
1089         * platform/SuspendableTaskQueue.h: Added.
1090         (WebCore::SuspendableTaskQueue::create):
1091         (WebCore::SuspendableTaskQueue::isClosed const):
1092         (WebCore::SuspendableTaskQueue::hasPendingTasks const):
1093         Add a SuspendableTaskQueue class which is Page-Cache aware and can be used to queue
1094         generic tasks as WTF::Function<void<>> lambdas.
1095
1096 2019-10-03  Chris Dumez  <cdumez@apple.com>
1097
1098         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache
1099         https://bugs.webkit.org/show_bug.cgi?id=202474
1100
1101         Reviewed by Alex Christensen.
1102
1103         Provisional / scheduled loads in subframes should not prevent a page from entering the back/forward cache.
1104         To address the issue, we now make sure to stop all loads before checking for PageCache eligibility.
1105
1106         Test: fast/history/page-cache-quick-redirect-iframe.html
1107
1108         * history/PageCache.cpp:
1109         (WebCore::PageCache::addIfCacheable):
1110         * loader/FrameLoader.cpp:
1111         (WebCore::FrameLoader::stopForPageCache):
1112         * loader/FrameLoader.h:
1113
1114 2019-10-03  Chris Dumez  <cdumez@apple.com>
1115
1116         XMLHttpRequest sometimes prevents pages from entering the back/forward cache
1117         https://bugs.webkit.org/show_bug.cgi?id=202434
1118         <rdar://problem/55890340>
1119
1120         Reviewed by Geoffrey Garen.
1121
1122         XMLHttpRequest::canSuspendForDocumentSuspension() was returning false if the document has not fired
1123         the window's load event, with a comment explaining that cancelling the XHR in the upon suspension
1124         may cause the load event to get fired and thus run script when forbidden. However, we should only
1125         return false if the XMLHttpRequest is actually loading (m_loader is not null). XHRs that are not
1126         loading should never prevent page caching.
1127
1128         I saw failures to enter the back/forward cache on yandex.ru and taobao.com because of this.
1129
1130         Test: http/tests/navigation/page-cache-failed-xhr.html
1131
1132         * xml/XMLHttpRequest.cpp:
1133         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const):
1134
1135 2019-10-03  John Wilander  <wilander@apple.com>
1136
1137         Resource Load Statistics: Downgrade document.referrer for all third-party iframes
1138         https://bugs.webkit.org/show_bug.cgi?id=202506
1139         <rdar://problem/55786397>
1140
1141         Reviewed by Brent Fulgham.
1142
1143         This change downgrades document.referrer for all third-party iframes if ITP/Resource Load Statistics
1144         is enabled. The behavior matches the downgrade of all HTTP referrers for third-party resources
1145         which landed in https://trac.webkit.org/changeset/250413/webkit.
1146
1147         Tests: http/tests/resourceLoadStatistics/downgrade-document-referrer-nested-third-party-iframe.html
1148                http/tests/resourceLoadStatistics/downgrade-document-referrer-third-party-iframe.html
1149                http/tests/resourceLoadStatistics/leave-empty-document-referrer-alone-third-party-iframe.html
1150
1151         * dom/Document.cpp:
1152         (WebCore::Document::referrer):
1153         (WebCore::Document::referrer const): Deleted.
1154             Can no longer be const since it lazily downgrades and saves the referrer on read.
1155         * dom/Document.h:
1156
1157 2019-10-03  Devin Rousso  <drousso@apple.com>
1158
1159         Web Inspector: remove `InspectorInstrumentationCookie`
1160         https://bugs.webkit.org/show_bug.cgi?id=202487
1161
1162         Reviewed by Matt Baker.
1163
1164         All it does is create a shallow-copy of the `InstrumentingAgents` (it copies a pointer to
1165         the `InstrumentingAgents` object, so any of the pointers to the `InspectorAgent` that are
1166         contained therein are shared between each instance) and save the tracking
1167         `InspectorTimelineAgent`'s id (monotonically increasing integer).
1168
1169         All uses of `InspectorInstrumentationCookie` are local values, so there's no way that the
1170         `InspectorTimelineAgent` (or the id) could change in between an
1171         `InspectorInstrumentation::will*` and an `InspectorInstrumentation::did*`, as both the
1172         tracking state and id are controlled by the frontend and cannot "interrupt".
1173
1174         Removing `InspectorInstrumentationCookie` _can_ cause issues is in situations where the
1175         `ScriptExecutionContext` (or `Page`) changes between the `InspectorInstrumentation::will*`
1176         and the `InspectorInstrumentation::did*`, but this can be avoided so long as a pointer to
1177         the "context" used for `InspectorInstrumentation::will*` is saved.
1178
1179         Covered by existing tests: inspector/timeline/*
1180
1181         * inspector/InspectorInstrumentationCookie.h: Removed.
1182         * inspector/InspectorInstrumentationCookie.cpp: Removed.
1183
1184         * inspector/agents/InspectorTimelineAgent.h:
1185         * inspector/agents/InspectorTimelineAgent.cpp:
1186         (WebCore::InspectorTimelineAgent::internalStop):
1187         (WebCore::InspectorTimelineAgent::didDispatchEvent):
1188         (WebCore::InspectorTimelineAgent::didPaint):
1189         (WebCore::InspectorTimelineAgent::clearRecordStack): Deleted.
1190
1191         * bindings/js/JSCallbackData.cpp:
1192         (WebCore::JSCallbackData::invokeCallback):
1193         * bindings/js/JSCustomElementInterface.cpp:
1194         (WebCore::constructCustomElementSynchronously):
1195         (WebCore::JSCustomElementInterface::upgradeElement):
1196         (WebCore::JSCustomElementInterface::invokeCallback):
1197         * bindings/js/JSErrorHandler.cpp:
1198         (WebCore::JSErrorHandler::handleEvent):
1199         * bindings/js/JSEventListener.cpp:
1200         (WebCore::JSEventListener::handleEvent):
1201         * bindings/js/JSExecState.h:
1202         * bindings/js/JSExecStateInstrumentation.h:
1203         (WebCore::JSExecState::instrumentFunctionInternal):
1204         (WebCore::JSExecState::instrumentFunctionCall):
1205         (WebCore::JSExecState::instrumentFunctionConstruct):
1206         * bindings/js/ScheduledAction.cpp:
1207         (WebCore::ScheduledAction::executeFunctionInContext):
1208         * bindings/js/ScriptController.cpp:
1209         (WebCore::ScriptController::evaluateInWorld):
1210         (WebCore::ScriptController::evaluateModule):
1211         * dom/Document.cpp:
1212         (WebCore::Document::resolveStyle):
1213         * dom/EventTarget.cpp:
1214         (WebCore::EventTarget::innerInvokeEventListeners):
1215         * dom/MutationObserver.cpp:
1216         (WebCore::MutationObserver::deliver):
1217         * dom/ScriptedAnimationController.cpp:
1218         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
1219         * page/DOMTimer.cpp:
1220         (WebCore::DOMTimer::fired):
1221         * page/DOMWindow.cpp:
1222         (WebCore::DOMWindow::dispatchEvent):
1223         * page/FrameViewLayoutContext.cpp:
1224         (WebCore::FrameViewLayoutContext::layout):
1225         * page/IntersectionObserver.cpp:
1226         (WebCore::IntersectionObserver::notify):
1227         * page/PerformanceObserver.cpp:
1228         (WebCore::PerformanceObserver::deliver):
1229
1230         * inspector/InspectorInstrumentation.h:
1231         (WebCore::InspectorInstrumentation::willCallFunction):
1232         (WebCore::InspectorInstrumentation::didCallFunction):
1233         (WebCore::InspectorInstrumentation::willDispatchEvent):
1234         (WebCore::InspectorInstrumentation::didDispatchEvent):
1235         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
1236         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
1237         (WebCore::InspectorInstrumentation::willEvaluateScript):
1238         (WebCore::InspectorInstrumentation::didEvaluateScript):
1239         (WebCore::InspectorInstrumentation::willFireTimer):
1240         (WebCore::InspectorInstrumentation::didFireTimer):
1241         (WebCore::InspectorInstrumentation::willLayout):
1242         (WebCore::InspectorInstrumentation::didLayout):
1243         (WebCore::InspectorInstrumentation::willRecalculateStyle):
1244         (WebCore::InspectorInstrumentation::didRecalculateStyle):
1245         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
1246         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
1247         (WebCore::InspectorInstrumentation::willFireObserverCallback):
1248         (WebCore::InspectorInstrumentation::didFireObserverCallback):
1249         * inspector/InspectorInstrumentation.cpp:
1250         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
1251         (WebCore::InspectorInstrumentation::didCallFunctionImpl):
1252         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
1253         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
1254         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
1255         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
1256         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
1257         (WebCore::InspectorInstrumentation::didEvaluateScriptImpl):
1258         (WebCore::InspectorInstrumentation::willFireTimerImpl):
1259         (WebCore::InspectorInstrumentation::didFireTimerImpl):
1260         (WebCore::InspectorInstrumentation::willLayoutImpl):
1261         (WebCore::InspectorInstrumentation::didLayoutImpl):
1262         (WebCore::InspectorInstrumentation::willRecalculateStyleImpl):
1263         (WebCore::InspectorInstrumentation::didRecalculateStyleImpl):
1264         (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
1265         (WebCore::InspectorInstrumentation::didFireAnimationFrameImpl):
1266         (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
1267         (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
1268         (WebCore::InspectorInstrumentation::retrieveTimelineAgent): Deleted.
1269
1270         * Sources.txt:
1271         * WebCore.xcodeproj/project.pbxproj:
1272
1273 2019-10-03  Sihui Liu  <sihui_liu@apple.com>
1274
1275         IndexedDB: add size estimate for key path when estimate task size
1276         https://bugs.webkit.org/show_bug.cgi?id=202480
1277
1278         Reviewed by Geoffrey Garen.
1279
1280         No observable behavior change.
1281
1282         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1283         (WebCore::IDBServer::estimateSize):
1284
1285 2019-10-03  youenn fablet  <youenn@apple.com>
1286
1287         Regression: iOS 13.1 MediaStreamTrack.enabled = false kills audio track
1288         https://bugs.webkit.org/show_bug.cgi?id=202405
1289         <rdar://problem/55922616>
1290
1291         Reviewed by Eric Carlson.
1292
1293         When the web page is setting enabled to false, media session might change from PlayRecord to None.
1294         This might trigger CoreAudio to no longer output audio samples, thus triggering our audio capture failure timer.
1295         This would end the track after 2 seconds.
1296         Given audio tracks can be reenabled by a web page, we should not change the Media Session setup based on that.
1297         This patch updates MediaStream::mediaType to return independently of the enabled state.
1298
1299         Add internals API to write a cross platform test.
1300
1301         Test: fast/mediastream/audio-track-enabled.html
1302         Manually tested as well.
1303
1304         * Modules/mediastream/MediaStream.cpp:
1305         (WebCore::MediaStream::mediaType const):
1306         * platform/mediastream/MediaStreamPrivate.cpp:
1307         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const):
1308         * testing/Internals.cpp:
1309         (WebCore::Internals::supportsAudioSession const):
1310         (WebCore::Internals::audioSessionCategory const):
1311         * testing/Internals.h:
1312         * testing/Internals.idl:
1313
1314 2019-10-03  youenn fablet  <youenn@apple.com>
1315
1316         http/tests/security/navigate-when-restoring-cached-page.html should not use RTCPeerConnection to not enter in page cache
1317         https://bugs.webkit.org/show_bug.cgi?id=202521
1318
1319         Reviewed by Chris Dumez.
1320
1321         Introduce a dummy ActiveDOMObject which can never be suspended for document suspension.
1322         Allow a page to create this dummy ActiveDOMObject through internals.
1323         Covered by updated test.
1324
1325         * dom/ActiveDOMObject.h:
1326         * testing/Internals.cpp:
1327         (WebCore::Internals::preventDocumentForEnteringPageCache):
1328         * testing/Internals.h:
1329         * testing/Internals.idl:
1330
1331 2019-10-03  Tim Horton  <timothy_horton@apple.com>
1332
1333         WebKit doesn't build with trunk clang
1334         https://bugs.webkit.org/show_bug.cgi?id=202511
1335
1336         Reviewed by Anders Carlsson.
1337
1338         * Modules/fetch/FetchLoader.h:
1339         * Modules/geolocation/Geolocation.h:
1340         * Modules/indexeddb/IDBTransaction.h:
1341         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1342         * Modules/indexeddb/shared/InProcessIDBServer.h:
1343         * Modules/notifications/Notification.cpp:
1344         * Modules/notifications/Notification.h:
1345         * platform/graphics/ca/TileController.h:
1346         * workers/service/context/ServiceWorkerThreadProxy.h:
1347         Fix the build by exporting destructors and custom delete operators.
1348         I don't know why this changed, but trunk clang insists.
1349         There are also some new warnings; this only fixes the hard errors.
1350
1351 2019-10-03  Tim Horton  <timothy_horton@apple.com>
1352
1353         Yet another build fix
1354
1355         * css/typedom/TypedOMCSSImageValue.h:
1356         Forward declare Document.
1357
1358 2019-10-03  Jiewen Tan  <jiewen_tan@apple.com>
1359
1360         Support googleLegacyAppidSupport extension
1361         https://bugs.webkit.org/show_bug.cgi?id=202427
1362         <rdar://problem/55887473>
1363
1364         Reviewed by Brent Fulgham.
1365
1366         This patch adds support for googleLegacyAppidSupport extension, when set:
1367         1) user agent should only use the U2F transport protocol,
1368         2) should only communicate with roaming authenticators, and
1369         3) should use a hard-coded appID of https://www.gstatic.com/securitykey/origins.json.
1370         To be noticed as the name implies, this extension is exclusively for RP ID = google.com.
1371
1372         Implementation wise, all operations are captured in methods with name processGoogleLegacyAppIdSupportExtension.
1373         1) AuthenticatorCoordinator takes care of setting the value.
1374         2) U2fCommandConstructor takes care of hard coding the AppID.
1375         3) AuthenticatorManager takes care of removing AuthenticatorTransport::Internal from TransportSet, so startDiscovery
1376         will not poke platform authenticators.
1377         4) CtapAuthenticator takes care of downgrading to U2fAuthenticator.
1378         5) U2fAuthenticator takes care of setting the AppID in the response.
1379
1380         Partially covered by new test cases in existing tests, and remaining will be covered by manual tests.
1381
1382         * Modules/webauthn/AuthenticationExtensionsClientInputs.h:
1383         (WebCore::AuthenticationExtensionsClientInputs::encode const):
1384         (WebCore::AuthenticationExtensionsClientInputs::decode):
1385         * Modules/webauthn/AuthenticationExtensionsClientInputs.idl:
1386         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1387         (WebCore::AuthenticatorCoordinatorInternal::processGoogleLegacyAppIdSupportExtension):
1388         (WebCore::AuthenticatorCoordinator::create const):
1389         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1390         (WebCore::PublicKeyCredentialCreationOptions::encode const):
1391         (WebCore::PublicKeyCredentialCreationOptions::decode):
1392         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
1393         (fido::convertToU2fRegisterCommand):
1394         (fido::processGoogleLegacyAppIdSupportExtension):
1395         * Modules/webauthn/fido/U2fCommandConstructor.h:
1396
1397 2019-10-03  Yury Semikhatsky  <yurys@chromium.org>
1398
1399         Web Inspector: tests under LayoutTests/inspector/debugger are flaky
1400         https://bugs.webkit.org/show_bug.cgi?id=137131
1401         <rdar://problem/18461335>
1402
1403         Reviewed by Devin Rousso.
1404
1405         Fix debugger tests on GTK. All tests that pause on breakpoint didn't work because
1406         in layout tests InspectorFrontendClientLocal was using Timer to dispatch commands
1407         sent from the local front-end page to the inspected one. When paused inside a script
1408         triggered by the front-end nested timer event would be scheduled but never fired
1409         because in glib implementation of RunLoop::TimerBase uses event source which doesn't
1410         allow recursion (g_source_set_can_recurse is not called on the source), so dispatching
1411         Debugger.resume command didn't work when paused inside another inspector command (e.g.
1412         eval). RunLoop itself uses event source which does allow recursion. So instead of using
1413         a timer for asynchronous command dispatching with delay=0 we now schedule a task in
1414         RunLoop's queue.
1415
1416         * inspector/InspectorFrontendClientLocal.cpp:
1417         (WebCore::InspectorBackendDispatchTask::dispatch):
1418         (WebCore::InspectorBackendDispatchTask::reset):
1419         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
1420         (WebCore::InspectorBackendDispatchTask::scheduleOneShot): ensures that there is one inspector
1421         dispatch task in the queue.
1422         (WebCore::InspectorBackendDispatchTask::dispatchOneMessage): this is mostly the same behavior
1423         as was with timerFired, we should be able to dispatch all accumulated messages from the queue
1424         in one batch but for now I'd like to keep it one per iteration.
1425
1426 2019-10-03  Joonghun Park  <pjh0718@gmail.com>
1427
1428         CSS ellipse() doesn't accept single <shape-radius>
1429         https://bugs.webkit.org/show_bug.cgi?id=181745
1430
1431         CSS ellipse() should only accept 0 or 2 radii.
1432         The corresponding csswg discussion is
1433         https://github.com/w3c/csswg-drafts/issues/2175.
1434
1435         Reviewed by Antti Koivisto.
1436
1437         Tests: imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-computed.html
1438                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-invalid.html
1439                imported/w3c/web-platform-tests/css/css-masking/parsing/clip-path-valid.html
1440                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-computed.html
1441                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-invalid.html
1442                imported/w3c/web-platform-tests/css/css-masking/parsing/shape-outside-valid.html
1443
1444         * css/CSSBasicShapes.cpp:
1445         (WebCore::CSSBasicShapeEllipse::cssText const):
1446         * css/parser/CSSPropertyParser.cpp:
1447         (WebCore::consumeBasicShapeEllipse):
1448
1449 2019-10-03  Zan Dobersek  <zdobersek@igalia.com>
1450
1451         [Nicosia] Enable runtime checks and triggers for async non-main-frame scrolling
1452         https://bugs.webkit.org/show_bug.cgi?id=202509
1453
1454         Reviewed by Carlos Garcia Campos.
1455
1456         Add build guards that would enable runtime checks of the asynchronous
1457         frame scrolling setting in the ScrollingCoordinator and
1458         RenderLayerCompositor classes for the Nicosia-using ports.
1459
1460         The check in ScrollingCoordinator avoids bailing on coordinating
1461         scrolling for non-main frames when the setting is enabled. The check in
1462         RenderLayerCompositor avoids imposing a requirement for a composition
1463         layer for any non-main frame when the setting is disabled.
1464
1465         * page/scrolling/ScrollingCoordinator.cpp:
1466         (WebCore::ScrollingCoordinator::coordinatesScrollingForFrameView const):
1467         * rendering/RenderLayerCompositor.cpp:
1468         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
1469
1470 2019-10-02  Antti Koivisto  <antti@apple.com>
1471
1472         [CSS Shadow Parts] Support multiple arguments for ::part()
1473         https://bugs.webkit.org/show_bug.cgi?id=202482
1474
1475         Reviewed by Ryosuke Niwa.
1476
1477         Support ::part(foo bar).
1478
1479         * css/CSSSelector.cpp:
1480         (WebCore::CSSSelector::selectorText const):
1481         (WebCore::CSSSelector::setArgumentList):
1482         (WebCore::CSSSelector::setLangArgumentList): Deleted.
1483
1484         Give this a more generic name and use it for ::part() too.
1485
1486         * css/CSSSelector.h:
1487         (WebCore::CSSSelector::argumentList const):
1488         (WebCore::CSSSelector::langArgumentList const): Deleted.
1489         * css/SelectorChecker.cpp:
1490         (WebCore::SelectorChecker::checkOne const):
1491
1492         Match only if all parts are found from the element 'part' attribute.
1493
1494         * css/parser/CSSParserSelector.cpp:
1495         (WebCore::CSSParserSelector::setArgumentList):
1496         (WebCore::CSSParserSelector::setLangArgumentList): Deleted.
1497         * css/parser/CSSParserSelector.h:
1498         * css/parser/CSSSelectorParser.cpp:
1499         (WebCore::CSSSelectorParser::consumePseudo):
1500
1501         Parse the list.
1502
1503         * cssjit/SelectorCompiler.cpp:
1504         (WebCore::SelectorCompiler::addPseudoClassType):
1505
1506 2019-10-02  Andy Estes  <aestes@apple.com>
1507
1508         [iOS] When hit testing for a context menu interaction, do not consider whether the element is contenteditable
1509         https://bugs.webkit.org/show_bug.cgi?id=202498
1510         <rdar://problem/54723131>
1511
1512         Reviewed by Tim Horton.
1513
1514         When the user selects a context menu action, WebKit performs a hit test in order to find the
1515         acted-on element on the page. This is separate from the hit test performed to generate the
1516         context menu's targeted preview. Since an arbitrary amount of time can elapse between
1517         preview generation and action selection, this second hit-tests might return a different
1518         element.
1519
1520         One case where we know a different element can be returned is in apps that dynamically
1521         enable and disable editing. If editing is disabled when the first hit test occurs but is
1522         enabled when the second one occurs, different elements will be returned due to
1523         Frame::qualifyingNodeAtViewportLocation preferring to return the root editable element when
1524         the approximate node is contenteditable.
1525
1526         While the appropriate long-term fix is to only hit-test once and use that element for both
1527         preview generation and action selection, this patch implements a short-term fix to address
1528         the specific problem in rdar://problem/54723131 by disabling the contenteditable behavior
1529         described above for context menu interaction hit testing.
1530
1531         The long-term fix is tracked by <https://webkit.org/b/202499>.
1532
1533         * page/Frame.h:
1534         * page/ios/FrameIOS.mm:
1535         (WebCore::Frame::qualifyingNodeAtViewportLocation):
1536         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
1537         (WebCore::ancestorRespondingToClickEventsNodeQualifier):
1538         (WebCore::Frame::nodeRespondingToClickEvents):
1539         (WebCore::Frame::nodeRespondingToDoubleClickEvent):
1540         (WebCore::Frame::nodeRespondingToInteraction):
1541         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
1542
1543 2019-10-02  Antti Koivisto  <antti@apple.com>
1544
1545         [CSS Shadow Parts] Basic ::part() pseudo element support
1546         https://bugs.webkit.org/show_bug.cgi?id=202456
1547
1548         Reviewed by Ryosuke Niwa.
1549
1550         Implement basic parsing and selector matching for ::part() pseudo element.
1551
1552         * css/CSSSelector.cpp:
1553         (WebCore::CSSSelector::pseudoId):
1554         (WebCore::CSSSelector::parsePseudoElementType):
1555         (WebCore::CSSSelector::selectorText const):
1556         * css/CSSSelector.h:
1557         * css/ElementRuleCollector.cpp:
1558         (WebCore::ElementRuleCollector::matchAuthorRules):
1559         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
1560         * css/ElementRuleCollector.h:
1561         * css/RuleSet.cpp:
1562         (WebCore::RuleSet::addRule):
1563         * css/RuleSet.h:
1564         (WebCore::RuleSet::partPseudoElementRules const):
1565         * css/SelectorChecker.cpp:
1566         (WebCore::SelectorChecker::checkOne const):
1567         * css/SelectorPseudoElementTypeMap.in:
1568         * css/parser/CSSParserSelector.cpp:
1569         (WebCore::CSSParserSelector::parsePseudoElementSelector):
1570
1571         Also added ::slotted to SelectorPseudoElementTypeMap.in to resolve a FIXME here.
1572
1573         * css/parser/CSSParserSelector.h:
1574         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):
1575         * css/parser/CSSSelectorParser.cpp:
1576         (WebCore::isOnlyPseudoElementFunction):
1577         (WebCore::CSSSelectorParser::consumePseudo):
1578
1579         Parse single values only, multipart ::part(foo bar) case is not yet handled.
1580
1581         * dom/Element.cpp:
1582         (WebCore::Element::partNames const):
1583
1584 2019-10-02  Antoine Quint  <graouts@apple.com>
1585
1586         Adopt copyToVector() in AnimationTimeline::animationsForElement()
1587         https://bugs.webkit.org/show_bug.cgi?id=202488
1588
1589         Reviewed by Wenson Hsieh.
1590
1591         * animation/AnimationTimeline.cpp:
1592         (WebCore::AnimationTimeline::animationsForElement const):
1593
1594 2019-10-02  Thibault Saunier  <tsaunier@igalia.com>
1595
1596         [GStreamer] Let playbin handle redirects for us when appropriate
1597         https://bugs.webkit.org/show_bug.cgi?id=195326
1598
1599         A simplified mechanism has been added in GStreamer to handle corner cases.
1600
1601         Reviewed by Xabier Rodriguez-Calvar.
1602
1603         Not easily testable at our level
1604
1605         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1606         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1607
1608 2019-10-02  Tim Horton  <timothy_horton@apple.com>
1609
1610         Another build fix
1611
1612         * css/typedom/TypedOMCSSImageValue.cpp:
1613         (WebCore::TypedOMCSSImageValue::TypedOMCSSImageValue):
1614         * css/typedom/TypedOMCSSImageValue.h:
1615         I feel like I am actively being thwarted.
1616
1617 2019-10-02  Tim Horton  <timothy_horton@apple.com>
1618
1619         Another build fix
1620
1621         * css/typedom/TypedOMCSSImageValue.h:
1622
1623 2019-10-02  Tim Horton  <timothy_horton@apple.com>
1624
1625         Try to fix the Windows build
1626
1627         * css/typedom/TypedOMCSSImageValue.cpp:
1628         (WebCore::TypedOMCSSImageValue::document const):
1629         * css/typedom/TypedOMCSSImageValue.h:
1630         Out-of-line this instead of including Document.h in TypedOMCSSImageValue,
1631         which was an earlier build fix from r250610.
1632
1633         * platform/graphics/cg/GradientCG.cpp:
1634         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
1635         * platform/graphics/win/GraphicsContextCGWin.cpp:
1636         Try to fix the build.
1637
1638 2019-10-02  Keith Rollin  <krollin@apple.com>
1639
1640         Unreviewed build fix after r250595.
1641
1642         macCatalyst appears to have triggered the the problem where the build
1643         can sometimes fail if the unified sources mechanism doesn't group
1644         together the right set of files.
1645
1646         * css/typedom/TypedOMCSSImageValue.h:
1647
1648 2019-10-02  Antoine Quint  <graouts@apple.com>
1649
1650         [Web Animations] Implement replaced animations
1651         https://bugs.webkit.org/show_bug.cgi?id=202190
1652         <rdar://55697719>
1653
1654         Reviewed by Dean Jackson.
1655
1656         Implementing section "5.5 Replacing Animations" (https://drafts.csswg.org/web-animations/#replacing-animations) of the Web Animations
1657         specification which allows for Web Animations to be destroyed when they are superseded by another animation and the developer doesn't
1658         explicitly opt into persisting them using the persist() method.
1659
1660         An animation is marked as replaceable (to sum up) when it's finished and another animation for the same property takes precedence.
1661         As part of DocumentTimeline::internalUpdateAnimationsAndSendEvents(), we'll go through all replaceable animations, dispatch a "remove"
1662         DOM event, and remove them from our list of animations.
1663
1664         We also make a couple of fixes in this patch that were uncovered while working on the WPT tests for replaced animations:
1665         
1666         - we would incorrectly parse single values for a property that allows lists (change in KeyframeEffect's processKeyframeLikeObject())
1667         - we didn't account for the position in the global animation list when sorted animations by composite order (AnimationTimeline::animationsForElement())
1668
1669         Finally, to get more readable results, we implement a stub of commitStyles(). Its full implementation is tracked by http://wkb.ug/202193.
1670
1671         * animation/AnimationTimeline.cpp:
1672         (WebCore::AnimationTimeline::animationTimingDidChange): Mark the position of the animation in the global animation list, to which it may only be added once.
1673         (WebCore::AnimationTimeline::animationsForElement const): Account for the animation's position in the global animation when sorting.
1674         * animation/DeclarativeAnimation.cpp:
1675         (WebCore::DeclarativeAnimation::bindingsReplaceState const): Flush pending styles when querying the ready state for a declarative animation.
1676         * animation/DeclarativeAnimation.h:
1677         * animation/DocumentTimeline.cpp:
1678         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Run the "remove replaced animations" procedure as the second step in the "update animations
1679         and send events" procedure.
1680         (WebCore::DocumentTimeline::animationCanBeRemoved): Determine whether a given animation may be removed based on its finished state, replace state and whether
1681         it is fully superseded by another animation targeting the same property on the same target element.
1682         (WebCore::DocumentTimeline::removeReplacedAnimations): Remove any removable animation and dispatch a "remove" DOM event for each removed animation. 
1683         * animation/DocumentTimeline.h:
1684         * animation/KeyframeEffect.cpp:
1685         (WebCore::processKeyframeLikeObject): Fix an issue found in a replaced animations WPT test that showed that we didn't record the value of an animation that allows lists.
1686         * animation/WebAnimation.cpp:
1687         (WebCore::WebAnimation::isReplaceable const):
1688         (WebCore::WebAnimation::persist): Mark the replace state as "persisted" and ensure the animation is set on the animation list for its target element in case it had already
1689         been removed based on its persisted state.
1690         (WebCore::WebAnimation::commitStyles): Stub for a new function.
1691         * animation/WebAnimation.h:
1692         (WebCore::WebAnimation::replaceState const):
1693         (WebCore::WebAnimation::setReplaceState):
1694         (WebCore::WebAnimation::bindingsReplaceState const):
1695         (WebCore::WebAnimation::globalPosition const):
1696         (WebCore::WebAnimation::setGlobalPosition):
1697         * animation/WebAnimation.idl:
1698         * dom/EventNames.h: Add the new "remove" event so that the "onremove" DOM property is available on Animation objects. 
1699
1700 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
1701
1702         Unreviewed build fix in Nicosia's ScrollingTreePositionedNode class.
1703
1704         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
1705         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1706         Fix the name of the variable included in the log call.
1707
1708 2019-10-02  youenn fablet  <youenn@apple.com>
1709
1710         Use strongly typed identifiers for webrtc sockets
1711         https://bugs.webkit.org/show_bug.cgi?id=202400
1712
1713         Reviewed by Chris Dumez.
1714
1715         No observable change of behavior.
1716
1717         * Headers.cmake:
1718         * WebCore.xcodeproj/project.pbxproj:
1719         * platform/mediastream/libwebrtc/LibWebRTCSocketIdentifier.h: Copied from Source/WebKit/NetworkProcess/webrtc/NetworkRTCSocket.h.
1720
1721 2019-10-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1722
1723         [GTK][WPE] Stop using legacy custom protocol implementation
1724         https://bugs.webkit.org/show_bug.cgi?id=202407
1725
1726         Reviewed by Žan Doberšek.
1727
1728         Remove the code to setup custom protocols in soup session.
1729
1730         * platform/network/soup/SoupNetworkSession.cpp:
1731         (WebCore::SoupNetworkSession::SoupNetworkSession):
1732         * platform/network/soup/SoupNetworkSession.h:
1733
1734 2019-10-02  Zan Dobersek  <zdobersek@igalia.com>
1735
1736         [Nicosia] Enable async scrolling at build-time for Nicosia-using ports
1737         https://bugs.webkit.org/show_bug.cgi?id=202397
1738
1739         Reviewed by Carlos Garcia Campos.
1740
1741         * PlatformPlayStation.cmake: Add missing build targets.
1742         * SourcesGTK.txt: Ditto.
1743
1744 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1745
1746         Clean up some includes to make the build a bit faster
1747         https://bugs.webkit.org/show_bug.cgi?id=202444
1748
1749         Reviewed by Geoff Garen.
1750
1751         No new tests, just reorganizing.
1752
1753         Apply some profile-guided optimizations to our headers.
1754
1755         * bindings/js/CallTracerTypes.h:
1756         * css/typedom/TypedOMCSSImageValue.h:
1757         * html/canvas/WebGLObject.h:
1758         * html/canvas/WebGLVertexArrayObjectBase.h:
1759         * inspector/InspectorInstrumentation.cpp:
1760         (WebCore::InspectorInstrumentation::instrumentingAgentsForWebGPUDevice):
1761         (WebCore::InspectorInstrumentation::instrumentingAgentsForWorkerGlobalScope):
1762         (WebCore::InspectorInstrumentation::instrumentingAgentsForPage):
1763         (WebCore::InspectorInstrumentation::instrumentingAgentsForContext):
1764         * inspector/InspectorInstrumentation.h:
1765         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice):
1766         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice):
1767         (WebCore::InspectorInstrumentation::didCreateWebGPUPipeline):
1768         * platform/graphics/BitmapImage.cpp:
1769         * platform/graphics/Font.h:
1770         * platform/graphics/cg/GraphicsContextCG.cpp:
1771         (WebCore::getUserToBaseCTM):
1772         * platform/graphics/cg/GraphicsContextCG.h:
1773         (WebCore::getUserToBaseCTM): Deleted.
1774         * platform/graphics/cg/ImageBufferCG.cpp:
1775         * platform/graphics/cocoa/IOSurface.h:
1776         * platform/graphics/mac/PDFDocumentImageMac.mm:
1777         InspectorInstrumentation.h is one of the most expensive headers in the entire project.
1778         While not included in many places (70), it is fairly straightforward to reduce
1779         its per-inclusion cost by rougly 80%.
1780
1781 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1782
1783         Progress towards a functioning CMake build on Mac
1784         https://bugs.webkit.org/show_bug.cgi?id=202443
1785
1786         Rubber-stamped by Tim Horton.
1787
1788         * testing/Internals.mm:
1789
1790 2019-10-01  John Wilander  <wilander@apple.com>
1791
1792         Storage Access API: document.hasStorageAccess() should return true when the cookie policy allows access
1793         https://bugs.webkit.org/show_bug.cgi?id=202435
1794         <rdar://problem/55718526>
1795
1796         Reviewed by Brent Fulgham.
1797
1798         WebKit's Storage Access API implementation has so far only looked at whether ITP is
1799         blocking cookie access or not. However, the default cookie policy is still in
1800         effect underneath ITP. document.hasStorageAccess() should return true if the
1801         third-party:
1802         a) is not classified by ITP, and
1803         b) has cookies which implies it can use cookies as third-party according to the
1804         default cookie policy.
1805
1806         Tests: http/tests/storageAccess/has-storage-access-false-by-default-ephemeral.html
1807                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies-ephemeral.html
1808                http/tests/storageAccess/has-storage-access-true-if-third-party-has-cookies.html
1809
1810         * platform/network/NetworkStorageSession.h:
1811         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1812         (WebCore::NetworkStorageSession::hasCookies const):
1813         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1814         (WebCore::NetworkStorageSession::hasCookies const):
1815             Not yet implemented. Always says false.
1816         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1817         (WebCore::NetworkStorageSession::hasCookies const):
1818             Not yet implemented. Always says false.
1819
1820 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1821
1822         Clean up some includes to make the build a bit faster
1823         https://bugs.webkit.org/show_bug.cgi?id=202437
1824
1825         Reviewed by Jer Noble.
1826
1827         * Modules/webaudio/PannerNode.h:
1828         * Modules/webaudio/RealtimeAnalyser.h:
1829         * platform/audio/HRTFPanner.h:
1830         FFTFrame includes Accelerate.h, which is quite expensive.
1831
1832 2019-10-01  Antti Koivisto  <antti@apple.com>
1833
1834         [CSS Shadow Parts] Parse 'part' attribute
1835         https://bugs.webkit.org/show_bug.cgi?id=202409
1836
1837         Reviewed by Ryosuke Niwa.
1838
1839         Add parsing for Element 'part' attribute and the IDL interface.
1840         Also add a feature flag for CSS Shadow Parts.
1841
1842         * dom/Element.cpp:
1843         (WebCore::Element::attributeChanged):
1844         (WebCore::isNonEmptyTokenList):
1845         (WebCore::Element::classAttributeChanged):
1846         (WebCore::Element::partAttributeChanged):
1847         (WebCore::Element::partNames const):
1848         (WebCore::Element::part):
1849         (WebCore::classStringHasClassName): Deleted.
1850         * dom/Element.h:
1851         * dom/Element.idl:
1852         * dom/ElementRareData.cpp:
1853         * dom/ElementRareData.h:
1854         (WebCore::ElementRareData::partList const):
1855         (WebCore::ElementRareData::setPartList):
1856         (WebCore::ElementRareData::partNames const):
1857         (WebCore::ElementRareData::setPartNames):
1858         * html/HTMLAttributeNames.in:
1859         * page/RuntimeEnabledFeatures.h:
1860         (WebCore::RuntimeEnabledFeatures::setCSSShadowPartsEnabled):
1861         (WebCore::RuntimeEnabledFeatures::cssShadowPartsEnabled const):
1862
1863 2019-10-01  Yusuke Suzuki  <ysuzuki@apple.com>
1864
1865         [JSC] Place VM* in TLS
1866         https://bugs.webkit.org/show_bug.cgi?id=202391
1867
1868         Reviewed by Mark Lam.
1869
1870         Use JSLockHolder instead. It automatically puts VM* in TLS.
1871
1872         * bindings/js/IDBBindingUtilities.cpp:
1873         (WebCore::toJS):
1874         (WebCore::deserializeIDBValueToJSValue):
1875
1876 2019-10-01  youenn fablet  <youenn@apple.com>
1877
1878         Queue events and promise resolution in RTCPeerConnection when suspended for page cache
1879         https://bugs.webkit.org/show_bug.cgi?id=202396
1880
1881         Reviewed by Chris Dumez.
1882
1883         This patch prepares RTCPeerConnection to be suspendable to enter page cache.
1884         For that purpose, we queue events and promise resolution/rejection tasks if the RTCPeerConnection m_shouldDelayTasks is set to true.
1885         This queueing is enabled when RTCPeerConnection is asked to suspend itself.
1886         The queued tasks are then executed at resume time.
1887         Renamed fireEvent to dispatchEventWhenFeasible.
1888         No change of behavior for now.
1889
1890         * Modules/mediastream/PeerConnectionBackend.cpp:
1891         (WebCore::PeerConnectionBackend::createOfferSucceeded):
1892         (WebCore::PeerConnectionBackend::createOfferFailed):
1893         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
1894         (WebCore::PeerConnectionBackend::createAnswerFailed):
1895         (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
1896         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
1897         (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
1898         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
1899         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1900         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1901         * Modules/mediastream/RTCPeerConnection.cpp:
1902         (WebCore::RTCPeerConnection::doClose):
1903         (WebCore::RTCPeerConnection::suspend):
1904         (WebCore::RTCPeerConnection::resume):
1905         (WebCore::RTCPeerConnection::updateIceGatheringState):
1906         (WebCore::RTCPeerConnection::updateIceConnectionState):
1907         (WebCore::RTCPeerConnection::updateConnectionState):
1908         (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
1909         (WebCore::RTCPeerConnection::doTask):
1910         (WebCore::RTCPeerConnection::fireEvent):
1911         * Modules/mediastream/RTCPeerConnection.h:
1912
1913 2019-10-01  Brent Fulgham  <bfulgham@apple.com>
1914
1915         [FTW] Correct additional canvas test failures
1916         https://bugs.webkit.org/show_bug.cgi?id=202388
1917
1918         Reviewed by Fujii Hironori.
1919
1920         This patch corrects a handful of errors in Direct2D's drawing code.
1921
1922         * platform/graphics/win/Direct2DOperations.cpp:
1923         (WebCore::Direct2D::clearRect): Use the transformed dimensions of
1924         rects to determine whether they intersect with the render target.
1925         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1926         (WebCore::ImageBufferData::copyRectFromData const):
1927         (WebCore::ImageBufferData::loadDataToBitmapIfNeeded): It is not
1928         necessary (or correct) to 'endDraw' when loading image data to the
1929         Bitmap target.
1930         * platform/graphics/win/PathDirect2D.cpp:
1931         (WebCore::Path::strokeBoundingRect const): Provide an implementation.
1932
1933 2019-10-01  Alex Christensen  <achristensen@webkit.org>
1934
1935         Progress towards successful CMake build on Mac
1936         https://bugs.webkit.org/show_bug.cgi?id=202426
1937
1938         Rubber-stamped by Tim Horton.
1939
1940         * PlatformMac.cmake:
1941
1942 2019-10-01  Tim Horton  <timothy_horton@apple.com>
1943
1944         Clean up some includes to make the build a bit faster
1945         https://bugs.webkit.org/show_bug.cgi?id=202417
1946
1947         Reviewed by Jer Noble.
1948
1949         No new tests, just reorganizing.
1950
1951         Apply some profile-guided optimizations to our headers.
1952
1953         * Modules/mediasource/SourceBuffer.cpp:
1954         * WebCorePrefix.h:
1955         Add HashMap, which ends up included in all source files.
1956
1957         * html/HTMLImageElement.cpp:
1958         (WebCore::HTMLImageElement::HTMLImageElement):
1959         (WebCore::HTMLImageElement::selectImageSource):
1960         (WebCore::HTMLImageElement::didAttachRenderers):
1961         (WebCore::HTMLImageElement::insertedIntoAncestor):
1962         (WebCore::HTMLImageElement::width):
1963         (WebCore::HTMLImageElement::height):
1964         (WebCore::HTMLImageElement::naturalWidth const):
1965         (WebCore::HTMLImageElement::naturalHeight const):
1966         (WebCore::HTMLImageElement::complete const):
1967         (WebCore::HTMLImageElement::decode):
1968         (WebCore::HTMLImageElement::didMoveToNewDocument):
1969         (WebCore::HTMLImageElement::cachedImage const):
1970         (WebCore::HTMLImageElement::setLoadManually):
1971         (WebCore::HTMLImageElement::hasPendingActivity const):
1972         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const):
1973         * html/HTMLImageElement.h:
1974         (WebCore::HTMLImageElement::cachedImage const): Deleted.
1975         (WebCore::HTMLImageElement::setLoadManually): Deleted.
1976         (WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
1977         (WebCore::HTMLImageElement::pendingDecodePromisesCountForTesting const): Deleted.
1978         HTMLImageLoader brings in JSDOMPromiseDeferred, which is known to be horribly expensive.
1979         Out-of-line m_imageLoader.
1980
1981         * platform/graphics/GraphicsLayer.h:
1982         Swap Animation for TimingFunction, which is much smaller.
1983
1984         * platform/graphics/MediaPlayer.h:
1985         InbandTextTrackPrivate brings in SerializedPlatformRepresentation.h,
1986         which is very expensive. MediaPlayer.h is included in many places.
1987         Break the link.
1988
1989         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1990
1991 2019-10-01  youenn fablet  <youenn@apple.com>
1992
1993         RTCDataChannel should not prevent entering page cache except if in open state
1994         https://bugs.webkit.org/show_bug.cgi?id=202395
1995
1996         Reviewed by Chris Dumez.
1997
1998         Only prevent entering page cache in open state.
1999         Enqueue message through the document event queue to handle suspension properly.
2000
2001         We cannot yet write page cache tests as a data channel requires a peer connection which
2002         currently forbids entering page cache.
2003
2004         * Modules/mediastream/RTCDataChannel.cpp:
2005         (WebCore::RTCDataChannel::RTCDataChannel):
2006         (WebCore::RTCDataChannel::didReceiveStringData):
2007         (WebCore::RTCDataChannel::didReceiveRawData):
2008         (WebCore::RTCDataChannel::didDetectError):
2009         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
2010         (WebCore::RTCDataChannel::scheduleDispatchEvent):
2011         (WebCore::RTCDataChannel::scheduledEventTimerFired): Deleted.
2012         * Modules/mediastream/RTCDataChannel.h:
2013
2014 2019-10-01  Rob Buis  <rbuis@igalia.com>
2015
2016         [Mac] Layout Test imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html fails
2017         https://bugs.webkit.org/show_bug.cgi?id=202350
2018
2019         Reviewed by Alex Christensen.
2020
2021         In some cases didReceiveResponse will deliver redirects (normally willSendRequestInternal will be used for redirects).
2022         When this is done in manual redirect mode make sure the response type is opaque redirect.
2023
2024         Test: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-location.any.html
2025
2026         * loader/SubresourceLoader.cpp:
2027         (WebCore::SubresourceLoader::didReceiveResponse):
2028
2029 2019-10-01  Keith Rollin  <krollin@apple.com>
2030
2031         Remove some support for < iOS 13
2032         https://bugs.webkit.org/show_bug.cgi?id=202386
2033         <rdar://problem/55863017>
2034
2035         Reviewed by Eric Carlson.
2036
2037         Remove some support for iOS versions less than 13.0.
2038
2039         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
2040         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
2041         values >= 130000. This means that expressions like
2042         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101300" are always False and
2043         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101300" are always True.
2044
2045         This removal is part of a series of patches effecting the removal of
2046         dead code for old versions of iOS. This particular pass involves
2047         changes in which Jer Noble was involved. These changes are isolated
2048         from other similar changes in order to facilitate the reviewing
2049         process.
2050
2051         No new tests -- no new or changed functionality.
2052
2053         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2054         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
2055         (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
2056
2057 2019-10-01  Chris Dumez  <cdumez@apple.com>
2058
2059         Unreviewed attempt to fix Windows build after r250527.
2060
2061         * dom/GenericEventQueue.cpp:
2062         (WebCore::TaskQueueConstructor::construct):
2063         (WebCore::TaskQueueConstructor<Timer>::construct):
2064         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
2065         (WebCore::GenericEventQueueBase<T>::close):
2066         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
2067         (WebCore::GenericEventQueueBase<T>::setPaused):
2068         (WebCore::GenericEventQueueBase<T>::suspend):
2069         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
2070         * dom/GenericEventQueue.h:
2071         * platform/GenericTaskQueue.h:
2072
2073 2019-10-01  Alex Christensen  <achristensen@webkit.org>
2074
2075         Fix internal build after r250549
2076         https://bugs.webkit.org/show_bug.cgi?id=202390
2077
2078         There is an internal #define confirm on some systems, so rename DOMWindow::confirm to DOMWindow::confirmForBindings.
2079
2080         * page/DOMWindow.cpp:
2081         (WebCore::DOMWindow::confirmForBindings):
2082         (WebCore::DOMWindow::confirm): Deleted.
2083         * page/DOMWindow.h:
2084         * page/DOMWindow.idl:
2085
2086 2019-10-01  Chris Dumez  <cdumez@apple.com>
2087
2088         Unreviewed attempt to fix Windows build after r250527.
2089
2090         * platform/GenericTaskQueue.h:
2091
2092 2019-10-01  Zan Dobersek  <zdobersek@igalia.com>
2093
2094         [CoordGraphics] Implement sync methods for position, bounds origin
2095         https://bugs.webkit.org/show_bug.cgi?id=202398
2096
2097         Reviewed by Carlos Garcia Campos.
2098
2099         Add the CoordinatedGraphicsLayer::syncPosition() and
2100         CoordinatedGraphicsLayer::syncBoundsOrigin() method overrides, both
2101         performing a synchronization of the given GraphicsLayer attribute.
2102
2103         These methods are used by the scrolling code to reflect changes in these
2104         attributes without causing a layer flush (which is not necessary since
2105         the changes have already been applied in an equivalent way).
2106
2107         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2108         (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
2109         (WebCore::CoordinatedGraphicsLayer::syncPosition):
2110         (WebCore::CoordinatedGraphicsLayer::syncBoundsOrigin):
2111         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2112
2113 2019-10-01  Joonghun Park  <jh718.park@samsung.com>
2114
2115         Make table's clientWidth/Height include its border sizes.
2116         https://bugs.webkit.org/show_bug.cgi?id=200974
2117
2118         WebKit doesn't have table wrapper box currently
2119         while Gecko has it,
2120         so this CL tries to mimic the behavior that
2121         clientWidth/Height refers to table wrapper box
2122         which doesn't have borders applied to itself
2123         and table grid box has the borders.
2124
2125         This CL adds table's border sizes
2126         to clientWidth/Height
2127         at |LayoutBox::PixelSnappedClientWidth/Height|.
2128
2129         As a result of this CL, table's clientWidth/Height
2130         and offsetWidth/Height are equal now, respectively.
2131
2132         The corresponding csswg discussion is
2133         https://github.com/w3c/csswg-drafts/issues/4245.
2134
2135         Reviewed by Antti Koivisto.
2136
2137         Tests: fast/table/border-collapsing/bug236727.html
2138                imported/w3c/web-platform-tests/css/cssom-view/table-border-collapse-client-width-height.html
2139                imported/w3c/web-platform-tests/css/cssom-view/table-border-separate-client-width-height.html
2140                imported/w3c/web-platform-tests/css/cssom-view/table-with-border-client-width-height.html
2141
2142         * dom/Element.cpp:
2143         (WebCore::Element::clientWidth):
2144         (WebCore::Element::clientHeight):
2145
2146 2019-10-01  youenn fablet  <youenn@apple.com>
2147
2148         Remove races condition when validating capture sandbox extension revocation
2149         https://bugs.webkit.org/show_bug.cgi?id=202133
2150         <rdar://problem/55660905>
2151
2152         Reviewed by Eric Carlson.
2153
2154         Covered by existing tests.
2155
2156         * Modules/mediastream/MediaStreamTrack.cpp:
2157         (WebCore::MediaStreamTrack::endCapture):
2158         Synchronously update document media state when capture is ended.
2159         This allows to validate the fact that no document is capturing while we revoke sandbox extensions.
2160
2161 2019-10-01  youenn fablet  <youenn@apple.com>
2162
2163         MediaDevices should be SecureContext
2164         https://bugs.webkit.org/show_bug.cgi?id=202267
2165
2166         Reviewed by Eric Carlson.
2167
2168         Manually tested since 127.0.0.1/localhost are secure contexts.
2169
2170         * Modules/mediastream/MediaDevices.idl:
2171         * bindings/js/WebCoreBuiltinNames.h:
2172
2173 2019-09-30  Alex Christensen  <achristensen@webkit.org>
2174
2175         Resurrect Mac CMake build
2176         https://bugs.webkit.org/show_bug.cgi?id=202384
2177
2178         Rubber-stamped by Tim Horton.
2179
2180         * PlatformMac.cmake:
2181
2182 2019-09-30  Chris Dumez  <cdumez@apple.com>
2183
2184         Make GenericEventQueue an ActiveDOMObject
2185         https://bugs.webkit.org/show_bug.cgi?id=202373
2186
2187         Reviewed by Eric Carlson.
2188
2189         Make GenericEventQueue an ActiveDOMObject so that it is guaranteed to never fire any events while
2190         suspended without requiring the client to explicitly suspend/resume the event queue.
2191
2192         * Modules/encryptedmedia/MediaKeySession.cpp:
2193         (WebCore::MediaKeySession::MediaKeySession):
2194         (WebCore::MediaKeySession::enqueueMessage):
2195         (WebCore::MediaKeySession::updateKeyStatuses):
2196         * Modules/encryptedmedia/MediaKeySession.h:
2197         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2198         (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
2199         (WebCore::WebKitMediaKeySession::~WebKitMediaKeySession):
2200         (WebCore::WebKitMediaKeySession::addKeyTimerFired):
2201         (WebCore::WebKitMediaKeySession::sendMessage):
2202         (WebCore::WebKitMediaKeySession::sendError):
2203         (WebCore::WebKitMediaKeySession::hasPendingActivity const):
2204         (WebCore::WebKitMediaKeySession::stop):
2205         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
2206         * Modules/mediasource/MediaSource.cpp:
2207         (WebCore::MediaSource::MediaSource):
2208         (WebCore::MediaSource::hasPendingActivity const):
2209         (WebCore::MediaSource::stop):
2210         (WebCore::MediaSource::canSuspendForDocumentSuspension const):
2211         (WebCore::MediaSource::scheduleEvent):
2212         * Modules/mediasource/MediaSource.h:
2213         * Modules/mediasource/SourceBuffer.cpp:
2214         (WebCore::SourceBuffer::SourceBuffer):
2215         (WebCore::SourceBuffer::hasPendingActivity const):
2216         (WebCore::SourceBuffer::stop):
2217         (WebCore::SourceBuffer::scheduleEvent):
2218         * Modules/mediasource/SourceBuffer.h:
2219         * Modules/mediasource/SourceBufferList.cpp:
2220         (WebCore::SourceBufferList::SourceBufferList):
2221         (WebCore::SourceBufferList::scheduleEvent):
2222         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
2223         * Modules/mediasource/SourceBufferList.h:
2224         * Modules/webaudio/AudioContext.cpp:
2225         (WebCore::AudioContext::AudioContext):
2226         (WebCore::AudioContext::stop):
2227         * Modules/webaudio/AudioContext.h:
2228         * animation/DeclarativeAnimation.cpp:
2229         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
2230         (WebCore::DeclarativeAnimation::tick):
2231         (WebCore::DeclarativeAnimation::needsTick const):
2232         (WebCore::DeclarativeAnimation::remove):
2233         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
2234         (WebCore::DeclarativeAnimation::stop):
2235         (WebCore::DeclarativeAnimation::suspend):
2236         (WebCore::DeclarativeAnimation::resume):
2237         * animation/DeclarativeAnimation.h:
2238         * dom/GenericEventQueue.cpp:
2239         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
2240         (WebCore::GenericEventQueueBase<T>::setPaused):
2241         (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const):
2242         (WebCore::GenericEventQueueBase<T>::suspend):
2243         (WebCore::GenericEventQueueBase<T>::resume):
2244         (WebCore::GenericEventQueueBase<T>::rescheduleAllEventsIfNeeded):
2245         (WebCore::GenericEventQueueBase<T>::stop):
2246         (WebCore::GenericEventQueueBase<T>::activeDOMObjectName const):
2247         (WebCore::GenericEventQueue::create):
2248         (WebCore::MainThreadGenericEventQueue::create):
2249         * dom/GenericEventQueue.h:
2250         * dom/MessagePort.cpp:
2251         (WebCore::MessagePort::MessagePort):
2252         (WebCore::MessagePort::close):
2253         (WebCore::MessagePort::dispatchMessages):
2254         * dom/MessagePort.h:
2255         * html/HTMLMediaElement.cpp:
2256         (WebCore::HTMLMediaElement::HTMLMediaElement):
2257         (WebCore::HTMLMediaElement::~HTMLMediaElement):
2258         (WebCore::HTMLMediaElement::scheduleEvent):
2259         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2260         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
2261         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
2262         (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
2263         (WebCore::HTMLMediaElement::closeTaskQueues):
2264         (WebCore::HTMLMediaElement::suspend):
2265         (WebCore::HTMLMediaElement::resume):
2266         (WebCore::HTMLMediaElement::hasPendingActivity const):
2267         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
2268         * html/HTMLMediaElement.h:
2269         * html/track/TrackListBase.cpp:
2270         (WebCore::TrackListBase::TrackListBase):
2271         (WebCore::TrackListBase::scheduleTrackEvent):
2272         (WebCore::TrackListBase::scheduleChangeEvent):
2273         (WebCore::TrackListBase::isChangeEventScheduled const):
2274         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
2275         * html/track/TrackListBase.h:
2276         * workers/Worker.cpp:
2277         (WebCore::Worker::Worker):
2278         (WebCore::Worker::terminate):
2279         (WebCore::Worker::stop):
2280         (WebCore::Worker::hasPendingActivity const):
2281         (WebCore::Worker::enqueueEvent):
2282         (WebCore::Worker::dispatchEvent):
2283         * workers/Worker.h:
2284         * workers/service/ServiceWorkerContainer.cpp:
2285         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
2286         (WebCore::ServiceWorkerContainer::startMessages):
2287         (WebCore::ServiceWorkerContainer::postMessage):
2288         (WebCore::ServiceWorkerContainer::stop):
2289         * workers/service/ServiceWorkerContainer.h:
2290
2291 2019-09-30  Chris Dumez  <cdumez@apple.com>
2292
2293         IDBTransaction / IDBObjectStore should not prevent a page from entering the back / forward cache
2294         https://bugs.webkit.org/show_bug.cgi?id=202291
2295         <rdar://problem/55760106>
2296
2297         Reviewed by Geoffrey Garen.
2298
2299         IDBObjectStore does not fire any events and should therefore not cause any problem while in PageCache.
2300         IDBTransaction can only fire abort/complete/error events, all of which are being enqueued to the
2301         DocumentEventQueue. The DocumentEventQueue subclasses SuspendableTimer which will correctly suspend
2302         while the document is in page cache. IDBTransaction will therefore not cause events to fire (and JS
2303         to run) while in page cache.
2304
2305         Test: storage/indexeddb/IDBTransaction-page-cache.html
2306
2307         * Modules/indexeddb/IDBObjectStore.cpp:
2308         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const):
2309         * Modules/indexeddb/IDBTransaction.cpp:
2310         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const):
2311
2312 2019-09-30  Chris Dumez  <cdumez@apple.com>
2313
2314         Refine restrictions for X-Temp-Tablet HTTP header experiment
2315         https://bugs.webkit.org/show_bug.cgi?id=202367
2316         <rdar://problem/55849139>
2317
2318         Reviewed by Geoffrey Garen.
2319
2320         Refine restrictions for X-Temp-Tablet HTTP header experiment:
2321         1. Only send the header if the embedding application is MobileSafari.
2322         2. Only send the header if the first party is google.com
2323         3. Only send the header if the current date is before 2/1/2020
2324         4. Send the header even if using an ephemeral session
2325
2326         * loader/cache/CachedResourceLoader.cpp:
2327         (WebCore::isXTempTabletHeaderExperimentOver):
2328         (WebCore::CachedResourceLoader::CachedResourceLoader):
2329         (WebCore::isGoogleSearch):
2330         (WebCore::CachedResourceLoader::shouldSendXTempTabletHeader const):
2331         (WebCore::CachedResourceLoader::requestResource):
2332         * loader/cache/CachedResourceLoader.h:
2333
2334 2019-09-30  Chris Dumez  <cdumez@apple.com>
2335
2336         Pages with Web Workers cannot enter the back / forward cache
2337         https://bugs.webkit.org/show_bug.cgi?id=202296
2338         <rdar://problem/55764073>
2339
2340         Reviewed by Jer Noble.
2341
2342         Allow pages that use Web Workers to enter the back / forward cache.
2343         This involves adding an EventQueue for all event firing on Woker
2344         objects and suspending this EventQueue while in the page cache.
2345
2346         This was preventing some of the pages on weather.com to enter the
2347         back / forward cache.
2348
2349         Test: fast/workers/worker-page-cache.html
2350
2351         * Modules/encryptedmedia/MediaKeySession.h:
2352         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
2353         * Modules/mediasource/MediaSource.h:
2354         * Modules/mediasource/SourceBuffer.h:
2355         * Modules/mediasource/SourceBufferList.h:
2356         * Modules/webaudio/AudioContext.cpp:
2357         (WebCore::AudioContext::AudioContext):
2358         * Modules/webaudio/AudioContext.h:
2359         * animation/DeclarativeAnimation.h:
2360
2361         * dom/GenericEventQueue.cpp:
2362         (WebCore::TaskQueueConstructor::construct):
2363         (WebCore::TaskQueueConstructor<Timer>::construct):
2364         (WebCore::GenericEventQueueBase<T>::GenericEventQueueBase):
2365         (WebCore::GenericEventQueueBase<T>::enqueueEvent):
2366         (WebCore::GenericEventQueueBase<T>::dispatchOneEvent):
2367         (WebCore::GenericEventQueueBase<T>::close):
2368         (WebCore::GenericEventQueueBase<T>::cancelAllEvents):
2369         (WebCore::GenericEventQueueBase<T>::hasPendingEvents const):
2370         (WebCore::GenericEventQueueBase<T>::hasPendingEventsOfType const):
2371         (WebCore::GenericEventQueueBase<T>::suspend):
2372         (WebCore::GenericEventQueueBase<T>::resume):
2373         * dom/GenericEventQueue.h:
2374         (WebCore::GenericEventQueueBase::isSuspended const):
2375         (WebCore::MainThreadGenericEventQueue::MainThreadGenericEventQueue):
2376         (WebCore::GenericEventQueue::GenericEventQueue):
2377         Rename GenericEventQueue to MainThreadGenericEventQueue since its implementation relies
2378         on a global shared Timer to fire events. Introduce a new GenericEventQueue which can
2379         actually be used from any thread. This is useful for MessagePort, which is used both
2380         on the main thread and on worker threads.
2381
2382         * dom/MessagePort.cpp:
2383         (WebCore::MessagePort::MessagePort):
2384         (WebCore::MessagePort::close):
2385         (WebCore::MessagePort::suspend):
2386         (WebCore::MessagePort::resume):
2387         (WebCore::MessagePort::dispatchMessages):
2388         * dom/MessagePort.h:
2389         Use an GenericEventQueue in MessagePort for consistency with Worker.
2390         MessagePort is an ActiveDOMobject which returns true in canSuspend(),
2391         we therefore need to make sure it suspends event firing while
2392         suspended.
2393
2394         * html/HTMLMediaElement.h:
2395         * html/track/TrackListBase.h:
2396         * workers/Worker.cpp:
2397         (WebCore::Worker::Worker):
2398         (WebCore::Worker::terminate):
2399         (WebCore::Worker::canSuspendForDocumentSuspension const):
2400         (WebCore::Worker::suspend):
2401         (WebCore::Worker::resume):
2402         (WebCore::Worker::stop):
2403         (WebCore::Worker::hasPendingActivity const):
2404         (WebCore::Worker::notifyFinished):
2405         (WebCore::Worker::enqueueEvent):
2406         (WebCore::Worker::dispatchEvent):
2407         * workers/Worker.h:
2408         * workers/WorkerMessagingProxy.cpp:
2409         (WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
2410         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
2411
2412 2019-09-27  Keith Rollin  <krollin@apple.com>
2413
2414         Coalesce or remove PLATFORM(MAC) || PLATFORM(IOS_FAMILY)
2415         https://bugs.webkit.org/show_bug.cgi?id=202119
2416         <rdar://problem/55638792>
2417
2418         Unreviewed, address post landing review comments for r248533 from
2419         Darin Adler.
2420
2421         No new tests -- no new or changed functionality.
2422
2423         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2424         (WebCore::convert):
2425         (WebCore::subLocality): Deleted.
2426         (WebCore::setSubLocality): Deleted.
2427         (WebCore::subAdministrativeArea): Deleted.
2428         (WebCore::setSubAdministrativeArea): Deleted.
2429
2430 2019-09-30  Antti Koivisto  <antti@apple.com>
2431
2432         RenderLineBreak should use LineLayoutTraversal
2433         https://bugs.webkit.org/show_bug.cgi?id=202316
2434
2435         Reviewed by Zalan Bujtas.
2436
2437         Replace more path specific code with LineLayoutTraversal.
2438
2439         * Headers.cmake:
2440         * rendering/RenderLineBreak.cpp:
2441         (WebCore::RenderLineBreak::linesBoundingBox const):
2442         (WebCore::RenderLineBreak::absoluteRects const):
2443         (WebCore::RenderLineBreak::absoluteQuads const):
2444         (WebCore::simpleLineLayout): Deleted.
2445         * rendering/RenderTreeAsText.cpp:
2446         (WebCore::RenderTreeAsText::writeRenderObject):
2447         (WebCore::writeTextBox):
2448         * rendering/SimpleLineLayoutFunctions.cpp:
2449         (WebCore::SimpleLineLayout::computeBoundingBox): Deleted.
2450         (WebCore::SimpleLineLayout::collectAbsoluteRects): Deleted.
2451         (WebCore::SimpleLineLayout::rendererForPosition): Deleted.
2452         * rendering/SimpleLineLayoutFunctions.h:
2453         * rendering/line/LineLayoutTraversal.cpp:
2454         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
2455         (WebCore::LineLayoutTraversal::ElementBoxIterator::atEnd const):
2456         (WebCore::LineLayoutTraversal::elementBoxFor):
2457         (WebCore::LineLayoutTraversal::TextBox::rect const): Deleted.
2458         (WebCore::LineLayoutTraversal::TextBox::logicalRect const): Deleted.
2459         (WebCore::LineLayoutTraversal::TextBox::hasHyphen const): Deleted.
2460         (WebCore::LineLayoutTraversal::TextBox::isLeftToRightDirection const): Deleted.
2461         (WebCore::LineLayoutTraversal::TextBox::dirOverride const): Deleted.
2462         (WebCore::LineLayoutTraversal::TextBox::text const): Deleted.
2463         (WebCore::LineLayoutTraversal::TextBox::isLineBreak const): Deleted.
2464         (WebCore::LineLayoutTraversal::TextBox::localStartOffset const): Deleted.
2465         (WebCore::LineLayoutTraversal::TextBox::localEndOffset const): Deleted.
2466         (WebCore::LineLayoutTraversal::TextBox::length const): Deleted.
2467         (WebCore::LineLayoutTraversal::TextBox::isLastOnLine const): Deleted.
2468         (WebCore::LineLayoutTraversal::TextBox::isLast const): Deleted.
2469         (WebCore::LineLayoutTraversal::TextBox::iterator const): Deleted.
2470
2471         Move to header as templates.
2472
2473         * rendering/line/LineLayoutTraversal.h:
2474         (WebCore::LineLayoutTraversal::ElementBoxIterator::ElementBoxIterator):
2475         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator bool const):
2476         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator* const):
2477         (WebCore::LineLayoutTraversal::ElementBoxIterator::operator-> const):
2478
2479         Add a new iterator type for element boxes.
2480         It doesn't currently really iterate, is just allows testing for end.
2481
2482         (WebCore::LineLayoutTraversal::Box<Iterator>::rect const):
2483         (WebCore::LineLayoutTraversal::Box<Iterator>::logicalRect const):
2484         (WebCore::LineLayoutTraversal::Box<Iterator>::isLeftToRightDirection const):
2485         (WebCore::LineLayoutTraversal::Box<Iterator>::dirOverride const):
2486         (WebCore::LineLayoutTraversal::Box<Iterator>::isLineBreak const):
2487         (WebCore::LineLayoutTraversal::Box<Iterator>::iterator const):
2488
2489         Split properties that all inline boxes have out from TextBox.
2490         Make it a template class.
2491
2492         (WebCore::LineLayoutTraversal::TextBox<Iterator>::hasHyphen const):
2493         (WebCore::LineLayoutTraversal::TextBox<Iterator>::text const):
2494         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localStartOffset const):
2495         (WebCore::LineLayoutTraversal::TextBox<Iterator>::localEndOffset const):
2496         (WebCore::LineLayoutTraversal::TextBox<Iterator>::length const):
2497         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLastOnLine const):
2498         (WebCore::LineLayoutTraversal::TextBox<Iterator>::isLast const):
2499
2500         Make a template class.
2501
2502         (WebCore::LineLayoutTraversal::hasTextBoxes): Deleted.
2503
2504 2019-09-30  Rob Buis  <rbuis@igalia.com>
2505
2506         No-Cors check should take into account same-origin
2507         https://bugs.webkit.org/show_bug.cgi?id=202353
2508
2509         Reviewed by Youenn Fablet.
2510
2511         No-Cors check should take into account same-origin, in that case the
2512         check should bail out, since same-origin is already handled in
2513         the first step of [1].
2514
2515         Test: imported/web-platform-tests/fetch/api/redirect/redirect-mode.any.html
2516
2517         [1] https://fetch.spec.whatwg.org/#main-fetch Step 5
2518
2519         * loader/cache/CachedResourceLoader.cpp:
2520         (WebCore::CachedResourceLoader::canRequest):
2521
2522 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
2523
2524         [Nicosia] Complete ScrollingTreeNicosia::createScrollingTreeNode()
2525         https://bugs.webkit.org/show_bug.cgi?id=202358
2526
2527         Reviewed by Carlos Garcia Campos.
2528
2529         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
2530         (WebCore::ScrollingTreeNicosia::createScrollingTreeNode):
2531         Return appropriate objects for the remaining node types.
2532
2533 2019-09-30  Zan Dobersek  <zdobersek@igalia.com>
2534
2535         [Nicosia] Add missing conversion casts for LayerRepresentation objects
2536         https://bugs.webkit.org/show_bug.cgi?id=202357
2537
2538         Reviewed by Carlos Garcia Campos.
2539
2540         After r250491, we have to request explicit conversion of
2541         LayerRepresentation objects to Nicosia::PlatformLayer pointers.
2542
2543         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp:
2544         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2545         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
2546         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
2547         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
2548         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
2549         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp:
2550         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2551         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
2552         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
2553         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
2554         * page/scrolling/nicosia/ScrollingTreePositionedNode.cpp:
2555         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2556         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp:
2557         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2558
2559 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2560
2561         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
2562         https://bugs.webkit.org/show_bug.cgi?id=202256
2563         <rdar://problem/55772092>
2564
2565         Reviewed by Simon Fraser.
2566
2567         Make the scroll container and scrolled contents layer holders
2568         platform-independent by using the LayerRepresentation as the underlying
2569         type for the two member variables in ScrollingTreeScrollingNode.
2570
2571         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2572         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2573         * page/scrolling/ScrollingTreeScrollingNode.h:
2574         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2575         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
2576         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2577         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
2578
2579 2019-09-28  Brent Fulgham  <bfulgham@apple.com>
2580
2581         [FTW] Correct compositing, shadow, and radial gradient implementations
2582         https://bugs.webkit.org/show_bug.cgi?id=202177
2583
2584         Reviewed by Fujii Hironori.
2585
2586         This patch corrects a number of implementation errors in basic Canvas
2587         drawing operations.
2588
2589         Tested by canvas/philip/tests 
2590
2591         * platform/graphics/win/Direct2DOperations.cpp:
2592         (WebCore::Direct2D::State::setCompositeOperation): Initialize blend and
2593         composite modes to correct defaults.
2594         (WebCore::Direct2D::drawWithShadowHelper): Correct value used for blur
2595         standard deviation to more closely match other browser output.
2596         * platform/graphics/win/Direct2DUtilities.cpp:
2597         (WebCore::Direct2D::createBitmapCopyFromContext): Added helper function.
2598         * platform/graphics/win/Direct2DUtilities.h:
2599         * platform/graphics/win/GradientDirect2D.cpp:
2600         (WebCore::Gradient::generateGradient): Properly handle the case of a non-zero
2601         initial gradient radius. Properly compute the final radius.
2602         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
2603         (WebCore::ImageBufferData::readDataFromBitmapIfNeeded const): Update to use ID2D1DeviceContext
2604         from platformContext, rather than searching for it each time.
2605         (WebCore::ImageBufferData::compatibleBitmap): Ditto.
2606         * platform/graphics/win/PlatformContextDirect2D.cpp:
2607         (WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Grab the ID2D1DeviceContext for
2608         the RenderTarget at construction time.
2609         (WebCore::PlatformContextDirect2D::setRenderTarget): Ditto.
2610         (WebCore::PlatformContextDirect2D::endDraw): Perform compositing operations when needed.
2611         (WebCore::PlatformContextDirect2D::compositeIfNeeded): Added.
2612         (WebCore::PlatformContextDirect2D::setBlendAndCompositeMode): Update to properly set the
2613         blend and compositing mode (depending on global value set for the canvas.)
2614         * platform/graphics/win/PlatformContextDirect2D.h:
2615         (WebCore::PlatformContextDirect2D::deviceContext):
2616         (WebCore::PlatformContextDirect2D::setRenderTarget): Deleted.
2617         (WebCore::PlatformContextDirect2D::setBlendMode): Deleted.
2618         (WebCore::PlatformContextDirect2D::setCompositeMode): Deleted.
2619
2620 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2621
2622         Tighten up LayerRepresentation operators
2623         https://bugs.webkit.org/show_bug.cgi?id=202344
2624
2625         Reviewed by Simon Fraser.
2626
2627         Make the operators on the LayerRepresentation class explicit.
2628         Additionally, the bool operator is added to the class, allowing objects
2629         of this class to be safely used in boolean contexts like null checks.
2630         Before, use in such contexts fell back to using the
2631         GraphicsLayer::PlatformLayerID operator which caused asserts when the
2632         internal representation was of different type.
2633
2634         While the explicit operators prevent misuse, they do require additional
2635         conversion casts to retrieve the internal LayerRepresentation value.
2636
2637         * page/scrolling/ScrollingStateNode.h:
2638         (WebCore::LayerRepresentation::operator GraphicsLayer* const):
2639         (WebCore::LayerRepresentation::operator PlatformLayer* const):
2640         (WebCore::LayerRepresentation::operator GraphicsLayer::PlatformLayerID const):
2641         (WebCore::LayerRepresentation::operator bool const):
2642         (WebCore::LayerRepresentation::toRepresentation const):
2643         Add a missing ASSERT_NOT_REACHED() invocation.
2644         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2645         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
2646         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
2647         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
2648         * page/scrolling/cocoa/ScrollingTreeOverflowScrollProxyNode.mm:
2649         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2650         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
2651         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2652         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
2653         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
2654         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2655         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2656
2657 2019-09-29  Zalan Bujtas  <zalan@apple.com>
2658
2659         [LFC][IFC] Remove InlineLayout abstraction layer
2660         https://bugs.webkit.org/show_bug.cgi?id=202352
2661         <rdar://problem/55811532>
2662
2663         Reviewed by Antti Koivisto.
2664
2665         Move InlineLayout functions to InlineFormattingContext. Now inline layout has
2666         1. InlineFormattingContext -high level layout and preferred width computation, collecting inline content, constructing display boxes
2667         2. LineLayout -responsible for placing inline content on the current line (partial inline content handling, line breaking etc)
2668         3. Line -represents an actual line, turns inline content into runs.
2669
2670         * Sources.txt:
2671         * WebCore.xcodeproj/project.pbxproj:
2672         * layout/inlineformatting/InlineFormattingContext.cpp:
2673         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2674         (WebCore::Layout::InlineFormattingContext::lineLayout):
2675         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
2676         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2677         (WebCore::Layout::InlineFormattingContext::initialConstraintsForLine):
2678         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2679         * layout/inlineformatting/InlineFormattingContext.h:
2680         (WebCore::Layout::InlineFormattingContext::InlineLayout::layoutState const): Deleted.
2681         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingContext const): Deleted.
2682         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const): Deleted.
2683         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingState): Deleted.
2684         (WebCore::Layout::InlineFormattingContext::InlineLayout::widthConstraint const): Deleted.
2685         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp: Removed.
2686         * layout/inlineformatting/InlineFormattingState.h:
2687         (WebCore::Layout::InlineFormattingState::inlineItems const):
2688         * layout/inlineformatting/InlineLineLayout.cpp: Added.
2689         (WebCore::Layout::inlineItemWidth):
2690         (WebCore::Layout::LineLayout::LineInput::LineInput):
2691         (WebCore::Layout::LineLayout::UncommittedContent::add):
2692         (WebCore::Layout::LineLayout::UncommittedContent::reset):
2693         (WebCore::Layout::LineLayout::LineLayout):
2694         (WebCore::Layout::LineLayout::commitPendingContent):
2695         (WebCore::Layout::LineLayout::close):
2696         (WebCore::Layout::LineLayout::placeInlineItem):
2697         (WebCore::Layout::LineLayout::layout):
2698         * layout/inlineformatting/InlineLineLayout.h: Added.
2699         (WebCore::Layout::LineLayout::formattingContext const):
2700         (WebCore::Layout::LineLayout::UncommittedContent::runs):
2701         (WebCore::Layout::LineLayout::UncommittedContent::isEmpty const):
2702         (WebCore::Layout::LineLayout::UncommittedContent::size const):
2703         (WebCore::Layout::LineLayout::UncommittedContent::width const):
2704
2705 2019-09-29  Zan Dobersek  <zdobersek@igalia.com>
2706
2707         [Nicosia] Add overflow, overflow proxy node implementations
2708         https://bugs.webkit.org/show_bug.cgi?id=202306
2709
2710         Reviewed by Carlos Garcia Campos.
2711
2712         Add the ScrollingTreeOverflowScrollProxyNode and
2713         ScrollingTreeOverflowScrollingNodeNicosia classes, implementing the
2714         missing overlfow node types. Both implementations are based on the
2715         corresponsing classes for Cocoa/Mac platforms and should ideally
2716         share most of the platform-agnostic logic.
2717
2718         * SourcesWPE.txt:
2719         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.cpp: Added.
2720         (WebCore::ScrollingTreeOverflowScrollProxyNode::create):
2721         (WebCore::ScrollingTreeOverflowScrollProxyNode::ScrollingTreeOverflowScrollProxyNode):
2722         (WebCore::ScrollingTreeOverflowScrollProxyNode::commitStateBeforeChildren):
2723         (WebCore::ScrollingTreeOverflowScrollProxyNode::applyLayerPositions):
2724         (WebCore::ScrollingTreeOverflowScrollProxyNode::dumpProperties const):
2725         * page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h: Added.
2726         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: Added.
2727         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::create):
2728         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::ScrollingTreeOverflowScrollingNodeNicosia):
2729         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::commitStateAfterChildren):
2730         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::adjustedScrollPosition const):
2731         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::repositionScrollingLayers):
2732         (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::handleWheelEvent):
2733         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h: Added.
2734
2735 2019-09-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2736
2737         Crash when removing the target element while animating its attributes
2738         https://bugs.webkit.org/show_bug.cgi?id=202247
2739
2740         Reviewed by Darin Adler.
2741
2742         If SMIL is animating a CSS attribute, there is a chance the animation is
2743         ended while it is being started or progressed. For that reason, the member
2744         SVGAnimateElementBase::m_animator has to be made RefPtr and it has to be
2745         be protected in resetAnimatedType() and calculateAnimatedValue().
2746
2747         While SMILTimeContainer::updateAnimations() is calling progress() for the
2748         scheduled animation elements, SMILTimeContainer::unschedule() might get
2749         called if processing an animation causes events to be dispatched. For that
2750         reason we need to copy the scheduled animations Vector before processing
2751         them so we avoid changing the Vector while looping through its items.
2752
2753         Remove the guard SMILTimeContainer::m_preventScheduledAnimationsChanges
2754         which was added in r129670 for debugging purposes. In some situations, 
2755         the scheduled animations map could be modified out from under some of the
2756         functions of SMILTimeContainer.
2757
2758         Test: svg/animations/animate-and-remove-target-element.html
2759
2760         * svg/SVGAnimateElementBase.cpp:
2761         (WebCore::SVGAnimateElementBase::resetAnimatedType):
2762         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2763         * svg/SVGAnimateElementBase.h:
2764         * svg/SVGElement.cpp:
2765         (WebCore::SVGElement::createAnimator):
2766         * svg/SVGElement.h:
2767         * svg/animation/SMILTimeContainer.cpp:
2768         (WebCore::SMILTimeContainer::schedule):
2769         (WebCore::SMILTimeContainer::unschedule):
2770         (WebCore::SMILTimeContainer::setElapsed):
2771         (WebCore::SMILTimeContainer::sortByPriority):
2772         (WebCore::SMILTimeContainer::processAnimations):
2773         (WebCore::SMILTimeContainer::processScheduledAnimations):
2774         (WebCore::SMILTimeContainer::updateAnimations):
2775         (WebCore::SMILTimeContainer::~SMILTimeContainer): Deleted.
2776         * svg/animation/SMILTimeContainer.h:
2777         * svg/animation/SVGSMILElement.cpp:
2778         (WebCore::SVGSMILElement::calculateNextProgressTime const):
2779         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
2780         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
2781         * svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
2782         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
2783         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
2784         * svg/properties/SVGAttributeAnimator.h:
2785         * svg/properties/SVGMemberAccessor.h:
2786         (WebCore::SVGMemberAccessor::createAnimator const):
2787         * svg/properties/SVGPrimitivePropertyAnimator.h:
2788         (WebCore::SVGPrimitivePropertyAnimator::create):
2789         * svg/properties/SVGPropertyAnimatorFactory.h:
2790         (WebCore::SVGPropertyAnimatorFactory::createAnimator):
2791         * svg/properties/SVGPropertyOwnerRegistry.h:
2792         * svg/properties/SVGPropertyRegistry.h:
2793         * svg/properties/SVGValuePropertyAnimatorImpl.h:
2794         * svg/properties/SVGValuePropertyListAnimatorImpl.h:
2795
2796 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2797
2798         [LFC][IFC] Move horizontal alignment to Line
2799         https://bugs.webkit.org/show_bug.cgi?id=202351
2800         <rdar://problem/55810139>
2801
2802         Reviewed by Antti Koivisto.
2803
2804         Line should be able to finalize the run placement including horizontal alignment.
2805
2806         * layout/Verification.cpp:
2807         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2808         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2809         (WebCore::Layout::LineInput::LineInput):
2810         (WebCore::Layout::LineLayout::LineLayout):
2811         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
2812         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2813         * layout/inlineformatting/InlineLine.cpp:
2814         (WebCore::Layout::Line::Line):
2815         (WebCore::Layout::Line::isVisuallyEmpty const):
2816         (WebCore::Layout::Line::close):
2817         (WebCore::Layout::Line::verticalAlignContent):
2818         (WebCore::Layout::Line::horizontalAlignContent):
2819         (WebCore::Layout::Line::appendInlineContainerStart):
2820         (WebCore::Layout::Line::appendTextContent):
2821         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2822         (WebCore::Layout::Line::appendHardLineBreak):
2823         (WebCore::Layout::Line::inlineItemContentHeight const):
2824         * layout/inlineformatting/InlineLine.h:
2825
2826 2019-09-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2827
2828         [IDL] Support record<DOMString, *Callback> in bindings
2829         https://bugs.webkit.org/show_bug.cgi?id=202326
2830
2831         Reviewed by Sam Weinig.
2832
2833         Currently, IDLRecord's converter assumes that the value type (template argument V) can be converted by passing
2834         in only an ExecState and the JSValue, since it calls `auto typedValue = Converter<V>::convert(state, subValue)`.
2835         However, IDLCallbackFunctions additionally require the JSDOMGlobalObject (see JSDOMConverterCallbacks.h). This
2836         results in a compilation error in generated code, when attempting to convert the record.
2837
2838         To fix this, teach Converter<IDLRecord<K, V>> to accept three arguments (the ExecState, value, and global
2839         object) in the case where V requires the global object. Additionally, let the bindings generator know that
2840         JSValue to native object conversion requires the global object, by returning whether or not the value type of
2841         the IDL record requires the global object, in the case where the given type is a record.
2842
2843         * bindings/js/JSDOMConvertRecord.h:
2844         * bindings/scripts/CodeGeneratorJS.pm:
2845         (JSValueToNativeDOMConvertNeedsGlobalObject):
2846         * bindings/scripts/test/JS/JSTestObj.cpp:
2847
2848         Test this scenario by augmenting TestObj.idl with record<DOMString, VoidCallback>.
2849
2850         (WebCore::jsTestObjStringVoidCallbackRecordAttrGetter):
2851         (WebCore::jsTestObjStringVoidCallbackRecordAttr):
2852         (WebCore::setJSTestObjStringVoidCallbackRecordAttrSetter):
2853         (WebCore::setJSTestObjStringVoidCallbackRecordAttr):
2854         * bindings/scripts/test/TestObj.idl:
2855
2856 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2857
2858         [LFC][IFC] Line::InitialConstraints's heightAndBaseline should be optional
2859         https://bugs.webkit.org/show_bug.cgi?id=202348
2860
2861         Reviewed by Antti Koivisto.
2862
2863         Vertical properties are undefined while computing the preferred width.
2864
2865         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
2866         (WebCore::Layout::LineInput::LineInput):
2867         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
2868         * layout/inlineformatting/InlineLine.cpp:
2869         (WebCore::Layout::Line::Line):
2870         * layout/inlineformatting/InlineLine.h:
2871
2872 2019-09-28  Chris Dumez  <cdumez@apple.com>
2873
2874         [Experiment][iOS] Add temporary HTTP header to distinguish iPads for requests to Google
2875         https://bugs.webkit.org/show_bug.cgi?id=202335
2876         <rdar://problem/55790994>
2877
2878         Reviewed by Maciej Stachowiak.
2879
2880         * loader/cache/CachedResourceLoader.cpp:
2881         (WebCore::CachedResourceLoader::requestResource):
2882         * platform/network/HTTPHeaderNames.in:
2883
2884 2019-09-28  Zalan Bujtas  <zalan@apple.com>
2885
2886         [LFC][IFC] Line::Box should have a const public interface
2887         https://bugs.webkit.org/show_bug.cgi?id=202336
2888         <rdar://problem/55798628>
2889
2890         Reviewed by Antti Koivisto.
2891
2892         Clean up Line::Box interface.
2893
2894         * layout/inlineformatting/InlineLine.cpp:
2895         (WebCore::Layout::Line::close):
2896         * layout/inlineformatting/InlineLine.h:
2897         (WebCore::Layout::Line::Run::displayRun const):
2898         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
2899         (WebCore::Layout::Line::Run::expand):
2900         (WebCore::Layout::Line::Run::displayRun): Deleted.
2901
2902 2019-09-27  Chris Dumez  <cdumez@apple.com>
2903
2904         Pages using WebGLRenderingContext fail to enter the back/forward cache
2905         https://bugs.webkit.org/show_bug.cgi?id=202318
2906         <rdar://problem/55783612>
2907
2908         Reviewed by Tim Horton.
2909
2910         Allow pages with a WebGLRenderingContext to enter the back/forward cache by updating the
2911         implementation to use SuspendableTimers to fire JS events. This guarantees that no events
2912         will be fired (and thus no JS will run) while in the page cache.
2913
2914         This was preventing some of the pages on weather.com and facebook.com from entering the
2915         back/forward cache.
2916
2917         Test: fast/canvas/webgl/canvas-webgl-page-cache.html
2918
2919         * dom/DocumentEventQueue.cpp:
2920         * html/canvas/WebGLRenderingContextBase.cpp:
2921         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2922         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const):
2923         (WebCore::WebGLRenderingContextBase::suspend):
2924         (WebCore::WebGLRenderingContextBase::resume):
2925         (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
2926         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
2927         (WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification):
2928         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
2929         * html/canvas/WebGLRenderingContextBase.h:
2930         * page/DOMTimer.cpp:
2931         (WebCore::DOMTimer::DOMTimer):
2932         * page/DOMTimer.h:
2933         * page/SuspendableTimer.cpp:
2934         (WebCore::SuspendableTimerBase::SuspendableTimerBase):
2935         (WebCore::SuspendableTimerBase::hasPendingActivity const):
2936         (WebCore::SuspendableTimerBase::stop):
2937         (WebCore::SuspendableTimerBase::suspend):
2938         (WebCore::SuspendableTimerBase::resume):
2939         (WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const):
2940         (WebCore::SuspendableTimerBase::didStop):
2941         (WebCore::SuspendableTimerBase::cancel):
2942         (WebCore::SuspendableTimerBase::startRepeating):
2943         (WebCore::SuspendableTimerBase::startOneShot):
2944         (WebCore::SuspendableTimerBase::repeatInterval const):
2945         (WebCore::SuspendableTimerBase::augmentFireInterval):
2946         (WebCore::SuspendableTimerBase::augmentRepeatInterval):
2947         (WebCore::SuspendableTimer::activeDOMObjectName const):
2948         * page/SuspendableTimer.h:
2949
2950 2019-09-27  Adrian Perez de Castro  <aperez@igalia.com>
2951
2952         [GTK][WPE] Fixes for non-unified builds after r249714
2953         https://bugs.webkit.org/show_bug.cgi?id=202304
2954
2955         Reviewed by Youenn Fablet.
2956
2957         No new tests needed.
2958
2959         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp: Add missing inclusion of Frame.h
2960         to make the compiler stop complaining about Frame being used without being defined.
2961         * inspector/InspectorShaderProgram.h: Add missing inclusion of wtf/Variant.h, where
2962         WTF::Monostate is defined; and prefixed the usage with its namespace.
2963
2964 2019-09-27  Andres Gonzalez  <andresg_22@apple.com>
2965
2966         Support accessibility for <figure> element on iOS.
2967         https://bugs.webkit.org/show_bug.cgi?id=202272
2968         <rdar://problem/54789907>
2969
2970         Reviewed by Chris Fleizach.
2971
2972         Test: accessibility/ios-simulator/figure-element.html
2973
2974         Added a role description for the <figure> element.
2975         * accessibility/AccessibilityObject.cpp:
2976         (WebCore::AccessibilityObject::roleDescription const):
2977
2978 2019-09-27  Zalan Bujtas  <zalan@apple.com>
2979
2980         [iPadOS] Can’t use RalphLauren.com on iPad because hover menus don’t stay up
2981         https://bugs.webkit.org/show_bug.cgi?id=202331
2982         <rdar://problem/55629493>
2983
2984         Reviewed by Tim Horton.
2985
2986         Unfortunately the top level menu items now are ARIA labelled as 'buttons' and that triggers the fast path on content observation.
2987         This patch introduces a quirk on ralphLauren.com to ignore the ARIA labels when checking whether the target node should always click through.
2988
2989         * page/Quirks.cpp:
2990         (WebCore::Quirks::shouldIgnoreAriaForFastPathContentObservationCheck const):
2991         * page/Quirks.h:
2992
2993 2019-09-27  Per Arne Vollan  <pvollan@apple.com>
2994
2995         [Win] Crash under FontCache::lastResortFallbackFont
2996         https://bugs.webkit.org/show_bug.cgi?id=202325
2997         <rdar://problem/47856730>
2998
2999         Reviewed by Brent Fulgham.
3000
3001         As demonstrated by crash reports, there seems to be cases where we are not able to create a last resort fallback font  
3002         on Windows. If all attempts to create a fallback font fail, create a font from the default UI font.
3003  
3004         No new tests. I have not been able to reproduce this issue. 
3005
3006         * platform/graphics/win/FontCacheWin.cpp:
3007         (WebCore::FontCache::lastResortFallbackFont):
3008
3009 2019-09-27  Jiewen Tan  <jiewen_tan@apple.com>
3010
3011         Unreviewed, rolling out r250397.
3012
3013         caused failure on iOS 13
3014
3015         Reverted changeset:
3016
3017         "REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-
3018         credential-create-success-u2f.https.html is failing"
3019         https://bugs.webkit.org/show_bug.cgi?id=201620
3020         https://trac.webkit.org/changeset/250397
3021
3022 2019-09-27  Jer Noble  <jer.noble@apple.com>
3023
3024         [iOS] Vimeo fails to AirPlay in desktop mode
3025         https://bugs.webkit.org/show_bug.cgi?id=202322
3026
3027         Reviewed by Eric Carlson.
3028
3029         Add a Quirk which opts Vimeo out of the preload=auto restriction, and allows their
3030         second video element containing a HLS stream to correctly start AirPlaying when the
3031         system route changes.
3032
3033         * html/HTMLMediaElement.cpp:
3034         (WebCore::HTMLMediaElement::finishInitialization):
3035         * page/Quirks.cpp:
3036         (WebCore::Quirks::needsPreloadAutoQuirk const):
3037         * page/Quirks.h:
3038
3039 2019-09-27  Zalan Bujtas  <zalan@apple.com>
3040
3041         [LFC][IFC] Line::close should merge the text runs.
3042         https://bugs.webkit.org/show_bug.cgi?id=202319
3043         <rdar://problem/55785949>
3044
3045         Reviewed by Antti Koivisto.
3046
3047         Now Line::close returns the final Display::Run list.
3048
3049         * layout/displaytree/DisplayRect.h:
3050         (WebCore::Display::Rect::expandHorizontally):
3051         (WebCore::Display::Rect::expandVertically):
3052         (WebCore::Display::Rect::expand):
3053         * layout/displaytree/DisplayRun.h:
3054         (WebCore::Display::Run::expandVertically):
3055         (WebCore::Display::Run::expandHorizontally):
3056         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3057         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3058         * layout/inlineformatting/InlineLine.cpp:
3059         (WebCore::Layout::Line::close):
3060         * layout/inlineformatting/InlineLine.h:
3061         (WebCore::Layout::Line::Run::displayRun):
3062
3063 2019-09-27  Chris Dumez  <cdumez@apple.com>
3064
3065         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache
3066         https://bugs.webkit.org/show_bug.cgi?id=202314
3067         <rdar://problem/55783482>
3068
3069         Reviewed by Alex Christensen.
3070
3071         Allow pages served over HTTPS with `Cache-Control: no-store` header to enter the back/forward cache.
3072         This was preventing all pages on Facebook.com to enter the back/forward cache.
3073
3074         No new tests, updated existing test.
3075
3076         * history/PageCache.cpp:
3077         (WebCore::canCacheFrame):
3078
3079 2019-09-27  Devin Rousso  <drousso@apple.com>
3080
3081         Flaky Test: inspector/canvas/updateShader.html
3082         https://bugs.webkit.org/show_bug.cgi?id=202186
3083         <rdar://problem/55716053>
3084
3085         Reviewed by Joseph Pecoraro.
3086
3087         If the `WebGLProgram` outlives it's `WebGLRenderingContext`, the `ScriptExecutionContext*`
3088         that was provided in the constructor won't be invalidated leading to the bad access crash.
3089
3090         Rather than pass the `ScriptExecutionContext*` directly, have `WebGLProgram` inherit from
3091         `ContextDestructionObserver` so that it can propertly invalidate (and notify Web Inspector)
3092         when the related context is about to be destroyed.
3093
3094         Test: inspector/canvas/updateShader.html
3095
3096         * html/canvas/WebGLProgram.h:
3097         (WebCore::WebGLProgram::scriptExecutionContext const): Deleted.
3098         * html/canvas/WebGLProgram.cpp:
3099         (WebCore::WebGLProgram::WebGLProgram):
3100         (WebCore::WebGLProgram::contextDestroyed): Added.
3101
3102 2019-09-27  Zalan Bujtas  <zalan@apple.com>
3103
3104         [LFC][IFC] Replace Line::Run's logicalRect/textContext with Display::Run
3105         https://bugs.webkit.org/show_bug.cgi?id=202313
3106         <rdar://problem/55782430>
3107
3108         Reviewed by Antti Koivisto.
3109
3110         Display::Run is a container for logical rect and text context. Let's replace Line::Run's logical rect/text context with Display::Run.
3111
3112         * layout/Verification.cpp:
3113         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
3114         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3115         * layout/displaytree/DisplayRun.h:
3116         (WebCore::Display::Run::logicalRect const):
3117         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3118         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3119         (WebCore::Layout::InlineFormattingContext::InlineLayout::alignRuns const):
3120         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3121         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3122         * layout/inlineformatting/InlineFormattingState.h:
3123         (WebCore::Layout::InlineFormattingState::addInlineRun):
3124         * layout/inlineformatting/InlineLine.cpp:
3125         (WebCore::Layout::Line::Run::Run):
3126         (WebCore::Layout::Line::isVisuallyEmpty const):
3127         (WebCore::Layout::Line::appendNonBreakableSpace):
3128         (WebCore::Layout::Line::appendTextContent):
3129         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3130         (WebCore::Layout::Line::appendHardLineBreak):
3131         * layout/inlineformatting/InlineLine.h:
3132         (WebCore::Layout::Line::Run::displayRun const):
3133         (WebCore::Layout::Line::Run::logicalRect const):
3134         (WebCore::Layout::Line::Run::adjustLogicalTop):
3135         (WebCore::Layout::Line::Run::moveVertically):
3136         (WebCore::Layout::Line::Run::moveHorizontally):
3137         (WebCore::Layout::Line::Run::textContext const): Deleted.
3138         * layout/layouttree/LayoutTreeBuilder.cpp:
3139         (WebCore::Layout::outputInlineRuns):
3140
3141 2019-09-27  Truitt Savell  <tsavell@apple.com>
3142
3143         Unreviewed, rolling out r250415.
3144
3145         Broke iOS debug testing with 50 crashes and 850 API failure
3146
3147         Reverted changeset:
3148
3149         "ScrollingTreeScrollingNode: use LayerRepresentation for
3150         scroll container, scrolled contents layers"
3151         https://bugs.webkit.org/show_bug.cgi?id=202256
3152         https://trac.webkit.org/changeset/250415
3153
3154 2019-09-27  Alex Christensen  <achristensen@webkit.org>
3155
3156         Move service worker process termination delay disabling from process pool to website data store
3157         https://bugs.webkit.org/show_bug.cgi?id=202308
3158
3159         Reviewed by Chris Dumez.
3160
3161         * workers/service/server/SWServer.cpp:
3162         (WebCore::SWServer::SWServer):
3163         (WebCore::SWServer::unregisterServiceWorkerClient):
3164         * workers/service/server/SWServer.h:
3165         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay): Deleted.
3166
3167 2019-09-27  Chris Dumez  <cdumez@apple.com>
3168
3169         IDBRequest should not prevent a page from entering the back/forward cache
3170         https://bugs.webkit.org/show_bug.cgi?id=202270
3171         <rdar://problem/55744717>
3172
3173         Reviewed by Youenn Fablet.
3174
3175         Update IDBRequest::canSuspendForDocumentSuspension() to return true instead of
3176         false. IDBRequest can only fire 2 events (error / success) and for both its
3177         merely enqueues the Event to the DocumentEventQueue. The DocumentEventQueue
3178         uses a SuspendableTimer (which will be suspended while the document is in the
3179         page cache) so there is no risk of firing the events (and thus running script)
3180         while in the page cache.
3181
3182         Test: storage/indexeddb/IDBRequest-page-cache.html
3183
3184         * Modules/indexeddb/IDBRequest.cpp:
3185         (WebCore::IDBRequest::canSuspendForDocumentSuspension const):
3186
3187 2019-09-27  Zalan Bujtas  <zalan@apple.com>
3188
3189         [LFC][IFC] Remove redundant Line::TextContext member variables
3190         https://bugs.webkit.org/show_bug.cgi?id=202300
3191         <rdar://problem/55769916>
3192
3193         Reviewed by Antti Koivisto.
3194
3195         This is in preparation for using Display::Run in Line::Run instead of Display::Rect + TextContext.
3196
3197         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3198         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3199         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3200         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3201         * layout/inlineformatting/InlineLine.cpp:
3202         (WebCore::Layout::Line::Run::isWhitespace const):
3203         (WebCore::Layout::Line::Run::canBeExtended const):
3204         (WebCore::Layout::Line::isVisuallyEmpty const):
3205         (WebCore::Layout::Line::removeTrailingTrimmableContent):
3206         (WebCore::Layout::Line::trailingTrimmableWidth const):
3207         (WebCore::Layout::Line::appendTextContent):
3208         * layout/inlineformatting/InlineLine.h:
3209         (WebCore::Layout::Line::Run::isVisuallyEmpty const):
3210         (WebCore::Layout::Line::Run::setVisuallyIsEmpty):
3211         (WebCore::Layout::Line::Run::setTextIsCollapsed): Deleted.
3212
3213 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
3214
3215         [Nicosia] Implement frame scrolling functionality
3216         https://bugs.webkit.org/show_bug.cgi?id=202201
3217
3218         Reviewed by Carlos Garcia Campos.
3219
3220         Implement logic in the ScrollingTreeFrameScrollingNodeNicosia class,
3221         largely following the Mac port's implementation but skipping areas we
3222         don't support or can keep simple, like CSS scroll snap, frame pinning
3223         and more complex wheel event handling through the platform-specific
3224         delegate behavior.
3225
3226         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
3227         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateBeforeChildren):
3228         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::commitStateAfterChildren):
3229         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::handleWheelEvent):
3230         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::adjustedScrollPosition const):
3231         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::currentScrollPositionChanged):
3232         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionScrollingLayers):
3233         (WebCore::ScrollingTreeFrameScrollingNodeNicosia::repositionRelatedLayers):
3234         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
3235
3236 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
3237
3238         [Nicosia] ScrollingCoordinatorNicosia should handle wheel events coming from the main thread
3239         https://bugs.webkit.org/show_bug.cgi?id=202275
3240
3241         Reviewed by Carlos Garcia Campos.
3242
3243         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
3244         (WebCore::ScrollingCoordinatorNicosia::handleWheelEvent):
3245         Handle wheel events that get rerouted through the main thread,
3246         dispatching them back to the scrolling thread so that they end up
3247         performing the desired scroll if possible.
3248
3249 2019-09-27  Zan Dobersek  <zdobersek@igalia.com>
3250
3251         [CoordinatedGraphics] support bounds origin
3252         https://bugs.webkit.org/show_bug.cgi?id=198998
3253
3254         Reviewed by Carlos Garcia Campos.
3255
3256         Add bounds-origin support to the CoordinatedGraphics stack. Currently we
3257         take the short-cut implementation of just combining the bounds origin
3258         and the position value and incorporating them into the layer transform
3259         we calculate in TextureMapperLayer.
3260
3261         Additional boilerplate code is added, as required, to relay the
3262         WebCore::GraphicsLayer change of bounds origin to the rendering system.
3263
3264         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3265         (Nicosia::CompositionLayer::flushState):
3266         * platform/graphics/texmap/TextureMapperLayer.cpp:
3267         (WebCore::TextureMapperLayer::computeTransformsRecursive):
3268         (WebCore::TextureMapperLayer::setBoundsOrigin):
3269         * platform/graphics/texmap/TextureMapperLayer.h:
3270         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3271         (WebCore::CoordinatedGraphicsLayer::setBoundsOrigin):
3272         (WebCore::CoordinatedGraphicsLayer::computePositionRelativeToBase):
3273         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3274
3275 2019-09-26  Zan Dobersek  <zdobersek@igalia.com>
3276
3277         ScrollingTreeScrollingNode: use LayerRepresentation for scroll container, scrolled contents layers
3278         https://bugs.webkit.org/show_bug.cgi?id=202256
3279
3280         Reviewed by Simon Fraser.
3281
3282         Make the scroll container and scrolled contents layer holders
3283         platform-independent by using the LayerRepresentation as the underlying
3284         type for the two member variables in ScrollingTreeScrollingNode.
3285
3286         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3287         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3288         * page/scrolling/ScrollingTreeScrollingNode.h:
3289         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3290         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
3291         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
3292         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
3293
3294 2019-09-26  Chris Dumez  <cdumez@apple.com>
3295
3296         Pages frequently fails to enter the back/forward cache due to pending loads
3297         https://bugs.webkit.org/show_bug.cgi?id=202289
3298         <rdar://problem/55758506>
3299
3300         Reviewed by Geoffrey Garen.
3301
3302         Allow pages to enter the back / forward cache, even if they have pending loads.
3303         Note that these pending loads get cancelled. Also note that we won't enter page
3304         cache unless the 'load' event has been fired in the main frame, since a
3305         HistoryItem would not get created otherwise. This was causing frequent transient
3306         failures to enter the back / forward cache while browsing (e.g. on weather.com).
3307
3308         Test: http/tests/navigation/page-cache-pending-load.html
3309
3310         * history/PageCache.cpp:
3311         (WebCore::canCacheFrame):
3312         * loader/CrossOriginPreflightChecker.cpp:
3313         * loader/CrossOriginPreflightChecker.h:
3314         * loader/DocumentLoader.cpp:
3315         (WebCore::DocumentLoader::setMainDocumentError):
3316         (WebCore::DocumentLoader::stopLoading):
3317         * loader/DocumentLoader.h:
3318         * loader/DocumentThreadableLoader.cpp:
3319         * loader/DocumentThreadableLoader.h:
3320         * loader/cache/CachedResource.cpp:
3321         * loader/cache/CachedResource.h:
3322         * loader/cache/CachedResourceClient.h:
3323         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
3324         * page/DiagnosticLoggingKeys.cpp:
3325         (WebCore::DiagnosticLoggingKeys::mainFrameHasNotFinishedLoadingKey):
3326         * page/DiagnosticLoggingKeys.h:
3327
3328 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3329
3330         [LFC][IFC] Line::Run should have a reference to the associated InlineItem
3331         https://bugs.webkit.org/show_bug.cgi?id=202288
3332         <rdar://problem/55758112>
3333
3334         Reviewed by Antti Koivisto.
3335
3336         It makes it clearer where the type and the layout box come from.
3337
3338         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3339         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3340         * layout/inlineformatting/InlineLine.cpp:
3341         (WebCore::Layout::Line::Run::Run):
3342         * layout/inlineformatting/InlineLine.h:
3343         (WebCore::Layout::Line::Run::layoutBox const):
3344         (WebCore::Layout::Line::Run::textContext const):
3345         (WebCore::Layout::Line::Run::isText const):
3346         (WebCore::Layout::Line::Run::isBox const):
3347         (WebCore::Layout::Line::Run::isLineBreak const):
3348         (WebCore::Layout::Line::Run::isContainerStart const):
3349         (WebCore::Layout::Line::Run::isContainerEnd const):
3350         (WebCore::Layout::Line::Run::type const): Deleted.
3351
3352 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3353
3354         [LFC][IFC] Remove redundant Line::Content
3355         https://bugs.webkit.org/show_bug.cgi?id=202284
3356         <rdar://problem/55757187>
3357
3358         Reviewed by Antti Koivisto.
3359
3360         Line::Content is really just a list or runs at this point.
3361
3362         * layout/inlineformatting/InlineFormattingContext.h:
3363         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3364         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3365         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
3366         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
3367         * layout/inlineformatting/InlineLine.cpp:
3368         (WebCore::Layout::Line::Run::Run):
3369         (WebCore::Layout::Line::Line):
3370         (WebCore::Layout::Line::isVisuallyEmpty const):
3371         (WebCore::Layout::Line::close):
3372         (WebCore::Layout::Line::appendNonBreakableSpace):
3373         (WebCore::Layout::Line::appendTextContent):
3374         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3375         (WebCore::Layout::Line::appendHardLineBreak):
3376         (WebCore::Layout::Line::Content::Run::Run): Deleted.
3377         * layout/inlineformatting/InlineLine.h:
3378         (WebCore::Layout::Line::Run::layoutBox const):
3379         (WebCore::Layout::Line::Run::logicalRect const):
3380         (WebCore::Layout::Line::Run::textContext const):
3381         (WebCore::Layout::Line::Run::type const):
3382         (WebCore::Layout::Line::Run::isText const):
3383         (WebCore::Layout::Line::Run::isBox const):
3384         (WebCore::Layout::Line::Run::isLineBreak const):
3385         (WebCore::Layout::Line::Run::isContainerStart const):
3386         (WebCore::Layout::Line::Run::isContainerEnd const):
3387         (WebCore::Layout::Line::Run::adjustLogicalTop):
3388         (WebCore::Layout::Line::Run::moveVertically):
3389         (WebCore::Layout::Line::Run::moveHorizontally):
3390         (WebCore::Layout::Line::Run::setTextIsCollapsed):
3391         (WebCore::Layout::Line::Content::Run::layoutBox const): Deleted.
3392         (WebCore::Layout::Line::Content::Run::logicalRect const): Deleted.
3393         (WebCore::Layout::Line::Content::Run::textContext const): Deleted.
3394         (WebCore::Layout::Line::Content::Run::type const): Deleted.
3395         (WebCore::Layout::Line::Content::Run::isText const): Deleted.
3396         (WebCore::Layout::Line::Content::Run::isBox const): Deleted.
3397         (WebCore::Layout::Line::Content::Run::isLineBreak const): Deleted.
3398         (WebCore::Layout::Line::Content::Run::isContainerStart const): Deleted.
3399         (WebCore::Layout::Line::Content::Run::isContainerEnd const): Deleted.
3400         (WebCore::Layout::Line::Content::Run::adjustLogicalTop): Deleted.
3401         (WebCore::Layout::Line::Content::Run::moveVertically): Deleted.
3402         (WebCore::Layout::Line::Content::Run::moveHorizontally): Deleted.
3403         (WebCore::Layout::Line::Content::Run::setTextIsCollapsed): Deleted.
3404         (WebCore::Layout::Line::Content::runs const): Deleted.
3405         (WebCore::Layout::Line::Content::runs): Deleted.
3406
3407 2019-09-26  Zalan Bujtas  <zalan@apple.com>
3408
3409         [LFC][IFC] Move Line::Content::m_lineBox to Line.
3410         https://bugs.webkit.org/show_bug.cgi?id=202280
3411         <rdar://problem/55755798>
3412
3413         Reviewed by Antti Koivisto.
3414
3415         This is in preparation for Line producing Display::Runs instead of Line::Runs.
3416
3417         * layout/inlineformatting/InlineFormattingContext.h:
3418         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
3419         (WebCore::Layout::LineLayout::close):
3420         (WebCore::Layout::LineLayout::placeInlineItem):
3421         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout):
3422         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
3423         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns):
3424         * layout/inlineformatting/InlineLine.cpp:
3425         (WebCore::Layout::Line::Line):
3426         (WebCore::Layout::Line::close):
3427         (WebCore::Layout::Line::removeTrailingTrimmableContent):
3428         (WebCore::Layout::Line::moveLogicalLeft):
3429         (WebCore::Layout::Line::appendNonBreakableSpace):
3430         (WebCore::Layout::Line::appendTextContent):
3431         (WebCore::Layout::Line::appendNonReplacedInlineBox):
3432         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
3433         * layout/inlineformatting/InlineLine.h:
3434         (WebCore::Layout::Line::Content::runs const):
3435         (WebCore::Layout::Line::availableWidth const):
3436         (WebCore::Layout::Line::lineBox const):
3437         (WebCore::Layout::Line::logicalTop const):
3438         (WebCore::Layout::Line::logicalBottom const):
3439         (WebCore::Layout::Line::logicalLeft const):
3440         (WebCore::Layout::Line::logicalHeight const):
3441         (WebCore::Layout::Line::contentLogicalWidth const):