11e93bfa8f0eefb6547690bb5153fad650a7cb8f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-17  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC][TFC] Table formatting context accesses geometry information from parent BFC
4         https://bugs.webkit.org/show_bug.cgi?id=203082
5         <rdar://problem/56370827>
6
7         Reviewed by Antti Koivisto.
8
9         Tables are wrapped in a 2 level formatting context structure. A <table> element initiates a block formatting context for its principal table box
10         where the caption and the table content live. It also initiates a table wrapper box which establishes the table formatting context.
11         In many cases the TFC needs access to the parent (generated) BFC.
12
13         * layout/FormattingContext.cpp:
14         (WebCore::Layout::FormattingContext::geometryForBox const):
15         * layout/FormattingContext.h:
16         * layout/tableformatting/TableFormattingContext.cpp:
17         (WebCore::Layout::TableFormattingContext::computedTableWidth):
18
19 2019-10-17  Zalan Bujtas  <zalan@apple.com>
20
21         [LFC][Painting] Add support for image/background image painting
22         https://bugs.webkit.org/show_bug.cgi?id=203054
23         <rdar://problem/56347733>
24
25         Reviewed by Antti Koivisto.
26
27         In addition to image rendering, this patch also addresses various run/decoration painting issues.
28
29         * layout/displaytree/DisplayPainter.cpp:
30         (WebCore::Display::paintBoxDecoration):
31         (WebCore::Display::paintInlineContent):
32         (WebCore::Display::absoluteDisplayBox):
33         (WebCore::Display::paintBoxDecorationAndChildren):
34         (WebCore::Display::Painter::paint):
35         * layout/displaytree/DisplayRun.h:
36         (WebCore::Display::Run::setImage):
37         (WebCore::Display::Run::image const):
38         * layout/inlineformatting/InlineLine.cpp:
39         (WebCore::Layout::Line::appendNonReplacedInlineBox):
40         (WebCore::Layout::Line::appendReplacedInlineBox):
41         * layout/layouttree/LayoutReplaced.h:
42         (WebCore::Layout::Replaced::setCachedImage):
43         (WebCore::Layout::Replaced::cachedImage const):
44         * layout/layouttree/LayoutTreeBuilder.cpp:
45         (WebCore::Layout::TreeBuilder::createLayoutBox):
46
47 2019-10-17  Zalan Bujtas  <zalan@apple.com>
48
49         [LFC][IFC] Add Display::Run/LineBox mapping
50         https://bugs.webkit.org/show_bug.cgi?id=203051
51         <rdar://problem/56342487>
52
53         Reviewed by Antti Koivisto.
54
55         Mapping enables us to paint baseline aligned runs on the current line. This is temporary until after we figure out the final run/line structure.
56
57         * layout/FormattingContextGeometry.cpp:
58         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
59         * layout/Verification.cpp:
60         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
61         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
62         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
63         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
64         * layout/displaytree/DisplayPainter.cpp:
65         (WebCore::Display::paintInlineContent):
66         * layout/inlineformatting/InlineFormattingContext.cpp:
67         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
68         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
69         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
70         * layout/inlineformatting/InlineFormattingState.h:
71         (WebCore::Layout::InlineFormattingState::addLineBox):
72         (WebCore::Layout::InlineFormattingState::lineBoxForRun const):
73         (WebCore::Layout::InlineFormattingState::addInlineRun):
74         * layout/inlineformatting/InlineLine.cpp:
75         (WebCore::Layout::Line::Run::Run):
76         (WebCore::Layout::Line::alignContentVertically):
77         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
78         * layout/inlineformatting/InlineLine.h:
79         (WebCore::Layout::Line::Run::displayRun const):
80         (WebCore::Layout::Line::Run::logicalRect const):
81         (WebCore::Layout::Line::Run::adjustLogicalTop):
82         (WebCore::Layout::Line::Run::moveVertically):
83         (WebCore::Layout::Line::Run::moveHorizontally):
84         (WebCore::Layout::Line::Run::expand):
85         * layout/inlineformatting/InlineLineBox.h:
86         * layout/inlineformatting/InlineLineLayout.h:
87         * layout/layouttree/LayoutTreeBuilder.cpp:
88         (WebCore::Layout::outputInlineRuns):
89
90 2019-10-17  Antoine Quint  <graouts@apple.com>
91
92         [Web Animations] Enable the Web Animations JavaScript API by default
93         https://bugs.webkit.org/show_bug.cgi?id=203075
94
95         Reviewed by Antti Koivisto.
96
97         * page/RuntimeEnabledFeatures.h:
98
99 2019-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
100
101         Unreviewed, fix watchOS and tvOS builds after r251224
102
103         * platform/ios/PlatformPasteboardIOS.mm:
104         (WebCore::shouldTreatAtLeastOneTypeAsFile):
105
106         Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
107         section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.
108
109 2019-10-17  Youenn Fablet  <youenn@apple.com>
110
111         MultiChannelResampler does not need to recreate a ChannelProvider for every process call
112         https://bugs.webkit.org/show_bug.cgi?id=202982
113
114         Reviewed by Eric Carlson.
115
116         We no longer allocate a new ChannelProvider for every process call.
117         No observable change of behavior.
118
119         * platform/audio/MultiChannelResampler.cpp:
120         (WebCore::MultiChannelResampler::ChannelProvider::ChannelProvider):
121         (WebCore::MultiChannelResampler::ChannelProvider::setProvider):
122         (WebCore::MultiChannelResampler::MultiChannelResampler):
123         (WebCore::MultiChannelResampler::process):
124         * platform/audio/MultiChannelResampler.h:
125
126 2019-10-17  Devin Rousso  <drousso@apple.com>
127
128         Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
129         https://bugs.webkit.org/show_bug.cgi?id=200384
130         <rdar://problem/53850352>
131
132         Reviewed by Joseph Pecoraro.
133
134         * inspector/InspectorFrontendClient.h:
135         (WebCore::InspectorFrontendClient::backendCommandsURL): Deleted.
136         (WebCore::InspectorFrontendClient::debuggableType): Deleted.
137         * inspector/InspectorFrontendClientLocal.h:
138         * page/PageDebuggable.h:
139         (WebCore::PageDebuggable::type const):
140         * testing/Internals.cpp:
141         (WebCore::InspectorStubFrontend::debuggableType const): Added.
142         Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).
143
144 2019-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
145
146         [Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard may contain files
147         https://bugs.webkit.org/show_bug.cgi?id=203065
148
149         Reviewed by Tim Horton.
150
151         Platform-specific pasteboard refactoring before tackling webkit.org/b/203021. See below for details. No new
152         tests, as there is no change in behavior.
153
154         * platform/Pasteboard.h:
155         (WebCore::Pasteboard::changeCount const):
156
157         Add a stub for Pasteboard::changeCount() on non-Cocoa platforms.
158
159         * platform/ios/PlatformPasteboardIOS.mm:
160         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
161
162         Move this helper function farther up the file, so it can be used in more places.
163
164         (WebCore::webSafeTypes):
165
166         Add a separate helper to compute the list of web-safe MIME types (for instance, "text/plain") given a list of
167         platform types, and a function to determine whether to avoid exposing a given URL to the DOM.
168
169         (WebCore::shouldTreatAtLeastOneTypeAsFile):
170
171         Split this out into a separate helper function, so that it can be invoked when determining whether a given
172         NSItemProvider is suspected to contain file paths. In the case where we're getting the full list of types that
173         are safe for the DOM to read, we want to pass in the entire pasteboard object and iterate through all of the
174         available types in search for something that could feasibly accompany a file URL.
175
176         In the case of computing the web-safe types per item, we only have an item provider, in which case we only
177         iterate through the types in that NSItemProvider. See call sites below for examples.
178
179         (WebCore::PlatformPasteboard::informationForItemAtIndex):
180
181         Invoke the new `webSafeTypes` helper method.
182
183         (WebCore::pasteboardMayContainFilePaths):
184         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
185
186         Invoke the new `webSafeTypes` helper method.
187
188 2019-10-16  Brent Fulgham  <bfulgham@apple.com>
189
190         [FTW] Correct radial gradient handling of various radius orderings
191         https://bugs.webkit.org/show_bug.cgi?id=202815
192
193         Reviewed by Per Arne Vollan.
194
195         Revise the 'generateGradient' implementation to recognize that the
196         radius arguments might not be in increasing order. Direct2D's
197         implementation does expect this, so we need to swap order and
198         revise the gradient range to match.
199
200         Drive-by fix: Stop building unused image decoders if building with
201         the Apple stack.
202
203         * PlatformFTW.cmake: Stop building unused image decoders.
204         * platform/graphics/win/GradientDirect2D.cpp:
205         (WebCore::Gradient::generateGradient):
206
207 2019-10-16  Chris Dumez  <cdumez@apple.com>
208
209         Rename PageCache to BackForwardCache
210         https://bugs.webkit.org/show_bug.cgi?id=203048
211
212         Reviewed by Alex Christensen.
213
214         Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.
215
216         * Modules/geolocation/Geolocation.cpp:
217         (WebCore::Geolocation::suspend):
218         * Modules/mediarecorder/MediaRecorder.cpp:
219         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
220         * Modules/mediastream/RTCPeerConnection.cpp:
221         (WebCore::RTCPeerConnection::suspend):
222         * Modules/websockets/WebSocket.cpp:
223         (WebCore::WebSocket::suspend):
224         * Sources.txt:
225         * WebCore.xcodeproj/project.pbxproj:
226         * animation/WebAnimation.cpp:
227         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
228         * bindings/js/WindowProxy.cpp:
229         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
230         * bindings/js/WindowProxy.h:
231         * dom/ActiveDOMObject.h:
232         * dom/Document.cpp:
233         (WebCore::Document::~Document):
234         (WebCore::Document::scheduleStyleRecalc):
235         (WebCore::Document::needsStyleRecalc const):
236         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
237         (WebCore::Document::createRenderTree):
238         (WebCore::Document::didBecomeCurrentDocumentInFrame):
239         (WebCore::Document::attachToCachedFrame):
240         (WebCore::Document::detachFromCachedFrame):
241         (WebCore::Document::prepareForDestruction):
242         (WebCore::Document::adjustFocusedNodeOnNodeRemoval):
243         (WebCore::Document::setFocusedElement):
244         (WebCore::Document::takeDOMWindowFrom):
245         (WebCore::Document::setBackForwardCacheState):
246         (WebCore::Document::suspend):
247         (WebCore::Document::resume):
248         (WebCore::Document::topDocument const):
249         * dom/Document.h:
250         (WebCore::Document::backForwardCacheState const):
251         * dom/FullscreenManager.cpp:
252         (WebCore::FullscreenManager::willEnterFullscreen):
253         (WebCore::FullscreenManager::didEnterFullscreen):
254         (WebCore::FullscreenManager::willExitFullscreen):
255         (WebCore::FullscreenManager::didExitFullscreen):
256         * dom/FullscreenManager.h:
257         * dom/ScriptExecutionContext.cpp:
258         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
259         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
260         * history/BackForwardCache.cpp: Renamed from Source/WebCore/history/PageCache.cpp.
261         (WebCore::logBackForwardCacheFailureDiagnosticMessage):
262         (WebCore::canCacheFrame):
263         (WebCore::canCachePage):
264         (WebCore::BackForwardCache::singleton):
265         (WebCore::BackForwardCache::BackForwardCache):
266         (WebCore::BackForwardCache::dump const):
267         (WebCore::BackForwardCache::canCache const):
268         (WebCore::BackForwardCache::pruneToSizeNow):
269         (WebCore::BackForwardCache::setMaxSize):
270         (WebCore::BackForwardCache::frameCount const):
271         (WebCore::BackForwardCache::markPagesForDeviceOrPageScaleChanged):
272         (WebCore::BackForwardCache::markPagesForContentsSizeChanged):
273         (WebCore::BackForwardCache::markPagesForCaptionPreferencesChanged):
274         (WebCore::setBackForwardCacheState):
275         (WebCore::BackForwardCache::addIfCacheable):
276         (WebCore::BackForwardCache::take):
277         (WebCore::BackForwardCache::removeAllItemsForPage):
278         (WebCore::BackForwardCache::get):
279         (WebCore::BackForwardCache::remove):
280         (WebCore::BackForwardCache::prune):
281         * history/BackForwardCache.h: Renamed from Source/WebCore/history/PageCache.h.
282         * history/CachedFrame.cpp:
283         (WebCore::CachedFrameBase::restore):
284         (WebCore::CachedFrame::CachedFrame):
285         (WebCore::CachedFrame::clear):
286         (WebCore::CachedFrame::destroy):
287         * history/CachedFramePlatformData.h:
288         * history/HistoryItem.cpp:
289         (WebCore::HistoryItem::setCachedPage):
290         (WebCore::HistoryItem::setURL):
291         * history/HistoryItem.h:
292         (WebCore::HistoryItem::isInBackForwardCache const):
293         * html/HTMLMediaElement.cpp:
294         (WebCore::HTMLMediaElement::suspend):
295         (WebCore::HTMLMediaElement::resume):
296         * html/HTMLPlugInImageElement.cpp:
297         (WebCore::HTMLPlugInImageElement::createElementRenderer):
298         * html/HTMLSourceElement.cpp:
299         (WebCore::HTMLSourceElement::suspend):
300         * html/MediaElementSession.cpp:
301         (WebCore::MediaElementSession::autoplayPermitted const):
302         * loader/DocumentLoader.cpp:
303         (WebCore::DocumentLoader::addSubresourceLoader):
304         * loader/DocumentLoader.h:
305         * loader/EmptyFrameLoaderClient.h:
306         * loader/FrameLoader.cpp:
307         (WebCore::FrameLoader::closeURL):
308         (WebCore::FrameLoader::clear):
309         (WebCore::FrameLoader::stopAllLoaders):
310         (WebCore::FrameLoader::stopForBackForwardCache):
311         (WebCore::FrameLoader::commitProvisionalLoad):
312         (WebCore::FrameLoader::open):
313         (WebCore::FrameLoader::frameDetached):
314         (WebCore::FrameLoader::detachFromParent):
315         (WebCore::FrameLoader::receivedMainResourceError):
316         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
317         (WebCore::FrameLoader::dispatchUnloadEvents):
318         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
319         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
320         (WebCore::FrameLoader::loadDifferentDocumentItem):
321         * loader/FrameLoader.h:
322         * loader/FrameLoaderClient.h:
323         * loader/HistoryController.cpp:
324         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
325         (WebCore::HistoryController::restoreScrollPositionAndViewState):
326         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
327         (WebCore::HistoryController::updateForReload):
328         * loader/appcache/ApplicationCacheHost.cpp:
329         (WebCore::ApplicationCacheHost::canCacheInBackForwardCache):
330         * loader/appcache/ApplicationCacheHost.h:
331         * loader/cache/CachedResource.cpp:
332         (WebCore::CachedResource::load):
333         * page/DOMWindow.cpp:
334         (WebCore::DOMWindow::suspendForBackForwardCache):
335         (WebCore::DOMWindow::resumeFromBackForwardCache):
336         (WebCore::DOMWindow::decrementScrollEventListenersCount):
337         * page/DOMWindow.h:
338         * page/DOMWindowExtension.cpp:
339         (WebCore::DOMWindowExtension::suspendForBackForwardCache):
340         (WebCore::DOMWindowExtension::resumeFromBackForwardCache):
341         * page/DOMWindowExtension.h:
342         * page/DiagnosticLoggingKeys.cpp:
343         (WebCore::DiagnosticLoggingKeys::backForwardCacheKey):
344         (WebCore::DiagnosticLoggingKeys::backForwardCacheFailureKey):
345         * page/DiagnosticLoggingKeys.h:
346         * page/EventSource.cpp:
347         (WebCore::EventSource::scheduleReconnect):
348         (WebCore::EventSource::didReceiveResponse):
349         (WebCore::EventSource::didReceiveData):
350         (WebCore::EventSource::didFinishLoading):
351         (WebCore::EventSource::didFail):
352         (WebCore::EventSource::abortConnectionAttempt):
353         (WebCore::EventSource::suspend):
354         (WebCore::EventSource::resume):
355         (WebCore::EventSource::dispatchMessageEvent):
356         * page/EventSource.h:
357         * page/Frame.cpp:
358         (WebCore::Frame::setView):
359         (WebCore::Frame::setDocument):
360         (WebCore::Frame::willDetachPage):
361         * page/FrameView.cpp:
362         (WebCore::FrameView::didRestoreFromBackForwardCache):
363         (WebCore::FrameView::setContentsSize):
364         * page/FrameView.h:
365         * page/FrameViewLayoutContext.cpp:
366         (WebCore::FrameViewLayoutContext::layout):
367         (WebCore::FrameViewLayoutContext::scheduleLayout):
368         * page/MemoryRelease.cpp:
369         (WebCore::releaseCriticalMemory):
370         (WebCore::releaseMemory):
371         * page/MemoryRelease.h:
372         * page/Page.cpp:
373         (WebCore::Page::~Page):
374         (WebCore::Page::setViewScaleFactor):
375         (WebCore::Page::setDeviceScaleFactor):
376         * page/Page.h:
377         * page/PageGroup.cpp:
378         (WebCore::PageGroup::captionPreferencesChanged):
379         * page/PerformanceLogging.cpp:
380         (WebCore::PerformanceLogging::memoryUsageStatistics):
381         * page/Settings.yaml:
382         * page/SettingsBase.cpp:
383         (WebCore::SettingsBase::usesBackForwardCacheChanged):
384         * page/SettingsBase.h:
385         * page/animation/AnimationBase.cpp:
386         (WebCore::AnimationBase::setNeedsStyleRecalc):
387         * page/animation/CSSAnimationController.cpp:
388         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
389         (WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
390         (WebCore::CSSAnimationController::cancelAnimations):
391         (WebCore::CSSAnimationController::updateAnimations):
392         * page/animation/ImplicitAnimation.cpp:
393         (WebCore::ImplicitAnimation::sendTransitionEvent):
394         * page/animation/KeyframeAnimation.cpp:
395         (WebCore::KeyframeAnimation::sendAnimationEvent):
396         * page/scrolling/AsyncScrollingCoordinator.cpp:
397         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
398         * platform/mac/ScrollAnimatorMac.mm:
399         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
400         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
401         * rendering/RenderLayerBacking.cpp:
402         (WebCore::RenderLayerBacking::paintIntoLayer):
403         * rendering/RenderLayerCompositor.cpp:
404         (WebCore::RenderLayerCompositor::updateCompositingLayers):
405         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
406         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
407         * rendering/RenderLayerCompositor.h:
408         * rendering/RenderObject.h:
409         * rendering/SimpleLineLayoutCoverage.cpp:
410         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
411         * style/StyleTreeResolver.cpp:
412         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
413         * testing/Internals.cpp:
414         (WebCore::Internals::clearBackForwardCache):
415         (WebCore::Internals::backForwardCacheSize const):
416         (WebCore::Internals::preventDocumentForEnteringBackForwardCache):
417         * testing/Internals.h:
418         * testing/Internals.idl:
419         * xml/XMLHttpRequest.cpp:
420         (WebCore::XMLHttpRequest::suspend):
421
422 2019-10-16  John Wilander  <wilander@apple.com>
423
424         Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
425         https://bugs.webkit.org/show_bug.cgi?id=203017
426         <rdar://problem/56262708>
427
428         Reviewed by Alex Christensen.
429
430         NetworkStorageSession::shouldBlockCookies() now checks if the first-party website has
431         received user interaction and if not, blocks all third-party cookies, regardless of the
432         status of those third-party domains (prevalent or not).
433
434         Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.
435
436         Tests: http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html
437                http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html
438
439         * page/RuntimeEnabledFeatures.h:
440         (WebCore::RuntimeEnabledFeatures::setIsITPSessionSwitchingEnabled): Deleted.
441         (WebCore::RuntimeEnabledFeatures::isITPSessionSwitchingEnabled const): Deleted.
442         * page/Settings.yaml:
443         * platform/network/NetworkStorageSession.cpp:
444         (WebCore::NetworkStorageSession::hasHadUserInteractionAsFirstParty const):
445         (WebCore::NetworkStorageSession::shouldBlockCookies const):
446         (WebCore::NetworkStorageSession::setDomainsWithUserInteractionAsFirstParty):
447         * platform/network/NetworkStorageSession.h:
448         (WebCore::NetworkStorageSession::setIsThirdPartyCookieBlockingOnSitesWithoutUserInteractionEnabled):
449
450 2019-10-16  Zalan Bujtas  <zalan@apple.com>
451
452         [LFC][IFC] Add style and text content to Display::Run
453         https://bugs.webkit.org/show_bug.cgi?id=203045
454         <rdar://problem/56340105>
455
456         Reviewed by Antti Koivisto.
457
458         Painting Display::Runs requires style and text content. Currently there's no mapping structure to connect Display::Runs to Display::Boxes to access style and content.
459
460         * layout/displaytree/DisplayRun.h:
461         (WebCore::Display::Run::TextContext::content const):
462         (WebCore::Display::Run::style const):
463         (WebCore::Display::Run::Run):
464         (WebCore::Display::Run::TextContext::TextContext):
465         (WebCore::Display::Run::TextContext::expand):
466         * layout/inlineformatting/InlineLine.cpp:
467         (WebCore::Layout::Line::appendNonBreakableSpace):
468         (WebCore::Layout::Line::appendTextContent):
469         (WebCore::Layout::Line::appendNonReplacedInlineBox):
470         (WebCore::Layout::Line::appendHardLineBreak):
471         * layout/inlineformatting/InlineLine.h:
472         (WebCore::Layout::Line::Run::expand):
473
474 2019-10-16  Simon Fraser  <simon.fraser@apple.com>
475
476         Add dumping for BorderData and StyleBackgroundData
477         https://bugs.webkit.org/show_bug.cgi?id=203038
478
479         Reviewed by Zalan Bujtas.
480
481         As part of adding dumping for all RenderStyle data, add dumping support for 
482         BorderData and StyleBackgroundData.
483         
484         For large classes it's beneficial to avoid dumping default values; those classes
485         get a dump() function that can take an argument to say whether values which are default
486         should be printed.
487
488         * Sources.txt:
489         * WebCore.xcodeproj/project.pbxproj:
490         * platform/LengthSize.h:
491         (WebCore::LengthSize::isZero const):
492         * rendering/style/BorderData.cpp: Added.
493         (WebCore::operator<<):
494         (WebCore::BorderData::dump const):
495         * rendering/style/BorderData.h:
496         * rendering/style/RenderStyleConstants.h:
497         * rendering/style/StyleBackgroundData.cpp:
498         (WebCore::StyleBackgroundData::dump const):
499         (WebCore::operator<<):
500         * rendering/style/StyleBackgroundData.h:
501
502 2019-10-16  Chris Dumez  <cdumez@apple.com>
503
504         [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
505         https://bugs.webkit.org/show_bug.cgi?id=203034
506         <rdar://problem/56332453>
507
508         Reviewed by Antti Koivisto.
509
510         Use Seconds type for backForwardCacheExpirationInterval setting instead of
511         double, for clarity.
512
513         * history/CachedPage.cpp:
514         (WebCore::CachedPage::CachedPage):
515         (WebCore::CachedPage::hasExpired const):
516         * page/Settings.yaml:
517
518 2019-10-16  Zalan Bujtas  <zalan@apple.com>
519
520         [LFC][IFC] Fix various vertical alignment issues.
521         https://bugs.webkit.org/show_bug.cgi?id=203041
522
523         Reviewed by Antti Koivisto.
524
525         This patch fixes both regular inline box and inline-block baseline aligment. It also addresses a few related vertical positioning issues. 
526
527         * layout/inlineformatting/InlineLine.cpp:
528         (WebCore::Layout::Line::alignContentVertically):
529         (WebCore::Layout::Line::appendInlineContainerStart):
530         (WebCore::Layout::Line::appendInlineContainerEnd):
531         (WebCore::Layout::Line::appendTextContent):
532         (WebCore::Layout::Line::appendNonReplacedInlineBox):
533         (WebCore::Layout::Line::appendHardLineBreak):
534         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
535         (WebCore::Layout::Line::inlineItemContentHeight const):
536         * layout/inlineformatting/InlineLine.h:
537         * layout/inlineformatting/InlineLineBox.h:
538         (WebCore::Layout::LineBox::resetDescent):
539         (WebCore::Layout::LineBox::setLogicalHeightIfGreater):
540         (WebCore::Layout::LineBox::setBaselineOffsetIfGreater):
541         (WebCore::Layout::LineBox::setAscentIfGreater):
542         (WebCore::Layout::LineBox::setDescentIfGreater):
543         (WebCore::Layout::LineBox::resetBaseline):
544         (WebCore::
545         Layout::LineBox::setBaseline): Deleted.
546         (WebCore::Layout::LineBox::baseline): Deleted.
547         (WebCore::Layout::LineBox::setBaselineOffset): Deleted.
548         (WebCore::Layout::LineBox::Baseline::setAscentIfGreater): Deleted.
549         (WebCore::Layout::LineBox::Baseline::setDescentIfGreater): Deleted.
550
551 2019-10-16  Chris Dumez  <cdumez@apple.com>
552
553         Drop unused WKPageSetResourceCachingDisabled() SPI
554         https://bugs.webkit.org/show_bug.cgi?id=203035
555
556         Reviewed by Alex Christensen.
557
558         * history/PageCache.cpp:
559         (WebCore::canCachePage):
560         (WebCore::PageCache::take):
561         (WebCore::PageCache::get):
562         * html/HTMLMediaElement.cpp:
563         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
564         * inspector/agents/page/PageNetworkAgent.cpp:
565         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
566         * inspector/agents/worker/WorkerNetworkAgent.cpp:
567         (WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
568         * loader/FrameLoader.cpp:
569         (WebCore::FrameLoader::subresourceCachePolicy const):
570         (WebCore::FrameLoader::addExtraFieldsToRequest):
571         * loader/cache/CachedResourceLoader.cpp:
572         (WebCore::CachedResourceLoader::cachePolicy const):
573         * page/Page.h:
574         (WebCore::Page::isResourceCachingDisabledByWebInspector const):
575         (WebCore::Page::setResourceCachingDisabledByWebInspector):
576         (WebCore::Page::isResourceCachingDisabled const): Deleted.
577         (WebCore::Page::setResourceCachingDisabled): Deleted.
578         (WebCore::Page::setResourceCachingDisabledOverride): Deleted.
579         * workers/WorkerDebuggerProxy.h:
580         * workers/WorkerMessagingProxy.cpp:
581         (WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
582         (WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
583         * workers/WorkerMessagingProxy.h:
584         * workers/service/context/ServiceWorkerThreadProxy.cpp:
585         (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
586         (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
587         * workers/service/context/ServiceWorkerThreadProxy.h:
588
589 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
590
591         DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testRunner.accummulateLogsForChannel
592         https://bugs.webkit.org/show_bug.cgi?id=203024
593
594         Reviewed by Alex Christensen.
595
596         * platform/LogInitialization.h:
597         * platform/Logging.cpp:
598         (WebCore::clearAllLogChannelsToAccumulate): Added.
599         * platform/Logging.h:
600         * testing/js/WebCoreTestSupport.cpp:
601         (WebCoreTestSupport::clearAllLogChannelsToAccumulate): Added.
602         * testing/js/WebCoreTestSupport.h:
603
604 2019-10-16  Youenn Fablet  <youenn@apple.com>
605
606         WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly
607         https://bugs.webkit.org/show_bug.cgi?id=202930
608         <rdar://problem/56006776>
609
610         Reviewed by Eric Carlson.
611
612         There is a time where the bus channel number and audio source channel numbers may be different.
613         In case the bus channel number is less than the audio source channel number, initialization of
614         the WebAudioBufferList might not be fully done.
615         In that case, output silence and return early.
616         Reduce the number of frames to process based on the number of frames the output audio bus plans to process.
617
618         Partially covered by new API test (this a race so we cannot reproduce the crash easily).
619
620         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
621         (WebCore::MediaStreamAudioSourceNode::process):
622         Make sure to process the number of frames the output bus expect.
623         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
624         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
625
626 2019-10-16  Zalan Bujtas  <zalan@apple.com>
627
628         [LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore fixed width columns
629         https://bugs.webkit.org/show_bug.cgi?id=203010
630
631         Reviewed by Antti Koivisto.
632
633         Fixed width columns (e.g. <col width=100px>) don't participate in the extra horizontal space distribution.
634
635         * layout/tableformatting/TableFormattingContext.cpp:
636         (WebCore::Layout::TableFormattingContext::computedTableWidth):
637         (WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace):
638         (WebCore::Layout::TableFormattingContext::distributeAvailableWidth): Deleted.
639         * layout/tableformatting/TableFormattingContext.h:
640         * layout/tableformatting/TableGrid.cpp:
641         (WebCore::Layout::TableGrid::Column::hasFixedWidth const):
642         (WebCore::Layout::TableGrid::widthConstraints const):
643         * layout/tableformatting/TableGrid.h:
644         (WebCore::Layout::TableGrid::totalHorizontalSpacing const):
645         (WebCore::Layout::TableGrid::columnsContext const):
646
647 2019-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
648
649         [GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
650         https://bugs.webkit.org/show_bug.cgi?id=202976
651
652         Reviewed by Adrian Perez de Castro.
653
654         This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
655         blob, so we shouldn't assert.
656
657         * platform/sql/SQLiteStatement.cpp:
658         (WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.
659
660 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
661
662         Unreviewed build fix for Windows ports
663         https://bugs.webkit.org/show_bug.cgi?id=203016
664         <rdar://problem/56317774>
665
666         * page/DOMTimer.h: Added WEBCORE_EXPORT to ~DOMTimer().
667
668 2019-10-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
669
670         image/apng not recognized in source tag
671         https://bugs.webkit.org/show_bug.cgi?id=202785
672
673         Reviewed by Dean Jackson.
674
675         Add image/apng as supported mime type for images on Mac/iOS and
676         on all the other platforms that enable apng support.
677
678         This fixes the test imported/w3c/web-platform-tests/apng/supported-in-source-type.html
679
680         * platform/MIMETypeRegistry.cpp:
681         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
682
683 2019-10-15  Ryosuke Niwa  <rniwa@webkit.org>
684
685         adoptRef DOMTimer in install instead of its constructor
686         https://bugs.webkit.org/show_bug.cgi?id=203016
687
688         Reviewed by Simon Fraser.
689
690         Moved the code to add DOMTimer to ScriptExecutionContext's map to DOMTimer::install
691         instead of its constructor so that we can adoptRef there instead for clarity & simplicity.
692
693         * dom/ScriptExecutionContext.h:
694         (WebCore::ScriptExecutionContext::addTimeout):
695         * page/DOMTimer.cpp:
696         (WebCore::DOMTimer::DOMTimer):
697         (WebCore::DOMTimer::install):
698         (WebCore::DOMTimer::fired):
699
700 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
701
702         ScrollingTreeScrollingNodeDelegateMac::stretchAmount() should not have side effects
703         https://bugs.webkit.org/show_bug.cgi?id=203009
704
705         Reviewed by Dean Jackson.
706
707         Calling ScrollingTreeScrollingNodeDelegateMac::stretchAmount() had the side effect of calling
708         setMainFrameIsRubberBanding() on the scrolling tree.
709         
710         Remove this badness and replace it by modifying updateMainFramePinState() (which is called every time
711         the scroll position changes) to also compute if we're rubber-banding.
712         
713         Also make a bunch of methods on ScrollControllerClient const, which makes it clear that
714         they don't have side effects.
715
716         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
717         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
718         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
719         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
720         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState):
721         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState): Deleted.
722         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
723         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
724         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture const):
725         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const):
726         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const):
727         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount const):
728         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection const):
729         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally const):
730         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically const):
731         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
732         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
733         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching): Deleted.
734         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching): Deleted.
735         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount): Deleted.
736         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection): Deleted.
737         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally): Deleted.
738         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically): Deleted.
739         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection): Deleted.
740         * platform/cocoa/ScrollController.h:
741         * platform/mac/ScrollAnimatorMac.h:
742         * platform/mac/ScrollAnimatorMac.mm:
743         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent const):
744         (WebCore::ScrollAnimatorMac::pinnedInDirection const):
745         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture const):
746         (WebCore::ScrollAnimatorMac::allowsVerticalStretching const):
747         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching const):
748         (WebCore::ScrollAnimatorMac::stretchAmount const):
749         (WebCore::ScrollAnimatorMac::canScrollHorizontally const):
750         (WebCore::ScrollAnimatorMac::canScrollVertically const):
751         (WebCore::ScrollAnimatorMac::shouldRubberBandInDirection const):
752         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): Deleted.
753         (WebCore::ScrollAnimatorMac::pinnedInDirection): Deleted.
754         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
755         (WebCore::ScrollAnimatorMac::allowsVerticalStretching): Deleted.
756         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching): Deleted.
757         (WebCore::ScrollAnimatorMac::stretchAmount): Deleted.
758         (WebCore::ScrollAnimatorMac::canScrollHorizontally): Deleted.
759         (WebCore::ScrollAnimatorMac::canScrollVertically): Deleted.
760         (WebCore::ScrollAnimatorMac::shouldRubberBandInDirection): Deleted.
761         * platform/mock/ScrollAnimatorMock.h:
762
763 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
764
765         WheelEventTestMonitor doesn't need to be threadsafe
766         https://bugs.webkit.org/show_bug.cgi?id=203012
767
768         Reviewed by Dean Jackson.
769
770         WheelEventTestMonitor is only called on the main thread, so doesn't need a lock to protect
771         m_deferCompletionReasons, and add main thread assertions.
772
773         * page/WheelEventTestMonitor.cpp:
774         (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
775         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
776         (WebCore::WheelEventTestMonitor::deferForReason):
777         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
778         (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
779         * page/WheelEventTestMonitor.h:
780
781 2019-10-15  Andres Gonzalez  <andresg_22@apple.com>
782
783         AX: Make AXIsolatedTree compile again
784         https://bugs.webkit.org/show_bug.cgi?id=202702
785         <rdar://problem/56084968>
786
787         Reviewed by Joanmarie Diggs.
788
789         Re-submitting r251045 with a fix for internal builds.
790
791         * accessibility/AXObjectCache.cpp:
792         (WebCore::AXObjectCache::remove):
793         (WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy):
794         * accessibility/isolatedtree/AXIsolatedTree.cpp:
795         (WebCore::AXIsolatedTree::treePageCache):
796         (WebCore::AXIsolatedTree::nodeForID const):
797         (WebCore::AXIsolatedTree::applyPendingChanges):
798         (WebCore::AXIsolatedTree::initializePageTreeForID): Deleted.
799         (WebCore::AXIsolatedTree::setInitialRequestInProgress): Deleted.
800         * accessibility/isolatedtree/AXIsolatedTree.h:
801         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
802         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
803         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
804         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
805         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
806         (convertToNSArray):
807         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
808         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
809
810 2019-10-15  Ryosuke Niwa  <rniwa@webkit.org>
811
812         [iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
813         https://bugs.webkit.org/show_bug.cgi?id=202878
814
815         Unreviewed. Addressed Darin's post-commit review comment.
816
817         * dom/Node.cpp:
818         (WebCore::tryAddEventListener):
819
820 2019-10-15  Chris Dumez  <cdumez@apple.com>
821
822         [macOS] Simplify main thread initialization
823         https://bugs.webkit.org/show_bug.cgi?id=203001
824
825         Reviewed by Geoff Garen.
826
827         * bridge/objc/WebScriptObject.mm:
828         (+[WebScriptObject initialize]):
829         * platform/cocoa/SharedBufferCocoa.mm:
830         (+[WebCoreSharedBufferData initialize]):
831
832 2019-10-15  Peng Liu  <peng.liu6@apple.com>
833
834         [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture()
835         https://bugs.webkit.org/show_bug.cgi?id=201024
836
837         Reviewed by Eric Carlson.
838
839         Implement the support to enter and exit PiP mode with the Picture-in-Picture API.
840         Majority work of this patch was done by Carlos Eduardo Ramalho <cadubentzen@gmail.com>.
841
842         Also, fix a build error of Modules/webaudio/OfflineAudioContext.cpp because of this patch (due to unified build).
843
844         Tests: imported/w3c/web-platform-tests/picture-in-picture/css-selector.html
845                imported/w3c/web-platform-tests/picture-in-picture/disable-picture-in-picture.html
846                imported/w3c/web-platform-tests/picture-in-picture/enter-picture-in-picture.html
847                imported/w3c/web-platform-tests/picture-in-picture/exit-picture-in-picture.html
848                imported/w3c/web-platform-tests/picture-in-picture/idlharness.window.html
849                imported/w3c/web-platform-tests/picture-in-picture/leave-picture-in-picture.html
850                imported/w3c/web-platform-tests/picture-in-picture/mediastream.html
851                imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-element.html
852                imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-window.html
853                imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture-twice.html
854                imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture.html
855                imported/w3c/web-platform-tests/picture-in-picture/shadow-dom.html
856
857         * CMakeLists.txt:
858         * Configurations/FeatureDefines.xcconfig:
859         * DerivedSources-input.xcfilelist:
860         * DerivedSources-output.xcfilelist:
861         * DerivedSources.make:
862         * Modules/pictureinpicture/DocumentPictureInPicture.cpp: Added.
863         (WebCore::DocumentPictureInPicture::exitPictureInPicture):
864         (WebCore::DocumentPictureInPicture::from):
865         * Modules/pictureinpicture/DocumentPictureInPicture.h: Added.
866         (WebCore::DocumentPictureInPicture::pictureInPictureEnabled):
867         (WebCore::DocumentPictureInPicture::supplementName):
868         * Modules/pictureinpicture/DocumentPictureInPicture.idl: Added.
869         * Modules/pictureinpicture/EnterPictureInPictureEvent.cpp: Added.
870         (WebCore::EnterPictureInPictureEvent::create):
871         (WebCore::EnterPictureInPictureEvent::EnterPictureInPictureEvent):
872         * Modules/pictureinpicture/EnterPictureInPictureEvent.h: Added.
873         * Modules/pictureinpicture/EnterPictureInPictureEvent.idl: Added.
874         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp: Added.
875         (WebCore::HTMLVideoElementPictureInPicture::HTMLVideoElementPictureInPicture):
876         (WebCore::HTMLVideoElementPictureInPicture::~HTMLVideoElementPictureInPicture):
877         (WebCore::HTMLVideoElementPictureInPicture::from):
878         (WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture):
879         (WebCore::HTMLVideoElementPictureInPicture::autoPictureInPicture):
880         (WebCore::HTMLVideoElementPictureInPicture::setAutoPictureInPicture):
881         (WebCore::HTMLVideoElementPictureInPicture::disablePictureInPicture):
882         (WebCore::HTMLVideoElementPictureInPicture::setDisablePictureInPicture):
883         (WebCore::HTMLVideoElementPictureInPicture::exitPictureInPicture):
884         (WebCore::HTMLVideoElementPictureInPicture::didEnterPictureInPicture):
885         (WebCore::HTMLVideoElementPictureInPicture::didExitPictureInPicture):
886         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h: Added.
887         (WebCore::HTMLVideoElementPictureInPicture::supplementName):
888         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: Added.
889         * Modules/pictureinpicture/PictureInPictureWindow.cpp: Added.
890         (WebCore::PictureInPictureWindow::create):
891         (WebCore::PictureInPictureWindow::PictureInPictureWindow):
892         (WebCore::PictureInPictureWindow::activeDOMObjectName const):
893         (WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const):
894         (WebCore::PictureInPictureWindow::eventTargetInterface const):
895         (WebCore::PictureInPictureWindow::scriptExecutionContext const):
896         * Modules/pictureinpicture/PictureInPictureWindow.h: Added.
897         * Modules/pictureinpicture/PictureInPictureWindow.idl: Added.
898         * Modules/webaudio/OfflineAudioContext.cpp:
899         * Sources.txt:
900         * WebCore.xcodeproj/project.pbxproj:
901         * bindings/js/WebCoreBuiltinNames.h:
902         * dom/Document.cpp:
903         (WebCore::Document::pictureInPictureElement const):
904         (WebCore::Document::setPictureInPictureElement):
905         * dom/Document.h:
906         * dom/DocumentOrShadowRoot.idl:
907         * dom/EventNames.h:
908         * dom/EventNames.in:
909         * dom/EventTargetFactory.in:
910         * dom/ShadowRoot.cpp:
911         (WebCore::ShadowRoot::pictureInPictureElement const):
912         * dom/ShadowRoot.h:
913         * html/HTMLVideoElement.cpp:
914         (WebCore::HTMLVideoElement::fullscreenModeChanged):
915         (WebCore::HTMLVideoElement::setPictureInPictureObserver):
916         * html/HTMLVideoElement.h:
917         * page/Settings.yaml:
918         * platform/PictureInPictureObserver.h: Added.
919         (WebCore::PictureInPictureObserver::~PictureInPictureObserver):
920         * testing/InternalSettings.h:
921
922 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
923
924         Add TextStream dumping for ThemeTypes enums
925         https://bugs.webkit.org/show_bug.cgi?id=202972
926
927         Reviewed by Dean Jackson.
928
929         Make ControlPart, SelectionPart, ThemeFont and ThemeColor dumpable.
930
931         * Sources.txt:
932         * WebCore.xcodeproj/project.pbxproj:
933         * platform/ThemeTypes.cpp: Added.
934         (WebCore::operator<<):
935         * platform/ThemeTypes.h:
936
937 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
938
939         Add dumping for Animation and AnimationList
940         https://bugs.webkit.org/show_bug.cgi?id=202973
941
942         Reviewed by Dean Jackson.
943
944         Make Animation, AnimationList and related enums dumpable.
945
946         * platform/animation/Animation.cpp:
947         (WebCore::operator<<):
948         * platform/animation/Animation.h:
949         * platform/animation/AnimationList.cpp:
950         (WebCore::operator<<):
951         * platform/animation/AnimationList.h:
952
953 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
954
955         Don't mutate a NinePieceImage to create a mask default image
956         https://bugs.webkit.org/show_bug.cgi?id=202967
957
958         Reviewed by Dean Jackson.
959
960         For every StyleRareNonInheritedData, the maskBoxImage undergoes copy-on-write
961         via maskBoxImage.setMaskDefaults(). Fix by giving NinePieceImage a constructor
962         argument that cna make the mask flavor of image.
963
964         * css/StyleBuilderConverter.h:
965         (WebCore::StyleBuilderConverter::convertBorderMask):
966         (WebCore::StyleBuilderConverter::convertReflection):
967         * rendering/style/NinePieceImage.cpp:
968         (WebCore::NinePieceImage::defaultMaskData):
969         (WebCore::NinePieceImage::NinePieceImage):
970         * rendering/style/NinePieceImage.h:
971         (WebCore::NinePieceImage::setMaskDefaults): Deleted.
972         * rendering/style/StyleRareNonInheritedData.cpp:
973         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
974         * rendering/style/StyleReflection.h:
975         (WebCore::StyleReflection::StyleReflection):
976
977 2019-10-15  youenn fablet  <youenn@apple.com>
978
979         Move headers to keep from a HTTPHeaderNameSet to an OptionSet
980         https://bugs.webkit.org/show_bug.cgi?id=202977
981
982         Reviewed by Anders Carlsson.
983
984         Covered by existing tests.
985         New representation is smaller and more efficient to process.
986
987         * loader/CrossOriginAccessControl.cpp:
988         (WebCore::httpHeadersToKeepFromCleaning):
989         (WebCore::cleanHTTPRequestHeadersForAccessControl):
990         * loader/CrossOriginAccessControl.h:
991         (WebCore::cleanHTTPRequestHeadersForAccessControl): Deleted.
992         * loader/ResourceLoaderOptions.h:
993
994 2019-10-15  Zalan Bujtas  <zalan@apple.com>
995
996         [LFC][TFC] Use <col> to adjust the preferred column width.
997         https://bugs.webkit.org/show_bug.cgi?id=202997
998         <rdar://problem/56300345>
999
1000         Reviewed by Antti Koivisto.
1001
1002         The <col> elment can set the preferred width on the table column. Let's take these values into account while computing the preferred width for columns.
1003
1004         * layout/tableformatting/TableFormattingContext.cpp:
1005         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1006         * layout/tableformatting/TableFormattingContext.h:
1007         * layout/tableformatting/TableFormattingContextGeometry.cpp:
1008         (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const):
1009         * layout/tableformatting/TableGrid.h:
1010         (WebCore::Layout::TableGrid::Column::columnBox const):
1011
1012 2019-10-15  Zalan Bujtas  <zalan@apple.com>
1013
1014         [LFC][TFC] Add support for colgroup/col
1015         https://bugs.webkit.org/show_bug.cgi?id=202991
1016         <rdar://problem/56294715>
1017
1018         Reviewed by Antti Koivisto.
1019
1020         This patch sets up the column context when <colgroup> is present. This is in preparation for using <col>'s width to adjust the preferred width on table columns.
1021
1022         * layout/layouttree/LayoutTreeBuilder.cpp:
1023         (WebCore::Layout::TreeBuilder::createLayoutBox):
1024         * layout/tableformatting/TableFormattingContext.cpp:
1025         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
1026         * layout/tableformatting/TableGrid.cpp:
1027         (WebCore::Layout::TableGrid::Column::Column):
1028         (WebCore::Layout::TableGrid::ColumnsContext::addColumn):
1029         * layout/tableformatting/TableGrid.h:
1030
1031 2019-10-15  Alex Christensen  <achristensen@webkit.org>
1032
1033         Unreviewed, rolling out r251138.
1034
1035         Broke API tests
1036
1037         Reverted changeset:
1038
1039         "Pass CORS-enabled schemes through WebProcess instead of
1040         having them NetworkProcess-global"
1041         https://bugs.webkit.org/show_bug.cgi?id=202891
1042         https://trac.webkit.org/changeset/251138
1043
1044 2019-10-15  Chris Dumez  <cdumez@apple.com>
1045
1046         Stop using inheritance for WebBackForwardCacheEntry
1047         https://bugs.webkit.org/show_bug.cgi?id=202989
1048
1049         Reviewed by Alex Christensen.
1050
1051         * history/BackForwardItemIdentifier.h:
1052         (WebCore::BackForwardItemIdentifier::operator bool const):
1053
1054 2019-10-15  Alex Christensen  <achristensen@webkit.org>
1055
1056         Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
1057         https://bugs.webkit.org/show_bug.cgi?id=202891
1058
1059         Reviewed by Youenn Fablet.
1060
1061         * platform/LegacySchemeRegistry.cpp:
1062         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
1063         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
1064         (WebCore::LegacySchemeRegistry::allURLSchemesRegisteredAsCORSEnabled):
1065         * platform/LegacySchemeRegistry.h:
1066
1067 2019-10-15  Zalan Bujtas  <zalan@apple.com>
1068
1069         [LFC] Adjust computed width value when box sizing is border-box
1070         https://bugs.webkit.org/show_bug.cgi?id=202966
1071         <rdar://problem/56277954>
1072
1073         Reviewed by Antti Koivisto.
1074
1075         box-sizing: border-box; means the width value sets the size of the border box (and not the content box).
1076
1077         * layout/FormattingContext.cpp:
1078         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1079         * layout/FormattingContext.h:
1080         * layout/FormattingContextGeometry.cpp:
1081         (WebCore::Layout::FormattingContext::Geometry::computedContentWidth const):
1082         (WebCore::Layout::FormattingContext::Geometry::computedMinWidth const):
1083         (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth const):
1084         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1085         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1086         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
1087         * layout/blockformatting/BlockFormattingContext.cpp:
1088         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1089         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1090         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
1091
1092 2019-10-15  Zalan Bujtas  <zalan@apple.com>
1093
1094         [LFC][TFC] Add <col> element's width attribute value to Layout::Box rare data
1095         https://bugs.webkit.org/show_bug.cgi?id=202988
1096         <rdar://problem/56291048>
1097
1098         Reviewed by Antti Koivisto.
1099
1100         Sadly RenderStyle does not have this value.
1101
1102         * layout/layouttree/LayoutBox.cpp:
1103         (WebCore::Layout::Box::setColumnWidth):
1104         (WebCore::Layout::Box::columnWidth const):
1105         * layout/layouttree/LayoutBox.h:
1106         * layout/layouttree/LayoutTreeBuilder.cpp:
1107         (WebCore::Layout::TreeBuilder::createLayoutBox):
1108         (WebCore::Layout::outputLayoutBox):
1109
1110 2019-10-15  Zalan Bujtas  <zalan@apple.com>
1111
1112         [LFC] Adjust computed height value when box sizing is border-box
1113         https://bugs.webkit.org/show_bug.cgi?id=202965
1114         <rdar://problem/56276771>
1115
1116         Reviewed by Antti Koivisto.
1117
1118         box-sizing: border-box; means the height value sets the size of the border box (and not the content box).  
1119
1120         * layout/FormattingContext.cpp:
1121         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1122         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1123         * layout/FormattingContext.h:
1124         * layout/FormattingContextGeometry.cpp:
1125         (WebCore::Layout::FormattingContext::Geometry::computedContentHeight const):
1126         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1127         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1128         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
1129         (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
1130         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1131         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
1132         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
1133         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
1134         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1135         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1136         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
1137         * layout/LayoutState.cpp:
1138         (WebCore::Layout::LayoutState::displayBoxForLayoutBox):
1139         * layout/LayoutUnits.h:
1140         * layout/blockformatting/BlockFormattingContext.cpp:
1141         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1142         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1143         * layout/blockformatting/BlockFormattingContext.h:
1144         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1145         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1146         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
1147         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const):
1148         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1149         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1150         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1151         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1152         * layout/displaytree/DisplayBox.cpp:
1153         (WebCore::Display::Box::Box):
1154         (WebCore::Display::Box::Style::Style): Deleted.
1155         * layout/displaytree/DisplayBox.h:
1156         * layout/inlineformatting/InlineFormattingContext.cpp:
1157         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
1158         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1159         * layout/inlineformatting/InlineFormattingContext.h:
1160         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1161         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1162         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
1163         * layout/tableformatting/TableFormattingContext.cpp:
1164         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
1165         * layout/tableformatting/TableFormattingContext.h:
1166         * layout/tableformatting/TableFormattingContextGeometry.cpp:
1167         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
1168
1169 2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1170
1171         [Clipboard API] Implement getType() for ClipboardItems created from bindings
1172         https://bugs.webkit.org/show_bug.cgi?id=202943
1173
1174         Reviewed by Tim Horton.
1175
1176         Adds basic support for ClipboardItem.getType(), in the case where the ClipboardItems are created by the page. To
1177         achieve this, we introduce ClipboardItemDataSource, which represents the data source backing a given clipboard
1178         item. This backing may either consist of a list of types and their corresponding DOMPromises (for ClipboardItems
1179         that come from the page), or may consist of a list of items that will ask the platformr pasteboard for their
1180         data (to be supported in a future patch).
1181
1182         See below for more details.
1183
1184         Test: editing/async-clipboard/clipboard-item-basic.html
1185
1186         * Modules/async-clipboard/Clipboard.h:
1187         * Modules/async-clipboard/ClipboardItem.cpp:
1188         (WebCore::clipboardItemPresentationStyle):
1189         (WebCore::ClipboardItem::ClipboardItem):
1190
1191         Pass in the parent Clipboard object for ClipboardItems that are backed by the platform pasteboard (which are
1192         returned by Clipboard.read()). (Note that this doesn't make any difference until this codepath is actually
1193         exercised when we add support for Clipboard.read()).
1194
1195         (WebCore::ClipboardItem::create):
1196         (WebCore::ClipboardItem::types const):
1197         (WebCore::ClipboardItem::getType):
1198
1199         Plumb types() and getType() to the clipboard item's datasource.
1200
1201         (WebCore::ClipboardItem::navigator):
1202
1203         Make navigator() return the parent Clipboard object's navigator.
1204
1205         * Modules/async-clipboard/ClipboardItem.h:
1206         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: Added.
1207         (WebCore::blobFromString):
1208         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemBindingsDataSource):
1209
1210         Store the given list of types and DOM promises.
1211
1212         (WebCore::ClipboardItemBindingsDataSource::types const):
1213         (WebCore::ClipboardItemBindingsDataSource::getType):
1214
1215         Implement getType() by finding the matching promised type in the item's array of types, and waiting for the
1216         promise to either resolve or reject. If the promise resolves to either a string or blob, we deliver the result
1217         back to the page by resolving the promise returned by getType(). Otherwise, we reject it.
1218
1219         * Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
1220         * Modules/async-clipboard/ClipboardItemDataSource.h:
1221         (WebCore::ClipboardItemDataSource::ClipboardItemDataSource):
1222         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
1223
1224         Add a stub implementation of a clipboard item data source that is backed by data in the platform pasteboard. In
1225         a future patch, this will implement getType() by calling out to the platform pasteboard.
1226
1227         (WebCore::ClipboardItemPasteboardDataSource::ClipboardItemPasteboardDataSource):
1228         (WebCore::ClipboardItemPasteboardDataSource::types const):
1229         (WebCore::ClipboardItemPasteboardDataSource::getType):
1230         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.h:
1231         * Modules/mediastream/RTCRtpReceiver.cpp:
1232         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
1233
1234         Unrelated build fixes, due to changes in unified source groupings.
1235
1236         * Sources.txt:
1237         * WebCore.xcodeproj/project.pbxproj:
1238         * platform/network/mac/UTIUtilities.mm:
1239
1240         More build fixes, due to changes in unified source groupings.
1241
1242 2019-10-15  Zalan Bujtas  <zalan@apple.com>
1243
1244         [LFC][IFC] Add support for text-transform: uppercase/lowercase
1245         https://bugs.webkit.org/show_bug.cgi?id=202968
1246         <rdar://problem/56278141>
1247
1248         Reviewed by Antti Koivisto.
1249
1250         The text content on the layout box should be in its final state (This might change if we actually need the original content for some reason though).
1251
1252         * layout/layouttree/LayoutTreeBuilder.cpp:
1253         (WebCore::Layout::applyTextTransform):
1254         (WebCore::Layout::TreeBuilder::createLayoutBox):
1255
1256 2019-10-14  Youenn Fablet  <youenn@apple.com>
1257
1258         Handle service worker loads through NetworkResourceLoader
1259         https://bugs.webkit.org/show_bug.cgi?id=202309
1260
1261         Reviewed by Alex Christensen.
1262
1263         Allow to serialize HTTP header names as enumeration.
1264         Updated SWServer ability to handle schemes by adding built-in support for HTTP and HTTPS as done in LegacySchemeRegistry.
1265
1266         Covered by existing tests.
1267
1268         * loader/ResourceLoaderOptions.h:
1269         * platform/network/create-http-header-name-table:
1270         * workers/service/server/SWServer.cpp:
1271         (WebCore::SWServer::canHandleScheme const):
1272         * workers/service/server/SWServer.h:
1273         * workers/service/server/SWServerJobQueue.cpp:
1274         (WebCore::SWServerJobQueue::runRegisterJob):
1275
1276 2019-10-14  Tim Horton  <timothy_horton@apple.com>
1277
1278         Unify sources for bindings more densely
1279         https://bugs.webkit.org/show_bug.cgi?id=202918
1280
1281         Reviewed by Simon Fraser.
1282
1283         No new tests, just a build time speedup.
1284         For me, this is a reliable 17% boost on the WebCore Build Time Benchmark.
1285
1286         * Scripts/generate-unified-sources.sh:
1287         Use dense bundles for JS* and bindings/js/*.
1288         This seems acceptable for a few reasons:
1289
1290         - most of the time building these files is spent parsing the exact
1291         same set of JSC headers, because the generated bindings code ends
1292         up including the same set of things
1293
1294         - the incremental build cost of bundling more bindings sources together
1295         is small, because the JSC headers dominate the time
1296
1297         - folks will frequently have to rebuild all of the bindings (on every
1298         pull, for example, because they indirectly include most JSC headers),
1299         but rarely end up rebuilding only a single one (in my experience)
1300
1301         * bindings/js/ReadableStreamDefaultController.cpp:
1302         (WebCore::readableStreamCallFunction):
1303         (WebCore::ReadableStreamDefaultController::invoke):
1304         (WebCore::callFunction): Deleted.
1305         Deduplicate static functions that now get bundled together.
1306
1307         * platform/graphics/ca/PlatformCALayer.cpp:
1308         (WebCore::PlatformCALayer::currentTimeToMediaTime):
1309         * platform/graphics/ca/PlatformCALayer.h:
1310         In older macOS SDKs, CABase.h included ApplicationServices.h, which
1311         causes lots of trouble.
1312
1313 2019-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1314
1315         [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER
1316         https://bugs.webkit.org/show_bug.cgi?id=202362
1317
1318         Reviewed by Carlos Alberto Lopez Perez.
1319
1320         The problem is that PlatformDisplayLibWPE::initialize() is failing to initialize the EGL display for some
1321         reason. We need to understand why, but we should also handle the case of failing to initialize the EGL display
1322         and simply disable accelerated compositing mode to avoid white pages and crashes in websites using WebGL. This
1323         patch doesn't actually fix the bug, it just handles the EGL display initialization failure.
1324
1325         * platform/graphics/PlatformDisplay.cpp:
1326         (WebCore::PlatformDisplay::~PlatformDisplay): Set s_sharedDisplayForCompositing to nullptr when the shared
1327         display for compositing is destroyed.
1328         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
1329         (WebCore::PlatformDisplayLibWPE::initialize): Return false when EGL display initialization fails.
1330         * platform/graphics/libwpe/PlatformDisplayLibWPE.h:
1331
1332 2019-10-14  Chris Dumez  <cdumez@apple.com>
1333
1334         [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses
1335         https://bugs.webkit.org/show_bug.cgi?id=202929
1336         <rdar://problem/56250421>
1337
1338         Reviewed by Alex Christensen.
1339
1340         Drop FrameLoaderClient::didSaveToPageCache() function as it is no longer needed.
1341         Instead, we now call HistoryItem::notifyChanged() whenever HistoryItem::m_cachedPage
1342         changes. This communicates to the UIProcess whether or not a HistoryItem has an
1343         associated CachedPage.
1344
1345         I also added more release logging to the PageCache and renamed its logging channel
1346         from PageCache to WebBackForwardCache to match the UIProcess's channel.
1347
1348         * history/BackForwardItemIdentifier.h:
1349         (WebCore::BackForwardItemIdentifier::string const):
1350         * history/CachedFrame.cpp:
1351         (WebCore::CachedFrame::CachedFrame):
1352         * history/HistoryItem.cpp:
1353         (WebCore::HistoryItem::setCachedPage):
1354         (WebCore::HistoryItem::takeCachedPage):
1355         * history/HistoryItem.h:
1356         * history/PageCache.cpp:
1357         (WebCore::PageCache::addIfCacheable):
1358         (WebCore::PageCache::take):
1359         (WebCore::PageCache::removeAllItemsForPage):
1360         (WebCore::PageCache::get):
1361         (WebCore::PageCache::remove):
1362         (WebCore::PageCache::prune):
1363         * loader/EmptyFrameLoaderClient.h:
1364         * loader/FrameLoader.cpp:
1365         (WebCore::FrameLoader::commitProvisionalLoad):
1366         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
1367         * loader/FrameLoaderClient.h:
1368         * platform/Logging.h:
1369
1370 2019-10-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
1371
1372         Outsets for referenced SVG filters are always zero
1373         https://bugs.webkit.org/show_bug.cgi?id=202826
1374
1375         Reviewed by Simon Fraser.
1376
1377         Sometimes the filter is applied only to a part of the image, so we need
1378         to enlarge the source rectangle such that the border of the result image
1379         looks like as if the filter were applied to the whole image.
1380
1381         The filter outsets should only be calculated for the blur and the drop
1382         shadow filters. The problem is FilterOperations::outsets() was returning
1383         empty outsets always for the referenced filters.
1384
1385         Since the referenced filters must be software filters, the fix is to rely
1386         on CSSFilter in calculating the filter outsets for software filters.
1387
1388         By adding a virtual function called outset() to the FilterEffect class, 
1389         we can loop through the CSSFilter::m_effects asking every FilterEffect
1390         to return its outset(). This function is only overridden by FEDropShadow
1391         and FEGaussianBlur.
1392
1393         This should work because RenderLayer builds the CSSFilter when the styleChanged()
1394         happens through its updateFilterPaintingStrategy(). This will guarantee 
1395         that m_filters->filter()->outsets() will return the correct outsets for
1396         the referenced and the non-referenced software filters.
1397
1398         We should keep FilterOperations::outsets() because it has be used for
1399         the hardware non-referenced filters. In that case, RenderLayer does not
1400         build the the filter effects. Therefore m_filters can't be used because
1401         it is null in this case.
1402
1403         For accuracy, hasOutsets() implementation is deleted. Having a blur or
1404         drop shadow filter effect is not enough to say hasOutsets() is true. We
1405         need to calculate the outsets first and then ask if it isZero() or not.
1406
1407         Test: css3/filters/svg-blur-filter-clipped.html
1408
1409         * platform/graphics/IntRectExtent.h:
1410         (WebCore::operator==):
1411         (WebCore::operator+=):
1412         (WebCore::IntRectExtent::expandRect const): Deleted.
1413         IntRectExtent is only used as a filter outsets. So add the definition of
1414         IntOutsets in IntRectExtent.h.
1415
1416         * platform/graphics/filters/FEDropShadow.cpp:
1417         (WebCore::FEDropShadow::outsets const):
1418         * platform/graphics/filters/FEDropShadow.h:
1419         * platform/graphics/filters/FEGaussianBlur.cpp:
1420         (WebCore::FEGaussianBlur::calculateOutsetSize):
1421         (WebCore::FEGaussianBlur::outsets const):
1422         * platform/graphics/filters/FEGaussianBlur.h:
1423         * platform/graphics/filters/FilterEffect.h:
1424         (WebCore::FilterEffect::outsets const):
1425         * platform/graphics/filters/FilterOperations.cpp:
1426         (WebCore::FilterOperations::outsets const):
1427         (WebCore::outsetSizeForBlur): Deleted.
1428         (WebCore::FilterOperations::hasOutsets const): Deleted.
1429         * platform/graphics/filters/FilterOperations.h:
1430         (WebCore::FilterOperations::hasOutsets const):
1431         * platform/graphics/texmap/TextureMapperLayer.cpp:
1432         (WebCore::TextureMapperLayer::computeOverlapRegions):
1433
1434         * rendering/CSSFilter.cpp:
1435         (WebCore::CSSFilter::build):
1436         (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
1437         (WebCore::CSSFilter::outsets const):
1438         Calculate m_outsets once and cache its value for later uses.
1439
1440         * rendering/CSSFilter.h:
1441         * rendering/RenderLayer.cpp:
1442         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
1443         (WebCore::RenderLayer::hasAncestorWithFilterOutsets const):
1444         (WebCore::transparencyClipBox):
1445         (WebCore::RenderLayer::calculateClipRects const):
1446         * rendering/RenderLayer.h:
1447         * rendering/style/RenderStyle.h:
1448         (WebCore::RenderStyle::filterOutsets const):
1449         (WebCore::RenderStyle::hasFilterOutsets const): Deleted.
1450
1451 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1452
1453         [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items
1454         https://bugs.webkit.org/show_bug.cgi?id=202916
1455
1456         Reviewed by Tim Horton.
1457
1458         Adjusts the `Pasteboard::write` codepath for writing PasteboardCustomData to the platform pasteboard, such that
1459         it accepts multiple PasteboardCustomDatas. No new tests, since there is no behavior change.
1460
1461         * dom/DataTransfer.cpp:
1462         (WebCore::DataTransfer::commitToPasteboard):
1463
1464         Pass in the PasteboardCustomData as a single-item vector.
1465
1466         * platform/Pasteboard.h:
1467         * platform/PasteboardStrategy.h:
1468         * platform/PlatformPasteboard.h:
1469         * platform/StaticPasteboard.h:
1470         * platform/cocoa/PasteboardCocoa.mm:
1471         (WebCore::Pasteboard::writeCustomData):
1472         * platform/gtk/PasteboardGtk.cpp:
1473         (WebCore::Pasteboard::writeCustomData):
1474         * platform/gtk/PlatformPasteboardGtk.cpp:
1475         (WebCore::PlatformPasteboard::write):
1476         * platform/ios/PlatformPasteboardIOS.mm:
1477         (WebCore::PlatformPasteboard::write):
1478
1479         Adjust this method to return the updated change count.
1480
1481         * platform/libwpe/PasteboardLibWPE.cpp:
1482         (WebCore::Pasteboard::writeCustomData):
1483         * platform/libwpe/PlatformPasteboardLibWPE.cpp:
1484         (WebCore::PlatformPasteboard::write):
1485         * platform/mac/PlatformPasteboardMac.mm:
1486         (WebCore::PlatformPasteboard::write):
1487
1488         Add logic to fall back to writing legacy pasteboard types in the case where there is only one item.
1489
1490         * platform/win/PasteboardWin.cpp:
1491         (WebCore::Pasteboard::writeCustomData):
1492
1493 2019-10-14  Ryosuke Niwa  <rniwa@webkit.org>
1494
1495         Deploy smart pointers in RadioButtonGroups and RadioButtonGroup
1496         https://bugs.webkit.org/show_bug.cgi?id=202942
1497
1498         Reviewed by Zalan Bujtas.
1499
1500         Use Ref & WeakPtr instead of raw pointers in RadioButtonGroups and RadioButtonGroup.
1501
1502         Also made RadioButtonGroups::m_nameToGroupMap a HashMap instead of a unique_ptr of HashMap
1503         since RadioButtonGroups is lazily created in TreeScope as of r250708.
1504
1505         No new tests since there should be no observable behavioral change.
1506
1507         * accessibility/AccessibilityRenderObject.cpp:
1508         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
1509         * dom/RadioButtonGroups.cpp:
1510         (WebCore::RadioButtonGroup): Use WeakHashSet and WeakPtr instead of raw pointers.
1511         (WebCore::RadioButtonGroup::isEmpty const):
1512         (WebCore::RadioButtonGroup::checkedButton const):
1513         (WebCore::RadioButtonGroup::members const):
1514         (WebCore::RadioButtonGroup::setCheckedButton):
1515         (WebCore::RadioButtonGroup::updateCheckedState):
1516         (WebCore::RadioButtonGroup::requiredStateChanged):
1517         (WebCore::RadioButtonGroup::remove):
1518         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
1519         (WebCore::RadioButtonGroup::updateValidityForAllButtons):
1520         (WebCore::RadioButtonGroup::contains const):
1521         (WebCore::RadioButtonGroups::addButton):
1522         (WebCore::RadioButtonGroups::groupMembers const):
1523         (WebCore::RadioButtonGroups::updateCheckedState):
1524         (WebCore::RadioButtonGroups::requiredStateChanged):
1525         (WebCore::RadioButtonGroups::checkedButtonForGroup const):
1526         (WebCore::RadioButtonGroups::hasCheckedButton const):
1527         (WebCore::RadioButtonGroups::isInRequiredGroup const):
1528         (WebCore::RadioButtonGroups::removeButton):
1529         * dom/RadioButtonGroups.h:
1530         (WebCore::RadioButtonGroups):
1531         * html/HTMLInputElement.cpp:
1532         (WebCore::HTMLInputElement::radioButtonGroup const):
1533         (WebCore::HTMLInputElement::checkedRadioButtonForGroup const):
1534         * html/HTMLInputElement.h:
1535
1536 2019-10-14  David Quesada  <david_quesada@apple.com>
1537
1538         Remove WebCore::IOSApplication::isWebApp()
1539         https://bugs.webkit.org/show_bug.cgi?id=181259
1540
1541         Reviewed by Alex Christensen.
1542
1543         As of iOS 11, the Web.app process no longer uses WebKit directly, so IOSApplication::isWebApp()
1544         is never true. Since it's no longer needed, remove it.
1545
1546         * platform/RuntimeApplicationChecks.h:
1547         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1548         (WebCore::IOSApplication::isWebApp): Deleted.
1549
1550 2019-10-14  Andy Estes  <aestes@apple.com>
1551
1552         REGRESSION (r243682): Quick Look previews loaded from the memory cache render with the wrong content type
1553         https://bugs.webkit.org/show_bug.cgi?id=202935
1554         <rdar://problem/54318133>
1555
1556         Reviewed by Tim Horton.
1557
1558         When loading a Quick Look preview after deciding content policy, PreviewLoader would update
1559         DocumentLoader with the preview response (the response that contains the preview's
1560         Content-Type). It would not update the CachedResource representing the preview main
1561         resource, however, which caches the underlying ResourceResponse in m_response.
1562
1563         When loading from the memory cache, it's the CachedResource's response that's used to
1564         synthesize DocumentLoader::responseReceived. When loading Quick Look previews *before*
1565         deciding content policy, this response would be the preview response, but as described
1566         above, when loading after deciding content policy it's the underlying response.
1567
1568         This patch updates a Quick Look preview's CachedResource with the preview response along
1569         with updating DocumentLoader so that there is not a mismatch between the resource's content
1570         type and its underlying data.
1571
1572         Added a new API test.
1573
1574         * loader/DocumentLoader.cpp:
1575         (WebCore::DocumentLoader::previewResponseReceived):
1576         * loader/DocumentLoader.h:
1577         * loader/ResourceLoader.h:
1578         (WebCore::ResourceLoader::didReceivePreviewResponse):
1579         * loader/SubresourceLoader.cpp:
1580         (WebCore::SubresourceLoader::didReceivePreviewResponse):
1581         * loader/SubresourceLoader.h:
1582         * loader/cache/CachedRawResource.cpp:
1583         (WebCore::CachedRawResource::previewResponseReceived):
1584         * loader/cache/CachedRawResource.h:
1585         * loader/cache/CachedRawResourceClient.h:
1586         (WebCore::CachedRawResourceClient::previewResponseReceived):
1587         * loader/cache/CachedResource.cpp:
1588         (WebCore::CachedResource::previewResponseReceived):
1589         * loader/cache/CachedResource.h:
1590         * loader/ios/PreviewLoader.mm:
1591         (-[WebPreviewLoader _loadPreviewIfNeeded]):
1592
1593 2019-10-14  Youenn Fablet  <youenn@apple.com>
1594
1595         A response body promise should be rejected in case of a failure happening after the HTTP response
1596         https://bugs.webkit.org/show_bug.cgi?id=202792
1597
1598         Reviewed by Chris Dumez.
1599
1600         Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-error.https.html
1601
1602         * Modules/fetch/FetchResponse.cpp:
1603         (WebCore::FetchResponse::BodyLoader::didFail):
1604         Propagate error to fetch body consumer if any.
1605
1606 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1607
1608         [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
1609         https://bugs.webkit.org/show_bug.cgi?id=202851
1610
1611         Reviewed by Darin Adler.
1612
1613         This patch refactors some logic around WebCore::PasteboardCustomData, in preparation for implementing the async
1614         clipboard API. There are two main goals of this refactoring:
1615
1616         1. Enable writing multiple items (each backed by PasteboardCustomData) to the platform pasteboard.
1617         2. Enable writing platform data in the form of SharedBuffers to the platform pasteboard.
1618
1619         See below for more details; no tests, as there is no change in behavior yet.
1620
1621         * Headers.cmake:
1622         * Sources.txt:
1623         * SourcesCocoa.txt:
1624         * WebCore.xcodeproj/project.pbxproj:
1625
1626         Move PasteboardCustomData out of Pasteboard.h and into its own file.
1627
1628         * dom/DataTransfer.cpp:
1629         (WebCore::DataTransfer::commitToPasteboard):
1630         * editing/cocoa/EditorCocoa.mm:
1631         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
1632         * platform/Pasteboard.cpp:
1633         (WebCore::PasteboardCustomData::createSharedBuffer const): Deleted.
1634         (WebCore::PasteboardCustomData::fromSharedBuffer): Deleted.
1635
1636         Moved these method implementations to PasteboardCustomData.cpp.
1637
1638         * platform/Pasteboard.h:
1639
1640         Refactor PasteboardCustomData so that its member variables are now private, and encapsulated behind methods
1641         Additionally, make it so that the only way to set data on PasteboardCustomData is to use the writeString,
1642         writeData, and writeStringInCustomData methods, which ensure that the PasteboardCustomData is always in a
1643         consistent state.
1644
1645         * platform/PasteboardCustomData.cpp: Added.
1646         (WebCore::copyPlatformData):
1647         (WebCore::PasteboardCustomData::Entry::Entry):
1648         (WebCore::PasteboardCustomData::Entry::operator=):
1649
1650         Refactor the implementation of PasteboardCustomData, so that it contains a list of PasteboardCustomData entries
1651         instead of individual Vectors and HashMaps.
1652
1653         (WebCore::PasteboardCustomData::PasteboardCustomData):
1654         (WebCore::PasteboardCustomData::createSharedBuffer const):
1655         (WebCore::PasteboardCustomData::fromSharedBuffer):
1656         (WebCore::PasteboardCustomData::writeString):
1657         (WebCore::PasteboardCustomData::writeData):
1658         (WebCore::PasteboardCustomData::writeStringInCustomData):
1659         (WebCore::PasteboardCustomData::addOrMoveEntryToEnd):
1660
1661         Move logic from StaticPasteboard into PasteboardCustomData, and refactor these methods to handle
1662         Vector<PasteboardCustomData::Entry>.
1663
1664         (WebCore::PasteboardCustomData::clear):
1665         (WebCore::PasteboardCustomData::operator=):
1666         (WebCore::PasteboardCustomData::orderedTypes const):
1667         (WebCore::PasteboardCustomData::hasData const):
1668         (WebCore::PasteboardCustomData::hasSameOriginCustomData const):
1669         (WebCore::PasteboardCustomData::sameOriginCustomStringData const):
1670         (WebCore::PasteboardCustomData::readBuffer const):
1671         (WebCore::PasteboardCustomData::readString const):
1672         (WebCore::PasteboardCustomData::readStringInCustomData const):
1673         (WebCore::PasteboardCustomData::forEachType const):
1674         (WebCore::PasteboardCustomData::forEachPlatformString const):
1675         (WebCore::PasteboardCustomData::forEachCustomString const):
1676         (WebCore::PasteboardCustomData::forEachPlatformStringOrBuffer const):
1677
1678         Moved these method implementations from StaticPasteboard to PasteboardCustomData, and also introduced some new
1679         methods to help iterate through types and data.
1680
1681         * platform/PasteboardCustomData.h: Added.
1682         (WebCore::PasteboardCustomData::origin const):
1683         (WebCore::PasteboardCustomData::setOrigin):
1684         (WebCore::PasteboardCustomData::data const):
1685         * platform/PasteboardStrategy.h:
1686         * platform/PlatformPasteboard.h:
1687         * platform/SharedBuffer.cpp:
1688         (WebCore::SharedBuffer::decoder const):
1689         * platform/SharedBuffer.h:
1690         * platform/StaticPasteboard.cpp:
1691         (WebCore::StaticPasteboard::hasData):
1692         (WebCore::StaticPasteboard::typesSafeForBindings):
1693         (WebCore::StaticPasteboard::typesForLegacyUnsafeBindings):
1694         (WebCore::StaticPasteboard::readString):
1695         (WebCore::StaticPasteboard::readStringInCustomData):
1696         (WebCore::StaticPasteboard::writeString):
1697         (WebCore::StaticPasteboard::writeData):
1698         (WebCore::StaticPasteboard::writeStringInCustomData):
1699         (WebCore::StaticPasteboard::clear):
1700         (WebCore::StaticPasteboard::takeCustomData):
1701         (WebCore::StaticPasteboard::StaticPasteboard): Deleted.
1702
1703         Refactor StaticPasteboard to now contain a PasteboardCustomData; additionally, adjust several methods in
1704         StaticPasteboard to simply call into PasteboardCustomData to write, read, or clear data.
1705
1706         (WebCore::updateTypes): Deleted.
1707         * platform/StaticPasteboard.h:
1708         * platform/cocoa/PasteboardCocoa.mm:
1709         (WebCore::Pasteboard::readStringInCustomData):
1710         (WebCore::Pasteboard::readOrigin):
1711         (WebCore::PasteboardCustomData::cocoaType): Deleted.
1712
1713         Moved the implementation of PasteboardCustomData::cocoaType from PasteboardCocoa.mm to
1714         PasteboardCustomDataCocoa.mm.
1715
1716         * platform/cocoa/PasteboardCustomDataCocoa.mm: Added.
1717         (WebCore::PasteboardCustomData::cocoaType):
1718         * platform/ios/AbstractPasteboard.h:
1719         * platform/ios/PlatformPasteboardIOS.mm:
1720         (WebCore::PlatformPasteboard::changeCount const):
1721         (WebCore::registerItemsToPasteboard):
1722         (WebCore::registerItemToPasteboard):
1723         (WebCore::PlatformPasteboard::write):
1724
1725         Support writing multiple PasteboardCustomData objects to the platform pasteboard on iOS, by generating
1726         NSItemProviders for each one. This refactors the existing `registerItemToPasteboard` helper to handle multiple
1727         registration lists, renames it to `registerItemsToPasteboard` (plural), and then reimplements
1728         `registerItemToPasteboard` in terms of `registerItemsToPasteboard`.
1729
1730         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1731         (WebCore::createItemProviderRegistrationList):
1732
1733         Adjust these to use getters on PasteboardCustomData instead of accessing the member variables directly.
1734
1735         * platform/ios/WebItemProviderPasteboard.mm:
1736         (-[WebItemProviderPasteboard init]):
1737         (-[WebItemProviderPasteboard stageRegistrationLists:]):
1738         (-[WebItemProviderPasteboard clearRegistrationLists]):
1739         (-[WebItemProviderPasteboard takeRegistrationLists]):
1740
1741         Refactor registration list staging on WebItemProviderPasteboard to support multiple registration lists, each
1742         representing a single item provider.
1743
1744         (-[WebItemProviderPasteboard stageRegistrationList:]): Deleted.
1745         (-[WebItemProviderPasteboard takeRegistrationList]): Deleted.
1746         * platform/mac/PasteboardMac.mm:
1747         (WebCore::Pasteboard::write):
1748         * platform/mac/PasteboardWriter.mm:
1749         (WebCore::createPasteboardWriter):
1750         * platform/mac/PlatformPasteboardMac.mm:
1751         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
1752         (WebCore::PlatformPasteboard::write):
1753
1754         Support writing multiple PasteboardCustomData objects to the platform pasteboard on macOS, by creating and
1755         setting NSPasteboardItems for each custom data. This means that instead of using legacy macOS pasteboard types,
1756         we need to use the "modern" NSPasteboardTypes when writing each item. This is because NSPasteboardItem quietly
1757         fails when attempting to set data for a legacy pasteboard type.
1758
1759         (WebCore::createPasteboardItem):
1760
1761 2019-10-14  Truitt Savell  <tsavell@apple.com>
1762
1763         Unreviewed, rolling out r251081.
1764
1765         Broke macOS and iOS builds
1766
1767         Reverted changeset:
1768
1769         "transform-box: content-box, stroke-box missing"
1770         https://bugs.webkit.org/show_bug.cgi?id=201892
1771         https://trac.webkit.org/changeset/251081
1772
1773 2019-10-14  Dean Jackson  <dino@apple.com>
1774
1775         Reset maxCanvasPixelMemory between tests
1776         https://bugs.webkit.org/show_bug.cgi?id=202941
1777         <rdar://problem/56260865>
1778
1779         Reviewed by Wenson Hsieh.
1780
1781         Reset the maximum canvas memory between tests.
1782
1783         * testing/Internals.cpp:
1784         (WebCore::Internals::resetToConsistentState):
1785
1786 2019-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
1787
1788         [Cocoa] font-family:system-ui on Chinese systems don't get Chinese quote marks
1789         https://bugs.webkit.org/show_bug.cgi?id=202778
1790
1791         Unreviewed.
1792
1793         Addressing post-review comment.
1794
1795         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
1796         (WebCore::SystemFontDatabaseCoreText::createSystemUIFont):
1797
1798 2019-10-14  Alex Christensen  <achristensen@webkit.org>
1799
1800         REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
1801         https://bugs.webkit.org/show_bug.cgi?id=201902
1802
1803         Reviewed by Ryosuke Niwa.
1804
1805         * Modules/webauthn/fido/U2fResponseConverter.cpp:
1806         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
1807
1808 2019-10-14  Russell Epstein  <russell_e@apple.com>
1809
1810         Unreviewed, rolling out r251081.
1811
1812         Broke macOS and iOS builds.
1813
1814         Reverted changeset:
1815
1816         "transform-box: content-box, stroke-box missing"
1817         https://bugs.webkit.org/show_bug.cgi?id=201892
1818         https://trac.webkit.org/changeset/251081
1819
1820 2019-10-14  Dirk Schulze  <krit@webkit.org>
1821
1822         transform-box: content-box, stroke-box missing
1823         https://bugs.webkit.org/show_bug.cgi?id=201892
1824
1825         Reviewed by Simon Fraser.
1826
1827         Added the keywords content-box and stroke-box to the
1828         transform-box CSS property.
1829         Those keywords were added to the spec after the implementation
1830         in WebKit.
1831
1832         Test: transforms/transform-box.html
1833
1834         * css/CSSPrimitiveValueMappings.h:
1835         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1836         (WebCore::CSSPrimitiveValue::operator TransformBox const):
1837         * css/CSSProperties.json:
1838         * css/CSSValueKeywords.in:
1839         * css/parser/CSSPropertyParser.cpp:
1840         (WebCore::CSSPropertyParser::parseSingleValue):
1841         * rendering/RenderLayer.cpp:
1842         (WebCore::computeReferenceBox):
1843         (WebCore::transformBoxToCSSBoxType):
1844         (WebCore::RenderLayer::currentTransform const):
1845         * rendering/style/RenderStyleConstants.h:
1846         * svg/SVGGraphicsElement.cpp:
1847         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
1848
1849 2019-10-14  Truitt Savell  <tsavell@apple.com>
1850
1851         Unreviewed, rolling out r251045.
1852
1853         Broke internal builds
1854
1855         Reverted changeset:
1856
1857         "AX: Make AXIsolatedTree compile again"
1858         https://bugs.webkit.org/show_bug.cgi?id=202702
1859         https://trac.webkit.org/changeset/251045
1860
1861 2019-10-14  youenn fablet  <youenn@apple.com>
1862
1863         Reuse existing web processes for running service workers
1864         https://bugs.webkit.org/show_bug.cgi?id=202195
1865
1866         Reviewed by Chris Dumez.
1867
1868         Update implementation to be able to run service workers jointly with page.
1869         Add internals API to get the process ID.
1870         This allows writing tests to check whether a service worker is in the same process as its client or not.
1871
1872         Test: http/wpt/service-workers/service-worker-different-process.https.html
1873
1874         * testing/Internals.cpp:
1875         (WebCore::Internals::processIdentifier const):
1876         * testing/Internals.h:
1877         * testing/Internals.idl:
1878         * testing/ServiceWorkerInternals.cpp:
1879         (WebCore::ServiceWorkerInternals::processIdentifier const):
1880         * testing/ServiceWorkerInternals.h:
1881         * testing/ServiceWorkerInternals.idl:
1882         * workers/service/ServiceWorkerProvider.cpp:
1883         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
1884         Do not register dummy documents whose sole purpose is to do loading for service workers.
1885         * workers/service/context/SWContextManager.cpp:
1886         (WebCore::SWContextManager::setConnection):
1887         Now that connections might be created more than once on a given process,
1888         Make sure that the replaced connection is stopped or there is no replaced connection.
1889         (WebCore::SWContextManager::stopAllServiceWorkers):
1890         Add routine to stop all service workers running in a given web process.
1891         * workers/service/context/SWContextManager.h:
1892         (WebCore::SWContextManager::Connection::isClosed const):
1893         (WebCore::SWContextManager::Connection::setAsClosed):
1894
1895 2019-10-13  Tim Horton  <timothy_horton@apple.com>
1896
1897         Stop 'using namespace *Names' in files generated by make_names.pl
1898         https://bugs.webkit.org/show_bug.cgi?id=202907
1899
1900         Reviewed by Geoffrey Garen.
1901
1902         * dom/make_names.pl:
1903         (printFunctionTable):
1904         (printFactoryCppFile):
1905         (printWrapperFactoryCppFile):
1906         Stop 'using namespace SVGNames' and 'using namepace HTMLNames' in
1907         files generated by make_names.pl. Just use fully-qualified names.
1908
1909         There is some overlap between the two namespaces, so this is a
1910         prerequsite for doing more aggressive unified source bundling in bindings.
1911
1912 2019-10-13  Tim Horton  <timothy_horton@apple.com>
1913
1914         Don't include ApplicationServices in npapi.h
1915         https://bugs.webkit.org/show_bug.cgi?id=202911
1916
1917         Reviewed by Sam Weinig.
1918
1919         * plugins/npapi.h:
1920         Just include CoreGraphics.h, not ApplicationServices.h.
1921         ApplicationServices.h pulls in all sorts of crazy things like
1922         QuickDraw headers that have symbol conflicts with JSC (like Handle).
1923
1924 2019-10-13  Stephan Szabo  <stephan.szabo@sony.com>
1925
1926         Wincairo build broken: EventLoop.h: No such file or directory
1927         https://bugs.webkit.org/show_bug.cgi?id=202893
1928
1929         Reviewed by Fujii Hironori.
1930
1931         Remove include of EventLoop.h.
1932
1933         * platform/network/curl/SynchronousLoaderClientCurl.cpp:
1934
1935 2019-10-13  Konstantin Tokarev  <annulen@yandex.ru>
1936
1937         Fix compilation of Crypto.cpp on macOS with !WEB_CRYPTO
1938         https://bugs.webkit.org/show_bug.cgi?id=202895
1939
1940         Reviewed by Alexey Proskuryakov.
1941
1942         Crypto.cpp does not use getCommonCryptoDigestAlgorithm(), defined in
1943         CommonCryptoUtilities.h, but requires CommonCrypto includes which are
1944         coming with it. However, when WEB_CRYPTO is disabled necessary
1945         transitive includes are missing.
1946
1947         * page/Crypto.cpp:
1948
1949 2019-10-13  Simon Fraser  <simon.fraser@apple.com>
1950
1951         Convert ENinePieceImageRule into an enum class and rename
1952         https://bugs.webkit.org/show_bug.cgi?id=202889
1953
1954         Reviewed by Alex Christensen.
1955
1956         Enum classify ENinePieceImageRule.
1957         
1958         The bitfield in NinePieceImage isn't saving anything so don't use one there.
1959
1960         * css/CSSComputedStyleDeclaration.cpp:
1961         (WebCore::valueForRepeatRule):
1962         * css/CSSToStyleMap.cpp:
1963         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
1964         * css/StyleBuilderCustom.h:
1965         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue):
1966         * rendering/style/NinePieceImage.cpp:
1967         (WebCore::NinePieceImage::NinePieceImage):
1968         (WebCore::NinePieceImage::computeMiddleTileScale):
1969         (WebCore::NinePieceImage::computeTileScales):
1970         (WebCore::NinePieceImage::Data::Data):
1971         (WebCore::NinePieceImage::Data::create):
1972         * rendering/style/NinePieceImage.h:
1973         (WebCore::NinePieceImage::horizontalRule const):
1974         (WebCore::NinePieceImage::setHorizontalRule):
1975         (WebCore::NinePieceImage::verticalRule const):
1976         (WebCore::NinePieceImage::setVerticalRule):
1977
1978 2019-10-13  Simon Fraser  <simon.fraser@apple.com>
1979
1980         Clarify the naming of the radius-related functions on BorderData
1981         https://bugs.webkit.org/show_bug.cgi?id=202888
1982
1983         Reviewed by Alex Christensen.
1984
1985         BorderData had some confusingly named data members and functions ("topLeft"'"). Renamed
1986         to include the term "radius".
1987
1988         * platform/graphics/PathUtilities.cpp:
1989         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
1990         * rendering/style/BorderData.h:
1991         (WebCore::BorderData::BorderData):
1992         (WebCore::BorderData::hasBorderRadius const):
1993         (WebCore::BorderData::operator== const):
1994         (WebCore::BorderData::topLeftRadius const):
1995         (WebCore::BorderData::topRightRadius const):
1996         (WebCore::BorderData::bottomLeftRadius const):
1997         (WebCore::BorderData::bottomRightRadius const):
1998         (WebCore::BorderData::topLeft const): Deleted.
1999         (WebCore::BorderData::topRight const): Deleted.
2000         (WebCore::BorderData::bottomLeft const): Deleted.
2001         (WebCore::BorderData::bottomRight const): Deleted.
2002         * rendering/style/RenderStyle.cpp:
2003         (WebCore::calcRadiiFor):
2004         * rendering/style/RenderStyle.h:
2005         (WebCore::RenderStyle::borderTopLeftRadius const):
2006         (WebCore::RenderStyle::borderTopRightRadius const):
2007         (WebCore::RenderStyle::borderBottomLeftRadius const):
2008         (WebCore::RenderStyle::borderBottomRightRadius const):
2009         (WebCore::RenderStyle::resetBorderTopLeftRadius):
2010         (WebCore::RenderStyle::resetBorderTopRightRadius):
2011         (WebCore::RenderStyle::resetBorderBottomLeftRadius):
2012         (WebCore::RenderStyle::resetBorderBottomRightRadius):
2013         (WebCore::RenderStyle::setBorderTopLeftRadius):
2014         (WebCore::RenderStyle::setBorderTopRightRadius):
2015         (WebCore::RenderStyle::setBorderBottomLeftRadius):
2016         (WebCore::RenderStyle::setBorderBottomRightRadius):
2017
2018 2019-10-13  Simon Fraser  <simon.fraser@apple.com>
2019
2020         Convert LineBoxContain to use an OptionSet<>
2021         https://bugs.webkit.org/show_bug.cgi?id=202890
2022
2023         Reviewed by Alex Christensen.
2024
2025         Use OptionSet<LineBoxContain>.
2026
2027         * css/CSSComputedStyleDeclaration.cpp:
2028         (WebCore::createLineBoxContainValue):
2029         * css/CSSLineBoxContainValue.cpp:
2030         (WebCore::CSSLineBoxContainValue::CSSLineBoxContainValue):
2031         (WebCore::CSSLineBoxContainValue::customCSSText const):
2032         * css/CSSLineBoxContainValue.h:
2033         * css/StyleBuilderConverter.h:
2034         (WebCore::StyleBuilderConverter::convertLineBoxContain):
2035         * css/parser/CSSPropertyParser.cpp:
2036         (WebCore::consumeLineBoxContain):
2037         * rendering/RenderBlock.cpp:
2038         (WebCore::RenderBlock::minLineHeightForReplacedRenderer const):
2039         * rendering/RootInlineBox.cpp:
2040         (WebCore::RootInlineBox::ascentAndDescentForBox const):
2041         (WebCore::RootInlineBox::includeLeadingForBox const):
2042         (WebCore::RootInlineBox::includeFontForBox const):
2043         (WebCore::RootInlineBox::includeGlyphsForBox const):
2044         (WebCore::RootInlineBox::includeInitialLetterForBox const):
2045         (WebCore::RootInlineBox::includeMarginForBox const):
2046         (WebCore::RootInlineBox::fitsToGlyphs const):
2047         (WebCore::RootInlineBox::includesRootLineBoxFontOrLeading const):
2048         * rendering/SimpleLineLayout.cpp:
2049         (WebCore::SimpleLineLayout::canUseForFontAndText):
2050         (WebCore::SimpleLineLayout::canUseForStyle):
2051         * rendering/style/RenderStyle.h:
2052         (WebCore::RenderStyle::lineBoxContain const):
2053         (WebCore::RenderStyle::setLineBoxContain):
2054         (WebCore::RenderStyle::initialLineBoxContain):
2055         * rendering/style/StyleRareInheritedData.cpp:
2056         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2057         * rendering/style/StyleRareInheritedData.h:
2058         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2059         (WebCore::styleForFirstLetter):
2060
2061 2019-10-12  Ryosuke Niwa  <rniwa@webkit.org>
2062
2063         [iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
2064         https://bugs.webkit.org/show_bug.cgi?id=202878
2065
2066         Reviewed by Alex Christensen.
2067
2068         Added the missing null check in tryAddEventListener and tryRemoveEventListener for scroll event.
2069
2070         Test: fast/events/scroll-event-on-document-without-window.html
2071
2072         * dom/Node.cpp:
2073         (WebCore::tryAddEventListener):
2074         (WebCore::tryRemoveEventListener):
2075
2076 2019-10-12  Simon Fraser  <simon.fraser@apple.com>
2077
2078         Move CSSReflectionDirection into RenderStyleConstants as ReflectionDirection
2079         https://bugs.webkit.org/show_bug.cgi?id=202886
2080
2081         Reviewed by Sam Weinig.
2082
2083         Make CSSReflectionDirection an enum class ReflectionDirection, and fix the usage sites.
2084
2085         * Headers.cmake:
2086         * WebCore.xcodeproj/project.pbxproj:
2087         * css/CSSComputedStyleDeclaration.cpp:
2088         (WebCore::valueForReflection):
2089         * css/CSSPrimitiveValueMappings.h:
2090         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2091         (WebCore::CSSPrimitiveValue::operator ReflectionDirection const):
2092         (WebCore::CSSPrimitiveValue::operator CSSReflectionDirection const): Deleted.
2093         * css/CSSReflectionDirection.h: Removed.
2094         * rendering/RenderBox.cpp:
2095         (WebCore::RenderBox::reflectionOffset const):
2096         (WebCore::RenderBox::reflectedRect const):
2097         * rendering/RenderLayer.cpp:
2098         (WebCore::RenderLayer::calculateClipRects const):
2099         * rendering/style/RenderStyleConstants.cpp:
2100         (WebCore::operator<<):
2101         * rendering/style/RenderStyleConstants.h:
2102         * rendering/style/StyleReflection.h:
2103         (WebCore::StyleReflection::direction const):
2104         (WebCore::StyleReflection::setDirection):
2105         (WebCore::StyleReflection::StyleReflection):
2106
2107 2019-10-12  Simon Fraser  <simon.fraser@apple.com>
2108
2109         Fix the spelling of ThreeDDarkDhasowColor and unwrap the ThemeType enums
2110         https://bugs.webkit.org/show_bug.cgi?id=202887
2111
2112         Reviewed by Wenson Hsieh.
2113
2114         ThreeDDarkDhasowColor was misspelled, and one enum value per line please.
2115
2116         * platform/ThemeTypes.h:
2117
2118 2019-10-12  Chris Dumez  <cdumez@apple.com>
2119
2120         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects
2121         https://bugs.webkit.org/show_bug.cgi?id=202869
2122
2123         Reviewed by Ryosuke Niwa.
2124
2125         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects, this is necessary so that the wrapper
2126         stays alive as long as ActiveDOMObject::hasPendingActivity() returns true. We may have
2127         subtle lifetime bugs otherwise.
2128
2129         * Modules/encryptedmedia/MediaKeySession.h:
2130         * Modules/encryptedmedia/MediaKeySession.idl:
2131         * Modules/entriesapi/FileSystemDirectoryReader.idl:
2132         * Modules/entriesapi/FileSystemEntry.idl:
2133         * Modules/geolocation/Geolocation.idl:
2134         * Modules/indexeddb/IDBObjectStore.h:
2135         * Modules/indexeddb/IDBObjectStore.idl:
2136         * Modules/paymentrequest/PaymentResponse.idl:
2137         * Modules/webvr/VRDisplay.h:
2138         * Modules/webvr/VRDisplay.idl:
2139         * workers/service/ServiceWorkerContainer.idl:
2140
2141 2019-10-12  Simon Fraser  <simon.fraser@apple.com>
2142
2143         Implement TextStream-based dumping for all the RenderStyle and SVGRenderStyle enum classes
2144         https://bugs.webkit.org/show_bug.cgi?id=202877
2145
2146         Reviewed by Dean Jackson.
2147
2148         Make style-related enum classes dumpable with TextStream,  and make some SVG style-related
2149         classes dumpable.
2150
2151         * rendering/style/RenderStyleConstants.cpp:
2152         (WebCore::operator<<):
2153         * rendering/style/RenderStyleConstants.h:
2154         * rendering/style/SVGRenderStyleDefs.cpp:
2155         (WebCore::operator<<):
2156         * rendering/style/SVGRenderStyleDefs.h:
2157         * rendering/style/ShadowData.cpp:
2158         (WebCore::operator<<):
2159         * rendering/style/ShadowData.h:
2160
2161 2019-10-12  Chris Dumez  <cdumez@apple.com>
2162
2163         Unreviewed, rolling out r251040.
2164
2165         Broke IDB tests in Debug
2166
2167         Reverted changeset:
2168
2169         "Add [ActiveDOMObject] to IDLs of ActiveDOMObjects"
2170         https://bugs.webkit.org/show_bug.cgi?id=202869
2171         https://trac.webkit.org/changeset/251040
2172
2173 2019-10-12  Ryosuke Niwa  <rniwa@webkit.org>
2174
2175         Invoke callbacks registered by requestIdleCallback
2176         https://bugs.webkit.org/show_bug.cgi?id=202824
2177
2178         Reviewed by Antti Koivisto.
2179
2180         Invoke callbacks registered by requestIdleCallback unless it's canceled.
2181
2182         To do this, this patch introduces WindowEventLoop class, which represents the HTML5 event loop:
2183         https://html.spec.whatwg.org/multipage/webappapis.html#window-event-loop
2184
2185         Because each and only each agent cluster is meant to have its own window event loop, this class will be shared
2186         across multiple documents of the same registrable domain:
2187         https://html.spec.whatwg.org/multipage/webappapis.html#integration-with-the-javascript-agent-cluster-formalism
2188
2189         Tests: requestidlecallback/requestidlecallback-is-called.html
2190                requestidlecallback/requestidlecallback-is-not-called-when-canceled.html
2191
2192         * Sources.txt:
2193         * WebCore.xcodeproj/project.pbxproj:
2194         * dom/Document.cpp:
2195         (WebCore::Document::eventLoop): Added.
2196         (WebCore::Document::requestIdleCallback): Associate IdleCallbackController with this document.
2197         * dom/Document.h:
2198         (WebCore::Document::idleCallbackController): Added. Used for release assertions.
2199         * dom/IdleCallbackController.cpp:
2200         (WebCore::IdleCallbackController::IdleCallbackController): Keeps a weak pointer to Document.
2201         (WebCore::IdleCallbackController::queueIdleCallback):
2202         (WebCore::IdleCallbackController::removeIdleCallback):
2203         (WebCore::IdleCallbackController::queueTaskToStartIdlePeriod): Added.
2204         (WebCore::IdleCallbackController::startIdlePeriod): Added. Implements the start an idle period algorithm:
2205         https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm
2206         (WebCore::IdleCallbackController::queueTaskToInvokeIdleCallbacks): Added.
2207         (WebCore::IdleCallbackController::invokeIdleCallbacks): Added. The invoke idle callback timeout algorithm:
2208         https://w3c.github.io/requestidlecallback/#invoke-idle-callback-timeout-algorithm
2209         * dom/IdleCallbackController.h:
2210         * dom/IdleDeadline.h:
2211         * dom/WindowEventLoop.cpp: Added.
2212         (WebCore::WindowEventLoop::create): Added.
2213         (WebCore::WindowEventLoop::WindowEventLoop): Added.
2214         (WebCore::WindowEventLoop::queueTask): Added.
2215         (WebCore::WindowEventLoop::run): Added.
2216         * dom/WindowEventLoop.h: Added.
2217         * page/Page.cpp:
2218         (WebCore::Page::updateRendering): Added comments for the missing pieces.
2219
2220 2019-10-12  Chris Dumez  <cdumez@apple.com>
2221
2222         Back/Forward cache does not work after doing a favorite navigation
2223         https://bugs.webkit.org/show_bug.cgi?id=202762
2224         <rdar://problem/56126911>
2225
2226         Reviewed by Antti Koivisto.
2227
2228         When a subframe goes into the page cache, make sure we null out the opener
2229         link of any windows that were opened by this frame. This matches what would
2230         happened if this frame were closed.
2231
2232         Covered by the following API tests:
2233         ProcessSwap.PageCacheAfterProcessSwapByClient
2234         ProcessSwap.OpenerLinkAfterAPIControlledProcessSwappingOfOpener
2235
2236         * history/CachedFrame.cpp:
2237         (WebCore::CachedFrame::CachedFrame):
2238         * loader/FrameLoader.cpp:
2239         (WebCore::FrameLoader::~FrameLoader):
2240         (WebCore::FrameLoader::detachFromAllOpenedFrames):
2241         * loader/FrameLoader.h:
2242
2243 2019-10-12  Chris Fleizach  <cfleizach@apple.com>
2244
2245         AX: Make AXIsolatedTree compile again
2246         https://bugs.webkit.org/show_bug.cgi?id=202702
2247         <rdar://problem/56084968>
2248
2249         Reviewed by Joanmarie Diggs.
2250
2251         Fix compilation and runtime issues when building with ACCESSIBILITY_ISOLATED_TREE.
2252
2253         * accessibility/AccessibilityRenderObject.cpp:
2254         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
2255         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2256         (WebCore::AXIsolatedTree::treePageCache):
2257         (WebCore::AXIsolatedTree::nodeForID const):
2258             - Remove release assert here because the initial request that comes through happens on the main thread.
2259               We need to handle that case specific case.
2260         (WebCore::AXIsolatedTree::applyPendingChanges):
2261         (WebCore::AXIsolatedTree::initializePageTreeForID): Deleted.
2262         (WebCore::AXIsolatedTree::setInitialRequestInProgress): Deleted.
2263         * accessibility/isolatedtree/AXIsolatedTree.h:
2264         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
2265         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
2266         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2267         (convertToNSArray):
2268         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2269         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
2270
2271 2019-10-11  Ryosuke Niwa  <rniwa@webkit.org>
2272
2273         Windows build fix attempt after r251043.
2274
2275         * dom/ShadowRoot.cpp:
2276
2277 2019-10-11  Ryosuke Niwa  <rniwa@webkit.org>
2278
2279         Add the support for ShadowRoot.delegateFocus
2280         https://bugs.webkit.org/show_bug.cgi?id=166484
2281         <rdar://problem/29816058>
2282
2283         Reviewed by Antti Koivisto.
2284
2285         Implement delegatesFocus as specified in https://github.com/whatwg/html/pull/4796
2286
2287         When the shadow root of an element has delegates focus flag set, focusing on the shadow host would automatically
2288         "delegates" focus to the first focusable element in the shadow tree instead.
2289
2290         The first focusable element is determined as the first element that is programatically focusable or mouse focusable
2291         in the flat tree (composed tree in WebKit's terminology) in the case of the element getting focused via DOM API,
2292         Element.prototype.focus, by via mouse down. In the case of sequential focus navigation (via tab key), it's the
2293         first keyboard focusable element in the tabIndex order.
2294
2295         Tests: imported/w3c/web-platform-tests/shadow-dom/focus/click-focus-delegatesFocus-click-method.html
2296                imported/w3c/web-platform-tests/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html
2297                imported/w3c/web-platform-tests/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html
2298                imported/w3c/web-platform-tests/shadow-dom/focus/focus-method-delegatesFocus.html
2299                imported/w3c/web-platform-tests/shadow-dom/focus/focus-tabindex-order-shadow-negative-delegatesFocus.html
2300                imported/w3c/web-platform-tests/shadow-dom/focus/focus-tabindex-order-shadow-varying-delegatesFocus.html
2301                imported/w3c/web-platform-tests/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html
2302
2303         * dom/Element.cpp:
2304         (WebCore::Element::isKeyboardFocusable const): A shadow host with the delegates focus flag is not considered as
2305         keyboard focusable. The rest is taken care of by the existing logic in FocusController.
2306         (WebCore::isProgramaticallyFocusable): Extracted from Element::focus.
2307         (WebCore::findFirstProgramaticallyFocusableElementInComposedTree): Added.
2308         (WebCore::Element::focus): Added the support for delegatesFocus.
2309         * dom/Element.h:
2310         (WebCore::ShadowRootInit::delegatesFocus): Added.
2311         * dom/Element.idl: Ditto.
2312         * dom/ShadowRoot.cpp:
2313         (WebCore::ShadowRoot::ShadowRoot): Added delegatesFocus to the constructor.
2314         * dom/ShadowRoot.h:
2315         * page/EventHandler.cpp:
2316         (WebCore::findFirstMouseFocusableElementInComposedTree): Added.
2317         (WebCore::EventHandler::dispatchMouseEvent): Added the support for delegatesFocus. Uses the first mouse focusable
2318         element in the flat tree (composed tree) order.
2319         * page/FocusController.cpp:
2320         (WebCore::FocusController::findFirstFocusableElementInShadowRoot):
2321         * page/FocusController.h:
2322
2323 2019-10-11  Rob Buis  <rbuis@igalia.com>
2324
2325         Cleanup RuntimeEnabledFeatures includes
2326         https://bugs.webkit.org/show_bug.cgi?id=202857
2327
2328         Reviewed by Eric Carlson.
2329
2330         These classes must have had made use of runtime flags before
2331         but are not using them anymore.
2332
2333         * Modules/mediastream/MediaDevices.cpp:
2334         * Modules/mediastream/RTCRtpSender.cpp:
2335         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2336         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
2337         * accessibility/AccessibilityObject.cpp:
2338         * css/CSSComputedStyleDeclaration.cpp:
2339         * css/MediaQueryEvaluator.cpp:
2340         * css/MediaQueryExpression.cpp:
2341         * css/parser/CSSParser.cpp:
2342         * dom/ContainerNode.cpp:
2343         * dom/EventTarget.cpp:
2344         * dom/Position.cpp:
2345         * dom/PseudoElement.cpp:
2346         * dom/TreeScope.cpp:
2347         * dom/ViewportArguments.cpp:
2348         * history/CachedFrame.cpp:
2349         * html/HTMLPlugInElement.cpp:
2350         * html/HTMLStyleElement.cpp:
2351         * html/HTMLTrackElement.cpp:
2352         * inspector/agents/InspectorNetworkAgent.cpp:
2353         * loader/ResourceLoadNotifier.cpp:
2354         * page/DOMWindow.cpp:
2355         * page/EventHandler.cpp:
2356         * page/PointerLockController.cpp:
2357         * page/csp/ContentSecurityPolicy.cpp:
2358         * page/scrolling/ScrollingCoordinator.cpp:
2359         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2360         * rendering/RenderFlexibleBox.cpp:
2361         * rendering/style/RenderStyle.cpp:
2362         * rendering/updating/RenderTreeUpdater.cpp:
2363
2364 2019-10-11  Chris Dumez  <cdumez@apple.com>
2365
2366         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects
2367         https://bugs.webkit.org/show_bug.cgi?id=202869
2368
2369         Reviewed by Ryosuke Niwa.
2370
2371         Add [ActiveDOMObject] to IDLs of ActiveDOMObjects, this is necessary so that the wrapper
2372         stays alive as long as ActiveDOMObject::hasPendingActivity() returns true. We may have
2373         subtle lifetime bugs otherwise.
2374
2375         * Modules/encryptedmedia/MediaKeySession.h:
2376         * Modules/encryptedmedia/MediaKeySession.idl:
2377         * Modules/entriesapi/FileSystemDirectoryReader.idl:
2378         * Modules/entriesapi/FileSystemEntry.idl:
2379         * Modules/geolocation/Geolocation.idl:
2380         * Modules/indexeddb/IDBObjectStore.h:
2381         * Modules/indexeddb/IDBObjectStore.idl:
2382         * Modules/paymentrequest/PaymentResponse.idl:
2383         * Modules/webvr/VRDisplay.h:
2384         * Modules/webvr/VRDisplay.idl:
2385         * workers/service/ServiceWorkerContainer.idl:
2386
2387 2019-10-11  Devin Rousso  <drousso@apple.com>
2388
2389         Web Inspector: Elements: Computed: show shorthand properties in addition to longhand ones
2390         https://bugs.webkit.org/show_bug.cgi?id=200554
2391
2392         Reviewed by Matt Baker.
2393
2394         Test: inspector/css/getComputedStyleForNode.html
2395
2396         Include additional `CSS.CSSComputedStyleProperty` items for shorthand CSS properties when
2397         calling `CSS.getComputedStyleForNode`.
2398
2399         * inspector/InspectorStyleSheet.h:
2400         * inspector/InspectorStyleSheet.cpp:
2401         (WebCore::InspectorStyle::buildArrayForComputedStyle const):
2402         (WebCore::InspectorStyle::collectProperties const): Added.
2403         (WebCore::InspectorStyle::styleWithProperties const):
2404         (WebCore::InspectorStyle::populateAllProperties const): Deleted.
2405
2406 2019-10-08  Ryosuke Niwa  <rniwa@webkit.org>
2407
2408         Make WebInspector's remote debug EventLoop code into RunLoop
2409         https://bugs.webkit.org/show_bug.cgi?id=202716
2410
2411         Reviewed by Joseph Pecoraro.
2412
2413         Use RunLoop::cycle.
2414
2415         * PlatformFTW.cmake:
2416         * PlatformPlayStation.cmake:
2417         * PlatformWin.cmake:
2418         * SourcesCocoa.txt:
2419         * WebCore.xcodeproj/project.pbxproj:
2420         * inspector/PageScriptDebugServer.cpp:
2421         (WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
2422         * platform/SourcesGLib.txt:
2423         * platform/glib/EventLoopGlib.cpp: Removed.
2424         * platform/playstation/EventLoopPlayStation.cpp: Removed.
2425         * platform/win/EventLoopWin.cpp: Removed.
2426
2427 2019-10-11  Dean Jackson  <dino@apple.com>
2428
2429         REGRESSION (r244239) Layout Test fast/canvas/canvas-too-large-to-draw.html is failing
2430         https://bugs.webkit.org/show_bug.cgi?id=202870
2431
2432         Reviewed by Simon Fraser.
2433
2434         Add an internal method to specify a fake limit of canvas pixel memory
2435         so our tests produce reproducible results.
2436
2437         * html/HTMLCanvasElement.cpp:
2438         (WebCore::maxActivePixelMemory):
2439         (WebCore::HTMLCanvasElement::setMaxPixelMemoryForTesting):
2440         * html/HTMLCanvasElement.h:
2441         * testing/Internals.cpp:
2442         (WebCore::Internals::setMaxCanvasPixelMemory):
2443         * testing/Internals.h:
2444         * testing/Internals.idl:
2445
2446 2019-10-11  Chris Dumez  <cdumez@apple.com>
2447
2448         API Test TestWebKitAPI.WebKit.DefaultQuota is very flaky on High Sierra
2449         https://bugs.webkit.org/show_bug.cgi?id=202850
2450
2451         Reviewed by Alex Christensen.
2452
2453         Make sure the DOMCache / DOMCacheStorage objects stay alive while they have pending
2454         promises to be resolved.
2455
2456         * Modules/cache/DOMCache.cpp:
2457         (WebCore::DOMCache::hasPendingActivity const):
2458         * Modules/cache/DOMCache.h:
2459         * Modules/cache/DOMCache.idl:
2460         * Modules/cache/DOMCacheStorage.cpp:
2461         (WebCore::DOMCacheStorage::hasPendingActivity const):
2462         * Modules/cache/DOMCacheStorage.h:
2463         * Modules/cache/DOMCacheStorage.idl:
2464
2465 2019-10-11  Chris Dumez  <cdumez@apple.com>
2466
2467         Unreviewed, address post-landing feedback from Darin for r251019.
2468
2469         Added a new comment for clarity.
2470
2471         * loader/FrameLoader.cpp:
2472         (WebCore::FrameLoader::stopForPageCache):
2473
2474 2019-10-11  Alex Christensen  <achristensen@webkit.org>
2475
2476         Only use CFNetwork SPI for metrics where needed
2477         https://bugs.webkit.org/show_bug.cgi?id=202825
2478
2479         Reviewed by Joseph Pecoraro.
2480
2481         * platform/network/NetworkLoadMetrics.h:
2482
2483 2019-10-11  Chris Dumez  <cdumez@apple.com>
2484
2485         Pages frequently fail to enter the back/forward cache due to frames with a quick redirect coming
2486         https://bugs.webkit.org/show_bug.cgi?id=202768
2487         <rdar://problem/56132022>
2488
2489         Reviewed by Alex Christensen.
2490
2491         When a quick redirect is scheduled with the navigation scheduler, we set the m_quickRedirectComing flag.
2492         This flag is supposed to get unset if the navigation gets cancelled and when the navigation actually
2493         happens. However, for a navigation to a javascript: URL, we would return early after executing the JS
2494         and fail to reset the m_quickRedirectComing flag. Later on, we would fail to enter the page cache because
2495         we would think that the iframe still has a quick redirect scheduled.
2496
2497         Test: fast/history/page-cache-iframe-js-url.html
2498
2499         * loader/FrameLoader.cpp:
2500         (WebCore::FrameLoader::urlSelected):
2501         Reset the m_quickRedirectComing flag if we return early after executing
2502         the javascript URL.
2503
2504         (WebCore::FrameLoader::stopForPageCache):
2505         Stop policy checks & cancel scheduled navigations after stopping loads. Stopping loads may
2506         run script which may in theory schedule new navigations. This is hardening.
2507
2508 2019-10-11  Antti Koivisto  <antti@apple.com>
2509
2510         Position::upstream/downstream should not need to call ensureLineBoxes
2511         https://bugs.webkit.org/show_bug.cgi?id=202203
2512
2513         Reviewed by Zalan Bujtas.
2514
2515         This avoids forced switch to complex text layout path by Position constructor and will allow future cleanups.
2516
2517         Currently simple line path strips end of line whitespace when white-space:pre-wrap is set.
2518         These are don't affect rendering but they are needed for editing positions.
2519         This patch makes simple line path match the complex path by generating runs for these whitespaces.
2520
2521         * dom/Position.cpp:
2522         (WebCore::Position::upstream const):
2523         (WebCore::Position::downstream const):
2524         (WebCore::ensureLineBoxesIfNeeded): Deleted.
2525         * rendering/SimpleLineLayout.cpp:
2526         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded):
2527
2528         Create a new run if isLineBreak bit is set.
2529
2530         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
2531         (WebCore::SimpleLineLayout::LineState::trailingWhitespaceWidth const):
2532         (WebCore::SimpleLineLayout::computeLineLeft):
2533
2534         Also compute width of the hanging whitespace when aligning the line. This matches the code
2535         in updateLogicalWidthForLeft/Right/CenterAlignedBlock in the complex path.
2536
2537         (WebCore::SimpleLineLayout::preWrap):
2538
2539         breakSpaces implies preWrap is off.
2540
2541         (WebCore::SimpleLineLayout::firstFragment):
2542         (WebCore::SimpleLineLayout::createLineRuns):
2543
2544         Crete runs also for soft linebreaks in pre-wrap.
2545         Add whitespace runs to the end of the line in pre-wrap.
2546
2547         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2548
2549         Hang the whitespace run when wrapping.
2550
2551         (WebCore::SimpleLineLayout::removeTrailingWhitespace): Deleted.
2552
2553         Remainging logic moved to the callsite.
2554
2555 2019-10-11  Jonathan Bedard  <jbedard@apple.com>
2556
2557         Unreviewed, rolling out r250945.
2558
2559         Broke 18 Debug API tests
2560
2561         Reverted changeset:
2562
2563         "Add support for CompactPointerTuple<..., OptionSet<...>>"
2564         https://bugs.webkit.org/show_bug.cgi?id=201316
2565         https://trac.webkit.org/changeset/250945
2566
2567 2019-10-11  Bjorn Melinder  <bjornm@spotify.com>
2568
2569         OfflineAudioContext does not validate allocation of destination buffer
2570         https://bugs.webkit.org/show_bug.cgi?id=177259
2571
2572         Reviewed by Eric Carlson.
2573
2574         Moved the allocation of the destination buffer to the static
2575         OfflineAudioContext::create method where we are able to handle a failed
2576         allocation properly and return an Exception. This change handles both
2577         negative lengths as well as too large lengths where the memory cannot
2578         be allocated.
2579
2580         * Modules/webaudio/AudioContext.cpp:
2581         (WebCore::AudioContext::AudioContext):
2582         * Modules/webaudio/AudioContext.h:
2583         * Modules/webaudio/OfflineAudioContext.cpp:
2584         (WebCore::OfflineAudioContext::OfflineAudioContext):
2585         (WebCore::OfflineAudioContext::create):
2586         * Modules/webaudio/OfflineAudioContext.h:
2587
2588 2019-10-10  Konstantin Tokarev  <annulen@yandex.ru>
2589
2590         Guard GCrypt-specific code with USE(GCRYPT) instead of PLATFORM macros
2591         https://bugs.webkit.org/show_bug.cgi?id=202829
2592
2593         Reviewed by Jiewen Tan.
2594
2595         * crypto/keys/CryptoKeyEC.h:
2596         * crypto/keys/CryptoKeyRSA.h:
2597
2598 2019-10-10  Yury Semikhatsky  <yurys@chromium.org>
2599
2600         Web Inspector: use more C++ keywords for defining agents
2601         https://bugs.webkit.org/show_bug.cgi?id=200959
2602         <rdar://problem/54735374>
2603
2604         Reviewed by Joseph Pecoraro.
2605
2606         Add override annotation to overrided virtual methods in inspector code. This
2607         change is automatically generated by the following command:
2608         clang-tidy -checks='-*,modernize-use-override' -header-filter='.*inspector.*' -fix -p WebKitBuild/Release/
2609             WebKitBuild/Release/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-84c9f43f-*.cpp
2610             WebKitBuild/Release/DerivedSources/WebCore/unified-sources/UnifiedSource-84c9f43f-*.cpp
2611
2612         No new tests. No behavior changes.
2613
2614         * inspector/InspectorController.h:
2615         * inspector/InspectorFrontendClientLocal.h:
2616         * inspector/InspectorFrontendHost.cpp:
2617         * inspector/PageScriptDebugServer.h:
2618         * inspector/WebInjectedScriptManager.h:
2619         * inspector/WorkerInspectorController.h:
2620         * inspector/WorkerScriptDebugServer.h:
2621         * inspector/WorkerToPageFrontendChannel.h:
2622         * inspector/agents/InspectorApplicationCacheAgent.h:
2623         * inspector/agents/InspectorCPUProfilerAgent.h:
2624         * inspector/agents/InspectorCSSAgent.h:
2625         * inspector/agents/InspectorCanvasAgent.h:
2626         * inspector/agents/InspectorDOMAgent.h:
2627         * inspector/agents/InspectorDOMDebuggerAgent.h:
2628         * inspector/agents/InspectorDOMStorageAgent.h:
2629         * inspector/agents/InspectorDatabaseAgent.h:
2630         * inspector/agents/InspectorIndexedDBAgent.cpp:
2631         * inspector/agents/InspectorIndexedDBAgent.h:
2632         * inspector/agents/InspectorLayerTreeAgent.h:
2633         * inspector/agents/InspectorMemoryAgent.h:
2634         * inspector/agents/InspectorNetworkAgent.cpp:
2635         * inspector/agents/InspectorNetworkAgent.h:
2636         * inspector/agents/InspectorPageAgent.h:
2637         * inspector/agents/InspectorTimelineAgent.h:
2638         * inspector/agents/InspectorWorkerAgent.h:
2639         * inspector/agents/WebConsoleAgent.h:
2640         * inspector/agents/WebDebuggerAgent.h:
2641         * inspector/agents/WebHeapAgent.h:
2642         * inspector/agents/page/PageAuditAgent.h:
2643         * inspector/agents/page/PageConsoleAgent.h:
2644         * inspector/agents/page/PageDOMDebuggerAgent.h:
2645         * inspector/agents/page/PageDebuggerAgent.h:
2646         * inspector/agents/page/PageHeapAgent.h:
2647         * inspector/agents/page/PageNetworkAgent.h:
2648         * inspector/agents/page/PageRuntimeAgent.h:
2649         * inspector/agents/worker/ServiceWorkerAgent.h:
2650         * inspector/agents/worker/WorkerAuditAgent.h:
2651         * inspector/agents/worker/WorkerConsoleAgent.h:
2652         * inspector/agents/worker/WorkerDOMDebuggerAgent.h:
2653         * inspector/agents/worker/WorkerDebuggerAgent.h:
2654         * inspector/agents/worker/WorkerNetworkAgent.h:
2655         * inspector/agents/worker/WorkerRuntimeAgent.h:
2656
2657 2019-10-10  Tim Horton  <timothy_horton@apple.com>
2658
2659         Use HAVE(IOSURFACE_RGB10) instead of PLATFORM(IOS_FAMILY) where appropriate
2660         https://bugs.webkit.org/show_bug.cgi?id=202823
2661
2662         Reviewed by Wenson Hsieh.
2663
2664         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2665         (WebCore::layerContentsFormat):
2666         * platform/ios/LegacyTileGridTile.mm:
2667         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
2668
2669 2019-10-10  Jer Noble  <jer.noble@apple.com>
2670
2671         [Catalina] LayoutTest fast/canvas/webgl/texImage2D-mse-flip-{true,false}.html failing
2672         https://bugs.webkit.org/show_bug.cgi?id=202771
2673         <rdar://problem/49441298>
2674
2675         Reviewed by Eric Carlson.
2676
2677         Catalina no longer creates IOSurface-backed CVPixelBuffers by default for certain
2678         codecs; make the CVPixelBuffers generated by WebCoreDecompressionSession IOSurface-backed
2679         explicitly by passing in the correct attributes when creating the VTDecompressionSession.
2680
2681         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
2682         (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
2683
2684 2019-10-10  Myles C. Maxfield  <mmaxfield@apple.com>
2685
2686         [Cocoa] font-family:system-ui on Chinese systems don't get Chinese quote marks
2687         https://bugs.webkit.org/show_bug.cgi?id=202778
2688         <rdar://problem/52594556>
2689
2690         Reviewed by Simon Fraser.
2691
2692         This was caught by fast/text/international/system-language/han-quotes.html,
2693         but we didn't have time to fix it until now.
2694
2695         Test: fast/text/international/system-language/han-quotes.html
2696
2697         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
2698         (WebCore::SystemFontDatabaseCoreText::createSystemUIFont):
2699
2700 2019-10-10  Myles C. Maxfield  <mmaxfield@apple.com>
2701
2702         FontFaceSet's ready promise is not always resolved
2703         https://bugs.webkit.org/show_bug.cgi?id=202548
2704
2705         Reviewed by Youenn Fablet.
2706
2707         When we do layout on an element, FontRanges::glyphDataForCharacter() will cause the first
2708         available font to start loading, but will continue looking at subsequent fonts to see if
2709         there's a good one we can render while the load is happening. When looking for a fallback
2710         font, it calls FontRanges::Range::font() with a ExternalResourceDownloadPolicy set to
2711         Forbid. This is fine, except that a side effect of calling this function is that the
2712         CSSFontFace marks itself as Loading, which means document.fonts.ready is deferred. Then,
2713         the load finishes, and the subsequent CSSFontFace is never actually used, meaning it never
2714         exits the Loading state, which means document.fonts.ready never fires.
2715
2716         The solution to this is to just only allow the font to enter the Loading state if it's not
2717         one of these "subsequent" fonts.
2718
2719         Test: fast/text/fontfaceset-ready-not-fired.html
2720
2721         * css/CSSFontFace.cpp:
2722         (WebCore::CSSFontFace::pump):
2723
2724 2019-10-10  youenn fablet  <youenn@apple.com>
2725
2726         MockRealtimeVideoSource::setFrameRateWithPreset should not use preset after moving it
2727         https://bugs.webkit.org/show_bug.cgi?id=202800
2728
2729         Reviewed by Alexey Proskuryakov.
2730
2731         This does not affect behavior right now since clients typically get the intrinsic size through media samples.
2732         But this could create some inconsistencies.
2733
2734         * platform/mock/MockRealtimeVideoSource.cpp:
2735         (WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
2736
2737 2019-10-10  Devin Rousso  <drousso@apple.com>
2738
2739         Web Inspector: Timelines: don't call willDispatchEvent/didDispatchEvent unless there is a listener for the event
2740         https://bugs.webkit.org/show_bug.cgi?id=202713
2741
2742         Reviewed by Joseph Pecoraro.
2743
2744         Fixes failing inspector/timeline/timeline-recording.html after r250672. This was because the
2745         `InspectorTimelineAgent` expected a corresponding `willDispatchEvent` before it was told
2746         about the `didDispatchEvent`, which wasn't happening since only `willDispatchEvent` would
2747         early-return if the `DOMWindow` didn't have any event listeners for the dispatched event. By
2748         making the `DOMWindow::dispatchEvent` itself early-return in that case, it now handles both
2749         `willDispatchEvent` and `didDispatchEvent`, ensuring that they are always called in pairs.
2750
2751         * page/DOMWindow.cpp:
2752         (WebCore::DOMWindow::dispatchEvent):
2753
2754         * dom/EventTarget.cpp:
2755         (WebCore::EventTarget::innerInvokeEventListeners):
2756         * inspector/InspectorInstrumentation.h:
2757         (WebCore::InspectorInstrumentation::willDispatchEvent):
2758         (WebCore::InspectorInstrumentation::didDispatchEvent):
2759         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
2760         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
2761         * inspector/InspectorInstrumentation.cpp:
2762         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
2763         (WebCore::InspectorInstrumentation::didDispatchEventImpl):
2764         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
2765         (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
2766         `InspectorInstrumentation::willDispatchEventImpl` was always called with `hasEventListeners`
2767         as `true`, so there's no reason to keep that parameter around. Similarly, the change inside
2768         `DOMWindow::dispatchEvent` will make it so that the same is true for
2769         `InspectorInstrumentation::willDispatchEventOnWindowImpl` as well.
2770
2771 2019-10-10  Chris Dumez  <cdumez@apple.com>
2772
2773         Flaky Test: media/media-source/media-source-page-cache.html
2774         https://bugs.webkit.org/show_bug.cgi?id=202775
2775
2776         Reviewed by Eric Carlson.
2777
2778         SourceBufferList should never prevent entering the page cache, even if it has
2779         pending events in its queue. Its queue is a MainThreadGenericEventQueue, which
2780         is Page Cache-aware and will properly suspend the firing of events when needed.
2781
2782         No new tests, covered by flaky test which should no longer be.
2783
2784         * Modules/mediasource/SourceBufferList.cpp:
2785         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
2786
2787 2019-10-10  Sihui Liu  <sihui_liu@apple.com>
2788
2789         Add a unit test for StorageQuotaManager
2790         https://bugs.webkit.org/show_bug.cgi?id=202755
2791
2792         Reviewed by Youenn Fablet.
2793
2794         Expose state of StorageQuotaManager for newly added unit test.
2795
2796         * storage/StorageQuotaManager.h:
2797         (WebCore::StorageQuotaManager::state const):
2798
2799 2019-10-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2800
2801         Support programmatic paste requests on macOS
2802         https://bugs.webkit.org/show_bug.cgi?id=202773
2803         <rdar://problem/48957166>
2804
2805         Reviewed by Tim Horton.
2806
2807         Adds support for programmatic paste requests on macOS. See below for more details.
2808
2809         Tests: editing/pasteboard/dom-paste/dom-paste-confirmation.html
2810                editing/pasteboard/dom-paste/dom-paste-consecutive-confirmations.html
2811                editing/pasteboard/dom-paste/dom-paste-rejection.html
2812                editing/pasteboard/dom-paste/dom-paste-requires-user-gesture.html
2813                editing/pasteboard/dom-paste/dom-paste-same-origin.html
2814
2815         * editing/EditorCommand.cpp:
2816         (WebCore::defaultValueForSupportedPaste):
2817         (WebCore::supportedPaste):
2818         (WebCore::allowPasteFromDOM):
2819         (WebCore::enabledPaste):
2820
2821         Fixes an existing bug uncovered by the layout test editing/execCommand/clipboard-access.html, which tests the
2822         results of `document.queryCommandEnabled("copy")` and `document.queryCommandEnabled("paste")`. The problem here
2823         is that document.queryCommandEnabled("paste") returns true if DOM paste access requests are enabled, regardless
2824         of whether or not there is an active user gesture. This is inconsistent with the behavior of "copy" and "cut",
2825         which return false in the case where there is no user gesture (and the clipboard access policy is also equal to
2826         ClipboardAccessPolicy::RequiresUserGesture -- refer to `allowCopyCutFromDOM`).
2827
2828         When pasting, we only DOM paste access requests to be triggered only in the case where there is a user gesture.
2829         This means that enabledPaste should additionally be gated on a user gesture check. For consistency with the
2830         implementation of `enabledCopy`, we introduce a `allowPasteFromDOM` helper that is similar to
2831         `allowCopyCutFromDOM`, and additionally check this constraint when the paste command's source is the DOM (as
2832         opposed to a menu or key binding).
2833
2834         This adjustment also adds a missing canDHTMLPaste() check prior to consulting canPaste(). This ensures that when
2835         evaluating document.queryCommandEnabled("Paste"), we'll dispatch a "beforepaste" event, similar to how
2836         evaluating document.queryCommandEnabled("Copy") dispatches a "beforecopy" event.
2837
2838         * platform/LocalizedStrings.h:
2839
2840         Mark a function as WEBCORE_EXPORT.
2841
2842 2019-10-10  Eric Carlson  <eric.carlson@apple.com>
2843
2844         [GTK][WPE] Lots of media related tests crashing or flaky after r250918 - [ Mac WK2 ] Layout Test fast/mediastream/MediaStreamTrack-getSettings.html is a flaky failure
2845         https://bugs.webkit.org/show_bug.cgi?id=202784
2846
2847         Unreviewed, fix GTK and WPE test crashes.
2848
2849         * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
2850         (WebCore::WrappedMockRealtimeAudioSource::render): Reconfigure if necessary.
2851         (WebCore::WrappedMockRealtimeAudioSource::reconfigure): New, setup for rendering.
2852         (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange): Call reconfigure.
2853
2854 2019-10-10  youenn fablet  <youenn@apple.com>
2855
2856         Remove unified plan runtime flag
2857         https://bugs.webkit.org/show_bug.cgi?id=202721
2858
2859         Reviewed by Geoffrey Garen.
2860
2861         Covered by existing tests.
2862
2863         * Modules/mediastream/RTCRtpSender.cpp:
2864         (WebCore::RTCRtpSender::RTCRtpSender):
2865         * Modules/mediastream/RTCRtpTransceiver.idl:
2866         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2867         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
2868         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2869         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
2870         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
2871         (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
2872         (WebCore::LibWebRTCMediaEndpoint::OnTrack):
2873         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2874         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2875         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2876         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind):
2877         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
2878         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2879         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
2880         (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
2881         * page/RuntimeEnabledFeatures.h:
2882         (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
2883         * testing/Internals.cpp:
2884         (WebCore::Internals::useMockRTCPeerConnectionFactory):
2885
2886 2019-10-10  Chris Dumez  <cdumez@apple.com>
2887
2888         DOMCacheStorage should not prevent pages from entering the back/forward cache
2889         https://bugs.webkit.org/show_bug.cgi?id=202608
2890
2891         Reviewed by Youenn Fablet.
2892
2893         Make DOMCacheStorage fully suspendable by queueing all its asynchronous promise resolutions
2894         to a SuspendableTaskQueue. This makes sure that no promises are resolved while suspended
2895         in the page cache.
2896
2897         Test: http/tests/navigation/page-cache-domcachestorage-pending-promise.html
2898
2899         * Modules/cache/DOMCacheStorage.cpp:
2900         (WebCore::DOMCacheStorage::DOMCacheStorage):
2901         (WebCore::DOMCacheStorage::doSequentialMatch):
2902         (WebCore::DOMCacheStorage::match):
2903         (WebCore::DOMCacheStorage::has):
2904         (WebCore::DOMCacheStorage::open):
2905         (WebCore::DOMCacheStorage::doOpen):
2906         (WebCore::DOMCacheStorage::remove):
2907         (WebCore::DOMCacheStorage::doRemove):
2908         (WebCore::DOMCacheStorage::keys):
2909         (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const):
2910         * Modules/cache/DOMCacheStorage.h:
2911
2912 2019-10-10  youenn fablet  <youenn@apple.com>
2913
2914         Add asserts to MediaStreamPrivate observer routines
2915         https://bugs.webkit.org/show_bug.cgi?id=202724
2916
2917         Reviewed by Alex Christensen.
2918
2919         These methods are only to be called in main thread.
2920         Add asserts to validate this.
2921         No change of behavior.
2922
2923         * platform/mediastream/MediaStreamPrivate.cpp:
2924         (WebCore::MediaStreamPrivate::addObserver):
2925         (WebCore::MediaStreamPrivate::removeObserver):
2926         (WebCore::MediaStreamPrivate::forEachObserver const):
2927
2928 2019-10-09  youenn fablet  <youenn@apple.com>
2929
2930         A service worker process should not be created when enqueuing a service worker job
2931         https://bugs.webkit.org/show_bug.cgi?id=202578
2932         <rdar://problem/55979690>
2933
2934         Reviewed by Chris Dumez.
2935
2936         Ask for a service worker context connection when planning to install or run a service worker.
2937         This allows to not spin unnecessarily service worker processes for jobs that do not end up installing a service worker.
2938
2939         Covered by existing tests.
2940
2941         * workers/service/server/SWServer.cpp:
2942         (WebCore::SWServer::tryInstallContextData):
2943         (WebCore::SWServer::runServiceWorkerIfNecessary):
2944
2945 2019-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2946
2947         Unreviewed, fix the internal iOS build
2948
2949         * page/PointerCaptureController.h: Add some missing forward declarations.
2950
2951 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
2952
2953         Unreviewed, fix an asserition after r250937.
2954
2955         Space increase tasks will be finished once it's started.
2956
2957         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2958         (WebCore::IDBServer::UniqueIDBDatabase::finishSpaceIncreaseTask):
2959         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2960
2961 2019-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2962
2963         [Clipboard API] Refactor Pasteboard item reading functions to work on both iOS and macOS
2964         https://bugs.webkit.org/show_bug.cgi?id=202647
2965
2966         Reviewed by Tim Horton.
2967
2968         Moves some pasteboard helper functions out of iOS-specific code, and into platform-agnostic code. See below for
2969         more details. There is no change in behavior, as nothing exercises these new pasteboard functions on macOS yet.
2970
2971         * SourcesCocoa.txt:
2972         * WebCore.xcodeproj/project.pbxproj:
2973         * platform/Pasteboard.cpp:
2974         (WebCore::Pasteboard::allPasteboardItemInfo const):
2975         (WebCore::Pasteboard::pasteboardItemInfo const):
2976         (WebCore::Pasteboard::readString):
2977         (WebCore::Pasteboard::readBuffer):
2978         (WebCore::Pasteboard::readURL):
2979
2980         Add some new helpers on Pasteboard to read Strings, data, and URLs from the platform pasteboard. These forward
2981         to the platform strategy which, in WebKit2, are currently implemented using sync IPC, but could be changed in
2982         the future to be fully asynchronous.
2983
2984         * platform/Pasteboard.h:
2985         (WebCore::Pasteboard::name const):
2986
2987         Expose a cross-platform name() getter on Pasteboard. On non-Cocoa platforms, this simply returns the empty
2988         string, but on macOS and iOS, this returns the platform pasteboard name, which is stored in m_pasteboardName.
2989
2990         * platform/PasteboardItemInfo.h:
2991         (WebCore::PasteboardItemInfo::pathForContentType const):
2992         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
2993         (WebCore::PasteboardItemInfo::encode const):
2994         (WebCore::PasteboardItemInfo::decode):
2995
2996         Adds a couple of new members to PasteboardItemInfo (which represents metadata about a given item in the platform
2997         pasteboard). These are changeCount (which is self explanatory), and webSafeTypesByFidelity, which is a list of
2998         types in fidelity order which contains the list of pasteboard types that are safe to expose to bindings. These
2999         may include types such as "text/plain", "text/html", "text/uri-list", and "image/png".
3000
3001         To distinguish this list from the existing contentTypesByFidelity list, I've also renamed contentTypesByFidelity
3002         to platformTypesByFidelity, to make it more obvious that this other list of types are platform-specific, and not
3003         generally safe to expose to the web.
3004
3005         * platform/PasteboardStrategy.h:
3006         * platform/PlatformPasteboard.h:
3007
3008         Move several helpers out into platform-agnostic code.
3009
3010         * platform/cocoa/PasteboardCocoa.mm:
3011         (WebCore::Pasteboard::fileContentState):
3012         * platform/cocoa/PlatformPasteboardCocoa.mm: Added.
3013
3014         Add a new file to contain the implementation of PlatformPasteboard::allPasteboardItemInfo, which is the same
3015         across Cocoa platforms.
3016
3017         (WebCore::PlatformPasteboard::allPasteboardItemInfo):
3018         * platform/ios/PasteboardIOS.mm:
3019         (WebCore::Pasteboard::readRespectingUTIFidelities):
3020         * platform/ios/PlatformPasteboardIOS.mm:
3021         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3022         (WebCore::PlatformPasteboard::readBuffer const):
3023         (WebCore::PlatformPasteboard::readString const):
3024         (WebCore::PlatformPasteboard::readURL const):
3025
3026         Additionally refactor all methods on PlatformPasteboard that take pasteboard item indices as signed integers
3027         (`int`) to receive `size_t` values instead.
3028
3029         (WebCore::PlatformPasteboard::allPasteboardItemInfo): Deleted.
3030         * platform/libwpe/PasteboardLibWPE.cpp:
3031         (WebCore::Pasteboard::readString):
3032         (WebCore::Pasteboard::read):
3033         * platform/libwpe/PlatformPasteboardLibWPE.cpp:
3034         (WebCore::PlatformPasteboard::readString const):
3035
3036         Add an implementation stub for WPE.
3037
3038         * platform/mac/PlatformPasteboardMac.mm:
3039         (WebCore::modernPasteboardTypeForWebSafeMIMEType):
3040         (WebCore::webSafeMIMETypeForModernPasteboardType):
3041
3042         Add helpers to convert between modern NSPasteboardTypes and web-safe types. While some logic exists today on
3043         macOS to convert between legacy pasteboard types and web-safe types, conversion between the modern pasteboard
3044         types and web-safe types are needed since NSPasteboardItem's types only support NSPasteboardTypes and
3045         dynamically declared types that match the format of a universal type identfier (for instance, "com.foo.bar").
3046
3047         (WebCore::PlatformPasteboard::readBuffer const):
3048         (WebCore::PlatformPasteboard::readString const):
3049         (WebCore::PlatformPasteboard::readURL const):
3050         (WebCore::PlatformPasteboard::count const):
3051         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3052
3053         Implement all of these helpers by looking up the NSPasteboardItem at the given item index and querying it for
3054         data for non-legacy pasteboard types.
3055
3056         (WebCore::PlatformPasteboard::itemAtIndex const):
3057
3058 2019-10-09  Daniel Bates  <dabates@apple.com>
3059
3060         Add support for CompactPointerTuple<..., OptionSet<...>>
3061         https://bugs.webkit.org/show_bug.cgi?id=201316
3062
3063         Reviewed by Yusuke Suzuki.
3064
3065         Use the new CompactPointerTuple capability to replace CompactPointerTuple<RenderObject*, uint8_t>
3066         with CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> in Node.h.
3067
3068         * dom/Node.h:
3069         (WebCore::Node::hasStyleFlag const):
3070         (WebCore::Node::setStyleFlag):
3071         (WebCore::Node::clearStyleFlags):
3072         Update code now that we support CompactPointerTuple<..., OptionSet<...>>.
3073
3074 2019-10-09  John Wilander  <wilander@apple.com>
3075
3076         IsLoggedIn: Add as experimental feature
3077         https://bugs.webkit.org/show_bug.cgi?id=202707
3078         <rdar://problem/56095064>
3079
3080         Reviewed by Brent Fulgham and Chris Dumez.
3081
3082         IsLoggedIn was proposed to the WebAppSec WG at TPAC 2019.
3083         So far there is only an explainer posted to the mailing list:
3084         https://lists.w3.org/Archives/Public/public-webappsec/2019Sep/0004.html
3085
3086         This patch adds the three experimental web APIs:
3087         - Promise<void> setLoggedIn()
3088         - Promise<void> setLoggedOut()
3089         - Promise<bool> isLoggedIn()
3090
3091         It also tests that those APIs are only exposed in secure contexts.
3092
3093         The functionality is implemented as a supplement to Navigator.
3094
3095         Tests: http/tests/is-logged-in/available-in-secure-contexts.https.html
3096                http/tests/is-logged-in/unavailable-in-insecure-contexts.html
3097
3098         * DerivedSources-input.xcfilelist:
3099         * DerivedSources-output.xcfilelist:
3100         * DerivedSources.make:
3101         * Headers.cmake:
3102         * Sources.txt:
3103         * WebCore.xcodeproj/project.pbxproj:
3104         * page/NavigatorIsLoggedIn.cpp: Added.
3105         (WebCore::NavigatorIsLoggedIn::from):
3106         (WebCore::NavigatorIsLoggedIn::supplementName):
3107         (WebCore::NavigatorIsLoggedIn::setLoggedIn):
3108         (WebCore::NavigatorIsLoggedIn::setLoggedOut):
3109         (WebCore::NavigatorIsLoggedIn::isLoggedIn):
3110         * page/NavigatorIsLoggedIn.h: Added.
3111         * page/NavigatorIsLoggedIn.idl: Added.
3112         * page/PointerCaptureController.cpp:
3113         * page/PointerCaptureController.h:
3114         * page/Settings.yaml:
3115
3116 2019-10-09  Russell Epstein  <repstein@apple.com>
3117
3118         Unreviewed, rolling out r250930.
3119
3120         Broke watchOS Builds
3121
3122         Reverted changeset:
3123
3124         "Add support for CompactPointerTuple<..., OptionSet<...>>"
3125         https://bugs.webkit.org/show_bug.cgi?id=201316
3126         https://trac.webkit.org/changeset/250930
3127
3128 2019-10-09  Jiewen Tan  <jiewen_tan@apple.com>
3129
3130         [WebAuthn] Move the mock testing entrance to Internals
3131         https://bugs.webkit.org/show_bug.cgi?id=202560
3132         <rdar://problem/55973793>
3133
3134         Reviewed by Chris Dumez.
3135
3136         This patch moves TestRunner.setWebAuthenticationMockConfiguration to
3137         Internals.setMockWebAuthenticationConfiguration and removes the old
3138         entrance. The purpose of this patch is to allow API tests to use
3139         the same mock infrastructure that is used by layout tests.
3140
3141         No new tests, covered by updates on existing tests.
3142
3143         * DerivedSources-input.xcfilelist:
3144         * DerivedSources-output.xcfilelist:
3145         * DerivedSources.make:
3146         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3147         * WebCore.xcodeproj/project.pbxproj:
3148         * page/ChromeClient.h:
3149         (WebCore::ChromeClient::setMockWebAuthenticationConfiguration):
3150         * testing/Internals.cpp:
3151         (WebCore::Internals::setMockWebAuthenticationConfiguration):
3152         * testing/Internals.h:
3153         * testing/Internals.idl:
3154         * testing/MockWebAuthenticationConfiguration.h: Added.
3155         (WebCore::MockWebAuthenticationConfiguration::LocalConfiguration::encode const):
3156         (WebCore::MockWebAuthenticationConfiguration::LocalConfiguration::decode):
3157         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::encode const):
3158         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
3159         (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::encode const):
3160         (WebCore::MockWebAuthenticationConfiguration::NfcConfiguration::decode):
3161         (WebCore::MockWebAuthenticationConfiguration::encode const):
3162         (WebCore::MockWebAuthenticationConfiguration::decode):
3163         * testing/MockWebAuthenticationConfiguration.idl: Added.
3164
3165 2019-10-09  Simon Fraser  <simon.fraser@apple.com>
3166
3167         Rename WheelEventTestTrigger and improve naming in related code
3168         https://bugs.webkit.org/show_bug.cgi?id=202772
3169
3170         Reviewed by Tim Horton.
3171
3172         Change the "test trigger" terminology to "monitor wheel events"; after all, tests
3173         call monitorWheelEvents() and callAfterScrollingCompletes(), and this is not triggering
3174         a test.
3175
3176         * Sources.txt:
3177         * WebCore.xcodeproj/project.pbxproj:
3178         * page/FrameView.cpp:
3179         (WebCore::FrameView::adjustScrollbarsForLayout):
3180         (WebCore::FrameView::setScrollPosition):
3181         (WebCore::FrameView::didAddScrollbar):
3182         * page/Page.cpp:
3183         (WebCore::Page::ensureWheelEventTestMonitor):
3184         (WebCore::Page::ensureTestTrigger): Deleted.
3185         * page/Page.h:
3186         (WebCore::Page::wheelEventTestMonitor const):
3187         (WebCore::Page::clearWheelEventTestMonitor):
3188         (WebCore::Page::isMonitoringWheelEvents const):
3189         (WebCore::Page::testTrigger const): Deleted.
3190         (WebCore::Page::clearTrigger): Deleted.
3191         (WebCore::Page::expectsWheelEventTriggers const): Deleted.
3192         * page/WheelEventTestMonitor.cpp: Added.
3193         (WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
3194         (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
3195         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
3196         (WebCore::WheelEventTestMonitor::deferForReason):
3197         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
3198         (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
3199         (WebCore::operator<<):
3200         * page/WheelEventTestMonitor.h: Renamed from Source/WebCore/page/WheelEventTestTrigger.h.
3201         * page/WheelEventTestTrigger.cpp: Removed.
3202         * page/mac/EventHandlerMac.mm:
3203         (WebCore::EventHandler::platformPrepareForWheelEvents):
3204         * page/scrolling/AsyncScrollingCoordinator.cpp:
3205         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3206         (WebCore::AsyncScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
3207         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3208         (WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const):
3209         (WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const):
3210         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
3211         (WebCore::AsyncScrollingCoordinator::deferTestsForReason const): Deleted.
3212         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason const): Deleted.
3213         * page/scrolling/AsyncScrollingCoordinator.h:
3214         * page/scrolling/ScrollingCoordinator.h:
3215         (WebCore::ScrollingCoordinator::updateIsMonitoringWheelEventsForFrameView):
3216         (WebCore::ScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView): Deleted.
3217         * page/scrolling/ScrollingStateScrollingNode.cpp:
3218         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3219         (WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
3220         (WebCore::ScrollingStateScrollingNode::setIsMonitoringWheelEvents):
3221         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
3222         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Deleted.
3223         * page/scrolling/ScrollingStateScrollingNode.h:
3224         (WebCore::ScrollingStateScrollingNode::isMonitoringWheelEvents const):
3225         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger const): Deleted.
3226         * page/scrolling/ScrollingTree.h:
3227         (WebCore::ScrollingTree::deferWheelEventTestCompletionForReason):
3228         (WebCore::ScrollingTree::removeWheelEventTestCompletionDeferralForReason):
3229         (WebCore::ScrollingTree::deferTestsForReason): Deleted.
3230         (WebCore::ScrollingTree::removeTestDeferralForReason): Deleted.
3231         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3232         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
3233         * page/scrolling/ScrollingTreeScrollingNode.h:
3234         * page/scrolling/ThreadedScrollingTree.cpp:
3235         (WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason):
3236         (WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason):
3237         (WebCore::ThreadedScrollingTree::deferTestsForReason): Deleted.
3238         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Deleted.
3239         * page/scrolling/ThreadedScrollingTree.h:
3240         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
3241         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3242         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
3243         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
3244         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
3245         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const): Deleted.
3246         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const): Deleted.
3247         * platform/Logging.h:
3248         * platform/ScrollAnimator.cpp:
3249         (WebCore::ScrollAnimator::deferWheelEventTestCompletionForReason const):
3250         (WebCore::ScrollAnimator::removeWheelEventTestCompletionDeferralForReason const):
3251         (WebCore::ScrollAnimator::deferTestsForReason const): Deleted.
3252         (WebCore::ScrollAnimator::removeTestDeferralForReason const): Deleted.
3253         * platform/ScrollAnimator.h:
3254         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestMonitor):
3255         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger): Deleted.
3256         * platform/cocoa/ScrollController.h:
3257         (WebCore::ScrollControllerClient::deferWheelEventTestCompletionForReason const):
3258         (WebCore::ScrollControllerClient::removeWheelEventTestCompletionDeferralForReason const):
3259         (WebCore::ScrollControllerClient::deferTestsForReason const): Deleted.
3260         (WebCore::ScrollControllerClient::removeTestDeferralForReason const): Deleted.
3261         * platform/cocoa/ScrollController.mm:
3262         (WebCore::ScrollController::startSnapRubberbandTimer):
3263         (WebCore::ScrollController::stopSnapRubberbandTimer):
3264         (WebCore::ScrollController::scheduleStatelessScrollSnap):
3265         (WebCore::ScrollController::startDeferringWheelEventTestCompletionDueToScrollSnapping):
3266         (WebCore::ScrollController::stopDeferringWheelEventTestCompletionDueToScrollSnapping):
3267         (WebCore::ScrollController::startScrollSnapTimer):
3268         (WebCore::ScrollController::stopScrollSnapTimer):
3269         (WebCore::ScrollController::startDeferringTestsDueToScrollSnapping): Deleted.
3270         (WebCore::ScrollController::stopDeferringTestsDueToScrollSnapping): Deleted.
3271         * platform/mac/ScrollAnimatorMac.mm:
3272         (WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
3273         (WebCore::ScrollAnimatorMac::didEndScrollGesture const):
3274         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon):
3275         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired):
3276         * rendering/RenderBox.cpp:
3277         (WebCore::setupWheelEventMonitor):
3278         (WebCore::RenderBox::setScrollLeft):
3279         (WebCore::RenderBox::setScrollTop):
3280         (WebCore::setupWheelEventTestTrigger): Deleted.
3281         * rendering/RenderLayer.cpp:
3282         (WebCore::RenderLayer::createScrollbar):
3283         * rendering/RenderListBox.cpp:
3284         (WebCore::setupWheelEventTestMonitor):
3285         (WebCore::RenderListBox::setScrollTop):
3286         (WebCore::RenderListBox::createScrollbar):
3287         (WebCore::setupWheelEventTestTrigger): Deleted.
3288         * testing/js/WebCoreTestSupport.cpp:
3289         (WebCoreTestSupport::monitorWheelEvents):
3290         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer):
3291         (WebCoreTestSupport::clearWheelEventTestMonitor):
3292         (WebCoreTestSupport::clearWheelEventTestTrigger): Deleted.
3293         * testing/js/WebCoreTestSupport.h:
3294
3295 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
3296
3297         IndexedDB: update size to actual disk usage only when estimated increase is bigger than space available
3298         https://bugs.webkit.org/show_bug.cgi?id=201957
3299
3300         Reviewed by Youenn Fablet.
3301
3302         For better performance.
3303
3304         Covered by existing tests.
3305
3306         * Modules/indexeddb/server/IDBServer.cpp:
3307         (WebCore::IDBServer::IDBServer::QuotaUser::resetSpaceUsed): m_estimatedSpaceIncrease will be updated when task
3308         is finished, so no need to clear it when doing reset.
3309         (WebCore::IDBServer::IDBServer::QuotaUser::computeSpaceUsed):
3310         * Modules/indexeddb/server/IDBServer.h:
3311
3312         * Modules/indexeddb/server/UniqueIDBDatabase.cpp: instead of reading file size after each task, just add the 
3313         task size to known usage and get an estimated usage.
3314         (WebCore::IDBServer::UniqueIDBDatabase::startSpaceIncreaseTask):
3315         (WebCore::IDBServer::UniqueIDBDatabase::finishSpaceIncreaseTask):
3316         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
3317         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
3318         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
3319         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
3320         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
3321         (WebCore::IDBServer::UniqueIDBDatabase::generateUniqueCallbackIdentifier):
3322         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
3323         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
3324         (WebCore::IDBServer::UniqueIDBDatabase::didOpenBackingStore):
3325         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
3326         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateObjectStore):
3327         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
3328         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
3329         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
3330         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCreateIndex):
3331         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
3332         (WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameIndex):
3333         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
3334         (WebCore::IDBServer::UniqueIDBDatabase::didPerformPutOrAdd):
3335         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
3336         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3337         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
3338         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
3339         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
3340         (WebCore::IDBServer::generateUniqueCallbackIdentifier): Deleted.
3341         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded): Deleted.
3342         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3343
3344         * storage/StorageQuotaManager.cpp: use m_state to decide what action to take on next request. Previously when a 
3345         request asked for size bigger than space available, we would go to ask for more space directly. Now because IDB
3346         can be reporting estimated usage, we first ask IDB to compute its actual disk usage and ask for more space if 
3347         actual space available is smaller than requested size.
3348         (WebCore::StorageQuotaManager::askUserToInitialize):
3349         (WebCore::StorageQuotaManager::removeUser):
3350         (WebCore::StorageQuotaManager::requestSpace):
3351         (WebCore::StorageQuotaManager::askForMoreSpace):
3352         (WebCore::StorageQuotaManager::processPendingRequests):
3353         * storage/StorageQuotaManager.h:
3354         * storage/StorageQuotaUser.h:
3355         (WebCore::StorageQuotaUser::computeSpaceUsed):
3356
3357 2019-10-09  Sihui Liu  <sihui_liu@apple.com>
3358
3359         IndexedDB: include size of index records in size estimate of put/add task
3360         https://bugs.webkit.org/show_bug.cgi?id=202483
3361
3362         Reviewed by Geoffrey Garen.
3363
3364         SQLiteIDBBackingStore has two tables IndexRecords and Records. For add operation add(VALUE, KEY), we add a new 
3365         record to Records table. If we can extract index value from VALUE for some index, we would add a new record to
3366         IndexRecords table.
3367
3368         We estimated the task szie of add task with (KEY_SIZE + VALUE_SIZE), but we didn't count the size that could be
3369         added to the IndexRecords table. This could lead to storage abuse.
3370
3371         Test: storage/indexeddb/request-size-estimate.html
3372
3373         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3374         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
3375
3376 2019-10-09  Chris Dumez  <cdumez@apple.com>
3377
3378         Youtube.com is unable to enter the back/forward cache on macOS
3379         https://bugs.webkit.org/show_bug.cgi?id=202754
3380         <rdar://problem/56117666>
3381
3382         Reviewed by Eric Carlson.
3383
3384         As of r250542, the MainThreadGenericEventQueue used by both MediaSource and
3385         SourceBuffer to fire event is PageCache-aware. As a result, both these
3386         ActiveDOMObjects can now safety suspend without risking running script while
3387         in the page cache. I did have to update some logic in MediaSource::removeSourceBuffer()
3388         to make sure we do not unnecessarily construct new ActiveDOMObjects while
3389         suspending, as this is not allowed.
3390
3391         Test: media/media-source/media-source-page-cache.html
3392
3393         * Modules/mediasource/MediaSource.cpp:
3394         (WebCore::MediaSource::removeSourceBuffer):
3395         (WebCore::MediaSource::canSuspendForDocumentSuspension const):
3396         * Modules/mediasource/SourceBuffer.cpp:
3397         (WebCore::SourceBuffer::canSuspendForDocumentSuspension const):
3398         * Modules/mediasource/SourceBuffer.h:
3399
3400 2019-10-09  Daniel Bates  <dabates@apple.com>
3401
3402         Add support for CompactPointerTuple<..., OptionSet<...>>
3403         https://bugs.webkit.org/show_bug.cgi?id=201316
3404
3405         Reviewed by Yusuke Suzuki.
3406
3407         Use the new CompactPointerTuple capability to replace CompactPointerTuple<RenderObject*, uint8_t>
3408         with CompactPointerTuple<RenderObject*, OptionSet<ElementStyleFlag>> in Node.h.
3409
3410         * dom/Node.h:
3411         (WebCore::Node::hasStyleFlag const):
3412         (WebCore::Node::setStyleFlag):
3413         (WebCore::Node::clearStyleFlags):
3414         Update code now that we support CompactPointerTuple<..., OptionSet<...>>.
3415
3416 2019-10-09  Zalan Bujtas  <zalan@apple.com>
3417
3418         RunResolver::rangeForRendererWithOffsets should check for range end
3419         https://bugs.webkit.org/show_bug.cgi?id=202761
3420         <rdar://problem/55917924>
3421
3422         Reviewed by Antti Koivisto.
3423
3424         This patch ensures that when rangeForRenderer comes back with a collapsed run (empty range), rangeForRendererWithOffsets returns an empty range as well.
3425
3426         Test: fast/text/simple-line-layout-range-check-end.html
3427
3428         * rendering/SimpleLineLayoutResolver.cpp:
3429         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets const):
3430
3431 2019-10-09  Alicia Boya García  <aboya@igalia.com>
3432
3433         [MSE][GStreamer] Fix video sometimes not appearing
3434         https://bugs.webkit.org/show_bug.cgi?id=201401
3435
3436         Reviewed by Xabier Rodriguez-Calvar.
3437
3438         The code in MediaPlayerPrivateGStreamer::changePipelineState() was
3439         supposed to call `ensureGLVideoSinkContext()` on upwards transitions
3440         to PAUSED but the code did not take into account non-step-by-step
3441         state transitions, which happens frequently with playbin3 in the MSE
3442         case.
3443
3444         Before the patch, when playbin3 transitioned from READY to PLAYING
3445         without stopping for preroll this call would not be made and the
3446         texture IDs received at the sink would not correspond to the
3447         compositor GL context, leading to artifacts (often the player controls
3448         or a blank screen).
3449
3450         Test: imported/w3c/web-platform-tests/media-source/mediasource-video-is-visible.html
3451
3452         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3453         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
3454
3455 2019-10-09  Eric Carlson  <eric.carlson@apple.com>
3456
3457         [ Mac WK2 ] Layout Test fast/mediastream/MediaStreamTrack-getSettings.html is a flaky failure
3458         https://bugs.webkit.org/show_bug.cgi?id=196400
3459         <rdar://problem/49567579>
3460
3461         Reviewed by Youenn Fablet.
3462
3463         No new tests, this fixes a broken test.
3464
3465         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3466         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3467         (WebCore::MockRealtimeAudioSourceMac::reconfigure): Reconfigure buffers as well.
3468         (WebCore::MockRealtimeAudioSourceMac::render): Call reconfigure if the buffer isn't
3469         configured correctly.
3470         (WebCore::MockRealtimeAudioSourceMac::settingsDidChange): Call reconfigure.
3471
3472         * platform/mock/MockRealtimeAudioSource.cpp:
3473         (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Set sample rate to default.
3474
3475 2019-10-09  Chris Dumez  <cdumez@apple.com>
3476
3477         Unreviewed, address Darin's post-landing comments for r250912.
3478
3479         The array should be const.
3480
3481         * css/CSSDefaultStyleSheets.cpp:
3482
3483 2019-10-09  Daniel Bates  <dabates@apple.com>
3484
3485         Clean up: Remove pre-macOS Sierra workaround for missing kVK_RightCommand
3486         https://bugs.webkit.org/show_bug.cgi?id=202597
3487
3488         Reviewed by Anders Carlsson.
3489
3490         kVK_RightCommand has been defined in HIToolbox/Events.h since macOS Sierra. We no longer
3491         need to maintain code to manually define it.
3492
3493         * platform/mac/PlatformEventFactoryMac.mm:
3494         (WebCore::keyForKeyEvent):
3495
3496 2019-10-09  Antti Koivisto  <antti@apple.com>
3497
3498         [CSS Shadow Parts] Minor exportparts attribute parsing cleanups
3499         https://bugs.webkit.org/show_bug.cgi?id=202740
3500
3501         Reviewed by Zalan Bujtas.
3502
3503         * dom/ShadowRoot.cpp:
3504         (WebCore::parsePartMapping):
3505         (WebCore::parsePartMappingsList):
3506
3507         Return the map as the return value.
3508
3509         (WebCore::ShadowRoot::partMappings const):
3510
3511 2019-10-09  Andy Estes  <aestes@apple.com>
3512
3513         [iOS] Remove redundant uses of USE(UIKIT_EDITING)
3514         https://bugs.webkit.org/show_bug.cgi?id=202717
3515
3516         Reviewed by Anders Carlsson.
3517
3518         * page/ios/FrameIOS.mm:
3519         (WebCore::Frame::qualifyingNodeAtViewportLocation):
3520         (WebCore::Frame::approximateNodeAtViewportLocationLegacy):
3521
3522 2019-10-09  Chris Dumez  <cdumez@apple.com>
3523
3524         [iOS] REGRESSION (r250398) Layout Test fast/history/page-cache-element-state-focused.html is failing
3525         https://bugs.webkit.org/show_bug.cgi?id=202712
3526         <rdar://problem/56082428>
3527
3528         Reviewed by Antti Koivisto.
3529
3530         The test was failing depending on the order in which the tests were executed. The reason is that
3531         elements would either use the full UA stylesheet (html.css) or the simple one in CSSDefaultStyleSheets.cpp.
3532         Unfortunately, the outline-width was different on iOS between the simple stylesheet and the full one, causing
3533         the test output to look different depending on which stylesheet was used.
3534
3535         Address the issue by making sure that the outline-width is 3px on IOS_FAMILY in the simple stylesheet, to
3536         be consistent with the value in the full stylesheet (html.css).
3537
3538         * css/CSSDefaultStyleSheets.cpp:
3539
3540 2019-10-09  Zalan Bujtas  <zalan@apple.com>
3541
3542         [LFC][Painting] Decouple content and decoration painting
3543         https://bugs.webkit.org/show_bug.cgi?id=202718
3544         <rdar://problem/56104661>
3545
3546         Reviewed by Antti Koivisto.
3547
3548         This patch adds support for individual run painting <div><span style="background-color: red">red</span>black</div>.
3549         This is pretty much all we can do with the current data structures (lack of context).
3550
3551         * layout/displaytree/DisplayPainter.cpp:
3552         (WebCore::Display::paintBoxDecoration):
3553         (WebCore::Display::paintInlineContent):
3554         (WebCore::Display::Painter::paint):
3555         (WebCore::Display::paintBlockLevelBoxDecoration): Deleted.
3556         * layout/inlineformatting/InlineLine.cpp:
3557         (WebCore::Layout::Line::appendInlineContainerStart):
3558         (WebCore::Layout::Line::appendInlineContainerEnd):
3559
3560 2019-10-09  Fujii Hironori  <Hironori.Fujii@sony.com>
3561
3562         Unreviewed build fix for Windows ports
3563         https://bugs.webkit.org/show_bug.cgi?id=202630
3564         <rdar://problem/56107907>
3565
3566         dom/Document.cpp(3990): error C2653: 'MediaStreamTrack': is not a class or namespace name
3567         dom/Document.cpp(3990): error C3861: 'captureState': identifier not found
3568
3569         * dom/Document.cpp:
3570         (WebCore::Document::updateIsPlayingMedia): Restored #if ENABLE(MEDIA_STREAM).
3571
3572 2019-10-09  Antti Koivisto  <antti@apple.com>
3573
3574         [CSS Shadow Parts] Mark as supported in features.json
3575         https://bugs.webkit.org/show_bug.cgi?id=202730
3576
3577         Reviewed Ryosuke Niwa.
3578
3579         * features.json:
3580
3581 2019-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3582
3583         [GTK] Wayland: do not use EGL_PLATFORM_WAYLAND_KHR with eglGetPlatformDisplayEXT
3584         https://bugs.webkit.org/show_bug.cgi?id=202689
3585
3586         Reviewed by Žan Doberšek.
3587
3588         Use EGL_PLATFORM_WAYLAND_EXT instead. It shouldn't really matter because both are the same value.
3589
3590         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
3591         (WebCore::PlatformDisplayWayland::initialize):
3592
3593 2019-10-09  Antti Koivisto  <antti@apple.com>
3594
3595         [CSS Shadow Parts] Allow exporting single part with multiple names using exportparts attribute
3596         https://bugs.webkit.org/show_bug.cgi?id=202719
3597
3598         Reviewed by Ryosuke Niwa.
3599
3600         Cases like exportparts="part:export1, part:export2" should work.
3601
3602         * css/SelectorChecker.cpp:
3603         (WebCore::SelectorChecker::checkOne const):
3604
3605         Allow one part name to expand into multiple names for matching.
3606
3607         * dom/ShadowRoot.cpp:
3608         (WebCore::parsePartMappingsList):
3609
3610         Allow multiple names per mapping.
3611
3612         (WebCore::ShadowRoot::partMappings const):
3613         * dom/ShadowRoot.h:
3614
3615 2019-10-09  Philippe Normand  <pnormand@igalia.com>
3616
3617         REGRESSION(r246399): [GStreamer] Problems playing AAC streams
3618         https://bugs.webkit.org/show_bug.cgi?id=202204
3619
3620         Reviewed by Xabier Rodriguez-Calvar.
3621
3622         Push the EOS event in the WebKitWebSrc element when the internal
3623         queue is empty only for non-live resources. In the live case the
3624         queue might drain temporarily but that's OK because data would
3625         still be queued in downstream elements.
3626
3627         No new tests, the EOS event was pushed too early because of this
3628         regression but there's no way to differentiate it from an expected
3629         event in a layout test.
3630
3631         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3632         (webKitWebSrcCreate):
3633
3634 2019-10-09  youenn fablet  <youenn@apple.com>
3635
3636         MediaStreamTrack does not need to be a Document audio producer
3637         https://bugs.webkit.org/show_bug.cgi?id=202630
3638
3639         Reviewed by Eric Carlson.
3640
3641         Instead of having all tracks being MediaProducer, we can use the new methods introduced for iOS
3642         to mute/unmute capture tracks and get capture media state.
3643         This allows to not register tracks that are not capture tracks.
3644         Covered by existing tests.
3645
3646         * Modules/mediastream/MediaStreamTrack.cpp:
3647         (WebCore::MediaStreamTrack::MediaStreamTrack):
3648         (WebCore::MediaStreamTrack::~MediaStreamTrack):
3649         (WebCore::MediaStreamTrack::setMuted):
3650         (WebCore::MediaStreamTrack::applyConstraints):
3651         (WebCore::MediaStreamTrack::mediaState const):
3652         (WebCore::MediaStreamTrack::updateCaptureAccordingToMutedState):
3653         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Deleted.
3654         * Modules/mediastream/MediaStreamTrack.h:
3655         * dom/Document.cpp:
3656         (WebCore::Document::updateIsPlayingMedia):
3657         (WebCore::Document::pageMutedStateDidChange):
3658
3659 2019-10-08  Antti Koivisto  <antti@apple.com>
3660
3661         [CSS Shadow Parts] Enable by default
3662         https://bugs.webkit.org/show_bug.cgi?id=202644
3663
3664         Reviewed by Ryosuke Niwa.
3665
3666         Flip the switch.
3667
3668         * page/RuntimeEnabledFeatures.h:
3669
3670 2019-10-08  Jiewen Tan  <jiewen_tan@apple.com>
3671
3672         Partially undo r250811
3673         https://bugs.webkit.org/show_bug.cgi?id=202715
3674         <rdar://problem/56084287>
3675
3676         Reviewed by Chris Dumez.
3677
3678         This patch changes the SerializedScriptValue to always wrap CryptoKey objects again.
3679         CryptoKey objects could belong to an array or another object. In those cases, IDBObjectStore
3680         cannot set the flag for the embedded Cryptokey objects. Neither can postMessage to unset
3681         the flag. Therefore, there is no way to separate the serialization process into two and
3682         this patch restores the old behaviour. However, the hardening part of r250811 is kept
3683         and therefore the crash should still be prevented.
3684
3685         No new test, updated existing test
3686
3687         * Modules/indexeddb/IDBObjectStore.cpp:
3688         (WebCore::IDBObjectStore::putOrAdd):
3689         (WebCore::JSC::setIsWrappingRequiredForCryptoKey): Deleted.
3690         * bindings/js/SerializedScriptValue.cpp:
3691         (WebCore::CloneSerializer::dumpIfTerminal):
3692         (WebCore::CloneDeserializer::readTerminal):
3693         * crypto/CryptoKey.h:
3694         (WebCore::CryptoKey::allows const):
3695         (WebCore::CryptoKey::isWrappingRequired const): Deleted.
3696         (WebCore::CryptoKey::setIsWrappingRequired): Deleted.
3697         (): Deleted.
3698         * dom/ScriptExecutionContext.h:
3699
3700 2019-10-08  Devin Rousso  <drousso@apple.com>
3701
3702         Web Inspector: Canvas: modifications to shader modules can be shared between vertex/fragment shaders
3703         https://bugs.webkit.org/show_bug.cgi?id=202031
3704
3705         Reviewed by Dean Jackson.
3706
3707         Test: inspector/canvas/updateShader-webgpu-sharedVertexFragment.html
3708
3709         * Modules/webgpu/WebGPUPipeline.h:
3710         * Modules/webgpu/WebGPUComputePipeline.cpp:
3711         (WebCore::WebGPUComputePipeline::cloneShaderModules): Added.
3712         (WebCore::WebGPUComputePipeline::recompile):
3713         * Modules/webgpu/WebGPURenderPipeline.cpp:
3714         (WebCore::WebGPURenderPipeline::cloneShaderModules): Added.
3715         (WebCore::WebGPURenderPipeline::recompile):
3716         Recreate the vertex/fragment/compute shader module(s) when recompiling so that modifications
3717         to it via this pipeline don't affect other pipelines that also use the same shader module.
3718
3719         * inspector/InspectorShaderProgram.h:
3720         * inspector/InspectorShaderProgram.cpp:
3721         (WebCore::InspectorShaderProgram::updateShader):
3722         (WebCore::InspectorShaderProgram::buildObjectForShaderProgram): Added.
3723         * inspector/agents/InspectorCanvasAgent.cpp:
3724         (WebCore::InspectorCanvasAgent::didCreateWebGLProgram):
3725         (WebCore::InspectorCanvasAgent::didCreateWebGPUPipeline):
3726         Include as part of the `Canvas.event.programCreated` payload a flag indicating whether the
3727         vertex shader module and fragment shader module are the same for `WebGPURenderPipeline`s.
3728
3729 2019-10-08  Timothy Hatcher  <timothy@apple.com>
3730
3731         Copying white text from dark mode WebKit apps and pasting in a light mode app results in white (invisible) text.
3732         https://bugs.webkit.org/show_bug.cgi?id=202662
3733         rdar://problem/48677354
3734
3735         Reviewed by Megan Gardner.
3736
3737         Covered by new API tests.
3738
3739         HTMLConverter needs to strip white text colors when the document is in dark mode, like it does for black in light mode.
3740
3741         * editing/cocoa/HTMLConverter.mm:
3742         (normalizedColor): Handle dark mode and ignore white.
3743         (HTMLConverterCaches::colorPropertyValueForNode): Pass element to normalizedColor.
3744
3745 2019-10-08  Antti Koivisto  <antti@apple.com>
3746
3747         [CSS Shadow Parts] Fix style invalidation with class selector and ::before and ::after
3748         https://bugs.webkit.org/show_bug.cgi?id=202694
3749
3750         Reviewed by Ryosuke Niwa.
3751
3752         Test: fast/css/shadow-parts/invalidation-class-before-after.html
3753
3754         * style/StyleInvalidator.cpp:
3755         (WebCore::Style::Invalidator::invalidateIfNeeded):
3756         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
3757
3758         Invalidate in the shadow tree if the computed match element is host.
3759
3760         (WebCore::Style::Invalidator::invalidateInShadowTreeIfNeeded):
3761
3762         Factor into a function.
3763
3764         * style/StyleInvalidator.h:
3765
3766 2019-10-08  Adrian Perez de Castro  <aperez@igalia.com>
3767
3768         [GTK][WPE] Fix non-unified builds after r250486
3769         https://bugs.webkit.org/show_bug.cgi?id=202636
3770
3771         Reviewed by Youenn Fablet.
3772
3773         No new tests needed.
3774
3775         * Modules/fetch/FetchLoader.h: Add missing forward declaration of WebCore::SharedBuffer.
3776         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: Add missing inclusion of header
3777         wtf/text/StringConcatenateNumbers.h
3778         * Modules/indexeddb/shared/IDBIterateCursorData.cpp: Ditto.
3779         * animation/DocumentTimeline.cpp: Add missing inclusion of the EventNames.h and
3780         JavaScriptCore/VM.h headers.
3781         * bindings/js/JSDOMWindowCustom.cpp: Add missing inclusion of the JSDOMConvertCallbacks.h
3782         header.
3783         * bindings/js/JSIDBRequestCustom.cpp: Add missing inclusion of the JSDOMConvertIndexedDB.h
3784         and JSDOMConvertSequences.h headers.
3785         * bindings/js/JSRemoteDOMWindowCustom.cpp: Add missing inclusion of the
3786         JSDOMExceptionHandling.h header.
3787         * bindings/js/ScriptController.cpp: Add missing inclusion of the
3788         JavaScriptCore/WeakGCMapInlines.h header to avoid missing symbols during linking.
3789         * bindings/js/ScriptModuleLoader.h: Add missing inclusion of the wtf/HashSet.h header
3790         and add a forward declaration for the JSC::JSModuleRecord type.
3791         * bindings/js/WindowProxy.cpp: Add missing inclusion of the JavaScriptCore/StrongInlines.h
3792         header to avoid missing symbols during linking.
3793         * css/FontFaceSet.cpp: Add missing inclusion of the DOMPromiseProxy.h header.
3794         * css/FontFaceSet.h: Add missing inclusion of the IDLTypes.h header.
3795         * dom/IdleDeadline.h: Add missing inclusion of the wtf/Ref.h header.
3796         * history/CachedPage.h: Add missing inclusion of the wtf/MonotonicTime.h header.
3797         * html/canvas/WebGLBuffer.h: Add missing inclusion of the wtf/RefPtr.h header.
3798         * html/canvas/WebGLFramebuffer.h: Add missing inclusion of the wtf/HashMap.h and
3799         wtf/Vector.h headers.
3800         * html/canvas/WebGLProgram.h: Add missing inclusion of the wtf/HashFunctions.h, wtf/Lock.h,
3801         and wtf/Vector.h headers; add the missing namespace to an usage of WTF::LockHolder.
3802         * html/canvas/WebGLShader.h: Add missing inclusion of the wtf/text/WTFString.h header.
3803         * inspector/InspectorController.cpp: Add missing inclusion of the SharedBuffer.h header.
3804         * inspector/agents/InspectorCanvasAgent.cpp: Add missing inclusion of the ImageBitmap.h
3805         header.
3806         * page/DOMWindowExtension.cpp: Add missing inclusion of the Document.h header.
3807         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Add missing inclusion of the
3808         ScrollingTreeFrameScrollingNode.h header.
3809         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Add missing inclusion
3810         of the Logging.h header.
3811         * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: Add missing
3812         inclusion of the ScrollingTree.h header.
3813         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Add missing inclusion of the
3814         ScrollingTreeOverflowScrollProxyNode.h header.
3815         * platform/SuspendableTaskQueue.cpp: Add missing inclusion of the ScriptExecutionContext.h
3816         header.
3817         * workers/Worker.cpp: Add missing inclusion of the JavaScriptCore/ScriptCallStack.h header.
3818
3819 2019-10-08  youenn fablet  <youenn@apple.com>
3820
3821         MediaStreamTrack should be a PlatformMediaSessionClient instead of MediaStream
3822         https://bugs.webkit.org/show_bug.cgi?id=202631
3823
3824         Reviewed by Eric Carlson.
3825
3826         Make MediaStreamTrack a PlatformMediaSessionClient, which allows tracking tracks that are not owned by a stream.
3827         MediaStream is no longer a PlatformMediaSessionClient so we move some of MediaStream API implementation to MediaStreamTrack.
3828
3829         Covered by updated test.
3830
3831         * Modules/mediastream/MediaStream.cpp:
3832         (WebCore::MediaStream::MediaStream):
3833         (WebCore::MediaStream::startProducingData):
3834         (WebCore::MediaStream::stopProducingData):
3835         (WebCore::MediaStream::statusDidChange):
3836         (WebCore::MediaStream::mediaType const): Deleted.
3837         (WebCore::MediaStream::presentationType const): Deleted.
3838         (WebCore::MediaStream::characteristics const): Deleted.
3839         (WebCore::MediaStream::mayResumePlayback): Deleted.
3840         (WebCore::MediaStream::suspendPlayback): Deleted.
3841         (WebCore::MediaStream::sourceApplicationIdentifier const): Deleted.
3842         (WebCore::MediaStream::canProduceAudio const): Deleted.
3843         (WebCore::MediaStream::processingUserGestureForMedia const): Deleted.
3844         * Modules/mediastream/MediaStream.h:
3845         * Modules/mediastream/MediaStreamTrack.cpp:
3846         (WebCore::MediaStreamTrack::MediaStreamTrack):
3847         (WebCore::MediaStreamTrack::configureTrackRendering):
3848         (WebCore::MediaStreamTrack::mediaType const):
3849         (WebCore::MediaStreamTrack::presentationType const):
3850         (WebCore::MediaStreamTrack::characteristics const):
3851         (WebCore::MediaStreamTrack::mayResumePlayback):
3852         (WebCore::MediaStreamTrack::suspendPlayback):
3853         (WebCore::MediaStreamTrack::sourceApplicationIdentifier const):
3854         (WebCore::MediaStreamTrack::canProduceAudio const):
3855         (WebCore::MediaStreamTrack::processingUserGestureForMedia const):
3856         * Modules/mediastream/MediaStreamTrack.h:
3857         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3858         (WebCore::MediaPlayerPrivateGStreamer::load):
3859         * platform/mediastream/MediaStreamPrivate.cpp:
3860         (WebCore::MediaStreamPrivate::hasVideo const):
3861         (WebCore::MediaStreamPrivate::hasAudio const):
3862         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
3863         (WebCore::MediaStreamPrivate::hasCaptureAudioSource const): Deleted.
3864         * platform/mediastream/MediaStreamPrivate.h:
3865         * platform/mediastream/MediaStreamTrackPrivate.h:
3866
3867 2019-10-08  Brady Eidson  <beidson@apple.com>
3868
3869         Service Worker Fetch events should time out.
3870         https://bugs.webkit.org/show_bug.cgi?id=202188
3871
3872         Reviewed by Alex Christensen.
3873
3874         Test: http/tests/workers/service/basic-timeout.https.html
3875
3876         * workers/service/server/SWServer.h:
3877         * workers/service/server/SWServerWorker.h:
3878         (WebCore::SWServerWorker::setHasTimedOutAnyFetchTasks):
3879         (WebCore::SWServerWorker::hasTimedOutAnyFetchTasks const):
3880
3881 2019-10-08  Alexey Shvayka  <shvaikalesh@gmail.com>
3882
3883         Accept two values in the overflow shorthand
3884         https://bugs.webkit.org/show_bug.cgi?id=184691
3885
3886         Reviewed by Simon Fraser.
3887
3888         In https://github.com/w3c/csswg-drafts/issues/2484 it was resolved to accept one or two values in
3889         the overflow shorthand, instead of only one. If two values are specified, the first would be used
3890         for overflow-x and the second for overflow-y. This change was shipped in Firefox 61 and Chrome 68.
3891         This patch implements new syntax while preserving handling of -webkit-paged-x and -webkit-paged-y.
3892
3893         Tests: fast/css/cssText-shorthand.html
3894                fast/css/getComputedStyle/getComputedStyle-overflow.html
3895                imported/w3c/web-platform-tests/css/css-overflow/overflow-shorthand-001.html
3896                imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-computed.html
3897                imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-valid.html
3898                imported/w3c/web-platform-tests/css/cssom/shorthand-values.html
3899
3900         * css/CSSComputedStyleDeclaration.cpp:
3901         (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
3902         * css/CSSProperties.json:
3903         * css/StyleProperties.cpp:
3904         (WebCore::StyleProperties::getPropertyValue const):
3905         * css/parser/CSSPropertyParser.cpp:
3906         (WebCore::CSSPropertyParser::consumeOverflowShorthand):
3907         (WebCore::CSSPropertyParser::parseShorthand):
3908         * css/parser/CSSPropertyParser.h:
3909
3910 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
3911
3912         Unreviewed, fix WebCore's features.json after r250824
3913
3914         * features.json: Remove an erroneous "specification" key.
3915
3916 2019-10-08  Chris Dumez  <cdumez@apple.com>
3917
3918         Make sure ActiveDOMObject properly deals with detached documents
3919         https://bugs.webkit.org/show_bug.cgi?id=202596
3920
3921         Reviewed by Geoffrey Garen.
3922
3923         For detached document, the script execution context is their context document.
3924         The ActiveDOMObject constructor taking a Document& would make sure to get the
3925         document's contextDocument. However, if the ActiveDOMObject constructor taking
3926         a ScriptExecutionContext* is called, it would assume this is the right script
3927         execution context, which is unsafe. In this patch, all ActiveDOMObject
3928         constructors now check for detached documents and make sure to use their
3929         context document when necessary.
3930
3931         * dom/ActiveDOMObject.cpp:
3932         (WebCore::suitableScriptExecutionContext):
3933         (WebCore::ActiveDOMObject::ActiveDOMObject):
3934         * dom/ActiveDOMObject.h:
3935         * dom/Document.h:
3936
3937 2019-10-09  Simon Fraser  <simon.fraser@apple.com>
3938
3939         Clean up WheelEventTestTriggers logging
3940         https://bugs.webkit.org/show_bug.cgi?id=202764
3941
3942         Reviewed by Tim Horton.
3943
3944         Make DeferTestTriggerReason a bit set, and use OptionSet<> rather than StdSet. Make
3945         DeferTestTriggerReason and ScrollableAreaReasonMap loggable, and simplify the logging.
3946
3947         * page/WheelEventTestTrigger.cpp:
3948         (WebCore::WheelEventTestTrigger::clearAllTestDeferrals):
3949         (WebCore::WheelEventTestTrigger::deferTestsForReason):
3950         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason):
3951         (WebCore::WheelEventTestTrigger::triggerTestTimerFired):
3952         (WebCore::operator<<):
3953         (WebCore::dumpState): Deleted.
3954         * page/WheelEventTestTrigger.h:
3955         * page/scrolling/AsyncScrollingCoordinator.cpp:
3956         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3957         (WebCore::AsyncScrollingCoordinator::deferTestsForReason const):
3958         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason const):
3959         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3960         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
3961         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
3962
3963 2019-10-08  Ross Kirsling  <ross.kirsling@sony.com>
3964
3965         Unreviewed. Restabilize non-unified build.
3966
3967         * Modules/fetch/FetchLoader.h:
3968         * animation/DocumentTimeline.cpp:
3969         * bindings/js/JSDOMWindowCustom.cpp:
3970         * bindings/js/JSIDBRequestCustom.cpp:
3971         * bindings/js/JSRemoteDOMWindowCustom.cpp:
3972         * bindings/js/ScriptModuleLoader.h:
3973         * bindings/js/WindowProxy.cpp:
3974         * css/FontFaceSet.cpp:
3975         * css/FontFaceSet.h:
3976         * css/typedom/StylePropertyMapReadOnly.cpp:
3977         * history/CachedPage.h:
3978         * html/canvas/WebGLBuffer.cpp:
3979         * html/canvas/WebGLBuffer.h:
3980         * html/canvas/WebGLFramebuffer.h:
3981         * html/canvas/WebGLProgram.cpp:
3982         * html/canvas/WebGLProgram.h:
3983         * html/canvas/WebGLShader.h:
3984         * inspector/InspectorController.cpp:
3985         * inspector/agents/InspectorCanvasAgent.cpp:
3986         * workers/Worker.cpp:
3987         * workers/service/ServiceWorkerContainer.cpp:
3988         * workers/service/ServiceWorkerGlobalScope.cpp:
3989
3990 2019-10-08  Zalan Bujtas  <zalan@apple.com>
3991
3992         [LFC][Painting] Add very basic block and inline painting
3993         https://bugs.webkit.org/show_bug.cgi?id=202697
3994         <rdar://problem/56076562>
3995
3996         Reviewed by Antti Koivisto.
3997
3998         This is a very basic border/background painting with simple text. No phases/z-index/layers of any kind.
3999
4000         * layout/displaytree/DisplayBox.h: This seems to be getting out of hand.
4001         (WebCore::Display::Box::moveBy):
4002         * layout/displaytree/DisplayPainter.cpp:
4003         (WebCore::Display::paintBlockLevelBoxDecoration):
4004         (WebCore::Display::paintInlineContent):
4005         (WebCore::Display::Painter::paint):
4006         * layout/floats/FloatingContext.h:
4007         * layout/inlineformatting/InlineFormattingState.h:
4008         (WebCore::Layout::InlineFormattingState::inlineRuns const):
4009         (WebCore::Layout::InlineFormattingState::lineBoxes const):
4010
4011 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
4012
4013         Unreviewed, try to fix the WinCairo build after r250824
4014
4015         * dom/IdleDeadline.h:
4016
4017         Add a missing include for <wtf/Ref.h>, such that the adoptRef function is defined.
4018
4019 2019-10-08  Wenson Hsieh  <wenson_hsieh@apple.com>
4020
4021         Unreviewed, try to fix the open source macOS build after r250824
4022
4023         * bindings/js/JSDOMConvertRecord.h:
4024
4025         Add a missing #include for JSDOMGlobalObject. This file utilizes methods on JSDOMGlobalObject, but only&n