Remove IDBBackingStoreTemporaryFileHandler
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-10-21  Sihui Liu  <sihui_liu@apple.com>
2
3         Remove IDBBackingStoreTemporaryFileHandler
4         https://bugs.webkit.org/show_bug.cgi?id=203128
5
6         Reviewed by Alex Christensen.
7
8         IDBBackingStoreTemporaryFileHandler has only one member function, and implementation of that is to delete
9         files. To keep the same behavior, we can remove this class and delete the temporary files at the places where 
10         objects of this class were used.
11
12         By doing this, we no longer need to pass the NetworkProcess/InProcessIDBServer all the way down to 
13         SQLiteIDBBackingStore that is used only on background thread.
14
15         * Modules/indexeddb/server/IDBBackingStore.h:
16         * Modules/indexeddb/server/IDBServer.cpp:
17         (WebCore::IDBServer::IDBServer::create):
18         (WebCore::IDBServer::IDBServer::IDBServer):
19         (WebCore::IDBServer::IDBServer::createBackingStore):
20         * Modules/indexeddb/server/IDBServer.h:
21         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
22         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
23         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
24         (WebCore::IDBServer::SQLiteIDBBackingStore::temporaryFileHandler const): Deleted.
25         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
26         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
27         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
28         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
29         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
30         (WebCore::InProcessIDBServer::InProcessIDBServer):
31         (WebCore::InProcessIDBServer::accessToTemporaryFileComplete): Deleted.
32         * Modules/indexeddb/shared/InProcessIDBServer.h:
33
34 2019-10-21  Jer Noble  <jer.noble@apple.com>
35
36         Add MediaCapabilities support for DolbyVision codecs.
37         https://bugs.webkit.org/show_bug.cgi?id=203170
38
39         Reviewed by Eric Carlson.
40
41         Test: media/dovi-codec-parameters.html
42
43         Add support for parsing DolbyVision (DoVi) style codec profile strings.
44
45         * platform/cocoa/VideoToolboxSoftLink.cpp:
46         * platform/cocoa/VideoToolboxSoftLink.h:
47         * platform/graphics/HEVCUtilities.cpp:
48         (WebCore::codecStringForDoViCodecType):
49         (WebCore::profileIDForAlphabeticDoViProfile):
50         (WebCore::isValidDoViProfileID):
51         (WebCore::maximumLevelIDForDoViProfileID):
52         (WebCore::isValidProfileIDForCodecName):
53         (WebCore::parseDoViCodecParameters):
54         * platform/graphics/HEVCUtilities.h:
55         * platform/graphics/cocoa/HEVCUtilitiesCocoa.h:
56         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
57         (WebCore::codecStringToCodecTypeMap):
58         (WebCore::CFStringArrayToNumberVector):
59         (WebCore::validateDoViParameters):
60         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
61         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
62         * testing/Internals.cpp:
63         (WebCore::Internals::parseDoViCodecParameters):
64         * testing/Internals.h:
65         * testing/Internals.idl:
66
67 2019-10-21  Dean Jackson  <dino@apple.com>
68
69         Dispatch AR event on the originating anchor element
70         https://bugs.webkit.org/show_bug.cgi?id=203198
71         <rdar://55743929>
72
73         Reviewed by Simon Fraser.
74
75         Expose an ElementContext on the SystemPreviewInfo, so that
76         when something happens in the AR QuickLook an event can be
77         fired on the originating <a> element.
78
79         * dom/Document.cpp:
80         (WebCore::Document::dispatchSystemPreviewActionEvent): Make sure
81         we dispatch only to the HTMLAnchorElement.
82         * dom/Document.h:
83         * html/HTMLAnchorElement.cpp:
84         (WebCore::HTMLAnchorElement::handleClick):
85         * loader/FrameLoaderTypes.h:
86         (WebCore::SystemPreviewInfo::encode const):
87         (WebCore::SystemPreviewInfo::decode):
88         * testing/Internals.cpp:
89         (WebCore::Internals::elementIdentifier const):
90         * testing/Internals.h:
91         * testing/Internals.idl:
92
93 2019-10-21  Dean Jackson  <dino@apple.com>
94
95         Move ElementContext from WebKit to WebCore
96         https://bugs.webkit.org/show_bug.cgi?id=203210
97         <rdar://problem/56475682>
98
99         Reviewed by Simon Fraser.
100
101         * WebCore.xcodeproj/project.pbxproj:
102         * dom/RadioButtonGroups.h:
103
104 2019-10-21  Alex Christensen  <achristensen@webkit.org>
105
106         ServiceWorker tests should use TCPServer instead of WKURLSchemeHandler
107         https://bugs.webkit.org/show_bug.cgi?id=203141
108
109         Reviewed by Youenn Fablet.
110
111         This makes the tests more like what users will see,
112         and it allows us to not consult custom schemes when loading service workers,
113         which is preventing us from moving logic to the NetworkProcess.  See bug 203055.
114         Also, I now remove test-only code that's not used anymore.
115
116         * workers/service/server/SWServer.cpp:
117         (WebCore::SWServer::SWServer):
118         (WebCore::SWServer::canHandleScheme const):
119         * workers/service/server/SWServer.h:
120
121 2019-10-21  Joseph Pecoraro  <pecoraro@apple.com>
122
123         Web Inspector: Provide a flag for technology preview builds
124         https://bugs.webkit.org/show_bug.cgi?id=203164
125         <rdar://problem/56202164>
126
127         Reviewed by Devin Rousso.
128
129         * inspector/InspectorFrontendHost.cpp:
130         (WebCore::InspectorFrontendHost::isExperimentalBuild):
131         * inspector/InspectorFrontendHost.h:
132         * inspector/InspectorFrontendHost.idl:
133
134 2019-10-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
135
136         [SVG2]: Add 'auto' behavior to the 'width' and 'height' properties of the SVG <image> element
137         https://bugs.webkit.org/show_bug.cgi?id=202013
138
139         Reviewed by Simon Fraser.
140
141         The spec page is: https://www.w3.org/TR/SVG/geometry.html#Sizing
142
143         Handle the case if the 'width' or the 'height' of an SVG <image> or both
144         are missing.
145
146         Tests: svg/custom/image-width-height-auto-dynamic.svg
147                svg/custom/image-width-height-auto-initial.svg
148                svg/custom/image-width-height-length-initial.svg
149
150         * rendering/svg/RenderSVGImage.cpp:
151         (WebCore::RenderSVGImage::calculateObjectBoundingBox const):
152         (WebCore::RenderSVGImage::updateImageViewport):
153         * rendering/svg/RenderSVGImage.h:
154
155 2019-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
156
157         [Clipboard API] Implement ClipboardItem.getType() for platform clipboard items
158         https://bugs.webkit.org/show_bug.cgi?id=203168
159
160         Reviewed by Tim Horton.
161
162         This patch completes support for ClipboardItem.getType().
163
164         Tests:  editing/async-clipboard/clipboard-change-data-while-getting-type.html
165                 editing/async-clipboard/clipboard-get-type-with-old-items.html
166                 editing/async-clipboard/clipboard-item-get-type-basic.html
167                 ClipboardTests.ReadMultipleItems
168
169         * Modules/async-clipboard/Clipboard.cpp:
170         (WebCore::Clipboard::getType):
171
172         Implement getType(). If the given clipboard item is being tracked as one of the active clipboard items, then
173         allow it to read data from the platform pasteboard. We use existing pasteboard reading methods and classes
174         (PasteboardPlainText and WebContentMarkupReader) to ask the platform pasteboard for text and markup data,
175         respectively, and go through readURL() for "text/uri-list".
176
177         Before exposing any data to the page, we additionally check that the change count of the pasteboard is still
178         what we started with when setting up the current session. If this is not the case, we reject the promise and
179         immediately clear out the session.
180
181         (WebCore::Clipboard::activePasteboard):
182         * Modules/async-clipboard/Clipboard.h:
183         * dom/DataTransfer.h:
184
185         Drive-by tweak: make the WebContentReadingPolicy enum class narrower.
186
187         * platform/Pasteboard.h:
188
189         Add an enum flag for allowing or ignoring the platform URL type when reading plain text from the platform
190         pasteboard. We use this in Clipboard::getType() to ignore URLs on the platform pasteboard when plain text, since
191         the plain text reader would otherwise prefer URLs over plain text by default, and read the URL type instead of
192         the plain text type.
193
194         * platform/StaticPasteboard.h:
195         * platform/gtk/PasteboardGtk.cpp:
196         (WebCore::Pasteboard::read):
197         * platform/ios/PasteboardIOS.mm:
198         (WebCore::Pasteboard::read):
199         * platform/libwpe/PasteboardLibWPE.cpp:
200         (WebCore::Pasteboard::read):
201         * platform/mac/PasteboardMac.mm:
202         (WebCore::Pasteboard::read):
203         * platform/win/PasteboardWin.cpp:
204         (WebCore::Pasteboard::read):
205
206 2019-10-21  Simon Fraser  <simon.fraser@apple.com>
207
208         Setting border-radius on <video> element clips top and left sections of video
209         https://bugs.webkit.org/show_bug.cgi?id=202049
210         <rdar://problem/55570024>
211
212         Reviewed by Dean Jackson.
213
214         updateClippingStrategy() is called both when we're setting a mask layer on m_layer,
215         and on m_contentsClippingLayer, and they disagreed on the coordinate space that
216         the rounded rect was in. r246845 fixed rounded-rect scrollers, but broke video.
217
218         Fix by declaring that the rounded rect is relative to the bounds of the layer
219         argument. We don't try to size the shape layer to the rounded rect, because in some
220         configurations (e.g. scroller with left scrollbar) the rounded rect hangs outside
221         the clipping layer.
222
223         Test: compositing/video/video-border-radius-clipping.html
224
225         * platform/graphics/FloatRoundedRect.h:
226         (WebCore::FloatRoundedRect::setLocation):
227         * platform/graphics/ca/GraphicsLayerCA.cpp:
228         (WebCore::GraphicsLayerCA::updateClippingStrategy):
229         (WebCore::GraphicsLayerCA::updateContentsRects): The rounded rect is relative to the contentsClippingLayer,
230         so set its location to zero.
231         * rendering/RenderLayerBacking.cpp:
232         (WebCore::RenderLayerBacking::updateChildClippingStrategy): negate the offset, as we do in updateGeometry which
233         has similar code.
234
235 2019-10-21  Simon Fraser  <simon.fraser@apple.com>
236
237         [iOS WK2] Support hiding iframe scrollbars via ::-webkit-scrollbar style
238         https://bugs.webkit.org/show_bug.cgi?id=203178
239
240         Reviewed by Dean Jackson.
241         
242         ::-webkit-scrollbar {
243             display: none;
244         }
245         is supported for overflow:scroll, but not for iframes. To make the latter work,
246         two fixes were necessary.
247         
248         First, FrameView had to implement horizontalScrollbarHiddenByStyle()/verticalScrollbarHiddenByStyle().
249         This is a little tricky on iOS because we never create RenderScrollbars, so we have to consult
250         pseudo-styles directly; a bit of refactoring makes that cleaner.
251         
252         Second, ScrollableAreaParameters was failing to check horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle
253         in operator==, meaning that these data often didn't make it to the UI process.
254
255         Test: fast/scrolling/ios/scrollbar-hiding-iframes.html
256
257         * page/FrameView.cpp:
258         (WebCore::FrameView::rootElementForCustomScrollbarPartStyle const):
259         (WebCore::FrameView::createScrollbar):
260         (WebCore::FrameView::styleHidesScrollbarWithOrientation const):
261         (WebCore::FrameView::horizontalScrollbarHiddenByStyle const):
262         (WebCore::FrameView::verticalScrollbarHiddenByStyle const):
263         (WebCore::FrameView::updateScrollCorner):
264         * page/FrameView.h:
265         * page/scrolling/ScrollingCoordinatorTypes.h:
266         (WebCore::ScrollableAreaParameters::operator== const):
267         * platform/Scrollbar.h:
268         (WebCore::Scrollbar::isHiddenByStyle const):
269         * rendering/RenderLayer.cpp:
270         (WebCore::scrollbarHiddenByStyle):
271         * rendering/RenderScrollbar.cpp:
272         (WebCore::RenderScrollbar::getScrollbarPseudoStyle const):
273         (WebCore::RenderScrollbar::isHiddenByStyle const):
274         (WebCore::RenderScrollbar::getScrollbarPseudoStyle): Deleted.
275         * rendering/RenderScrollbar.h:
276
277 2019-10-21  youenn fablet  <youenn@apple.com>
278
279         Share code between AudioDestinationIOS and AudioDestinationMac
280         https://bugs.webkit.org/show_bug.cgi?id=203047
281         <rdar://problem/56340866>
282
283         Reviewed by Eric Carlson.
284
285         Introduce AudioDestinationCocoa to share code between iOS and Mac.
286         Most code is now shared, except for the configuration of the audio unit which is slightly different between Mac and iOS.
287
288         Introduce MockAudioDestinationCocoa to allow more code coverage of the shared code.
289         This could also allow us to validate dynamic changes in frame rate, number of frames to process...
290         Add Internals API to enable the mock destination.
291  
292         Covered by added test.
293
294         * SourcesCocoa.txt:
295         * WebCore.xcodeproj/project.pbxproj:
296         * platform/audio/cocoa/AudioDestinationCocoa.cpp: Added.
297         (WebCore::AudioDestination::create):
298         (WebCore::AudioDestination::hardwareSampleRate):
299         (WebCore::AudioDestination::maxChannelCount):
300         (WebCore::AudioDestinationCocoa::AudioDestinationCocoa):
301         (WebCore::AudioDestinationCocoa::~AudioDestinationCocoa):
302         (WebCore::AudioDestinationCocoa::start):
303         (WebCore::AudioDestinationCocoa::stop):
304         (WebCore::AudioDestinationCocoa::setIsPlaying):
305         (WebCore::AudioDestinationCocoa::setAudioStreamBasicDescription):
306         (WebCore::assignAudioBuffersToBus):
307         (WebCore::AudioDestinationCocoa::render):
308         (WebCore::AudioDestinationCocoa::inputProc):
309         * platform/audio/cocoa/AudioDestinationCocoa.h: Added.
310         (WebCore::AudioDestinationCocoa::outputUnit):
311         * platform/audio/ios/AudioDestinationIOS.cpp:
312         (WebCore::AudioDestinationCocoa::configure):
313         (WebCore::AudioDestinationCocoa::processBusAfterRender):
314         * platform/audio/ios/AudioDestinationIOS.h: Removed.
315         * platform/audio/mac/AudioDestinationMac.cpp:
316         (WebCore::AudioDestinationCocoa::configure):
317         (WebCore::AudioDestinationCocoa::processBusAfterRender):
318         * platform/audio/mac/AudioDestinationMac.h: Removed.
319         * platform/mock/MockAudioDestinationCocoa.cpp: Added.
320         (WebCore::MockAudioDestinationCocoa::MockAudioDestinationCocoa):
321         (WebCore::MockAudioDestinationCocoa::start):
322         (WebCore::MockAudioDestinationCocoa::stop):
323         (WebCore::MockAudioDestinationCocoa::tick):
324         * platform/mock/MockAudioDestinationCocoa.h: Added.
325         * testing/Internals.cpp:
326         (WebCore::Internals::Internals):
327         (WebCore::Internals::useMockAudioDestinationCocoa):
328         * testing/Internals.h:
329         * testing/Internals.idl:
330
331 2019-10-21  Chris Dumez  <cdumez@apple.com>
332
333         XMLHttpRequest should not prevent entering the back/forward cache
334         https://bugs.webkit.org/show_bug.cgi?id=203107
335         <rdar://problem/56438647>
336
337         Reviewed by Youenn Fablet.
338
339         Improve XMLHttpRequest for back/forward cache suspension:
340         1. We no longer cancel pending loads in the suspend() method as this may
341            fire events.
342         2. Simplify XMLHttpRequestProgressEventThrottle to use SuspendableTimers
343            to dispatch events that are deferred by suspension or throttling.
344
345         Test: http/tests/navigation/page-cache-xhr-in-loading-iframe.html
346
347         * xml/XMLHttpRequest.cpp:
348         (WebCore::XMLHttpRequest::XMLHttpRequest):
349         (WebCore::XMLHttpRequest::open):
350         Add check to throw a InvalidStateError if the associated document is not fully active,
351         as per https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open (Step 2). This avoids
352         dispatching events after ActiveDOMObject::stop() has been called and brings a few more
353         passes on WPT tests.
354
355         (WebCore::XMLHttpRequest::dispatchEvent):
356         (WebCore::XMLHttpRequest::suspend):
357         (WebCore::XMLHttpRequest::resume):
358         (WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const): Deleted.
359         (WebCore::XMLHttpRequest::resumeTimerFired): Deleted.
360         * xml/XMLHttpRequest.h:
361         * xml/XMLHttpRequestProgressEventThrottle.cpp:
362         (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
363         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
364         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
365         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEventWhenPossible):
366         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent):
367         (WebCore::XMLHttpRequestProgressEventThrottle::flushProgressEvent):
368         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEventsAfterResuming):
369         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEventTimerFired):
370         (WebCore::XMLHttpRequestProgressEventThrottle::suspend):
371         (WebCore::XMLHttpRequestProgressEventThrottle::resume):
372         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent): Deleted.
373         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents): Deleted.
374         (WebCore::XMLHttpRequestProgressEventThrottle::fired): Deleted.
375         (WebCore::XMLHttpRequestProgressEventThrottle::hasEventToDispatch const): Deleted.
376         * xml/XMLHttpRequestProgressEventThrottle.h:
377
378 2019-10-21  Alicia Boya García  <aboya@igalia.com>
379
380         [MSE][GStreamer] Revert WebKitMediaSrc rework temporarily
381         https://bugs.webkit.org/show_bug.cgi?id=203078
382
383         Reviewed by Carlos Garcia Campos.
384
385         While the WebKitMediaSrc rework fixed a number of tests and introduced
386         design improvements in MSE, it also exposed a number of bugs related
387         to the playbin3 switch.
388
389         Fixing these has been turned tricky, so in order to not keep known
390         user-facing bugs, I'm reverting it for now until a workable solution
391         is available.
392
393         * platform/GStreamer.cmake:
394         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
395         (WTF::refGPtr<GstMiniObject>): Deleted.
396         (WTF::derefGPtr<GstMiniObject>): Deleted.
397         * platform/graphics/gstreamer/GRefPtrGStreamer.h:
398         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
399         (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
400         (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
401         (WebCore::MediaPlayerPrivateGStreamer::paused const):
402         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
403         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
404         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
405         (WebCore::MediaPlayerPrivateGStreamer::videoSinkCapsChangedCallback):
406         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideoCaps):
407         (WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
408         (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage):
409         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
410         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
411         (WebCore::MediaPlayerPrivateGStreamer::configurePlaySink):
412         (WebCore::MediaPlayerPrivateGStreamer::invalidateCachedPosition): Deleted.
413         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
414         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
415         (WebCore::MediaPlayerPrivateGStreamerBase::sizeChanged):
416         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
417         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSizeFromCaps const): Deleted.
418         (WebCore::MediaPlayerPrivateGStreamerBase::doSamplesHaveDifferentNaturalSizes const): Deleted.
419         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
420         * platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
421         (WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
422         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
423         (WebCore::AppendPipeline::appsinkNewSample):
424         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
425         * platform/graphics/gstreamer/mse/AppendPipeline.h:
426         (WebCore::AppendPipeline::appsinkCaps):
427         (WebCore::AppendPipeline::track):
428         (WebCore::AppendPipeline::streamType):
429         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
430         (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
431         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
432         (WebCore::MediaPlayerPrivateGStreamerMSE::pause):
433         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
434         (WebCore::MediaPlayerPrivateGStreamerMSE::configurePlaySink):
435         (WebCore::MediaPlayerPrivateGStreamerMSE::changePipelineState):
436         (WebCore::MediaPlayerPrivateGStreamerMSE::notifySeekNeedsDataForTime):
437         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
438         (WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
439         (WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate):
440         (WebCore::MediaPlayerPrivateGStreamerMSE::seeking const):
441         (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
442         (WebCore::MediaPlayerPrivateGStreamerMSE::waitForSeekCompleted):
443         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
444         (WebCore::MediaPlayerPrivateGStreamerMSE::sourceSetup):
445         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
446         (WebCore::MediaPlayerPrivateGStreamerMSE::asyncStateChangeDone):
447         (WebCore::MediaPlayerPrivateGStreamerMSE::mediaSourceClient):
448         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
449         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
450         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
451         (WebCore::MediaPlayerPrivateGStreamerMSE::markEndOfStream):
452         (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
453         (WebCore::MediaPlayerPrivateGStreamerMSE::play): Deleted.
454         (WebCore::MediaPlayerPrivateGStreamerMSE::reportSeekCompleted): Deleted.
455         (WebCore::MediaPlayerPrivateGStreamerMSE::didEnd): Deleted.
456         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
457         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
458         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
459         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
460         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
461         (WebCore::MediaSourceClientGStreamerMSE::flush):
462         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
463         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
464         (WebCore::MediaSourceClientGStreamerMSE::isReadyForMoreSamples): Deleted.
465         (WebCore::MediaSourceClientGStreamerMSE::notifyClientWhenReadyForMoreSamples): Deleted.
466         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
467         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
468         (WebCore::MediaSourceGStreamer::markEndOfStream):
469         (WebCore::MediaSourceGStreamer::unmarkEndOfStream):
470         (WebCore::MediaSourceGStreamer::waitForSeekCompleted):
471         (WebCore::MediaSourceGStreamer::seekCompleted):
472         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h:
473         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added.
474         (getStreamByTrackId):
475         (getStreamBySourceBufferPrivate):
476         (pushSample):
477         (WebCore::PlaybackPipeline::setWebKitMediaSrc):
478         (WebCore::PlaybackPipeline::webKitMediaSrc):
479         (WebCore::PlaybackPipeline::addSourceBuffer):
480         (WebCore::PlaybackPipeline::removeSourceBuffer):
481         (WebCore::PlaybackPipeline::attachTrack):
482         (WebCore::PlaybackPipeline::reattachTrack):
483         (WebCore::PlaybackPipeline::notifyDurationChanged):
484         (WebCore::PlaybackPipeline::markEndOfStream):
485         (WebCore::PlaybackPipeline::flush):
486         (WebCore::PlaybackPipeline::enqueueSample):
487         (WebCore::PlaybackPipeline::allSamplesInTrackEnqueued):
488         (WebCore::PlaybackPipeline::pipeline):
489         * platform/graphics/gstreamer/mse/PlaybackPipeline.h: Copied from Source/WebCore/platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h.
490         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
491         (WebCore::SourceBufferPrivateGStreamer::enqueueSample):
492         (WebCore::SourceBufferPrivateGStreamer::isReadyForMoreSamples):
493         (WebCore::SourceBufferPrivateGStreamer::setReadyForMoreSamples):
494         (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
495         (WebCore::SourceBufferPrivateGStreamer::notifyClientWhenReadyForMoreSamples):
496         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
497         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
498         (disabledAppsrcNeedData):
499         (disabledAppsrcEnoughData):
500         (disabledAppsrcSeekData):
501         (enabledAppsrcEnoughData):
502         (enabledAppsrcSeekData):
503         (getStreamByAppsrc):
504         (webkitMediaSrcChain):
505         (webkit_media_src_init):
506         (webKitMediaSrcFinalize):
507         (webKitMediaSrcSetProperty):
508         (webKitMediaSrcGetProperty):
509         (webKitMediaSrcDoAsyncStart):
510         (webKitMediaSrcDoAsyncDone):
511         (webKitMediaSrcChangeState):
512         (webKitMediaSrcGetSize):
513         (webKitMediaSrcQueryWithParent):
514         (webKitMediaSrcUpdatePresentationSize):
515         (webKitMediaSrcLinkStreamToSrcPad):
516         (webKitMediaSrcLinkSourcePad):
517         (webKitMediaSrcFreeStream):
518         (webKitMediaSrcCheckAllTracksConfigured):
519         (webKitMediaSrcUriGetType):
520         (webKitMediaSrcGetProtocols):
521         (webKitMediaSrcGetUri):
522         (webKitMediaSrcSetUri):
523         (webKitMediaSrcUriHandlerInit):
524         (seekNeedsDataMainThread):
525         (notifyReadyForMoreSamplesMainThread):
526         (webKitMediaSrcSetMediaPlayerPrivate):
527         (webKitMediaSrcSetReadyForSamples):
528         (webKitMediaSrcPrepareSeek):
529         (WebKitMediaSrcPrivate::streamByName): Deleted.
530         (): Deleted.
531         (WTF::refGPtr<WebKitMediaSrcPad>): Deleted.
532         (WTF::derefGPtr<WebKitMediaSrcPad>): Deleted.
533         (webkit_media_src_pad_class_init): Deleted.
534         (Stream::Stream): Deleted.
535         (Stream::StreamingMembers::StreamingMembers): Deleted.
536         (Stream::StreamingMembers::durationEnqueued const): Deleted.
537         (findPipeline): Deleted.
538         (webkit_media_src_class_init): Deleted.
539         (debugProbe): Deleted.
540         (copyCollectionAndAddStream): Deleted.
541         (copyCollectionWithoutStream): Deleted.
542         (gstStreamType): Deleted.
543         (webKitMediaSrcAddStream): Deleted.
544         (webKitMediaSrcRemoveStream): Deleted.
545         (webKitMediaSrcActivateMode): Deleted.
546         (webKitMediaSrcPadLinked): Deleted.
547         (webKitMediaSrcStreamNotifyLowWaterLevel): Deleted.
548         (webKitMediaSrcLoop): Deleted.
549         (webKitMediaSrcEnqueueObject): Deleted.
550         (webKitMediaSrcEnqueueSample): Deleted.
551         (webKitMediaSrcEnqueueEvent): Deleted.
552         (webKitMediaSrcEndOfStream): Deleted.
553         (webKitMediaSrcIsReadyForMoreSamples): Deleted.
554         (webKitMediaSrcNotifyWhenReadyForMoreSamples): Deleted.
555         (webKitMediaSrcStreamFlushStart): Deleted.
556         (webKitMediaSrcStreamFlushStop): Deleted.
557         (webKitMediaSrcFlush): Deleted.
558         (webKitMediaSrcSeek): Deleted.
559         (countStreamsOfType): Deleted.
560         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
561         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h: Added.
562
563 2019-10-21  Tim Horton  <timothy_horton@apple.com>
564
565         Clean up some includes to improve WebKit2 build speed
566         https://bugs.webkit.org/show_bug.cgi?id=203071
567
568         Reviewed by Wenson Hsieh.
569
570         No new tests, just shuffling code around.
571
572         * bindings/js/WindowProxy.cpp:
573         (WebCore::WindowProxy::WindowProxy):
574         (WebCore::WindowProxy::~WindowProxy):
575         (WebCore::WindowProxy::detachFromFrame):
576         (WebCore::WindowProxy::destroyJSWindowProxy):
577         (WebCore::WindowProxy::createJSWindowProxy):
578         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
579         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
580         (WebCore::WindowProxy::setDOMWindow):
581         (WebCore::WindowProxy::attachDebugger):
582         (WebCore::WindowProxy::jsWindowProxies const):
583         (WebCore::WindowProxy::releaseJSWindowProxies):
584         (WebCore::WindowProxy::setJSWindowProxies):
585         * bindings/js/WindowProxy.h:
586         (WebCore::WindowProxy::existingJSWindowProxy const):
587         (WebCore::WindowProxy::jsWindowProxies const): Deleted.
588         (WebCore::WindowProxy::releaseJSWindowProxies): Deleted.
589         (WebCore::WindowProxy::setJSWindowProxies): Deleted.
590         * platform/graphics/cocoa/IOSurface.h:
591         * platform/graphics/cocoa/IOSurface.mm:
592         (WebCore::IOSurface::~IOSurface):
593
594 2019-10-21  Joonghun Park  <jh718.park@samsung.com>
595
596         [GTK] Unreviewed. Fix build warning: unused parameter ‘Foo’ [-Wunused-parameter] since r251320.
597
598         * dom/Element.cpp:
599         (WebCore::shouldIgnoreMouseEvent):
600
601 2019-10-20  Chris Dumez  <cdumez@apple.com>
602
603         Unreviewed, drop debug logging that was inadvertently committed with r251327.
604
605         * history/BackForwardCache.cpp:
606
607 2019-10-20  Zalan Bujtas  <zalan@apple.com>
608
609         [LFC][IFC] Make InlineTextItem reusable when 'segment break' behavior changes
610         https://bugs.webkit.org/show_bug.cgi?id=203184
611         <rdar://problem/56438945>
612
613         Reviewed by Antti Koivisto.
614
615         InlineTextItem::isWhitespace should dynamically check for 'preserve new line' behavior. This way we don't have to rebuild the inline item list
616         when the related style property value changes.
617
618         * layout/inlineformatting/InlineTextItem.cpp:
619         (WebCore::Layout::isWhitespaceCharacter):
620         (WebCore::Layout::moveToNextNonWhitespacePosition):
621         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
622         (WebCore::Layout::InlineTextItem::createWhitespaceItem):
623         (WebCore::Layout::InlineTextItem::createNonWhitespaceItem):
624         (WebCore::Layout::InlineTextItem::createSegmentBreakItem):
625         (WebCore::Layout::InlineTextItem::createEmptyItem):
626         (WebCore::Layout::InlineTextItem::InlineTextItem):
627         (WebCore::Layout::InlineTextItem::split const):
628         (WebCore::Layout::InlineTextItem::isWhitespace const):
629         (WebCore::Layout::isSoftLineBreak): Deleted.
630         * layout/inlineformatting/InlineTextItem.h:
631         (WebCore::Layout::InlineTextItem::isSegmentBreak const):
632         (WebCore::Layout::InlineTextItem::isWhitespace const): Deleted.
633
634 2019-10-20  Zalan Bujtas  <zalan@apple.com>
635
636         [LFC][IFC] Move the collapsed bit from InlineItems to runs
637         https://bugs.webkit.org/show_bug.cgi?id=203183
638
639         Reviewed by Antti Koivisto.
640         <rdar://problem/56437181>
641
642         Let's not store the collapsed bit on the InlineTextItem. All we need to know is whether the InlineTextItem content is collapsible or not.
643         Also when only the white-space property changes (going from preserve whitespace to not and vice versa) we don't actually need to rebuild the
644         InlinItem list since they don't carry any layout dependent information.
645         This patch also fixes leading/trailing content preservation. 
646
647         * layout/inlineformatting/InlineLine.cpp:
648         (WebCore::Layout::Line::Run::canBeExtended const):
649         (WebCore::Layout::shouldPreserveTrailingContent):
650         (WebCore::Layout::shouldPreserveLeadingContent):
651         (WebCore::Layout::Line::appendTextContent):
652         * layout/inlineformatting/InlineLine.h:
653         (WebCore::Layout::Line::Run::isCollapsed const):
654         (WebCore::Layout::Line::Run::setIsCollapsed):
655         * layout/inlineformatting/InlineLineLayout.cpp:
656         (WebCore::Layout::inlineItemWidth):
657         * layout/inlineformatting/InlineTextItem.cpp:
658         (WebCore::Layout::InlineTextItem::createAndAppendTextItems):
659         (WebCore::Layout::InlineTextItem::InlineTextItem):
660         (WebCore::Layout::InlineTextItem::split const):
661         * layout/inlineformatting/InlineTextItem.h:
662         (WebCore::Layout::InlineTextItem::isCollapsible const):
663         (WebCore::Layout::InlineTextItem::isCollapsed const): Deleted.
664         * layout/inlineformatting/text/TextUtil.cpp:
665         (WebCore::Layout::TextUtil::isTrimmableContent): Deleted.
666         * layout/inlineformatting/text/TextUtil.h:
667
668 2019-10-19  Chris Dumez  <cdumez@apple.com>
669
670         FileReader should not prevent entering the back/forward cache
671         https://bugs.webkit.org/show_bug.cgi?id=203106
672
673         Reviewed by Geoffrey Garen.
674
675         FileReader should not prevent entering the back/forward cache. To support this,
676         its implementation now uses a SuspendableTaskQueue to dispatch events.
677
678         Test: fast/files/file-reader-back-forward-cache.html
679
680         * dom/ActiveDOMObject.cpp:
681         (WebCore::ActiveDOMObject::isAllowedToRunScript const):
682         * dom/ActiveDOMObject.h:
683         * dom/ScriptExecutionContext.cpp:
684         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
685         * fileapi/FileReader.cpp:
686         (WebCore::FileReader::FileReader):
687         (WebCore::FileReader::stop):
688         (WebCore::FileReader::hasPendingActivity const):
689         (WebCore::FileReader::readInternal):
690         (WebCore::FileReader::abort):
691         (WebCore::FileReader::didStartLoading):
692         (WebCore::FileReader::didReceiveData):
693         (WebCore::FileReader::didFinishLoading):
694         (WebCore::FileReader::didFail):
695         (WebCore::FileReader::fireEvent):
696         * fileapi/FileReader.h:
697
698 2019-10-19  Adrian Perez de Castro  <aperez@igalia.com>
699
700         [GTK][WPE] Fix non-unified builds after r250857
701         https://bugs.webkit.org/show_bug.cgi?id=203145
702
703         Reviewed by Carlos Garcia Campos.
704
705         No new tests needed.
706
707         * Modules/async-clipboard/ClipboardItem.cpp: Add missing inclusion of the Clipboard.h header.
708         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: Add missing inclusion of the
709         ClipboardItem.h header.
710         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp: Add missing inclusions of
711         the Clipboard.h, ClipboardItem.h, and JSDOMPromiseDeferred.h headers.
712         * dom/AbstractEventLoop.h: Add missing inclusion of the wtf/RefCounted.h header.
713         * dom/WindowEventLoop.h: Add missing inclusion of the DocumentIdentifier.h header.
714         * dom/IdleCallbackController.h: Add missing forward-declaration for the Document class.
715         * dom/RadioButtonGroups.h: Add needed inclusion of of the wtf/text/AtomStringHash.h header,
716         needed because AtomString is used as key for a HashMap; remove the (now unneeded) of the
717         wtf/Forward.h header.
718         * page/WheelEventTestMonitor.cpp: Add missing inclusion of the wtf/OptionSet.h header.
719         * rendering/style/ShadowData.cpp: Add missing inclusion of the wtf/text/TextStream.h header.
720
721 2019-10-19  Ryosuke Niwa  <rniwa@webkit.org>
722
723         Integrate media query evaluation into HTML5 event loop
724         https://bugs.webkit.org/show_bug.cgi?id=203134
725         <rdar://problem/56396316>
726
727         Reviewed by Antti Koivisto.
728
729         Moved the code to call media query listeners to HTML5 event loop's step to update the rendering:
730         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
731
732         Tests: fast/media/mq-inverted-colors-live-update-for-listener.html
733                fast/media/mq-prefers-reduced-motion-live-update-for-listener.html
734
735         * css/MediaQueryMatcher.cpp:
736         (WebCore::MediaQueryMatcher::evaluateAll): Renamed from styleResolverChanged.
737         * css/MediaQueryMatcher.h:
738         * dom/Document.cpp:
739         (WebCore::Document::updateElementsAffectedByMediaQueries): Split from evaluateMediaQueryList.
740         This function is still called right after each layout update so that picture element may start
741         requesting newly selected image resources without having to wait for a rendering update.
742         But this function will no longer execute arbitrary scripts.
743         (WebCore::Document::evaluateMediaQueriesAndReportChanges): Split from evaluateMediaQueryList.
744         Evaluates media query listeners.
745         * dom/Document.h:
746         * inspector/agents/InspectorPageAgent.cpp:
747         (WebCore::InspectorPageAgent::setEmulatedMedia): Force the evaluation of media queries for now
748         but this code should really be scheduling a rendering update instead so added a FIXME.
749         * page/Frame.cpp:
750         (WebCore::Frame::setPrinting): Evaluate media queries. We should consider invoking the full
751         algorithm to update the rendering here. e.g. intersection observer may add more contents.
752         * page/Page.cpp:
753         (WebCore::Page::updateRendering): Call evaluateMediaQueriesAndReportChanges.
754
755 2019-10-18  Tim Horton  <timothy_horton@apple.com>
756
757         macCatalyst: Cursor should send mouse events, not touch events
758         https://bugs.webkit.org/show_bug.cgi?id=203175
759         <rdar://problem/56321134>
760
761         Reviewed by Simon Fraser.
762
763         * dom/Element.cpp:
764         (WebCore::shouldIgnoreMouseEvent):
765         (WebCore::Element::dispatchMouseEvent):
766         * page/PointerCaptureController.cpp:
767         (WebCore::PointerCaptureController::reset):
768         Share more code between platforms that support touch events and platforms that don't;
769         we want to be able to dispatch pointer events that originate from mouse events
770         in macCatalyst despite touch events being enabled (by virtue of being iOS WebKit),
771         so un-ifdef that code.
772
773 2019-10-18  Simon Fraser  <simon.fraser@apple.com>
774
775         Make it possible to query scrollbar pseudo-style without having a scrollbar
776         https://bugs.webkit.org/show_bug.cgi?id=203174
777
778         Reviewed by Tim Horton.
779
780         A future patch needs the ability to query scrollbar pseudo-style without having
781         a scrollbar, and it was ugly to pass a live RenderScrollbar into CSS style resolution
782         functions. Instead, pass in a pure-data object that has information about the scrollbar.
783
784         * css/ElementRuleCollector.cpp:
785         (WebCore::ElementRuleCollector::ruleMatches):
786         * css/SelectorChecker.h:
787         * css/SelectorCheckerTestFunctions.h:
788         (WebCore::scrollbarMatchesEnabledPseudoClass):
789         (WebCore::scrollbarMatchesDisabledPseudoClass):
790         (WebCore::scrollbarMatchesHoverPseudoClass):
791         (WebCore::scrollbarMatchesActivePseudoClass):
792         (WebCore::scrollbarMatchesHorizontalPseudoClass):
793         (WebCore::scrollbarMatchesVerticalPseudoClass):
794         (WebCore::scrollbarMatchesDecrementPseudoClass):
795         (WebCore::scrollbarMatchesIncrementPseudoClass):
796         (WebCore::scrollbarMatchesStartPseudoClass):
797         (WebCore::scrollbarMatchesEndPseudoClass):
798         (WebCore::scrollbarMatchesDoubleButtonPseudoClass):
799         (WebCore::scrollbarMatchesSingleButtonPseudoClass):
800         (WebCore::scrollbarMatchesNoButtonPseudoClass):
801         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
802         * css/StyleResolver.h:
803         (WebCore::PseudoStyleRequest::PseudoStyleRequest):
804         * rendering/RenderScrollbar.cpp:
805         (WebCore::RenderScrollbar::getScrollbarPseudoStyle):
806
807 2019-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
808
809         [SVG2]: Remove the SVGExternalResourcesRequired interface
810         https://bugs.webkit.org/show_bug.cgi?id=191293
811
812         Reviewed by Simon Fraser.
813
814         The spec page is: https://www.w3.org/TR/SVG/changes.html.
815
816         r251290 made externalResourcesRequired have no effect on firing the load
817         event. All the control was moved to SVGURIReference. This patch will remove
818         this interface entirely to conform with SVG2 specs and other browsers.
819
820         * CMakeLists.txt:
821         * DerivedSources-input.xcfilelist:
822         * DerivedSources-output.xcfilelist:
823         * DerivedSources.make:
824         * Sources.txt:
825         * WebCore.xcodeproj/project.pbxproj:
826         * svg/SVGAElement.cpp:
827         (WebCore::SVGAElement::SVGAElement):
828         (WebCore::SVGAElement::parseAttribute):
829         (WebCore::SVGAElement::svgAttributeChanged):
830         * svg/SVGAElement.h:
831         * svg/SVGAElement.idl:
832         * svg/SVGAnimationElement.cpp:
833         (WebCore::SVGAnimationElement::SVGAnimationElement):
834         (WebCore::SVGAnimationElement::isSupportedAttribute):
835         (WebCore::SVGAnimationElement::parseAttribute):
836         * svg/SVGAnimationElement.h:
837         * svg/SVGAnimationElement.idl:
838         * svg/SVGCircleElement.cpp:
839         (WebCore::SVGCircleElement::SVGCircleElement):
840         (WebCore::SVGCircleElement::parseAttribute):
841         (WebCore::SVGCircleElement::svgAttributeChanged):
842         * svg/SVGCircleElement.h:
843         * svg/SVGCircleElement.idl:
844         * svg/SVGClipPathElement.cpp:
845         (WebCore::SVGClipPathElement::SVGClipPathElement):
846         (WebCore::SVGClipPathElement::parseAttribute):
847         (WebCore::SVGClipPathElement::svgAttributeChanged):
848         * svg/SVGClipPathElement.h:
849         * svg/SVGClipPathElement.idl:
850         * svg/SVGCursorElement.cpp:
851         (WebCore::SVGCursorElement::SVGCursorElement):
852         (WebCore::SVGCursorElement::parseAttribute):
853         * svg/SVGCursorElement.h:
854         * svg/SVGCursorElement.idl:
855         * svg/SVGDefsElement.cpp:
856         (WebCore::SVGDefsElement::SVGDefsElement):
857         * svg/SVGDefsElement.h:
858         * svg/SVGDefsElement.idl:
859         * svg/SVGEllipseElement.cpp:
860         (WebCore::SVGEllipseElement::SVGEllipseElement):
861         (WebCore::SVGEllipseElement::parseAttribute):
862         (WebCore::SVGEllipseElement::svgAttributeChanged):
863         * svg/SVGEllipseElement.h:
864         * svg/SVGEllipseElement.idl:
865         * svg/SVGExternalResourcesRequired.cpp: Removed.
866         * svg/SVGExternalResourcesRequired.h: Removed.
867         * svg/SVGExternalResourcesRequired.idl: Removed.
868         * svg/SVGFEImageElement.cpp:
869         (WebCore::SVGFEImageElement::SVGFEImageElement):
870         (WebCore::SVGFEImageElement::parseAttribute):
871         * svg/SVGFEImageElement.h:
872         * svg/SVGFEImageElement.idl:
873         * svg/SVGFilterElement.cpp:
874         (WebCore::SVGFilterElement::SVGFilterElement):
875         (WebCore::SVGFilterElement::parseAttribute):
876         (WebCore::SVGFilterElement::svgAttributeChanged):
877         * svg/SVGFilterElement.h:
878         * svg/SVGFilterElement.idl:
879         * svg/SVGFontElement.cpp:
880         (WebCore::SVGFontElement::SVGFontElement):
881         * svg/SVGFontElement.h:
882         * svg/SVGForeignObjectElement.cpp:
883         (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
884         (WebCore::SVGForeignObjectElement::parseAttribute):
885         (WebCore::SVGForeignObjectElement::svgAttributeChanged):
886         * svg/SVGForeignObjectElement.h:
887         * svg/SVGForeignObjectElement.idl:
888         * svg/SVGGElement.cpp:
889         (WebCore::SVGGElement::SVGGElement):
890         (WebCore::SVGGElement::parseAttribute): Deleted.
891         (WebCore::SVGGElement::svgAttributeChanged): Deleted.
892         * svg/SVGGElement.h:
893         * svg/SVGGElement.idl:
894         * svg/SVGGradientElement.cpp:
895         (WebCore::SVGGradientElement::SVGGradientElement):
896         (WebCore::SVGGradientElement::parseAttribute):
897         * svg/SVGGradientElement.h:
898         * svg/SVGGradientElement.idl:
899         * svg/SVGImageElement.cpp:
900         (WebCore::SVGImageElement::SVGImageElement):
901         (WebCore::SVGImageElement::parseAttribute):
902         (WebCore::SVGImageElement::svgAttributeChanged):
903         * svg/SVGImageElement.h:
904         * svg/SVGImageElement.idl:
905         * svg/SVGLineElement.cpp:
906         (WebCore::SVGLineElement::SVGLineElement):
907         (WebCore::SVGLineElement::parseAttribute):
908         (WebCore::SVGLineElement::svgAttributeChanged):
909         * svg/SVGLineElement.h:
910         * svg/SVGLineElement.idl:
911         * svg/SVGMPathElement.cpp:
912         (WebCore::SVGMPathElement::SVGMPathElement):
913         (WebCore::SVGMPathElement::parseAttribute):
914         (WebCore::SVGMPathElement::svgAttributeChanged):
915         * svg/SVGMPathElement.h:
916         * svg/SVGMPathElement.idl:
917         * svg/SVGMarkerElement.cpp:
918         (WebCore::SVGMarkerElement::SVGMarkerElement):
919         (WebCore::SVGMarkerElement::parseAttribute):
920         (WebCore::SVGMarkerElement::svgAttributeChanged):
921         * svg/SVGMarkerElement.h:
922         * svg/SVGMarkerElement.idl:
923         * svg/SVGMaskElement.cpp:
924         (WebCore::SVGMaskElement::SVGMaskElement):
925         (WebCore::SVGMaskElement::parseAttribute):
926         (WebCore::SVGMaskElement::svgAttributeChanged):
927         * svg/SVGMaskElement.h:
928         * svg/SVGMaskElement.idl:
929         * svg/SVGPathElement.cpp:
930         (WebCore::SVGPathElement::SVGPathElement):
931         (WebCore::SVGPathElement::parseAttribute):
932         (WebCore::SVGPathElement::svgAttributeChanged):
933         * svg/SVGPathElement.h:
934         * svg/SVGPathElement.idl:
935         * svg/SVGPatternElement.cpp:
936         (WebCore::SVGPatternElement::SVGPatternElement):
937         (WebCore::SVGPatternElement::parseAttribute):
938         (WebCore::SVGPatternElement::svgAttributeChanged):
939         * svg/SVGPatternElement.h:
940         * svg/SVGPatternElement.idl:
941         * svg/SVGPolyElement.cpp:
942         (WebCore::SVGPolyElement::SVGPolyElement):
943         (WebCore::SVGPolyElement::parseAttribute):
944         (WebCore::SVGPolyElement::svgAttributeChanged):
945         * svg/SVGPolyElement.h:
946         * svg/SVGPolygonElement.idl:
947         * svg/SVGPolylineElement.idl:
948         * svg/SVGRectElement.cpp:
949         (WebCore::SVGRectElement::SVGRectElement):
950         (WebCore::SVGRectElement::parseAttribute):
951         (WebCore::SVGRectElement::svgAttributeChanged):
952         * svg/SVGRectElement.h:
953         * svg/SVGRectElement.idl:
954         * svg/SVGSVGElement.cpp:
955         (WebCore::SVGSVGElement::SVGSVGElement):
956         (WebCore::SVGSVGElement::parseAttribute):
957         (WebCore::SVGSVGElement::svgAttributeChanged):
958         * svg/SVGSVGElement.h:
959         * svg/SVGSVGElement.idl:
960         * svg/SVGScriptElement.cpp:
961         (WebCore::SVGScriptElement::SVGScriptElement):
962         (WebCore::SVGScriptElement::parseAttribute):
963         (WebCore::SVGScriptElement::svgAttributeChanged):
964         * svg/SVGScriptElement.h:
965         * svg/SVGScriptElement.idl:
966         * svg/SVGSwitchElement.cpp:
967         (WebCore::SVGSwitchElement::SVGSwitchElement):
968         * svg/SVGSwitchElement.h:
969         * svg/SVGSwitchElement.idl:
970         * svg/SVGSymbolElement.cpp:
971         (WebCore::SVGSymbolElement::SVGSymbolElement):
972         (WebCore::SVGSymbolElement::parseAttribute):
973         (WebCore::SVGSymbolElement::svgAttributeChanged): Deleted.
974         * svg/SVGSymbolElement.h:
975         * svg/SVGSymbolElement.idl:
976         * svg/SVGTextContentElement.cpp:
977         (WebCore::SVGTextContentElement::SVGTextContentElement):
978         (WebCore::SVGTextContentElement::parseAttribute):
979         (WebCore::SVGTextContentElement::svgAttributeChanged):
980         * svg/SVGTextContentElement.h:
981         * svg/SVGTextContentElement.idl:
982         * svg/SVGUseElement.cpp:
983         (WebCore::SVGUseElement::SVGUseElement):
984         (WebCore::SVGUseElement::parseAttribute):
985         (WebCore::SVGUseElement::svgAttributeChanged):
986         * svg/SVGUseElement.h:
987         * svg/SVGUseElement.idl:
988         * svg/SVGViewElement.cpp:
989         (WebCore::SVGViewElement::SVGViewElement):
990         (WebCore::SVGViewElement::parseAttribute):
991         (WebCore::SVGViewElement::svgAttributeChanged):
992         * svg/SVGViewElement.h:
993         * svg/SVGViewElement.idl:
994
995 2019-10-18  Wenson Hsieh  <wenson_hsieh@apple.com>
996
997         [Clipboard API] Refactor Pasteboard::read() to take an optional item index
998         https://bugs.webkit.org/show_bug.cgi?id=203161
999
1000         Reviewed by Tim Horton.
1001
1002         Adds an optional `itemIndex` argument to Pasteboard::read(PasteboardPlainText&) and
1003         Pasteboard::read(PasteboardWebContentReader&, WebContentReadingPolicy). See below for more details.
1004
1005         Tests:  CopyHTML.ItemTypesWhenCopyingWebContent
1006                 PasteWebArchive.WebArchiveTypeIdentifier
1007
1008         * editing/mac/EditorMac.mm:
1009         (WebCore::Editor::dataSelectionForPasteboard):
1010
1011         Recognize "com.apple.webarchive" alongside "Apple Web Archive pasteboard type" when writing and reading from the
1012         platform pasteboard on macOS. We add support for this here because the existing private type cannot be written
1013         to an NSPasteboardItem, since it does not conform to a valid UTI format. Luckily, there already exists a UTI
1014         that represents a web archive, so we can use it instead.
1015
1016         We need to write and read web archive data from NSPasteboardItem in order to support the case where there are
1017         multiple items in the pasteboard that contain different web archive data.
1018
1019         * platform/Pasteboard.h:
1020         * platform/StaticPasteboard.h:
1021         * platform/gtk/PasteboardGtk.cpp:
1022         (WebCore::Pasteboard::read):
1023         * platform/ios/PasteboardIOS.mm:
1024         (WebCore::Pasteboard::read):
1025
1026         Read the string from `itemIndex` if specified; otherwise, fall back to index 0. This could actually be fixed in
1027         the future to scan all pasteboard items for a suitable string instead of falling back on the first item, but for
1028         now, we maintain the existing behavior.
1029
1030         (WebCore::Pasteboard::readRespectingUTIFidelities):
1031
1032         If an `itemIndex` is specified, ignore all other item indices when looking for suitable content.
1033
1034         * platform/libwpe/PasteboardLibWPE.cpp:
1035         (WebCore::Pasteboard::read):
1036         * platform/mac/DragDataMac.mm:
1037         (WebCore::DragData::containsCompatibleContent const):
1038         * platform/mac/PasteboardMac.mm:
1039         (WebCore::Pasteboard::write):
1040         (WebCore::readStringAtPreferredItemIndex):
1041         (WebCore::readBufferAtPreferredItemIndex):
1042
1043         Add helper methods to read strings and buffers from the pasteboard, at an optional `itemIndex` if specified.
1044
1045         (WebCore::Pasteboard::read):
1046
1047         Adopt the helper functions when reading plain text and web content, and respect the given `itemIndex`. To do
1048         this, we need to read both legacy and modern types from the pasteboard, instead of just legacy types. This is
1049         because NSPasteboardItem on macOS only accepts and provides data in the form of modern pasteboard types.
1050
1051         * platform/mac/PlatformPasteboardMac.mm:
1052         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
1053         (WebCore::PlatformPasteboard::readBuffer const):
1054         (WebCore::PlatformPasteboard::readString const):
1055
1056         Fix these methods to accept platform pasteboard types instead of MIME types, to match the behavior of existing
1057         readBuffer and readString methods in PlatformPasteboardIOS.
1058
1059         * platform/win/PasteboardWin.cpp:
1060         (WebCore::Pasteboard::read):
1061
1062 2019-10-18  Devin Rousso  <drousso@apple.com>
1063
1064         [ASAN] Fix WebGPU tests after r250258
1065         https://bugs.webkit.org/show_bug.cgi?id=203133
1066         <rdar://problem/56379008>
1067
1068         Reviewed by Joseph Pecoraro.
1069
1070         * platform/graphics/gpu/GPUObjectBase.h:
1071         (WebCore::GPUObjectBase::~GPUObjectBase): Added.
1072         Add a default virtual destructor since this class class is the one that is `RefCounted` and
1073         the `WebGPUPipeline` subclass is virtual.
1074
1075         * Modules/webgpu/WebGPUPipeline.h:
1076         (WebCore::WebGPUPipeline::scriptExecutionContext const): Deleted.
1077         * Modules/webgpu/WebGPUPipeline.cpp:
1078         (WebCore::WebGPUPipeline::WebGPUPipeline):
1079         (WebCore::WebGPUPipeline::contextDestroyed): Added.
1080         Make `WebGPUPipeline` a subclass of `ContextDestructionObserver` so that the raw pointer to
1081         the associated `ScriptExecutionContext` is properly cleared and isn't UAFd.
1082
1083         * Modules/webgpu/WebGPUComputePipeline.h:
1084         * Modules/webgpu/WebGPUComputePipeline.cpp:
1085         (WebCore::WebGPUComputePipeline::create):
1086         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
1087         (WebCore::WebGPUComputePipeline::cloneShaderModules):
1088         (WebCore::WebGPUComputePipeline::recompile):
1089         * Modules/webgpu/WebGPURenderPipeline.h:
1090         * Modules/webgpu/WebGPURenderPipeline.cpp:
1091         (WebCore::WebGPURenderPipeline::create):
1092         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
1093         (WebCore::WebGPURenderPipeline::cloneShaderModules):
1094         (WebCore::WebGPURenderPipeline::recompile):
1095         * Modules/webgpu/WebGPUDevice.cpp:
1096         (WebCore::WebGPUDevice::createRenderPipeline):
1097         (WebCore::WebGPUDevice::createComputePipeline):
1098         Rework how Web Inspector preserves related shader modules so that there isn't as much wasted
1099         space in the class layout, as we can use the `RefPtr` itself instead of an `Optional`.
1100
1101         * Modules/webgpu/WebGPUBuffer.idl:
1102         Now that `GPUObjectBase` has a virtual destructor, it has a vtable, which means that this
1103         object also does and therefore cannot be marked with `ImplementationLacksVTable`.
1104
1105         * inspector/InspectorShaderProgram.cpp:
1106         (WebCore::shaderForType):
1107         (WebCore::InspectorShaderProgram::requestShaderSource):
1108         (WebCore::InspectorShaderProgram::updateShader):
1109         (WebCore::InspectorShaderProgram::buildObjectForShaderProgram):
1110
1111 2019-10-18  Ryosuke Niwa  <rniwa@webkit.org>
1112
1113         Refactor AbstractEventLoop out of WindowEventLoop
1114         https://bugs.webkit.org/show_bug.cgi?id=203136
1115         <rdar://problem/56396749>
1116
1117         Reviewed by Antti Koivisto.
1118
1119         Extract AbstractEventLoop out of WindowEventLoop as a preparation for adding WorkerEventLoop.
1120
1121         Also replaced m_activeTaskCount with a boolean m_isScheduledToRun since it doesn't need to count.
1122
1123         * WebCore.xcodeproj/project.pbxproj:
1124         * dom/AbstractEventLoop.cpp: Added.
1125         * dom/AbstractEventLoop.h: Added.
1126         (WebCore::AbstractEventLoop): Added.
1127         * dom/WindowEventLoop.cpp:
1128         (WebCore::WindowEventLoop::WindowEventLoop): Deleted. Use the default constructor in the header instead.
1129         (WebCore::WindowEventLoop::queueTask):
1130         (WebCore::WindowEventLoop::suspend):
1131         (WebCore::WindowEventLoop::resume):
1132         (WebCore::WindowEventLoop::scheduleToRunIfNeeded): Extracted out of queueTask.
1133         (WebCore::WindowEventLoop::run):
1134         * dom/WindowEventLoop.h:
1135
1136 2019-10-18  Devin Rousso  <drousso@apple.com>
1137
1138         Web Inspector: Elements: allow WebKit engineers to edit UserAgent shadow trees
1139         https://bugs.webkit.org/show_bug.cgi?id=203159
1140
1141         Reviewed by Brian Burg.
1142
1143         Test: inspector/dom/setAllowEditingUserAgentShadowTrees.html
1144
1145         * inspector/agents/InspectorDOMAgent.h:
1146         * inspector/agents/InspectorDOMAgent.cpp:
1147         (WebCore::InspectorDOMAgent::assertEditableNode):
1148         (WebCore::InspectorDOMAgent::setInspectedNode):
1149         (WebCore::InspectorDOMAgent::setAllowEditingUserAgentShadowTrees): Added.
1150
1151 2019-10-17  Ryosuke Niwa  <rniwa@webkit.org>
1152
1153         Document::m_closeAfterStyleRecalc is unnecessary
1154         https://bugs.webkit.org/show_bug.cgi?id=203143
1155
1156         Reviewed by Antti Koivisto.
1157
1158         Removed the code to defer implicit close until the style recalc is done
1159         since we call FrameLoader::checkCompleted asynchronously via a timer these days.
1160
1161         * dom/Document.cpp:
1162         (WebCore::Document::resolveStyle):
1163         (WebCore::Document::implicitClose):
1164         * dom/Document.h:
1165
1166 2019-10-17  Dean Jackson  <dino@apple.com>
1167
1168         texImage2D for a half-float texture only accepts null
1169         https://bugs.webkit.org/show_bug.cgi?id=169999
1170         <rdar://problem/31713571>
1171
1172         Reviewed by Simon Fraser.
1173
1174         After we initially implemented this, the extension was
1175         modified such that texImage2D could upload to half-float
1176         from a Uint16 array.
1177
1178         Test: fast/canvas/webgl/oes-texture-half-float-uint16.html
1179
1180         * html/canvas/WebGLRenderingContextBase.cpp:
1181         (WebCore::WebGLRenderingContextBase::validateArrayBufferType): Accept
1182         Uint16.
1183
1184 2019-10-18  Daniel Bates  <dabates@apple.com>
1185
1186         REGRESSION (r241747): [iOS] Adjust default SVG focus ring width to match width for HTML documents
1187         https://bugs.webkit.org/show_bug.cgi?id=203011
1188
1189         Reviewed by Wenson Hsieh.
1190
1191         Update default user agent stylesheet for SVG documents (i.e. .svg resources) to use the same 3px
1192         outline width for focused elements as we do for HTML documents.
1193
1194         This makes the test imported/blink/svg/custom/focus-ring-2.svg pass on iOS.
1195
1196         * css/svg.css:
1197
1198 2019-10-18  Jer Noble  <jer.noble@apple.com>
1199
1200         Add experimental HDR MediaCapabilities support.
1201         https://bugs.webkit.org/show_bug.cgi?id=203113
1202
1203         Reviewed by Eric Carlson.
1204
1205         Tests: media/mediacapabilities/mock-decodingInfo-hdr.html
1206                platform/mac/media/mediacapabilities/hevc-decodingInfo-hdr.html
1207
1208         Add support for MediaCapabilities.decodeInfo() HDR support detection.
1209
1210         Add new enum IDL types to MediaCapabilities and remove old unused ones. Add
1211         mock implementation for HDR detection. Add Cocoa platform implementation.
1212
1213         * CMakeLists.txt:
1214         * DerivedSources-input.xcfilelist:
1215         * DerivedSources-output.xcfilelist:
1216         * DerivedSources.make:
1217         * Modules/mediacapabilities/ColorGamut.idl: 
1218         * Modules/mediacapabilities/HdrMetadataType.idl: 
1219         * Modules/mediacapabilities/ScreenLuminance.h: 
1220         * Modules/mediacapabilities/TransferFunction.idl: 
1221         * Modules/mediacapabilities/VideoConfiguration.idl:
1222         * Scripts/GenerateSettings.rb:
1223         * Sources.txt:
1224         * WebCore.xcodeproj/project.pbxproj:
1225         * bindings/scripts/CodeGenerator.pm:
1226         (WK_ucfirst):
1227         * bindings/scripts/CodeGeneratorJS.pm:
1228         (ToMethodName):
1229         * page/Settings.yaml:
1230         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
1231         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
1232         * platform/mediacapabilities/ColorGamut.h: 
1233         * platform/mediacapabilities/HdrMetadataType.h: 
1234         * platform/mediacapabilities/TransferFunction.h: 
1235         * platform/mediacapabilities/VideoConfiguration.h:
1236         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
1237         (WebCore::canDecodeMedia):
1238         (WebCore::canEncodeMedia):
1239
1240 2019-10-18  Jiewen Tan  <jiewen_tan@apple.com>
1241
1242         [WebAuthn] Implement AuthenticatorCancel
1243         https://bugs.webkit.org/show_bug.cgi?id=191523
1244         <rdar://problem/55920204>
1245
1246         Reviewed by Brent Fulgham.
1247
1248         Covered by new tests in existing test files.
1249
1250         * Modules/credentialmanagement/CredentialsContainer.cpp:
1251         (WebCore::CredentialsContainer::get):
1252         (WebCore::CredentialsContainer::isCreate):
1253         * Modules/webauthn/AuthenticatorCoordinator.cpp:
1254         (WebCore::AuthenticatorCoordinator::create const):
1255         (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
1256         * Modules/webauthn/AuthenticatorCoordinator.h:
1257         * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: Removed.
1258         * Modules/webauthn/AuthenticatorCoordinatorClient.h:
1259         * Modules/webauthn/PublicKeyCredential.cpp:
1260         (WebCore::PublicKeyCredential::tryCreate):
1261         * Modules/webauthn/PublicKeyCredential.h:
1262         * Modules/webauthn/PublicKeyCredentialData.h:
1263         * Modules/webauthn/fido/DeviceRequestConverter.h:
1264         * Modules/webauthn/fido/FidoHidMessage.cpp:
1265         (fido::FidoHidMessage::FidoHidMessage):
1266         * Modules/webauthn/fido/FidoHidPacket.cpp:
1267         (fido::FidoHidInitPacket::getSerializedData const):
1268         (fido::FidoHidContinuationPacket::getSerializedData const):
1269         * Sources.txt:
1270         * WebCore.xcodeproj/project.pbxproj:
1271         * testing/MockWebAuthenticationConfiguration.h:
1272         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::encode const):
1273         (WebCore::MockWebAuthenticationConfiguration::HidConfiguration::decode):
1274         * testing/MockWebAuthenticationConfiguration.idl:
1275         Adds a new option to test AuthenticatorCancel.
1276
1277 2019-10-18  Simon Fraser  <simon.fraser@apple.com>
1278
1279         Add TextStream dumping for BasicShape types
1280         https://bugs.webkit.org/show_bug.cgi?id=203150
1281
1282         Reviewed by Zalan Bujtas.
1283
1284         Add dumping for the classes, and make the BasicShape enum an enum class.
1285
1286         * css/BasicShapeFunctions.cpp:
1287         (WebCore::valueForBasicShape):
1288         * rendering/shapes/Shape.cpp:
1289         (WebCore::Shape::createShape):
1290         * rendering/style/BasicShapes.cpp:
1291         (WebCore::BasicShapeCircle::dump const):
1292         (WebCore::BasicShapeEllipse::dump const):
1293         (WebCore::BasicShapePolygon::dump const):
1294         (WebCore::BasicShapePath::dump const):
1295         (WebCore::BasicShapeInset::dump const):
1296         (WebCore::operator<<):
1297         * rendering/style/BasicShapes.h:
1298         (WebCore::BasicShapeCenterCoordinate::BasicShapeCenterCoordinate):
1299
1300 2019-10-18  Antti Koivisto  <antti@apple.com>
1301
1302         ElementRuleCollector function signature cleanups
1303         https://bugs.webkit.org/show_bug.cgi?id=203153
1304         <rdar://problem/56412684>
1305
1306         Unreviewed followup.
1307
1308         * css/ElementRuleCollector.cpp:
1309         (WebCore::ElementRuleCollector::transferMatchedRules):
1310
1311         Try to appease MSVC.
1312
1313 2019-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1314
1315         Load event must be fired only for the SVG structurally external elements and the outermost SVG element
1316         https://bugs.webkit.org/show_bug.cgi?id=203044
1317
1318         Reviewed by Simon Fraser.
1319
1320         The SVG1.1 spec for SVGLoad event is:
1321             https://www.w3.org/TR/SVG11/interact.html
1322
1323         The SVG2 spec for the load event is:
1324             https://www.w3.org/TR/SVG/changes.html#interact
1325             https://www.w3.org/TR/SVG/interact.html
1326
1327         SVG2 removes the SVGExternalResourcesRequired interface. It also simplifies
1328         the rules for firing the load event and made them consistent with the HTML
1329         specs. The plan is to remove SVGExternalResourcesRequired in a following
1330         patch. This patch makes SVGExternalResourcesRequired have no effect on the
1331         load event firing rules. It moves all the functionalities to SVGURIReference
1332         as a step towards removing the SVGExternalResourcesRequired interface.
1333
1334         Test: svg/custom/image-load-event.html
1335
1336         * dom/Document.cpp:
1337         (WebCore::Document::implicitClose):
1338         Do not use the SVGLoad term. It has been removed from the specs.
1339
1340         * dom/ScriptElement.cpp:
1341         (WebCore::ScriptElement::ScriptElement):
1342         * dom/ScriptElement.h:
1343         (WebCore::ScriptElement::errorOccurred const):
1344         (WebCore::ScriptElement::setErrorOccurred):
1345         Add a method to track the occurrence  of loading error. errorOccurred()
1346         || haveFiredLoadEvent() means no pending loading activity.
1347
1348         * svg/SVGDocumentExtensions.cpp:
1349         (WebCore::SVGDocumentExtensions::dispatchLoadEventToOutermostSVGElements):
1350         (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements): Deleted.
1351         * svg/SVGDocumentExtensions.h:
1352         Do not use the SVGLoad term. 
1353
1354         * svg/SVGElement.cpp:
1355         (WebCore::SVGElement::sendLoadEventIfPossible):
1356         (WebCore::SVGElement::loadEventTimerFired):
1357         (WebCore::SVGElement::loadEventTimer):
1358         (WebCore::SVGElement::finishParsingChildren):
1359         (WebCore::SVGElement::sendSVGLoadEventIfPossible): Deleted.
1360         (WebCore::SVGElement::sendSVGLoadEventIfPossibleAsynchronously): Deleted.
1361         (WebCore::SVGElement::svgLoadEventTimerFired): Deleted.
1362         (WebCore::SVGElement::svgLoadEventTimer): Deleted.
1363         * svg/SVGElement.h:
1364         finishParsingChildren() won't fire 'load' event anymore. The 'load' event 
1365         will be fired explicitly for the outermost SVG element from Document::implicitClose().
1366
1367         * svg/SVGExternalResourcesRequired.cpp:
1368         (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
1369         (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent): Deleted.
1370         (WebCore::SVGExternalResourcesRequired::insertedIntoDocument): Deleted.
1371         (WebCore::SVGExternalResourcesRequired::finishParsingChildren): Deleted.
1372         (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const): Deleted.
1373         * svg/SVGExternalResourcesRequired.h:
1374         (WebCore::SVGExternalResourcesRequired::setHaveFiredLoadEvent): Deleted.
1375         (WebCore::SVGExternalResourcesRequired::isParserInserted const): Deleted.
1376         (WebCore::SVGExternalResourcesRequired::haveFiredLoadEvent const): Deleted.
1377         * svg/SVGImageElement.cpp:
1378         (WebCore::SVGImageElement::haveLoadedRequiredResources):
1379         * svg/SVGImageLoader.cpp:
1380         (WebCore::SVGImageLoader::dispatchLoadEvent):
1381         The value of externalResourcesRequired() no longer controls firing the
1382         'load' event.
1383
1384         * svg/SVGScriptElement.cpp:
1385         (WebCore::SVGScriptElement::SVGScriptElement):
1386         (WebCore::SVGScriptElement::insertedIntoAncestor):
1387         (WebCore::SVGScriptElement::dispatchErrorEvent):
1388         (WebCore::SVGScriptElement::finishParsingChildren): Deleted.
1389         * svg/SVGScriptElement.h:
1390         dispatchErrorEvent() is now a virtual function. Let SVGScriptElement
1391         overrides it so it can track when the loader finishes its activity.
1392
1393         * svg/SVGStyleElement.cpp:
1394         (WebCore::SVGStyleElement::SVGStyleElement):
1395         * svg/SVGStyleElement.h:
1396
1397         * svg/SVGURIReference.cpp:
1398         (WebCore::SVGURIReference::contextElement const):
1399         (WebCore::SVGURIReference::parseAttribute):
1400         (WebCore::SVGURIReference::haveLoadedRequiredResources const):
1401         (WebCore::SVGURIReference::dispatchLoadEvent):
1402         * svg/SVGURIReference.h:
1403         (WebCore::SVGURIReference::haveFiredLoadEvent const):
1404         (WebCore::SVGURIReference::setHaveFiredLoadEvent):
1405         (WebCore::SVGURIReference::errorOccurred const):
1406         (WebCore::SVGURIReference::setErrorOccurred):
1407         SVGURIReference will decide whether the 'load' event can be fired or not.
1408
1409         * svg/SVGUseElement.cpp:
1410         (WebCore::SVGUseElement::SVGUseElement):
1411         (WebCore::SVGUseElement::insertedIntoAncestor):
1412         (WebCore::SVGUseElement::notifyFinished):
1413         (WebCore::SVGUseElement::finishParsingChildren): Deleted.
1414         (WebCore::SVGUseElement::isValid const): Deleted.
1415         (WebCore::SVGUseElement::haveLoadedRequiredResources): Deleted.
1416         (WebCore::SVGUseElement::setHaveFiredLoadEvent): Deleted.
1417         (WebCore::SVGUseElement::haveFiredLoadEvent const): Deleted.
1418         (WebCore::SVGUseElement::svgLoadEventTimer): Deleted.
1419         * svg/SVGUseElement.h:
1420         SVGUseElement needs to track firing the load event or error occurrence 
1421         the same way SVGImageElement and SVGScriptElement do.
1422
1423 2019-10-18  Antti Koivisto  <antti@apple.com>
1424
1425         ElementRuleCollector function signature cleanups
1426         https://bugs.webkit.org/show_bug.cgi?id=203153
1427
1428         Reviewed by Zalan Bujtas.
1429
1430         Many functions in ElementRuleCollector take repetitive arguments that can be removed:
1431
1432         - Make includeEmptyRules argument a class member
1433         - Remove RuleRange argument, update the ranges in rule transfer step.
1434
1435         * css/ElementRuleCollector.cpp:
1436         (WebCore::MatchRequest::MatchRequest):
1437         (WebCore::ElementRuleCollector::addMatchedRule):
1438         (WebCore::ElementRuleCollector::collectMatchingRules):
1439         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
1440         (WebCore::ElementRuleCollector::transferMatchedRules):
1441         (WebCore::ElementRuleCollector::matchAuthorRules):
1442         (WebCore::ElementRuleCollector::matchesAnyAuthorRules):
1443         (WebCore::ElementRuleCollector::collectMatchingAuthorRules):
1444         (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
1445         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1446         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
1447         (WebCore::ElementRuleCollector::matchPartPseudoElementRules):
1448         (WebCore::ElementRuleCollector::matchPartPseudoElementRulesForScope):
1449         (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
1450         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
1451         (WebCore::ElementRuleCollector::matchUserRules):
1452         (WebCore::ElementRuleCollector::matchUARules):
1453         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1454         (WebCore::ElementRuleCollector::matchAllRules):
1455         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
1456         * css/ElementRuleCollector.h:
1457         (WebCore::ElementRuleCollector::setIncludeEmptyRules):
1458         (WebCore::ElementRuleCollector::transferMatchedRules):
1459
1460         Range update happens now here based on the supplied argument.
1461
1462         * css/StyleResolver.cpp:
1463         (WebCore::StyleResolver::pseudoStyleForElement):
1464         (WebCore::StyleResolver::pseudoStyleRulesForElement):
1465 x
1466 2019-10-18  Antti Koivisto  <antti@apple.com>
1467
1468         [CSS Shadow Parts] :part rules should be able to override style attribute
1469         https://bugs.webkit.org/show_bug.cgi?id=202919
1470
1471         Reviewed by Zalan Bujtas.
1472
1473         Element inline style was simply appended to the matching declaration list and not sorted with the rest of the author style.
1474         This used to work because before CSS Shadow Parts feature inline style would always win.
1475
1476         Fixing this involves refactoring the rule collection code to remove this assumption.
1477
1478         * css/ElementRuleCollector.cpp:
1479         (WebCore::ElementRuleCollector::addMatchedRule):
1480
1481         Both initialize and update ranges here.
1482
1483         (WebCore::ElementRuleCollector::clearMatchedRules):
1484         (WebCore::ElementRuleCollector::addElementStyleProperties):
1485
1486         Both initialize and update ranges here.
1487
1488         (WebCore::ElementRuleCollector::sortAndTransferMatchedRules):
1489
1490         Split out transfering to a separate function.
1491
1492         (WebCore::ElementRuleCollector::transferMatchedRules):
1493
1494         Add a parameter to limit transfer to rules from a scope.
1495
1496         (WebCore::ElementRuleCollector::matchAuthorRules):
1497         (WebCore::ElementRuleCollector::matchesAnyAuthorRules):
1498
1499         Replace hasMatchedRules() with a more specific function. This can use collectMatchingAuthorRules and avoids unnecessary sorting step.
1500
1501         (WebCore::ElementRuleCollector::collectMatchingAuthorRules):
1502
1503         Split out collecting the rules from matchAuthorRules. Like other collect functions, this doesn't do any sorting.
1504
1505         (WebCore::ElementRuleCollector::matchAllRules):
1506
1507         Add element inline style before transfering rules from the containing host scope.
1508
1509         (WebCore::ElementRuleCollector::addElementInlineStyleProperties):
1510
1511         Factor adding inline style into a function.
1512
1513 ]        * css/ElementRuleCollector.h:
1514         (WebCore::ElementRuleCollector::hasMatchedRules const): Deleted.
1515         * css/StyleProperties.h:
1516         (WebCore::StylePropertiesBase::deref const):
1517         (WebCore::StylePropertiesBase::deref): Deleted.
1518
1519         Make const to allow RefPtr<const StyleProperties>
1520
1521         * css/StyleResolver.cpp:
1522         (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
1523
1524         Sort !important properties taking into account that the host scope has lower priority.
1525
1526         * style/StyleInvalidator.cpp:
1527         (WebCore::Style::Invalidator::invalidateIfNeeded):
1528
1529 2019-10-18  Zalan Bujtas  <zalan@apple.com>
1530
1531         [LFC][TFC] Include horizontal spacing when checking for the extra horizontal space
1532         https://bugs.webkit.org/show_bug.cgi?id=203154
1533         <rdar://problem/56408032>
1534
1535         Reviewed by Antti Koivisto.
1536
1537         * layout/tableformatting/TableFormattingContext.cpp:
1538         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
1539
1540 2019-10-18  Zalan Bujtas  <zalan@apple.com>
1541
1542         [LFC][TFC] Fix table's total horizontal spacing computation
1543         https://bugs.webkit.org/show_bug.cgi?id=203151
1544         <rdar://problem/56406930>
1545
1546         Reviewed by Antti Koivisto.
1547
1548         The horizontal spacing value sets the gaps between
1549         1. first column and the left edge of the table's content box
1550         2. between 2 columns
1551         3. last column and the right edge of the table's content box
1552         In case of 'n' columns, the number of gaps is 'n + 1'.
1553
1554         * layout/tableformatting/TableGrid.h:
1555         (WebCore::Layout::TableGrid::totalHorizontalSpacing const):
1556
1557 2019-10-18  Zalan Bujtas  <zalan@apple.com>
1558
1559         [LFC][TFC] Cache table's width constraint values.
1560         https://bugs.webkit.org/show_bug.cgi?id=203135
1561         <rdar://problem/56396352>
1562
1563         Reviewed by Antti Koivisto.
1564
1565         This patch ensures that when computedIntrinsicWidthConstraints is called from both the preferred width and the actual layout codepaths during a layout frame, we don't
1566         end up building up the grid twice.
1567
1568         * layout/tableformatting/TableFormattingContext.cpp:
1569         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
1570         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1571         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
1572         * layout/tableformatting/TableGrid.cpp:
1573         (WebCore::Layout::TableGrid::widthConstraints):
1574         (WebCore::Layout::TableGrid::widthConstraints const): Deleted.
1575         * layout/tableformatting/TableGrid.h:
1576         (WebCore::Layout::TableGrid::hasComputedWidthConstraints const):
1577
1578 2019-10-18  Zalan Bujtas  <zalan@apple.com>
1579
1580         [LFC][BFC] TableFormattingContext::computedIntrinsicWidthConstraints should not expect a valid containing block's width
1581         https://bugs.webkit.org/show_bug.cgi?id=203131
1582         <rdar://problem/56394676>
1583
1584         Reviewed by Antti Koivisto.
1585
1586         When TableFormattingContext::computedIntrinsicWidthConstraints is called by the preferred width computation (<div style="float: left"><table>)
1587         the containing block's width is not yet set (it gets computed based on the preferred width) so computedIntrinsicWidthConstraints should not be relying
1588         on it. Let's move that logic out to TableFormattingContext::layoutInFlowContent() where it belongs. 
1589
1590         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1591         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
1592         * layout/tableformatting/TableFormattingContext.cpp:
1593         (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
1594         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
1595         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
1596         (WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
1597         (WebCore::Layout::TableFormattingContext::computedTableWidth): Deleted.
1598         (WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace): Deleted.
1599         * layout/tableformatting/TableFormattingContext.h:
1600
1601 2019-10-18  Zalan Bujtas  <zalan@apple.com>
1602
1603         [LFC][BFC] Fix block level formatting root inflow box height computation
1604         https://bugs.webkit.org/show_bug.cgi?id=203085
1605         <rdar://problem/56372306>
1606
1607         Reviewed by Antti Koivisto.
1608
1609         Section 10.6.7 (https://www.w3.org/TR/CSS22/visudet.html#root-height) defines the height computation for block level formatting context roots.
1610         We already use it for floats, out-of-flow and block level boxes when overflow computes to not "visible".
1611         This patch makes generic in-flow non-replaced BFC roots (e.g. principal block container box for <table>) compute their heights according to 10.6.7.
1612
1613         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1614         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1615
1616 2019-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1617
1618         [Clipboard API] Support navigator.clipboard.read()
1619         https://bugs.webkit.org/show_bug.cgi?id=203021
1620
1621         Reviewed by Ryosuke Niwa.
1622
1623         Add support for navigator.clipboard.read(), which returns a promise that resolves to a list of ClipboardItems.
1624         See below for more details.
1625
1626         Tests: editing/async-clipboard/clipboard-change-data-while-reading.html
1627                editing/async-clipboard/clipboard-read-basic.html
1628
1629         * Modules/async-clipboard/Clipboard.cpp:
1630         (WebCore::Clipboard::read):
1631
1632         Implement read(). This makes two calls to the platform pasteboard: the first to get the current change count,
1633         and if the change count is different from the changeCount used for the last read() call (or there are no
1634         existing clipboard items being tracked), then we request pasteboard item information for all items on the
1635         pasteboard, and use this information to create new clipboard items. Otherwise, if the changeCount is still valid
1636         for the current list of clipboard items, simply return these clipboard items.
1637
1638         If the changeCount ends up being different in between the initial changeCount request and when the pasteboard
1639         item information is received, we immediately bail with a NotAllowedError. The new layout test
1640         clipboard-change-data-while-reading.html exercises this scenario.
1641
1642         (WebCore::Clipboard::getType):
1643         (WebCore::Clipboard::frame const):
1644         * Modules/async-clipboard/Clipboard.h:
1645         * Modules/async-clipboard/ClipboardItem.cpp:
1646         (WebCore::ClipboardItem::blobFromString):
1647         (WebCore::ClipboardItem::ClipboardItem):
1648         (WebCore::ClipboardItem::create):
1649         (WebCore::ClipboardItem::navigator):
1650
1651         Refactor this so that each clipboard item itself has a WeakPtr to its Navigator. This avoids having to follow
1652         the weak pointer to the Clipboard to get to the Clipboard's navigator during garbage collection when computing
1653         reachability from opaque roots, since this may happen on a background (GC) thread.
1654
1655         (WebCore::ClipboardItem::clipboard):
1656         * Modules/async-clipboard/ClipboardItem.h:
1657         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp:
1658         (WebCore::ClipboardItemBindingsDataSource::getType):
1659         (WebCore::blobFromString): Deleted.
1660
1661         Move this to ClipboardItem, and make it a static method.
1662
1663         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
1664         (WebCore::ClipboardItemPasteboardDataSource::ClipboardItemPasteboardDataSource):
1665         (WebCore::ClipboardItemPasteboardDataSource::getType):
1666         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.h:
1667
1668         Move a couple of member variables (index and changeCount) out of ClipboardItem. Instead of having each
1669         ClipboardItem keep track of this information, have the Clipboard that owns the ClipboardItem keep this
1670         information. This means that reading data from ClipboardItem will (in a future patch) work by having the item
1671         ask its Clipboard object to read data on its behalf.
1672
1673         * platform/Pasteboard.cpp:
1674         (WebCore::Pasteboard::allPasteboardItemInfo const):
1675         (WebCore::Pasteboard::pasteboardItemInfo const):
1676         (WebCore::Pasteboard::readString):
1677         (WebCore::Pasteboard::readBuffer):
1678         (WebCore::Pasteboard::readURL):
1679
1680         Add some null checks to handle the case where there is no pasteboard strategy.
1681
1682 2019-10-17  Chris Dumez  <cdumez@apple.com>
1683
1684         Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
1685         https://bugs.webkit.org/show_bug.cgi?id=203108
1686         <rdar://problem/56375671>
1687
1688         Reviewed by Geoff Garen.
1689
1690         We don't want to go back to a visually empty page on back/forward navigation.
1691
1692         * history/BackForwardCache.cpp:
1693         (WebCore::canCacheFrame):
1694         * page/DiagnosticLoggingKeys.cpp:
1695         (WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
1696         * page/DiagnosticLoggingKeys.h:
1697
1698 2019-10-17  Simon Fraser  <simon.fraser@apple.com>
1699
1700         Only include "deep color" in layer tree dumps if a tests requests it
1701         https://bugs.webkit.org/show_bug.cgi?id=203125
1702
1703         Reviewed by Tim Horton.
1704         
1705         Layer tree dumping tests can fail when run on different devices because the "deep color"
1706         property on layers is device-dependent. Stop dumping this by default, and have one test
1707         that sets the bit. iphone-7 is the only device we test that has deep color support.
1708
1709         Tests: compositing/contents-format/deep-color-backing-store.html
1710                compositing/contents-format/ipad/deep-color-backing-store.html
1711                compositing/contents-format/iphone-7/deep-color-backing-store.html
1712
1713         * page/Frame.h:
1714         * platform/graphics/GraphicsLayerClient.h:
1715         * platform/graphics/ca/GraphicsLayerCA.cpp:
1716         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1717         * rendering/RenderLayerCompositor.cpp:
1718         (WebCore::RenderLayerCompositor::layerTreeAsText):
1719         * testing/Internals.cpp:
1720         (WebCore::toLayerTreeFlags):
1721         * testing/Internals.h:
1722         * testing/Internals.idl:
1723
1724 2019-10-17  Dean Jackson  <dino@apple.com>
1725
1726         ctx.font = "" asserts in CSS parser
1727         https://bugs.webkit.org/show_bug.cgi?id=203127
1728         <rdar://problem/56391016>
1729
1730         Reviewed by Devin Rousso.
1731
1732         The HTML specification says:
1733         "values that cannot be parsed as CSS font values are ignored", so
1734         return early if we get an empty string, otherwise the CSS parser
1735         will assert. This was the only case I could find where we sidestepped
1736         most of the parsing infrastructure and injected a raw string.
1737
1738         Test: http/wpt/2dcontext/text-styles/2d.text.font.parse.invalid.html
1739
1740         * html/canvas/CanvasRenderingContext2D.cpp:
1741         (WebCore::CanvasRenderingContext2D::setFont):
1742
1743 2019-10-17  Ryosuke Niwa  <rniwa@webkit.org>
1744
1745         Integrate resize event with HTML5 event loop
1746         https://bugs.webkit.org/show_bug.cgi?id=202964
1747
1748         Reviewed by Geoffrey Garen.
1749
1750         Dispatch resize events in "run the resize steps" during the "update the rendering":
1751         https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering
1752
1753         Exisitng code in WebCore which was dispatching or scheduling dispatching of resize events now simply sets
1754         a flag on document and schedules a rendering update. In Page::updateRendering, we fire resize events on
1755         any documents with this flag set.
1756
1757         Test: fast/events/resize-subframe-in-rendering-update.html
1758
1759         * dom/Document.cpp:
1760         (WebCore::Document::setNeedsDOMWindowResizeEvent): Added.
1761         (WebCore::Document::setNeedsVisualViewportResize): Added.
1762         (WebCore::Document::runResizeSteps): Added. https://drafts.csswg.org/cssom-view/#run-the-resize-steps
1763         * dom/Document.h:
1764         * page/DOMWindow.cpp:
1765         (WebCore::DOMWindow::resizeTo const):
1766         * page/FrameView.cpp:
1767         (WebCore::FrameView::sendResizeEventIfNeeded): Now sets m_needsDOMWindowResizeEvent on Document instead of
1768         enqueuing a resize event.
1769         * page/Page.cpp:
1770         (WebCore::Page::updateRendering): Call runResizeSteps on each document.
1771         (WebCore::Page::collectDocuments): Added.
1772         * page/Page.h:
1773         * page/VisualViewport.cpp:
1774         (WebCore::VisualViewport::enqueueResizeEvent):
1775
1776 2019-10-17  Chris Dumez  <cdumez@apple.com>
1777
1778         Unreviewed, rolling out r251255.
1779
1780         This is causing the existing back/forward tests to be flaky
1781
1782         Reverted changeset:
1783
1784         "Don't put pages that have not reached the non-visually empty
1785         layout milestone in the back/forward cache"
1786         https://bugs.webkit.org/show_bug.cgi?id=203108
1787         https://trac.webkit.org/changeset/251255
1788
1789 2019-10-17  Mark Lam  <mark.lam@apple.com>
1790
1791         Use constexpr in more places and remove some unnecessary external linkage.
1792         https://bugs.webkit.org/show_bug.cgi?id=203115
1793
1794         Reviewed by Yusuke Suzuki.
1795
1796         No new tests because this patch adds no new functionality.
1797
1798         * html/track/TextTrackCueGeneric.cpp:
1799         * html/track/VTTCue.cpp:
1800         * page/EventHandler.cpp:
1801         (WebCore::SyntheticTouchPoint::SyntheticTouchPoint):
1802         * page/FrameTree.h:
1803         * page/scrolling/ScrollingMomentumCalculator.cpp:
1804         (WebCore::projectedInertialScrollDistance):
1805         * platform/graphics/FontTaggedSettings.h:
1806         * platform/graphics/Region.cpp:
1807         * platform/graphics/filters/FELighting.cpp:
1808         * rendering/TableLayout.h:
1809         * rendering/svg/SVGRenderingContext.h:
1810
1811 2019-10-17  Simon Fraser  <simon.fraser@apple.com>
1812
1813         [ Mojave+ ] Layout Test compositing/fixed-with-main-thread-scrolling.html is a flaky timeout
1814         https://bugs.webkit.org/show_bug.cgi?id=198757
1815
1816         Reviewed by Tim Horton.
1817         
1818         WheelEventTestMonitor depends on "deferral reasons" getting added and removed, such that there is always
1819         at least one reason active until scrolling quiesces.
1820
1821         WheelEventTestMonitor made the incorrect assumption that every call into ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent()
1822         would result in a scroll change making it to the main thread, so it would defer "ScrollingThreadSyncNeeded" there,
1823         and rely on AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll() to remove that deferral reason.
1824         That assumption is wrong, because wheel events may coalesce, or have no impact on scroll position if already scrolled
1825         to the max/min extent (e.g. when rubber banding).
1826         
1827         Fix by adding a new "HandlingWheelEvent" deferral reason for the duration that the scrolling thread is processing an wheel event,
1828         and then having ScrollingThreadSyncNeeded just represent the phase where any resulting scroll is being sent to the UI process.
1829         These phases should always overlap.
1830         
1831         This required moving isMonitoringWheelEvents() from the root scrolling node to the ScrollingTree.
1832
1833         * page/WheelEventTestMonitor.cpp:
1834         (WebCore::operator<<):
1835         * page/WheelEventTestMonitor.h:
1836         * page/scrolling/AsyncScrollingCoordinator.cpp:
1837         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1838         * page/scrolling/ScrollingTree.cpp:
1839         (WebCore::ScrollingTree::commitTreeState):
1840         * page/scrolling/ScrollingTree.h:
1841         (WebCore::ScrollingTree::isMonitoringWheelEvents const):
1842         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1843         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1844         * page/scrolling/ScrollingTreeScrollingNode.h:
1845         * page/scrolling/ThreadedScrollingTree.cpp:
1846         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1847         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1848         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
1849         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
1850         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
1851
1852 2019-10-17  Ryosuke Niwa  <rniwa@webkit.org>
1853
1854         Make requestIdleCallback suspendable
1855         https://bugs.webkit.org/show_bug.cgi?id=203023
1856
1857         Reviewed by Chris Dumez.
1858
1859         Make requestIdleCallback suspendable by making WindowEventLoop itself suspendable.
1860         Because WindowEventLoop can be shared across documents, we don't want to make it an ActiveDOMObject.
1861
1862         Instead, we would make CachedFrameBase::restore and CachedFrame manually invoke suspend & resume.
1863
1864         Test: requestidlecallback/requestidlecallback-in-page-cache.html
1865
1866         * dom/Document.h:
1867         (WebCore::Document::eventLoopIfExists): Added. This should probably go away once most of the event loop
1868         is implemented since we're almost always going to have this object then.
1869         * dom/WindowEventLoop.cpp:
1870         (WebCore::WindowEventLoop::queueTask): Because m_tasks may contain tasks of suspended documents,
1871         we check m_activeTaskCount, which is only positive when there is a task for non-suspended documents,
1872         to decide whether we schedule a callback or not.
1873         (WebCore::WindowEventLoop::suspend): Added. No-op for now.
1874         (WebCore::WindowEventLoop::resume): Added. Schedule a callback if there is a task associated with
1875         this document.
1876         (WebCore::WindowEventLoop::run): Skip a task for a suspended document, and add it back to m_tasks along
1877         with other tasks that got scheduled by running the current working set of tasks.
1878         * dom/WindowEventLoop.h:
1879         * history/CachedFrame.cpp:
1880         (WebCore::CachedFrameBase::restore):
1881         (WebCore::CachedFrame::CachedFrame):
1882
1883 2019-10-17  Chris Dumez  <cdumez@apple.com>
1884
1885         Don't put pages that have not reached the non-visually empty layout milestone in the back/forward cache
1886         https://bugs.webkit.org/show_bug.cgi?id=203108
1887
1888         Reviewed by Geoffrey Garen.
1889
1890         We don't want to go back to a visually empty page on back/forward navigation.
1891
1892         * history/BackForwardCache.cpp:
1893         (WebCore::canCacheFrame):
1894         * page/DiagnosticLoggingKeys.cpp:
1895         (WebCore::DiagnosticLoggingKeys::visuallyEmptyKey):
1896         * page/DiagnosticLoggingKeys.h:
1897
1898 2019-10-17  Dirk Schulze  <krit@webkit.org>
1899
1900         transform-box: content-box, stroke-box missing
1901         https://bugs.webkit.org/show_bug.cgi?id=201892
1902
1903         Reviewed by Simon Fraser.
1904
1905         Added the keywords content-box and stroke-box to the
1906         transform-box CSS property.
1907         Those keywords were added to the spec after the implementation
1908         in WebKit.
1909
1910         Test: transforms/transform-box.html
1911
1912         * css/CSSPrimitiveValueMappings.h:
1913         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1914         (WebCore::CSSPrimitiveValue::operator TransformBox const):
1915         * css/CSSProperties.json:
1916         * css/CSSValueKeywords.in:
1917         * css/parser/CSSPropertyParser.cpp:
1918         (WebCore::CSSPropertyParser::parseSingleValue):
1919         * rendering/RenderLayer.cpp:
1920         (WebCore::computeReferenceBox):
1921         (WebCore::transformBoxToCSSBoxType):
1922         (WebCore::RenderLayer::currentTransform const):
1923         * rendering/style/RenderStyleConstants.h:
1924         * svg/SVGGraphicsElement.cpp:
1925         (WebCore::SVGGraphicsElement::animatedLocalTransform const):
1926
1927 2019-10-17  Youenn Fablet  <youenn@apple.com>
1928
1929         SincResampler does not need to create a new AudioBus for each consumeSource call
1930         https://bugs.webkit.org/show_bug.cgi?id=202983
1931
1932         Reviewed by Eric Carlson.
1933
1934         Allocate an internal AudioBus once and for all.
1935         No observable change of behavior.
1936
1937         * platform/audio/SincResampler.cpp:
1938         (WebCore::SincResampler::consumeSource):
1939         * platform/audio/SincResampler.h:
1940
1941 2019-10-17  Chris Dumez  <cdumez@apple.com>
1942
1943         Deprecate ActiveDOMObject::canSuspendForDocumentSuspension()
1944         https://bugs.webkit.org/show_bug.cgi?id=203086
1945
1946         Reviewed by Geoffrey Garen.
1947
1948         Rename ActiveDOMObject::canSuspendForDocumentSuspension() to shouldPreventEnteringBackForwardCache_DEPRECATED()
1949         to make it clear that no new overrides should be added and that it is no longer OK to prevent the page from
1950         entering the back/forward cache. Also provide a default implementation that returns false so that well-behaved
1951         classes no longer need to override this.
1952
1953         * Modules/applepay/ApplePaySession.cpp:
1954         (WebCore::ApplePaySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1955         (WebCore::ApplePaySession::canSuspendForDocumentSuspension const): Deleted.
1956         * Modules/applepay/ApplePaySession.h:
1957         * Modules/cache/DOMCache.cpp:
1958         (WebCore::DOMCache::canSuspendForDocumentSuspension const): Deleted.
1959         * Modules/cache/DOMCache.h:
1960         * Modules/cache/DOMCacheStorage.cpp:
1961         (WebCore::DOMCacheStorage::canSuspendForDocumentSuspension const): Deleted.
1962         * Modules/cache/DOMCacheStorage.h:
1963         * Modules/encryptedmedia/MediaKeySession.cpp:
1964         (WebCore::MediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1965         (WebCore::MediaKeySession::canSuspendForDocumentSuspension const): Deleted.
1966         * Modules/encryptedmedia/MediaKeySession.h:
1967         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1968         (WebCore::WebKitMediaKeySession::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1969         (WebCore::WebKitMediaKeySession::canSuspendForDocumentSuspension const): Deleted.
1970         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1971         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
1972         (WebCore::FileSystemDirectoryReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1973         (WebCore::FileSystemDirectoryReader::canSuspendForDocumentSuspension const): Deleted.
1974         * Modules/entriesapi/FileSystemDirectoryReader.h:
1975         * Modules/entriesapi/FileSystemEntry.cpp:
1976         (WebCore::FileSystemEntry::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1977         (WebCore::FileSystemEntry::canSuspendForDocumentSuspension const): Deleted.
1978         * Modules/entriesapi/FileSystemEntry.h:
1979         * Modules/fetch/FetchRequest.cpp:
1980         (WebCore::FetchRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1981         (WebCore::FetchRequest::canSuspendForDocumentSuspension const): Deleted.
1982         * Modules/fetch/FetchRequest.h:
1983         * Modules/fetch/FetchResponse.cpp:
1984         (WebCore::FetchResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
1985         (WebCore::FetchResponse::canSuspendForDocumentSuspension const): Deleted.
1986         * Modules/fetch/FetchResponse.h:
1987         * Modules/geolocation/Geolocation.cpp:
1988         (WebCore::Geolocation::page const):
1989         (WebCore::Geolocation::canSuspendForDocumentSuspension const): Deleted.
1990         * Modules/geolocation/Geolocation.h:
1991         * Modules/indexeddb/IDBDatabase.cpp:
1992         (WebCore::IDBDatabase::canSuspendForDocumentSuspension const): Deleted.
1993         * Modules/indexeddb/IDBDatabase.h:
1994         * Modules/indexeddb/IDBIndex.cpp:
1995         (WebCore::IDBIndex::canSuspendForDocumentSuspension const): Deleted.
1996         * Modules/indexeddb/IDBIndex.h:
1997         * Modules/indexeddb/IDBObjectStore.cpp:
1998         (WebCore::IDBObjectStore::canSuspendForDocumentSuspension const): Deleted.
1999         * Modules/indexeddb/IDBObjectStore.h:
2000         * Modules/indexeddb/IDBRequest.cpp:
2001         (WebCore::IDBRequest::canSuspendForDocumentSuspension const): Deleted.
2002         * Modules/indexeddb/IDBRequest.h:
2003         * Modules/indexeddb/IDBTransaction.cpp:
2004         (WebCore::IDBTransaction::canSuspendForDocumentSuspension const): Deleted.
2005         * Modules/indexeddb/IDBTransaction.h:
2006         * Modules/mediarecorder/MediaRecorder.cpp:
2007         (WebCore::MediaRecorder::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2008         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const): Deleted.
2009         * Modules/mediarecorder/MediaRecorder.h:
2010         * Modules/mediasource/MediaSource.cpp:
2011         (WebCore::MediaSource::canSuspendForDocumentSuspension const): Deleted.
2012         * Modules/mediasource/MediaSource.h:
2013         * Modules/mediasource/SourceBuffer.cpp:
2014         (WebCore::SourceBuffer::canSuspendForDocumentSuspension const): Deleted.
2015         * Modules/mediasource/SourceBuffer.h:
2016         * Modules/mediasource/SourceBufferList.cpp:
2017         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Deleted.
2018         * Modules/mediasource/SourceBufferList.h:
2019         * Modules/mediastream/MediaDevices.cpp:
2020         (WebCore::MediaDevices::canSuspendForDocumentSuspension const): Deleted.
2021         * Modules/mediastream/MediaDevices.h:
2022         * Modules/mediastream/MediaStream.cpp:
2023         (WebCore::MediaStream::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2024         (WebCore::MediaStream::canSuspendForDocumentSuspension const): Deleted.
2025         * Modules/mediastream/MediaStream.h:
2026         * Modules/mediastream/MediaStreamTrack.cpp:
2027         (WebCore::MediaStreamTrack::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2028         (WebCore::MediaStreamTrack::canSuspendForDocumentSuspension const): Deleted.
2029         * Modules/mediastream/MediaStreamTrack.h:
2030         * Modules/mediastream/RTCDTMFSender.cpp:
2031         (WebCore::RTCDTMFSender::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2032         (WebCore::RTCDTMFSender::canSuspendForDocumentSuspension const): Deleted.
2033         * Modules/mediastream/RTCDTMFSender.h:
2034         * Modules/mediastream/RTCDataChannel.h:
2035         * Modules/mediastream/RTCPeerConnection.cpp:
2036         (WebCore::RTCPeerConnection::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2037         (WebCore::RTCPeerConnection::canSuspendForDocumentSuspension const): Deleted.
2038         * Modules/mediastream/RTCPeerConnection.h:
2039         * Modules/mediastream/UserMediaRequest.cpp:
2040         (WebCore::UserMediaRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2041         (WebCore::UserMediaRequest::canSuspendForDocumentSuspension const): Deleted.
2042         * Modules/mediastream/UserMediaRequest.h:
2043         * Modules/notifications/Notification.cpp:
2044         (WebCore::Notification::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2045         (WebCore::Notification::canSuspendForDocumentSuspension const): Deleted.
2046         * Modules/notifications/Notification.h:
2047         * Modules/paymentrequest/PaymentRequest.cpp:
2048         (WebCore::PaymentRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2049         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): Deleted.
2050         * Modules/paymentrequest/PaymentRequest.h:
2051         * Modules/paymentrequest/PaymentResponse.cpp:
2052         (WebCore::PaymentResponse::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2053         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Deleted.
2054         * Modules/paymentrequest/PaymentResponse.h:
2055         * Modules/pictureinpicture/PictureInPictureWindow.cpp:
2056         (WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const): Deleted.
2057         * Modules/pictureinpicture/PictureInPictureWindow.h:
2058         * Modules/webaudio/AudioContext.cpp:
2059         (WebCore::AudioContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2060         (WebCore::AudioContext::canSuspendForDocumentSuspension const): Deleted.
2061         * Modules/webaudio/AudioContext.h:
2062         * Modules/webdatabase/DatabaseContext.cpp:
2063         (WebCore::DatabaseContext::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2064         (WebCore::DatabaseContext::canSuspendForDocumentSuspension const): Deleted.
2065         * Modules/webdatabase/DatabaseContext.h:
2066         * Modules/webgpu/GPUCanvasContext.h:
2067         * Modules/websockets/WebSocket.cpp:
2068         (WebCore::WebSocket::canSuspendForDocumentSuspension const): Deleted.
2069         * Modules/websockets/WebSocket.h:
2070         * Modules/webvr/VRDisplay.cpp:
2071         (WebCore::VRDisplay::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2072         (WebCore::VRDisplay::canSuspendForDocumentSuspension const): Deleted.
2073         * Modules/webvr/VRDisplay.h:
2074         * animation/WebAnimation.cpp:
2075         (WebCore::WebAnimation::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2076         (WebCore::WebAnimation::canSuspendForDocumentSuspension const): Deleted.
2077         * animation/WebAnimation.h:
2078         * css/FontFaceSet.cpp:
2079         (WebCore::FontFaceSet::canSuspendForDocumentSuspension const): Deleted.
2080         * css/FontFaceSet.h:
2081         * dom/ActiveDOMObject.h:
2082         * dom/GenericEventQueue.cpp:
2083         (WebCore::GenericEventQueueBase<T>::canSuspendForDocumentSuspension const): Deleted.
2084         * dom/GenericEventQueue.h:
2085         * dom/MessagePort.cpp:
2086         (WebCore::MessagePort::canSuspendForDocumentSuspension const): Deleted.
2087         * dom/MessagePort.h:
2088         * dom/ScriptExecutionContext.cpp:
2089         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
2090         * fileapi/FileReader.cpp:
2091         (WebCore::FileReader::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2092         (WebCore::FileReader::canSuspendForDocumentSuspension const): Deleted.
2093         * fileapi/FileReader.h:
2094         * html/HTMLMarqueeElement.cpp:
2095         (WebCore::HTMLMarqueeElement::canSuspendForDocumentSuspension const): Deleted.
2096         * html/HTMLMarqueeElement.h:
2097         * html/HTMLMediaElement.cpp:
2098         (WebCore::HTMLMediaElement::canSuspendForDocumentSuspension const): Deleted.
2099         * html/HTMLMediaElement.h:
2100         * html/HTMLSourceElement.cpp:
2101         (WebCore::HTMLSourceElement::canSuspendForDocumentSuspension const): Deleted.
2102         * html/HTMLSourceElement.h:
2103         * html/ImageBitmap.cpp:
2104         * html/PublicURLManager.cpp:
2105         (WebCore::PublicURLManager::canSuspendForDocumentSuspension const): Deleted.
2106         * html/PublicURLManager.h:
2107         * html/canvas/WebGLRenderingContextBase.cpp:
2108         (WebCore::WebGLRenderingContextBase::canSuspendForDocumentSuspension const): Deleted.
2109         * html/canvas/WebGLRenderingContextBase.h:
2110         * html/track/TrackListBase.cpp:
2111         (WebCore::TrackListBase::canSuspendForDocumentSuspension const): Deleted.
2112         * html/track/TrackListBase.h:
2113         * page/EventSource.cpp:
2114         (WebCore::EventSource::canSuspendForDocumentSuspension const): Deleted.
2115         * page/EventSource.h:
2116         * page/IntersectionObserver.cpp:
2117         (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const): Deleted.
2118         * page/IntersectionObserver.h:
2119         * page/ResizeObserver.cpp:
2120         (WebCore::ResizeObserver::canSuspendForDocumentSuspension const): Deleted.
2121         * page/ResizeObserver.h:
2122         * page/SuspendableTimer.cpp:
2123         (WebCore::SuspendableTimerBase::canSuspendForDocumentSuspension const): Deleted.
2124         * page/SuspendableTimer.h:
2125         * platform/SuspendableTaskQueue.cpp:
2126         (WebCore::SuspendableTaskQueue::canSuspendForDocumentSuspension const): Deleted.
2127         * platform/SuspendableTaskQueue.h:
2128         * testing/Internals.cpp:
2129         * workers/Worker.cpp:
2130         (WebCore::Worker::canSuspendForDocumentSuspension const): Deleted.
2131         * workers/Worker.h:
2132         * workers/service/ServiceWorker.cpp:
2133         (WebCore::ServiceWorker::canSuspendForDocumentSuspension const): Deleted.
2134         * workers/service/ServiceWorker.h:
2135         * workers/service/ServiceWorkerContainer.cpp:
2136         (WebCore::ServiceWorkerContainer::canSuspendForDocumentSuspension const): Deleted.
2137         * workers/service/ServiceWorkerContainer.h:
2138         * workers/service/ServiceWorkerRegistration.cpp:
2139         (WebCore::ServiceWorkerRegistration::canSuspendForDocumentSuspension const): Deleted.
2140         * workers/service/ServiceWorkerRegistration.h:
2141         * xml/XMLHttpRequest.cpp:
2142         (WebCore::XMLHttpRequest::shouldPreventEnteringBackForwardCache_DEPRECATED const):
2143         (WebCore::XMLHttpRequest::canSuspendForDocumentSuspension const): Deleted.
2144         * xml/XMLHttpRequest.h:
2145
2146 2019-10-17  Zalan Bujtas  <zalan@apple.com>
2147
2148         [LFC][TFC] Table formatting context accesses geometry information from parent BFC
2149         https://bugs.webkit.org/show_bug.cgi?id=203082
2150         <rdar://problem/56370827>
2151
2152         Reviewed by Antti Koivisto.
2153
2154         Tables are wrapped in a 2 level formatting context structure. A <table> element initiates a block formatting context for its principal table box
2155         where the caption and the table content live. It also initiates a table wrapper box which establishes the table formatting context.
2156         In many cases the TFC needs access to the parent (generated) BFC.
2157
2158         * layout/FormattingContext.cpp:
2159         (WebCore::Layout::FormattingContext::geometryForBox const):
2160         * layout/FormattingContext.h:
2161         * layout/tableformatting/TableFormattingContext.cpp:
2162         (WebCore::Layout::TableFormattingContext::computedTableWidth):
2163
2164 2019-10-17  Zalan Bujtas  <zalan@apple.com>
2165
2166         [LFC][Painting] Add support for image/background image painting
2167         https://bugs.webkit.org/show_bug.cgi?id=203054
2168         <rdar://problem/56347733>
2169
2170         Reviewed by Antti Koivisto.
2171
2172         In addition to image rendering, this patch also addresses various run/decoration painting issues.
2173
2174         * layout/displaytree/DisplayPainter.cpp:
2175         (WebCore::Display::paintBoxDecoration):
2176         (WebCore::Display::paintInlineContent):
2177         (WebCore::Display::absoluteDisplayBox):
2178         (WebCore::Display::paintBoxDecorationAndChildren):
2179         (WebCore::Display::Painter::paint):
2180         * layout/displaytree/DisplayRun.h:
2181         (WebCore::Display::Run::setImage):
2182         (WebCore::Display::Run::image const):
2183         * layout/inlineformatting/InlineLine.cpp:
2184         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2185         (WebCore::Layout::Line::appendReplacedInlineBox):
2186         * layout/layouttree/LayoutReplaced.h:
2187         (WebCore::Layout::Replaced::setCachedImage):
2188         (WebCore::Layout::Replaced::cachedImage const):
2189         * layout/layouttree/LayoutTreeBuilder.cpp:
2190         (WebCore::Layout::TreeBuilder::createLayoutBox):
2191
2192 2019-10-17  Zalan Bujtas  <zalan@apple.com>
2193
2194         [LFC][IFC] Add Display::Run/LineBox mapping
2195         https://bugs.webkit.org/show_bug.cgi?id=203051
2196         <rdar://problem/56342487>
2197
2198         Reviewed by Antti Koivisto.
2199
2200         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.
2201
2202         * layout/FormattingContextGeometry.cpp:
2203         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
2204         * layout/Verification.cpp:
2205         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2206         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2207         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2208         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2209         * layout/displaytree/DisplayPainter.cpp:
2210         (WebCore::Display::paintInlineContent):
2211         * layout/inlineformatting/InlineFormattingContext.cpp:
2212         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
2213         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
2214         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
2215         * layout/inlineformatting/InlineFormattingState.h:
2216         (WebCore::Layout::InlineFormattingState::addLineBox):
2217         (WebCore::Layout::InlineFormattingState::lineBoxForRun const):
2218         (WebCore::Layout::InlineFormattingState::addInlineRun):
2219         * layout/inlineformatting/InlineLine.cpp:
2220         (WebCore::Layout::Line::Run::Run):
2221         (WebCore::Layout::Line::alignContentVertically):
2222         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2223         * layout/inlineformatting/InlineLine.h:
2224         (WebCore::Layout::Line::Run::displayRun const):
2225         (WebCore::Layout::Line::Run::logicalRect const):
2226         (WebCore::Layout::Line::Run::adjustLogicalTop):
2227         (WebCore::Layout::Line::Run::moveVertically):
2228         (WebCore::Layout::Line::Run::moveHorizontally):
2229         (WebCore::Layout::Line::Run::expand):
2230         * layout/inlineformatting/InlineLineBox.h:
2231         * layout/inlineformatting/InlineLineLayout.h:
2232         * layout/layouttree/LayoutTreeBuilder.cpp:
2233         (WebCore::Layout::outputInlineRuns):
2234
2235 2019-10-17  Antoine Quint  <graouts@apple.com>
2236
2237         [Web Animations] Enable the Web Animations JavaScript API by default
2238         https://bugs.webkit.org/show_bug.cgi?id=203075
2239
2240         Reviewed by Antti Koivisto.
2241
2242         * page/RuntimeEnabledFeatures.h:
2243
2244 2019-10-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2245
2246         Unreviewed, fix watchOS and tvOS builds after r251224
2247
2248         * platform/ios/PlatformPasteboardIOS.mm:
2249         (WebCore::shouldTreatAtLeastOneTypeAsFile):
2250
2251         Move the `shouldTreatAtLeastOneTypeAsFile` helper function out of the `PASTEBOARD_SUPPORTS_ITEM_PROVIDERS`
2252         section, and into generic iOS-family code so that it can be used in `pasteboardMayContainFilePaths`.
2253
2254 2019-10-17  Youenn Fablet  <youenn@apple.com>
2255
2256         MultiChannelResampler does not need to recreate a ChannelProvider for every process call
2257         https://bugs.webkit.org/show_bug.cgi?id=202982
2258
2259         Reviewed by Eric Carlson.
2260
2261         We no longer allocate a new ChannelProvider for every process call.
2262         No observable change of behavior.
2263
2264         * platform/audio/MultiChannelResampler.cpp:
2265         (WebCore::MultiChannelResampler::ChannelProvider::ChannelProvider):
2266         (WebCore::MultiChannelResampler::ChannelProvider::setProvider):
2267         (WebCore::MultiChannelResampler::MultiChannelResampler):
2268         (WebCore::MultiChannelResampler::process):
2269         * platform/audio/MultiChannelResampler.h:
2270
2271 2019-10-17  Devin Rousso  <drousso@apple.com>
2272
2273         Web Inspector: rework frontend agent construction to allow commands/events to be controlled by the related target's type
2274         https://bugs.webkit.org/show_bug.cgi?id=200384
2275         <rdar://problem/53850352>
2276
2277         Reviewed by Joseph Pecoraro.
2278
2279         * inspector/InspectorFrontendClient.h:
2280         (WebCore::InspectorFrontendClient::backendCommandsURL): Deleted.
2281         (WebCore::InspectorFrontendClient::debuggableType): Deleted.
2282         * inspector/InspectorFrontendClientLocal.h:
2283         * page/PageDebuggable.h:
2284         (WebCore::PageDebuggable::type const):
2285         * testing/Internals.cpp:
2286         (WebCore::InspectorStubFrontend::debuggableType const): Added.
2287         Split the `Web` debuggable type into `Page` (WebCore::Page) and `WebPage` (WebKit::WebPageProxy).
2288
2289 2019-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2290
2291         [Clipboard API] [iOS] Refactor logic for suppressing URL data when the pasteboard may contain files
2292         https://bugs.webkit.org/show_bug.cgi?id=203065
2293
2294         Reviewed by Tim Horton.
2295
2296         Platform-specific pasteboard refactoring before tackling webkit.org/b/203021. See below for details. No new
2297         tests, as there is no change in behavior.
2298
2299         * platform/Pasteboard.h:
2300         (WebCore::Pasteboard::changeCount const):
2301
2302         Add a stub for Pasteboard::changeCount() on non-Cocoa platforms.
2303
2304         * platform/ios/PlatformPasteboardIOS.mm:
2305         (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
2306
2307         Move this helper function farther up the file, so it can be used in more places.
2308
2309         (WebCore::webSafeTypes):
2310
2311         Add a separate helper to compute the list of web-safe MIME types (for instance, "text/plain") given a list of
2312         platform types, and a function to determine whether to avoid exposing a given URL to the DOM.
2313
2314         (WebCore::shouldTreatAtLeastOneTypeAsFile):
2315
2316         Split this out into a separate helper function, so that it can be invoked when determining whether a given
2317         NSItemProvider is suspected to contain file paths. In the case where we're getting the full list of types that
2318         are safe for the DOM to read, we want to pass in the entire pasteboard object and iterate through all of the
2319         available types in search for something that could feasibly accompany a file URL.
2320
2321         In the case of computing the web-safe types per item, we only have an item provider, in which case we only
2322         iterate through the types in that NSItemProvider. See call sites below for examples.
2323
2324         (WebCore::PlatformPasteboard::informationForItemAtIndex):
2325
2326         Invoke the new `webSafeTypes` helper method.
2327
2328         (WebCore::pasteboardMayContainFilePaths):
2329         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
2330
2331         Invoke the new `webSafeTypes` helper method.
2332
2333 2019-10-16  Brent Fulgham  <bfulgham@apple.com>
2334
2335         [FTW] Correct radial gradient handling of various radius orderings
2336         https://bugs.webkit.org/show_bug.cgi?id=202815
2337
2338         Reviewed by Per Arne Vollan.
2339
2340         Revise the 'generateGradient' implementation to recognize that the
2341         radius arguments might not be in increasing order. Direct2D's
2342         implementation does expect this, so we need to swap order and
2343         revise the gradient range to match.
2344
2345         Drive-by fix: Stop building unused image decoders if building with
2346         the Apple stack.
2347
2348         * PlatformFTW.cmake: Stop building unused image decoders.
2349         * platform/graphics/win/GradientDirect2D.cpp:
2350         (WebCore::Gradient::generateGradient):
2351
2352 2019-10-16  Chris Dumez  <cdumez@apple.com>
2353
2354         Rename PageCache to BackForwardCache
2355         https://bugs.webkit.org/show_bug.cgi?id=203048
2356
2357         Reviewed by Alex Christensen.
2358
2359         Rename PageCache to BackForwardCache for clarity and consistency with the UIProcess's WebBackForwardCache.
2360
2361         * Modules/geolocation/Geolocation.cpp:
2362         (WebCore::Geolocation::suspend):
2363         * Modules/mediarecorder/MediaRecorder.cpp:
2364         (WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
2365         * Modules/mediastream/RTCPeerConnection.cpp:
2366         (WebCore::RTCPeerConnection::suspend):
2367         * Modules/websockets/WebSocket.cpp:
2368         (WebCore::WebSocket::suspend):
2369         * Sources.txt:
2370         * WebCore.xcodeproj/project.pbxproj:
2371         * animation/WebAnimation.cpp:
2372         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
2373         * bindings/js/WindowProxy.cpp:
2374         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
2375         * bindings/js/WindowProxy.h:
2376         * dom/ActiveDOMObject.h:
2377         * dom/Document.cpp:
2378         (WebCore::Document::~Document):
2379         (WebCore::Document::scheduleStyleRecalc):
2380         (WebCore::Document::needsStyleRecalc const):
2381         (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
2382         (WebCore::Document::createRenderTree):
2383         (WebCore::Document::didBecomeCurrentDocumentInFrame):
2384         (WebCore::Document::attachToCachedFrame):
2385         (WebCore::Document::detachFromCachedFrame):
2386         (WebCore::Document::prepareForDestruction):
2387         (WebCore::Document::adjustFocusedNodeOnNodeRemoval):
2388         (WebCore::Document::setFocusedElement):
2389         (WebCore::Document::takeDOMWindowFrom):
2390         (WebCore::Document::setBackForwardCacheState):
2391         (WebCore::Document::suspend):
2392         (WebCore::Document::resume):
2393         (WebCore::Document::topDocument const):
2394         * dom/Document.h:
2395         (WebCore::Document::backForwardCacheState const):
2396         * dom/FullscreenManager.cpp:
2397         (WebCore::FullscreenManager::willEnterFullscreen):
2398         (WebCore::FullscreenManager::didEnterFullscreen):
2399         (WebCore::FullscreenManager::willExitFullscreen):
2400         (WebCore::FullscreenManager::didExitFullscreen):
2401         * dom/FullscreenManager.h:
2402         * dom/ScriptExecutionContext.cpp:
2403         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2404         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2405         * history/BackForwardCache.cpp: Renamed from Source/WebCore/history/PageCache.cpp.
2406         (WebCore::logBackForwardCacheFailureDiagnosticMessage):
2407         (WebCore::canCacheFrame):
2408         (WebCore::canCachePage):
2409         (WebCore::BackForwardCache::singleton):
2410         (WebCore::BackForwardCache::BackForwardCache):
2411         (WebCore::BackForwardCache::dump const):
2412         (WebCore::BackForwardCache::canCache const):
2413         (WebCore::BackForwardCache::pruneToSizeNow):
2414         (WebCore::BackForwardCache::setMaxSize):
2415         (WebCore::BackForwardCache::frameCount const):
2416         (WebCore::BackForwardCache::markPagesForDeviceOrPageScaleChanged):
2417         (WebCore::BackForwardCache::markPagesForContentsSizeChanged):
2418         (WebCore::BackForwardCache::markPagesForCaptionPreferencesChanged):
2419         (WebCore::setBackForwardCacheState):
2420         (WebCore::BackForwardCache::addIfCacheable):
2421         (WebCore::BackForwardCache::take):
2422         (WebCore::BackForwardCache::removeAllItemsForPage):
2423         (WebCore::BackForwardCache::get):
2424         (WebCore::BackForwardCache::remove):
2425         (WebCore::BackForwardCache::prune):
2426         * history/BackForwardCache.h: Renamed from Source/WebCore/history/PageCache.h.
2427         * history/CachedFrame.cpp:
2428         (WebCore::CachedFrameBase::restore):
2429         (WebCore::CachedFrame::CachedFrame):
2430         (WebCore::CachedFrame::clear):
2431         (WebCore::CachedFrame::destroy):
2432         * history/CachedFramePlatformData.h:
2433         * history/HistoryItem.cpp:
2434         (WebCore::HistoryItem::setCachedPage):
2435         (WebCore::HistoryItem::setURL):
2436         * history/HistoryItem.h:
2437         (WebCore::HistoryItem::isInBackForwardCache const):
2438         * html/HTMLMediaElement.cpp:
2439         (WebCore::HTMLMediaElement::suspend):
2440         (WebCore::HTMLMediaElement::resume):
2441         * html/HTMLPlugInImageElement.cpp:
2442         (WebCore::HTMLPlugInImageElement::createElementRenderer):
2443         * html/HTMLSourceElement.cpp:
2444         (WebCore::HTMLSourceElement::suspend):
2445         * html/MediaElementSession.cpp:
2446         (WebCore::MediaElementSession::autoplayPermitted const):
2447         * loader/DocumentLoader.cpp:
2448         (WebCore::DocumentLoader::addSubresourceLoader):
2449         * loader/DocumentLoader.h:
2450         * loader/EmptyFrameLoaderClient.h:
2451         * loader/FrameLoader.cpp:
2452         (WebCore::FrameLoader::closeURL):
2453         (WebCore::FrameLoader::clear):
2454         (WebCore::FrameLoader::stopAllLoaders):
2455         (WebCore::FrameLoader::stopForBackForwardCache):
2456         (WebCore::FrameLoader::commitProvisionalLoad):
2457         (WebCore::FrameLoader::open):
2458         (WebCore::FrameLoader::frameDetached):
2459         (WebCore::FrameLoader::detachFromParent):
2460         (WebCore::FrameLoader::receivedMainResourceError):
2461         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
2462         (WebCore::FrameLoader::dispatchUnloadEvents):
2463         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2464         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
2465         (WebCore::FrameLoader::loadDifferentDocumentItem):
2466         * loader/FrameLoader.h:
2467         * loader/FrameLoaderClient.h:
2468         * loader/HistoryController.cpp:
2469         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
2470         (WebCore::HistoryController::restoreScrollPositionAndViewState):
2471         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
2472         (WebCore::HistoryController::updateForReload):
2473         * loader/appcache/ApplicationCacheHost.cpp:
2474         (WebCore::ApplicationCacheHost::canCacheInBackForwardCache):
2475         * loader/appcache/ApplicationCacheHost.h:
2476         * loader/cache/CachedResource.cpp:
2477         (WebCore::CachedResource::load):
2478         * page/DOMWindow.cpp:
2479         (WebCore::DOMWindow::suspendForBackForwardCache):
2480         (WebCore::DOMWindow::resumeFromBackForwardCache):
2481         (WebCore::DOMWindow::decrementScrollEventListenersCount):
2482         * page/DOMWindow.h:
2483         * page/DOMWindowExtension.cpp:
2484         (WebCore::DOMWindowExtension::suspendForBackForwardCache):
2485         (WebCore::DOMWindowExtension::resumeFromBackForwardCache):
2486         * page/DOMWindowExtension.h:
2487         * page/DiagnosticLoggingKeys.cpp:
2488         (WebCore::DiagnosticLoggingKeys::backForwardCacheKey):
2489         (WebCore::DiagnosticLoggingKeys::backForwardCacheFailureKey):
2490         * page/DiagnosticLoggingKeys.h:
2491         * page/EventSource.cpp:
2492         (WebCore::EventSource::scheduleReconnect):
2493         (WebCore::EventSource::didReceiveResponse):
2494         (WebCore::EventSource::didReceiveData):
2495         (WebCore::EventSource::didFinishLoading):
2496         (WebCore::EventSource::didFail):
2497         (WebCore::EventSource::abortConnectionAttempt):
2498         (WebCore::EventSource::suspend):
2499         (WebCore::EventSource::resume):
2500         (WebCore::EventSource::dispatchMessageEvent):
2501         * page/EventSource.h:
2502         * page/Frame.cpp:
2503         (WebCore::Frame::setView):
2504         (WebCore::Frame::setDocument):
2505         (WebCore::Frame::willDetachPage):
2506         * page/FrameView.cpp:
2507         (WebCore::FrameView::didRestoreFromBackForwardCache):
2508         (WebCore::FrameView::setContentsSize):
2509         * page/FrameView.h:
2510         * page/FrameViewLayoutContext.cpp:
2511         (WebCore::FrameViewLayoutContext::layout):
2512         (WebCore::FrameViewLayoutContext::scheduleLayout):
2513         * page/MemoryRelease.cpp:
2514         (WebCore::releaseCriticalMemory):
2515         (WebCore::releaseMemory):
2516         * page/MemoryRelease.h:
2517         * page/Page.cpp:
2518         (WebCore::Page::~Page):
2519         (WebCore::Page::setViewScaleFactor):
2520         (WebCore::Page::setDeviceScaleFactor):
2521         * page/Page.h:
2522         * page/PageGroup.cpp:
2523         (WebCore::PageGroup::captionPreferencesChanged):
2524         * page/PerformanceLogging.cpp:
2525         (WebCore::PerformanceLogging::memoryUsageStatistics):
2526         * page/Settings.yaml:
2527         * page/SettingsBase.cpp:
2528         (WebCore::SettingsBase::usesBackForwardCacheChanged):
2529         * page/SettingsBase.h:
2530         * page/animation/AnimationBase.cpp:
2531         (WebCore::AnimationBase::setNeedsStyleRecalc):
2532         * page/animation/CSSAnimationController.cpp:
2533         (WebCore::CSSAnimationControllerPrivate::updateAnimations):
2534         (WebCore::CSSAnimationControllerPrivate::addElementChangeToDispatch):
2535         (WebCore::CSSAnimationController::cancelAnimations):
2536         (WebCore::CSSAnimationController::updateAnimations):
2537         * page/animation/ImplicitAnimation.cpp:
2538         (WebCore::ImplicitAnimation::sendTransitionEvent):
2539         * page/animation/KeyframeAnimation.cpp:
2540         (WebCore::KeyframeAnimation::sendAnimationEvent):
2541         * page/scrolling/AsyncScrollingCoordinator.cpp:
2542         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2543         * platform/mac/ScrollAnimatorMac.mm:
2544         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
2545         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
2546         * rendering/RenderLayerBacking.cpp:
2547         (WebCore::RenderLayerBacking::paintIntoLayer):
2548         * rendering/RenderLayerCompositor.cpp:
2549         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2550         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2551         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2552         * rendering/RenderLayerCompositor.h:
2553         * rendering/RenderObject.h:
2554         * rendering/SimpleLineLayoutCoverage.cpp:
2555         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
2556         * style/StyleTreeResolver.cpp:
2557         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2558         * testing/Internals.cpp:
2559         (WebCore::Internals::clearBackForwardCache):
2560         (WebCore::Internals::backForwardCacheSize const):
2561         (WebCore::Internals::preventDocumentForEnteringBackForwardCache):
2562         * testing/Internals.h:
2563         * testing/Internals.idl:
2564         * xml/XMLHttpRequest.cpp:
2565         (WebCore::XMLHttpRequest::suspend):
2566
2567 2019-10-16  John Wilander  <wilander@apple.com>
2568
2569         Resource Load Statistics (experimental): Block all third-party cookies on websites without prior user interaction
2570         https://bugs.webkit.org/show_bug.cgi?id=203017
2571         <rdar://problem/56262708>
2572
2573         Reviewed by Alex Christensen.
2574
2575         NetworkStorageSession::shouldBlockCookies() now checks if the first-party website has
2576         received user interaction and if not, blocks all third-party cookies, regardless of the
2577         status of those third-party domains (prevalent or not).
2578
2579         Bundled cleanup task: Remove the two month old feature flag for NSURLSession switching.
2580
2581         Tests: http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction-database.html
2582                http/tests/resourceLoadStatistics/third-party-cookie-blocking-on-sites-without-user-interaction.html
2583
2584         * page/RuntimeEnabledFeatures.h:
2585         (WebCore::RuntimeEnabledFeatures::setIsITPSessionSwitchingEnabled): Deleted.
2586         (WebCore::RuntimeEnabledFeatures::isITPSessionSwitchingEnabled const): Deleted.
2587         * page/Settings.yaml:
2588         * platform/network/NetworkStorageSession.cpp:
2589         (WebCore::NetworkStorageSession::hasHadUserInteractionAsFirstParty const):
2590         (WebCore::NetworkStorageSession::shouldBlockCookies const):
2591         (WebCore::NetworkStorageSession::setDomainsWithUserInteractionAsFirstParty):
2592         * platform/network/NetworkStorageSession.h:
2593         (WebCore::NetworkStorageSession::setIsThirdPartyCookieBlockingOnSitesWithoutUserInteractionEnabled):
2594
2595 2019-10-16  Zalan Bujtas  <zalan@apple.com>
2596
2597         [LFC][IFC] Add style and text content to Display::Run
2598         https://bugs.webkit.org/show_bug.cgi?id=203045
2599         <rdar://problem/56340105>
2600
2601         Reviewed by Antti Koivisto.
2602
2603         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.
2604
2605         * layout/displaytree/DisplayRun.h:
2606         (WebCore::Display::Run::TextContext::content const):
2607         (WebCore::Display::Run::style const):
2608         (WebCore::Display::Run::Run):
2609         (WebCore::Display::Run::TextContext::TextContext):
2610         (WebCore::Display::Run::TextContext::expand):
2611         * layout/inlineformatting/InlineLine.cpp:
2612         (WebCore::Layout::Line::appendNonBreakableSpace):
2613         (WebCore::Layout::Line::appendTextContent):
2614         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2615         (WebCore::Layout::Line::appendHardLineBreak):
2616         * layout/inlineformatting/InlineLine.h:
2617         (WebCore::Layout::Line::Run::expand):
2618
2619 2019-10-16  Simon Fraser  <simon.fraser@apple.com>
2620
2621         Add dumping for BorderData and StyleBackgroundData
2622         https://bugs.webkit.org/show_bug.cgi?id=203038
2623
2624         Reviewed by Zalan Bujtas.
2625
2626         As part of adding dumping for all RenderStyle data, add dumping support for 
2627         BorderData and StyleBackgroundData.
2628         
2629         For large classes it's beneficial to avoid dumping default values; those classes
2630         get a dump() function that can take an argument to say whether values which are default
2631         should be printed.
2632
2633         * Sources.txt:
2634         * WebCore.xcodeproj/project.pbxproj:
2635         * platform/LengthSize.h:
2636         (WebCore::LengthSize::isZero const):
2637         * rendering/style/BorderData.cpp: Added.
2638         (WebCore::operator<<):
2639         (WebCore::BorderData::dump const):
2640         * rendering/style/BorderData.h:
2641         * rendering/style/RenderStyleConstants.h:
2642         * rendering/style/StyleBackgroundData.cpp:
2643         (WebCore::StyleBackgroundData::dump const):
2644         (WebCore::operator<<):
2645         * rendering/style/StyleBackgroundData.h:
2646
2647 2019-10-16  Chris Dumez  <cdumez@apple.com>
2648
2649         [WK2] Handle back/forward cache entry expiration in the UIProcess instead of the WebProcess
2650         https://bugs.webkit.org/show_bug.cgi?id=203034
2651         <rdar://problem/56332453>
2652
2653         Reviewed by Antti Koivisto.
2654
2655         Use Seconds type for backForwardCacheExpirationInterval setting instead of
2656         double, for clarity.
2657
2658         * history/CachedPage.cpp:
2659         (WebCore::CachedPage::CachedPage):
2660         (WebCore::CachedPage::hasExpired const):
2661         * page/Settings.yaml:
2662
2663 2019-10-16  Zalan Bujtas  <zalan@apple.com>
2664
2665         [LFC][IFC] Fix various vertical alignment issues.
2666         https://bugs.webkit.org/show_bug.cgi?id=203041
2667
2668         Reviewed by Antti Koivisto.
2669
2670         This patch fixes both regular inline box and inline-block baseline aligment. It also addresses a few related vertical positioning issues. 
2671
2672         * layout/inlineformatting/InlineLine.cpp:
2673         (WebCore::Layout::Line::alignContentVertically):
2674         (WebCore::Layout::Line::appendInlineContainerStart):
2675         (WebCore::Layout::Line::appendInlineContainerEnd):
2676         (WebCore::Layout::Line::appendTextContent):
2677         (WebCore::Layout::Line::appendNonReplacedInlineBox):
2678         (WebCore::Layout::Line::appendHardLineBreak):
2679         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
2680         (WebCore::Layout::Line::inlineItemContentHeight const):
2681         * layout/inlineformatting/InlineLine.h:
2682         * layout/inlineformatting/InlineLineBox.h:
2683         (WebCore::Layout::LineBox::resetDescent):
2684         (WebCore::Layout::LineBox::setLogicalHeightIfGreater):
2685         (WebCore::Layout::LineBox::setBaselineOffsetIfGreater):
2686         (WebCore::Layout::LineBox::setAscentIfGreater):
2687         (WebCore::Layout::LineBox::setDescentIfGreater):
2688         (WebCore::Layout::LineBox::resetBaseline):
2689         (WebCore::
2690         Layout::LineBox::setBaseline): Deleted.
2691         (WebCore::Layout::LineBox::baseline): Deleted.
2692         (WebCore::Layout::LineBox::setBaselineOffset): Deleted.
2693         (WebCore::Layout::LineBox::Baseline::setAscentIfGreater): Deleted.
2694         (WebCore::Layout::LineBox::Baseline::setDescentIfGreater): Deleted.
2695
2696 2019-10-16  Chris Dumez  <cdumez@apple.com>
2697
2698         Drop unused WKPageSetResourceCachingDisabled() SPI
2699         https://bugs.webkit.org/show_bug.cgi?id=203035
2700
2701         Reviewed by Alex Christensen.
2702
2703         * history/PageCache.cpp:
2704         (WebCore::canCachePage):
2705         (WebCore::PageCache::take):
2706         (WebCore::PageCache::get):
2707         * html/HTMLMediaElement.cpp:
2708         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
2709         * inspector/agents/page/PageNetworkAgent.cpp:
2710         (WebCore::PageNetworkAgent::setResourceCachingDisabled):
2711         * inspector/agents/worker/WorkerNetworkAgent.cpp:
2712         (WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
2713         * loader/FrameLoader.cpp:
2714         (WebCore::FrameLoader::subresourceCachePolicy const):
2715         (WebCore::FrameLoader::addExtraFieldsToRequest):
2716         * loader/cache/CachedResourceLoader.cpp:
2717         (WebCore::CachedResourceLoader::cachePolicy const):
2718         * page/Page.h:
2719         (WebCore::Page::isResourceCachingDisabledByWebInspector const):
2720         (WebCore::Page::setResourceCachingDisabledByWebInspector):
2721         (WebCore::Page::isResourceCachingDisabled const): Deleted.
2722         (WebCore::Page::setResourceCachingDisabled): Deleted.
2723         (WebCore::Page::setResourceCachingDisabledOverride): Deleted.
2724         * workers/WorkerDebuggerProxy.h:
2725         * workers/WorkerMessagingProxy.cpp:
2726         (WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
2727         (WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
2728         * workers/WorkerMessagingProxy.h:
2729         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2730         (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
2731         (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
2732         * workers/service/context/ServiceWorkerThreadProxy.h:
2733
2734 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2735
2736         DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testRunner.accummulateLogsForChannel
2737         https://bugs.webkit.org/show_bug.cgi?id=203024
2738
2739         Reviewed by Alex Christensen.
2740
2741         * platform/LogInitialization.h:
2742         * platform/Logging.cpp:
2743         (WebCore::clearAllLogChannelsToAccumulate): Added.
2744         * platform/Logging.h:
2745         * testing/js/WebCoreTestSupport.cpp:
2746         (WebCoreTestSupport::clearAllLogChannelsToAccumulate): Added.
2747         * testing/js/WebCoreTestSupport.h:
2748
2749 2019-10-16  Youenn Fablet  <youenn@apple.com>
2750
2751         WebAudioSourceProviderAVFObjC::provideInput should set its WebAudioBufferList parameters correctly
2752         https://bugs.webkit.org/show_bug.cgi?id=202930
2753         <rdar://problem/56006776>
2754
2755         Reviewed by Eric Carlson.
2756
2757         There is a time where the bus channel number and audio source channel numbers may be different.
2758         In case the bus channel number is less than the audio source channel number, initialization of
2759         the WebAudioBufferList might not be fully done.
2760         In that case, output silence and return early.
2761         Reduce the number of frames to process based on the number of frames the output audio bus plans to process.
2762
2763         Partially covered by new API test (this a race so we cannot reproduce the crash easily).
2764
2765         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2766         (WebCore::MediaStreamAudioSourceNode::process):
2767         Make sure to process the number of frames the output bus expect.
2768         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2769         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
2770
2771 2019-10-16  Zalan Bujtas  <zalan@apple.com>
2772
2773         [LFC][TFC] TableFormattingContext::distributeExtraHorizontalSpace should not ignore fixed width columns
2774         https://bugs.webkit.org/show_bug.cgi?id=203010
2775
2776         Reviewed by Antti Koivisto.
2777
2778         Fixed width columns (e.g. <col width=100px>) don't participate in the extra horizontal space distribution.
2779
2780         * layout/tableformatting/TableFormattingContext.cpp:
2781         (WebCore::Layout::TableFormattingContext::computedTableWidth):
2782         (WebCore::Layout::TableFormattingContext::distributeExtraHorizontalSpace):
2783         (WebCore::Layout::TableFormattingContext::distributeAvailableWidth): Deleted.
2784         * layout/tableformatting/TableFormattingContext.h:
2785         * layout/tableformatting/TableGrid.cpp:
2786         (WebCore::Layout::TableGrid::Column::hasFixedWidth const):
2787         (WebCore::Layout::TableGrid::widthConstraints const):
2788         * layout/tableformatting/TableGrid.h:
2789         (WebCore::Layout::TableGrid::totalHorizontalSpacing const):
2790         (WebCore::Layout::TableGrid::columnsContext const):
2791
2792 2019-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2793
2794         [GTK][WPE] ASSERTION FAILED: blob in SQLiteStatement.cpp(163) : int WebCore::SQLiteStatement::bindBlob()
2795         https://bugs.webkit.org/show_bug.cgi?id=202976
2796
2797         Reviewed by Adrian Perez de Castro.
2798
2799         This is because IconDatabases passes a nullptr blob to store emtpty icons. sqlite3_bind_blob() allows nullptr as
2800         blob, so we shouldn't assert.
2801
2802         * platform/sql/SQLiteStatement.cpp:
2803         (WebCore::SQLiteStatement::bindBlob): Update the assert to only fail when blob is nullptr and size > 0.
2804
2805 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
2806
2807         Unreviewed build fix for Windows ports
2808         https://bugs.webkit.org/show_bug.cgi?id=203016
2809         <rdar://problem/56317774>
2810
2811         * page/DOMTimer.h: Added WEBCORE_EXPORT to ~DOMTimer().
2812
2813 2019-10-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2814
2815         image/apng not recognized in source tag
2816         https://bugs.webkit.org/show_bug.cgi?id=202785
2817
2818         Reviewed by Dean Jackson.
2819
2820         Add image/apng as supported mime type for images on Mac/iOS and
2821         on all the other platforms that enable apng support.
2822
2823         This fixes the test imported/w3c/web-platform-tests/apng/supported-in-source-type.html
2824
2825         * platform/MIMETypeRegistry.cpp:
2826         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2827
2828 2019-10-15  Ryosuke Niwa  <rniwa@webkit.org>
2829
2830         adoptRef DOMTimer in install instead of its constructor
2831         https://bugs.webkit.org/show_bug.cgi?id=203016
2832
2833         Reviewed by Simon Fraser.
2834
2835         Moved the code to add DOMTimer to ScriptExecutionContext's map to DOMTimer::install
2836         instead of its constructor so that we can adoptRef there instead for clarity & simplicity.
2837
2838         * dom/ScriptExecutionContext.h:
2839         (WebCore::ScriptExecutionContext::addTimeout):
2840         * page/DOMTimer.cpp:
2841         (WebCore::DOMTimer::DOMTimer):
2842         (WebCore::DOMTimer::install):
2843         (WebCore::DOMTimer::fired):
2844
2845 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2846
2847         ScrollingTreeScrollingNodeDelegateMac::stretchAmount() should not have side effects
2848         https://bugs.webkit.org/show_bug.cgi?id=203009
2849
2850         Reviewed by Dean Jackson.
2851
2852         Calling ScrollingTreeScrollingNodeDelegateMac::stretchAmount() had the side effect of calling
2853         setMainFrameIsRubberBanding() on the scrolling tree.
2854         
2855         Remove this badness and replace it by modifying updateMainFramePinState() (which is called every time
2856         the scroll position changes) to also compute if we're rubber-banding.
2857         
2858         Also make a bunch of methods on ScrollControllerClient const, which makes it clear that
2859         they don't have side effects.
2860
2861         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2862         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2863         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2864         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
2865         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinAndRubberbandState):
2866         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState): Deleted.
2867         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
2868         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2869         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture const):
2870         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching const):
2871         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching const):
2872         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount const):
2873         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection const):
2874         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally const):
2875         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically const):
2876         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection const):
2877         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2878         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching): Deleted.
2879         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching): Deleted.
2880         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount): Deleted.
2881         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection): Deleted.
2882         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally): Deleted.
2883         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically): Deleted.
2884         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection): Deleted.
2885         * platform/cocoa/ScrollController.h:
2886         * platform/mac/ScrollAnimatorMac.h:
2887         * platform/mac/ScrollAnimatorMac.mm:
2888         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent const):
2889         (WebCore::ScrollAnimatorMac::pinnedInDirection const):
2890         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture const):
2891         (WebCore::ScrollAnimatorMac::allowsVerticalStretching const):
2892         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching const):
2893         (WebCore::ScrollAnimatorMac::stretchAmount const):
2894         (WebCore::ScrollAnimatorMac::canScrollHorizontally const):
2895         (WebCore::ScrollAnimatorMac::canScrollVertically const):
2896         (WebCore::ScrollAnimatorMac::shouldRubberBandInDirection const):
2897         (WebCore::ScrollAnimatorMac::shouldForwardWheelEventsToParent): Deleted.
2898         (WebCore::ScrollAnimatorMac::pinnedInDirection): Deleted.
2899         (WebCore::ScrollAnimatorMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2900         (WebCore::ScrollAnimatorMac::allowsVerticalStretching): Deleted.
2901         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching): Deleted.
2902         (WebCore::ScrollAnimatorMac::stretchAmount): Deleted.
2903         (WebCore::ScrollAnimatorMac::canScrollHorizontally): Deleted.
2904         (WebCore::ScrollAnimatorMac::canScrollVertically): Deleted.
2905         (WebCore::ScrollAnimatorMac::shouldRubberBandInDirection): Deleted.
2906         * platform/mock/ScrollAnimatorMock.h:
2907
2908 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
2909
2910         WheelEventTestMonitor doesn't need to be threadsafe
2911         https://bugs.webkit.org/show_bug.cgi?id=203012
2912
2913         Reviewed by Dean Jackson.
2914
2915         WheelEventTestMonitor is only called on the main thread, so doesn't need a lock to protect
2916         m_deferCompletionReasons, and add main thread assertions.
2917
2918         * page/WheelEventTestMonitor.cpp:
2919         (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
2920         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer):
2921         (WebCore::WheelEventTestMonitor::deferForReason):
2922         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
2923         (WebCore::WheelEventTestMonitor::triggerTestTimerFired):
2924         * page/WheelEventTestMonitor.h:
2925
2926 2019-10-15  Andres Gonzalez  <andresg_22@apple.com>
2927
2928         AX: Make AXIsolatedTree compile again
2929         https://bugs.webkit.org/show_bug.cgi?id=202702
2930         <rdar://problem/56084968>
2931
2932         Reviewed by Joanmarie Diggs.
2933
2934         Re-submitting r251045 with a fix for internal builds.
2935
2936         * accessibility/AXObjectCache.cpp:
2937         (WebCore::AXObjectCache::remove):
2938         (WebCore::AXObjectCache::createIsolatedAccessibilityTreeHierarchy):
2939         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2940         (WebCore::AXIsolatedTree::treePageCache):
2941         (WebCore::AXIsolatedTree::nodeForID const):
2942         (WebCore::AXIsolatedTree::applyPendingChanges):
2943         (WebCore::AXIsolatedTree::initializePageTreeForID): Deleted.
2944         (WebCore::AXIsolatedTree::setInitialRequestInProgress): Deleted.
2945         * accessibility/isolatedtree/AXIsolatedTree.h:
2946         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
2947         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
2948         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
2949         * accessibility/isolatedtree/AXIsolatedTreeNode.h:
2950         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2951         (convertToNSArray):
2952         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2953         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
2954
2955 2019-10-15  Ryosuke Niwa  <rniwa@webkit.org>
2956
2957         [iOS] Crash in WebCore::DOMWindow::incrementScrollEventListenersCount
2958         https://bugs.webkit.org/show_bug.cgi?id=202878
2959
2960         Unreviewed. Addressed Darin's post-commit review comment.
2961
2962         * dom/Node.cpp:
2963         (WebCore::tryAddEventListener):
2964
2965 2019-10-15  Chris Dumez  <cdumez@apple.com>
2966
2967         [macOS] Simplify main thread initialization
2968         https://bugs.webkit.org/show_bug.cgi?id=203001
2969
2970         Reviewed by Geoff Garen.
2971
2972         * bridge/objc/WebScriptObject.mm:
2973         (+[WebScriptObject initialize]):
2974         * platform/cocoa/SharedBufferCocoa.mm:
2975         (+[WebCoreSharedBufferData initialize]):
2976
2977 2019-10-15  Peng Liu  <peng.liu6@apple.com>
2978
2979         [Picture-in-Picture Web API] Implement HTMLVideoElement.requestPictureInPicture() / Document.exitPictureInPicture()
2980         https://bugs.webkit.org/show_bug.cgi?id=201024
2981
2982         Reviewed by Eric Carlson.
2983
2984         Implement the support to enter and exit PiP mode with the Picture-in-Picture API.
2985         Majority work of this patch was done by Carlos Eduardo Ramalho <cadubentzen@gmail.com>.
2986
2987         Also, fix a build error of Modules/webaudio/OfflineAudioContext.cpp because of this patch (due to unified build).
2988
2989         Tests: imported/w3c/web-platform-tests/picture-in-picture/css-selector.html
2990                imported/w3c/web-platform-tests/picture-in-picture/disable-picture-in-picture.html
2991                imported/w3c/web-platform-tests/picture-in-picture/enter-picture-in-picture.html
2992                imported/w3c/web-platform-tests/picture-in-picture/exit-picture-in-picture.html
2993                imported/w3c/web-platform-tests/picture-in-picture/idlharness.window.html
2994                imported/w3c/web-platform-tests/picture-in-picture/leave-picture-in-picture.html
2995                imported/w3c/web-platform-tests/picture-in-picture/mediastream.html
2996                imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-element.html
2997                imported/w3c/web-platform-tests/picture-in-picture/picture-in-picture-window.html
2998                imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture-twice.html
2999                imported/w3c/web-platform-tests/picture-in-picture/request-picture-in-picture.html
3000                imported/w3c/web-platform-tests/picture-in-picture/shadow-dom.html
3001
3002         * CMakeLists.txt:
3003         * Configurations/FeatureDefines.xcconfig:
3004         * DerivedSources-input.xcfilelist:
3005         * DerivedSources-output.xcfilelist:
3006         * DerivedSources.make:
3007         * Modules/pictureinpicture/DocumentPictureInPicture.cpp: Added.
3008         (WebCore::DocumentPictureInPicture::exitPictureInPicture):
3009         (WebCore::DocumentPictureInPicture::from):
3010         * Modules/pictureinpicture/DocumentPictureInPicture.h: Added.
3011         (WebCore::DocumentPictureInPicture::pictureInPictureEnabled):
3012         (WebCore::DocumentPictureInPicture::supplementName):
3013         * Modules/pictureinpicture/DocumentPictureInPicture.idl: Added.
3014         * Modules/pictureinpicture/EnterPictureInPictureEvent.cpp: Added.
3015         (WebCore::EnterPictureInPictureEvent::create):
3016         (WebCore::EnterPictureInPictureEvent::EnterPictureInPictureEvent):
3017         * Modules/pictureinpicture/EnterPictureInPictureEvent.h: Added.
3018         * Modules/pictureinpicture/EnterPictureInPictureEvent.idl: Added.
3019         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp: Added.
3020         (WebCore::HTMLVideoElementPictureInPicture::HTMLVideoElementPictureInPicture):
3021         (WebCore::HTMLVideoElementPictureInPicture::~HTMLVideoElementPictureInPicture):
3022         (WebCore::HTMLVideoElementPictureInPicture::from):
3023         (WebCore::HTMLVideoElementPictureInPicture::requestPictureInPicture):
3024         (WebCore::HTMLVideoElementPictureInPicture::autoPictureInPicture):
3025         (WebCore::HTMLVideoElementPictureInPicture::setAutoPictureInPicture):
3026         (WebCore::HTMLVideoElementPictureInPicture::disablePictureInPicture):
3027         (WebCore::HTMLVideoElementPictureInPicture::setDisablePictureInPicture):
3028         (WebCore::HTMLVideoElementPictureInPicture::exitPictureInPicture):
3029         (WebCore::HTMLVideoElementPictureInPicture::didEnterPictureInPicture):
3030         (WebCore::HTMLVideoElementPictureInPicture::didExitPictureInPicture):
3031         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h: Added.
3032         (WebCore::HTMLVideoElementPictureInPicture::supplementName):
3033         * Modules/pictureinpicture/HTMLVideoElementPictureInPicture.idl: Added.
3034         * Modules/pictureinpicture/PictureInPictureWindow.cpp: Added.
3035         (WebCore::PictureInPictureWindow::create):
3036         (WebCore::PictureInPictureWindow::PictureInPictureWindow):
3037         (WebCore::PictureInPictureWindow::activeDOMObjectName const):
3038         (WebCore::PictureInPictureWindow::canSuspendForDocumentSuspension const):
3039         (WebCore::PictureInPictureWindow::eventTargetInterface const):
3040         (WebCore::PictureInPictureWindow::scriptExecutionContext const):
3041         * Modules/pictureinpicture/PictureInPictureWindow.h: Added.
3042         * Modules/pictureinpicture/PictureInPictureWindow.idl: Added.
3043         * Modules/webaudio/OfflineAudioContext.cpp:
3044         * Sources.txt:
3045         * WebCore.xcodeproj/project.pbxproj:
3046         * bindings/js/WebCoreBuiltinNames.h:
3047         * dom/Document.cpp:
3048         (WebCore::Document::pictureInPictureElement const):
3049         (WebCore::Document::setPictureInPictureElement):
3050         * dom/Document.h:
3051         * dom/DocumentOrShadowRoot.idl:
3052         * dom/EventNames.h:
3053         * dom/EventNames.in:
3054         * dom/EventTargetFactory.in:
3055         * dom/ShadowRoot.cpp:
3056         (WebCore::ShadowRoot::pictureInPictureElement const):
3057         * dom/ShadowRoot.h:
3058         * html/HTMLVideoElement.cpp:
3059         (WebCore::HTMLVideoElement::fullscreenModeChanged):
3060         (WebCore::HTMLVideoElement::setPictureInPictureObserver):
3061         * html/HTMLVideoElement.h:
3062         * page/Settings.yaml:
3063         * platform/PictureInPictureObserver.h: Added.
3064         (WebCore::PictureInPictureObserver::~PictureInPictureObserver):
3065         * testing/InternalSettings.h:
3066
3067 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
3068
3069         Add TextStream dumping for ThemeTypes enums
3070         https://bugs.webkit.org/show_bug.cgi?id=202972
3071
3072         Reviewed by Dean Jackson.
3073
3074         Make ControlPart, SelectionPart, ThemeFont and ThemeColor dumpable.
3075
3076         * Sources.txt:
3077         * WebCore.xcodeproj/project.pbxproj:
3078         * platform/ThemeTypes.cpp: Added.
3079         (WebCore::operator<<):
3080         * platform/ThemeTypes.h:
3081
3082 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
3083
3084         Add dumping for Animation and AnimationList
3085         https://bugs.webkit.org/show_bug.cgi?id=202973
3086
3087         Reviewed by Dean Jackson.
3088
3089         Make Animation, AnimationList and related enums dumpable.
3090
3091         * platform/animation/Animation.cpp:
3092         (WebCore::operator<<):
3093         * platform/animation/Animation.h:
3094         * platform/animation/AnimationList.cpp:
3095         (WebCore::operator<<):
3096         * platform/animation/AnimationList.h:
3097
3098 2019-10-15  Simon Fraser  <simon.fraser@apple.com>
3099
3100         Don't mutate a NinePieceImage to create a mask default image
3101         https://bugs.webkit.org/show_bug.cgi?id=202967
3102
3103         Reviewed by Dean Jackson.
3104
3105         For every StyleRareNonInheritedData, the maskBoxImage undergoes copy-on-write
3106         via maskBoxImage.setMaskDefaults(). Fix by giving NinePieceImage a constructor
3107         argument that cna make the mask flavor of image.
3108
3109         * css/StyleBuilderConverter.h:
3110         (WebCore::StyleBuilderConverter::convertBorderMask):
3111         (WebCore::StyleBuilderConverter::convertReflection):
3112         * rendering/style/NinePieceImage.cpp:
3113         (WebCore::NinePieceImage::defaultMaskData):
3114         (WebCore::NinePieceImage::NinePieceImage):
3115         * rendering/style/NinePieceImage.h:
3116         (WebCore::NinePieceImage::setMaskDefaults): Deleted.
3117         * rendering/style/StyleRareNonInheritedData.cpp:
3118         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3119         * rendering/style/StyleReflection.h:
3120         (WebCore::StyleReflection::StyleReflection):
3121
3122 2019-10-15  youenn fablet  <youenn@apple.com>
3123
3124         Move headers to keep from a HTTPHeaderNameSet to an OptionSet
3125         https://bugs.webkit.org/show_bug.cgi?id=202977
3126
3127         Reviewed by Anders Carlsson.
3128
3129         Covered by existing tests.
3130         New representation is smaller and more efficient to process.
3131
3132         * loader/CrossOriginAccessControl.cpp:
3133         (WebCore::httpHeadersToKeepFromCleaning):
3134         (WebCore::cleanHTTPRequestHeadersForAccessControl):
3135         * loader/CrossOriginAccessControl.h:
3136         (WebCore::cleanHTTPRequestHeadersForAccessControl): Deleted.
3137         * loader/ResourceLoaderOptions.h:
3138
3139 2019-10-15  Zalan Bujtas  <zalan@apple.com>
3140
3141         [LFC][TFC] Use <col> to adjust the preferred column width.
3142         https://bugs.webkit.org/show_bug.cgi?id=202997
3143         <rdar://problem/56300345>
3144
3145         Reviewed by Antti Koivisto.
3146
3147         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.
3148
3149         * layout/tableformatting/TableFormattingContext.cpp:
3150         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
3151         * layout/tableformatting/TableFormattingContext.h:
3152         * layout/tableformatting/TableFormattingContextGeometry.cpp:
3153         (WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const):
3154         * layout/tableformatting/TableGrid.h:
3155         (WebCore::Layout::TableGrid::Column::columnBox const):
3156
3157 2019-10-15  Zalan Bujtas  <zalan@apple.com>
3158
3159         [LFC][TFC] Add support for colgroup/col
3160         https://bugs.webkit.org/show_bug.cgi?id=202991
3161         <rdar://problem/56294715>
3162
3163         Reviewed by Antti Koivisto.
3164
3165         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.
3166
3167         * layout/layouttree/LayoutTreeBuilder.cpp:
3168         (WebCore::Layout::TreeBuilder::createLayoutBox):
3169         * layout/tableformatting/TableFormattingContext.cpp:
3170         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
3171         * layout/tableformatting/TableGrid.cpp:
3172         (WebCore::Layout::TableGrid::Column::Column):
3173         (WebCore::Layout::TableGrid::ColumnsContext::addColumn):
3174         * layout/tableformatting/TableGrid.h:
3175
3176 2019-10-15  Alex Christensen  <achristensen@webkit.org>
3177
3178         Unreviewed, rolling out r251138.
3179
3180         Broke API tests
3181
3182         Reverted changeset:
3183
3184         "Pass CORS-enabled schemes through WebProcess instead of
3185         having them NetworkProcess-global"
3186         https://bugs.webkit.org/show_bug.cgi?id=202891
3187         https://trac.webkit.org/changeset/251138
3188
3189 2019-10-15  Chris Dumez  <cdumez@apple.com>
3190
3191         Stop using inheritance for WebBackForwardCacheEntry
3192         https://bugs.webkit.org/show_bug.cgi?id=202989
3193
3194         Reviewed by Alex Christensen.
3195
3196         * history/BackForwardItemIdentifier.h:
3197         (WebCore::BackForwardItemIdentifier::operator bool const):
3198
3199 2019-10-15  Alex Christensen  <achristensen@webkit.org>
3200
3201         Pass CORS-enabled schemes through WebProcess instead of having them NetworkProcess-global
3202         https://bugs.webkit.org/show_bug.cgi?id=202891
3203
3204         Reviewed by Youenn Fablet.
3205
3206         * platform/LegacySchemeRegistry.cpp:
3207         (WebCore::LegacySchemeRegistry::registerURLSchemeAsCORSEnabled):
3208         (WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
3209         (WebCore::LegacySchemeRegistry::allURLSchemesRegisteredAsCORSEnabled):
3210         * platform/LegacySchemeRegistry.h:
3211
3212 2019-10-15  Zalan Bujtas  <zalan@apple.com>
3213
3214         [LFC] Adjust computed width value when box sizing is border-box
3215         https://bugs.webkit.org/show_bug.cgi?id=202966
3216         <rdar://problem/56277954>
3217
3218         Reviewed by Antti Koivisto.
3219
3220         box-sizing: border-box; means the width value sets the size of the border box (and not the content box).
3221
3222         * layout/FormattingContext.cpp:
3223         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
3224         * layout/FormattingContext.h:
3225         * layout/FormattingContextGeometry.cpp:
3226         (WebCore::Layout::FormattingContext::Geometry::computedContentWidth const):
3227         (WebCore::Layout::FormattingContext::Geometry::computedMinWidth const):
3228         (WebCore::Layout::FormattingContext::Geometry::computedMaxWidth const):
3229         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3230         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3231         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
3232         * layout/blockformatting/BlockFormattingContext.cpp:
3233         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
3234         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3235         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
3236
3237 2019-10-15  Zalan Bujtas  <zalan@apple.com>
3238
3239         [LFC][TFC] Add <col> element's width attribute value to Layout::Box rare data
3240         https://bugs.webkit.org/show_bug.cgi?id=202988
3241         <rdar://problem/56291048>
3242
3243         Reviewed by Antti Koivisto.
3244
3245         Sadly RenderStyle does not have this value.
3246
3247         * layout/layouttree/LayoutBox.cpp:
3248         (WebCore::Layout::Box::setColumnWidth):
3249         (WebCore::Layout::Box::columnWidth const):
3250         * layout/layouttree/LayoutBox.h:
3251         * layout/layouttree/LayoutTreeBuilder.cpp:
3252         (WebCore::Layout::TreeBuilder::createLayoutBox):
3253         (WebCore::Layout::outputLayoutBox):
3254
3255 2019-10-15  Zalan Bujtas  <zalan@apple.com>
3256
3257         [LFC] Adjust computed height value when box sizing is border-box
3258         https://bugs.webkit.org/show_bug.cgi?id=202965
3259         <rdar://problem/56276771>
3260
3261         Reviewed by Antti Koivisto.
3262
3263         box-sizing: border-box; means the height value sets the size of the border box (and not the content box).  
3264
3265         * layout/FormattingContext.cpp:
3266         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
3267         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
3268         * layout/FormattingContext.h:
3269         * layout/FormattingContextGeometry.cpp:
3270         (WebCore::Layout::FormattingContext::Geometry::computedContentHeight const):
3271         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
3272         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
3273         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
3274         (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
3275         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3276         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
3277         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
3278         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
3279         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3280         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
3281         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
3282         * layout/LayoutState.cpp:
3283         (WebCore::Layout::LayoutState::displayBoxForLayoutBox):
3284         * layout/LayoutUnits.h:
3285         * layout/blockformatting/BlockFormattingContext.cpp:
3286         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
3287         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
3288         * layout/blockformatting/BlockFormattingContext.h:
3289         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3290         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3291         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
3292         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin const):
3293         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3294         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
3295         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3296         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
3297         * layout/displaytree/DisplayBox.cpp:
3298         (WebCore::Display::Box::Box):
3299         (WebCore::Display::Box::Style::Style): Deleted.
3300         * layout/displaytree/DisplayBox.h:
3301         * layout/inlineformatting/InlineFormattingContext.cpp:
3302         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
3303         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
3304         * layout/inlineformatting/InlineFormattingContext.h:
3305         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
3306         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
3307         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
3308         * layout/tableformatting/TableFormattingContext.cpp:
3309         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
3310         * layout/tableformatting/TableFormattingContext.h:
3311         * layout/tableformatting/TableFormattingContextGeometry.cpp:
3312         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
3313
3314 2019-10-15  Wenson Hsieh  <wenson_hsieh@apple.com>
3315
3316         [Clipboard API] Implement getType() for ClipboardItems created from bindings
3317         https://bugs.webkit.org/show_bug.cgi?id=202943
3318
3319         Reviewed by Tim Horton.
3320
3321         Adds basic support for ClipboardItem.getType(), in the case where the ClipboardItems are created by the page. To
3322         achieve this, we introduce ClipboardItemDataSource, which represents the data source backing a given clipboard
3323         item. This backing may either consist of a list of types and their corresponding DOMPromises (for ClipboardItems
3324         that come from the page), or may consist of a list of items that will ask the platformr pasteboard for their
3325         data (to be supported in a future patch).
3326
3327         See below for more details.
3328
3329         Test: editing/async-clipboard/clipboard-item-basic.html
3330
3331         * Modules/async-clipboard/Clipboard.h:
3332         * Modules/async-clipboard/ClipboardItem.cpp:
3333         (WebCore::clipboardItemPresentationStyle):
3334         (WebCore::ClipboardItem::ClipboardItem):
3335
3336         Pass in the parent Clipboard object for ClipboardItems that are backed by the platform pasteboard (which are
3337         returned by Clipboard.read()). (Note that this doesn't make any difference until this codepath is actually
3338         exercised when we add support for Clipboard.read()).
3339
3340         (WebCore::ClipboardItem::create):
3341         (WebCore::ClipboardItem::types const):
3342         (WebCore::ClipboardItem::getType):
3343
3344         Plumb types() and getType() to the clipboard item's datasource.
3345
3346         (WebCore::ClipboardItem::navigator):
3347
3348         Make navigator() return the parent Clipboard object's navigator.
3349
3350         * Modules/async-clipboard/ClipboardItem.h:
3351         * Modules/async-clipboard/ClipboardItemBindingsDataSource.cpp: Added.
3352         (WebCore::blobFromString):
3353         (WebCore::ClipboardItemBindingsDataSource::ClipboardItemBindingsDataSource):
3354
3355         Store the given list of types and DOM promises.
3356
3357         (WebCore::ClipboardItemBindingsDataSource::types const):
3358         (WebCore::ClipboardItemBindingsDataSource::getType):
3359
3360         Implement getType() by finding the matching promised type in the item's array of types, and waiting for the
3361         promise to either resolve or reject. If the promise resolves to either a string or blob, we deliver the result
3362         back to the page by resolving the promise returned by getType(). Otherwise, we reject it.
3363
3364         * Modules/async-clipboard/ClipboardItemBindingsDataSource.h:
3365         * Modules/async-clipboard/ClipboardItemDataSource.h:
3366         (WebCore::ClipboardItemDataSource::ClipboardItemDataSource):
3367         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.cpp:
3368
3369         Add a stub implementation of a clipboard item data source that is backed by data in the platform pasteboard. In
3370         a future patch, this will implement getType() by calling out to the platform pasteboard.
3371
3372         (WebCore::ClipboardItemPasteboardDataSource::ClipboardItemPasteboardDataSource):
3373         (WebCore::ClipboardItemPasteboardDataSource::types const):
3374         (WebCore::ClipboardItemPasteboardDataSource::getType):
3375         * Modules/async-clipboard/ClipboardItemPasteboardDataSource.h:
3376         * Modules/mediastream/RTCRtpReceiver.cpp:
3377         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
3378
3379         Unrelated build fixes, due to changes in unified source groupings.
3380
3381         * Sources.txt:
3382         * WebCore.xcodeproj/project.pbxproj:
3383         * platform/network/mac/UTIUtilities.mm:
3384
3385         More build fixes, due to changes in unified source groupings.
3386
3387 2019-10-15  Zalan Bujtas  <zalan@apple.com>
3388
3389         [LFC][IFC] Add support for text-transform: uppercase/lowercase
3390         https://bugs.webkit.org/show_bug.cgi?id=202968
3391         <rdar://problem/56278141>
3392
3393         Reviewed by Antti Koivisto.
3394
3395         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).
3396
3397         * layout/layouttree/LayoutTreeBuilder.cpp:
3398         (WebCore::Layout::applyTextTransform):
3399         (WebCore::Layout::TreeBuilder::createLayoutBox):
3400
3401 2019-10-14  Youenn Fablet  <youenn@apple.com>
3402
3403         Handle service worker loads through NetworkResourceLoader
3404         https://bugs.webkit.org/show_bug.cgi?id=202309
3405
3406         Reviewed by Alex Christensen.
3407
3408         Allow to serialize HTTP header names as enumeration.
3409         Updated SWServer ability to handle schemes by adding built-in support for HTTP and HTTPS as done in LegacySchemeRegistry.
3410
3411         Covered by existing tests.
3412
3413         * loader/ResourceLoaderOptions.h:
3414         * platform/network/create-http-header-name-table:
3415         * workers/service/server/SWServer.cpp:
3416         (WebCore::SWServer::canHandleScheme const):
3417         * workers/service/server/SWServer.h:
3418         * workers/service/server/SWServerJobQueue.cpp:
3419         (WebCore::SWServerJobQueue::runRegisterJob):
3420
3421 2019-10-14  Tim Horton  <timothy_horton@apple.com>
3422
3423         Unify sources for bindings more densely
3424         https://bugs.webkit.org/show_bug.cgi?id=202918
3425
3426         Reviewed by Simon Fraser.
3427
3428         No new tests, just a build time speedup.
3429         For me, this is a reliable 17% boost on the WebCore Build Time Benchmark.
3430
3431         * Scripts/generate-unified-sources.sh:
3432         Use dense bundles for JS* and bindings/js/*.
3433         This seems acceptable for a few reasons:
3434
3435         - most of the time building these files is spent parsing the exact
3436         same set of JSC headers, because the generated bindings code ends
3437         up including the same set of things
3438
3439         - the incremental build cost of bundling more bindings sources together
3440         is small, because the JSC headers dominate the time
3441
3442         - folks will frequently have to rebuild all of the bindings (on every
3443         pull, for example, because they indirectly include most JSC headers),
3444         but rarely end up rebuilding only a single one (in my experience)
3445
3446         * bindings/js/ReadableStreamDefaultController.cpp:
3447         (WebCore::readableStreamCallFunction):
3448         (WebCore::ReadableStreamDefaultController::invoke):
3449         (WebCore::callFunction): Deleted.
3450         Deduplicate static functions that now get bundled together.
3451
3452         * platform/graphics/ca/PlatformCALayer.cpp:
3453         (WebCore::PlatformCALayer::currentTimeToMediaTime):
3454         * platform/graphics/ca/PlatformCALayer.h:
3455         In older macOS SDKs, CABase.h included ApplicationServices.h, which
3456         causes lots of trouble.
3457
3458 2019-10-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3459
3460         [GTK] White pages in AC mode: Cannot get default EGL display: EGL_BAD_PARAMETER
3461         https://bugs.webkit.org/show_bug.cgi?id=202362
3462
3463         Reviewed by Carlos Alberto Lopez Perez.
3464
3465         The problem is that PlatformDisplayLibWPE::initialize() is failing to initialize the EGL display for some
3466         reason. We need to understand why, but we should also handle the case of failing to initialize the EGL display
3467         and simply disable accelerated compositing mode to avoid white pages and crashes in websites using WebGL. This
3468         patch doesn't actually fix the bug, it just handles the EGL display initialization failure.
3469
3470         * platform/graphics/PlatformDisplay.cpp:
3471         (WebCore::PlatformDisplay::~PlatformDisplay): Set s_sharedDisplayForCompositing to nullptr when the shared
3472         display for compositing is destroyed.
3473         * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp:
3474         (WebCore::PlatformDisplayLibWPE::initialize): Return false when EGL display initialization fails.
3475         * platform/graphics/libwpe/PlatformDisplayLibWPE.h:
3476
3477 2019-10-14  Chris Dumez  <cdumez@apple.com>
3478
3479         [WK2] Have WebBackForwardCache class coordinate page caching in all WebProcesses
3480         https://bugs.webkit.org/show_bug.cgi?id=202929
3481         <rdar://problem/56250421>
3482
3483         Reviewed by Alex Christensen.
3484
3485         Drop FrameLoaderClient::didSaveToPageCache() function as it is no longer needed.
3486         Instead, we now call HistoryItem::notifyChanged() whenever HistoryItem::m_cachedPage
3487         changes. This communicates to the UIProcess whether or not a HistoryItem has an
3488         associated CachedPage.
3489
3490         I also added more release logging to the PageCache and renamed its logging channel
3491         from PageCache to WebBackForwardCache to match the UIProcess's channel.
3492
3493         * history/BackForwardItemIdentifier.h:
3494         (WebCore::BackForwardItemIdentifier::string const):
3495         * history/CachedFrame.cpp:
3496         (WebCore::CachedFrame::CachedFrame):
3497         * history/HistoryItem.cpp:
3498         (WebCore::HistoryItem::setCachedPage):
3499         (WebCore::HistoryItem::takeCachedPage):
3500         * history/HistoryItem.h:
3501         * history/PageCache.cpp:
3502         (WebCore::PageCache::addIfCacheable):
3503         (WebCore::PageCache::take):
3504         (WebCore::PageCache::removeAllItemsForPage):
3505         (WebCore::PageCache::get):
3506         (WebCore::PageCache::remove):
3507         (WebCore::PageCache::prune):
3508         * loader/EmptyFrameLoaderClient.h:
3509         * loader/FrameLoader.cpp:
3510         (WebCore::FrameLoader::commitProvisionalLoad):
3511         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
3512         * loader/FrameLoaderClient.h:
3513         * platform/Logging.h:
3514
3515 2019-10-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3516
3517         Outsets for referenced SVG filters are always zero
3518         https://bugs.webkit.org/show_bug.cgi?id=202826
3519
3520         Reviewed by Simon Fraser.
3521
3522         Sometimes the filter is applied only to a part of the image, so we need
3523         to enlarge the source rectangle such that the border of the result image
3524         looks like as if the filter were applied to the whole image.
3525
3526         The filter outsets should only be calculated for the blur and the drop
3527         shadow filters. The problem is FilterOperations::outsets() was returning
3528         empty outsets always for the referenced filters.
3529
3530         Since the referenced filters must be software filters, the fix is to rely
3531         on CSSFilter in calculating the filter outsets for software filters.
3532
3533         By adding a virtual function called outset() to the FilterEffect class, 
3534         we can loop through the CSSFilter::m_effects asking every FilterEffect
3535         to return its outset(). This function is only overridden by FEDropShadow
3536         and FEGaussianBlur.
3537
3538         This should work because RenderLayer builds the CSSFilter when the styleChanged()
3539         happens through its updateFilterPaintingStrategy(). This will guarantee 
3540         that m_filters->filter()->outsets() will return the correct outsets for
3541         the referenced and the non-referenced software filters.
3542
3543         We should keep FilterOperations::outsets() because it has be used for
3544         the hardware non-referenced filters. In that case, RenderLayer does not
3545         build the the filter effects. Therefore m_filters can't be used because
3546         it is null in this case.
3547
3548         For accuracy, hasOutsets() implementation is deleted. Having a blur or
3549         drop shadow filter effect is not enough to say hasOutsets() is true. We
3550         need to calculate the outsets first and then ask if it isZero() or not.
3551
3552         Test: css3/filters/svg-blur-filter-clipped.html
3553
3554         * platform/graphics/IntRectExtent.h:
3555         (WebCore::operator==):
3556         (WebCore::operator+=):
3557         (WebCore::IntRectExtent::expandRect const): Deleted.
3558         IntRectExtent is only used as a filter outsets. So add the definition of
3559         IntOutsets in IntRectExtent.h.
3560
3561         * platform/graphics/filters/FEDropShadow.cpp:
3562         (WebCore::FEDropShadow::outsets const):
3563         * platform/graphics/filters/FEDropShadow.h:
3564         * platform/graphics/filters/FEGaussianBlur.cpp:
3565         (WebCore::FEGaussianBlur::calculateOutsetSize):
3566         (WebCore::FEGaussianBlur::outsets const):
3567         * platform/graphics/filters/FEGaussianBlur.h:
3568         * platform/graphics/filters/FilterEffect.h:
3569         (WebCore::FilterEffect::outsets const):
3570         * platform/graphics/filters/FilterOperations.cpp:
3571         (WebCore::FilterOperations::outsets const):
3572         (WebCore::outsetSizeForBlur): Deleted.
3573         (WebCore::FilterOperations::hasOutsets const): Deleted.
3574         * platform/graphics/filters/FilterOperations.h:
3575         (WebCore::FilterOperations::hasOutsets const):
3576         * platform/graphics/texmap/TextureMapperLayer.cpp:
3577         (WebCore::TextureMapperLayer::computeOverlapRegions):
3578
3579         * rendering/CSSFilter.cpp:
3580         (WebCore::CSSFilter::build):
3581         (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
3582         (WebCore::CSSFilter::outsets const):
3583         Calculate m_outsets once and cache its value for later uses.
3584
3585         * rendering/CSSFilter.h:
3586         * rendering/RenderLayer.cpp:
3587         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
3588         (WebCore::RenderLayer::hasAncestorWithFilterOutsets const):
3589         (WebCore::transparencyClipBox):
3590         (WebCore::RenderLayer::calculateClipRects const):
3591         * rendering/RenderLayer.h:
3592         * rendering/style/RenderStyle.h:
3593         (WebCore::RenderStyle::filterOutsets const):
3594         (WebCore::RenderStyle::hasFilterOutsets const): Deleted.
3595
3596 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3597
3598         [Clipboard API] Refactor custom pasteboard writing codepaths to handle multiple items
3599         https://bugs.webkit.org/show_bug.cgi?id=202916
3600
3601         Reviewed by Tim Horton.
3602
3603         Adjusts the `Pasteboard::write` codepath for writing PasteboardCustomData to the platform pasteboard, such that
3604         it accepts multiple PasteboardCustomDatas. No new tests, since there is no behavior change.
3605
3606         * dom/DataTransfer.cpp:
3607         (WebCore::DataTransfer::commitToPasteboard):
3608
3609         Pass in the PasteboardCustomData as a single-item vector.
3610
3611         * platform/Pasteboard.h:
3612         * platform/PasteboardStrategy.h:
3613         * platform/PlatformPasteboard.h:
3614         * platform/StaticPasteboard.h:
3615         * platform/cocoa/PasteboardCocoa.mm:
3616         (WebCore::Pasteboard::writeCustomData):
3617         * platform/gtk/PasteboardGtk.cpp:
3618         (WebCore::Pasteboard::writeCustomData):
3619         * platform/gtk/PlatformPasteboardGtk.cpp:
3620         (WebCore::PlatformPasteboard::write):
3621         * platform/ios/PlatformPasteboardIOS.mm:
3622         (WebCore::PlatformPasteboard::write):
3623
3624         Adjust this method to return the updated change count.
3625
3626         * platform/libwpe/PasteboardLibWPE.cpp:
3627         (WebCore::Pasteboard::writeCustomData):
3628         * platform/libwpe/PlatformPasteboardLibWPE.cpp:
3629         (WebCore::PlatformPasteboard::write):
3630         * platform/mac/PlatformPasteboardMac.mm:
3631         (WebCore::PlatformPasteboard::write):
3632
3633         Add logic to fall back to writing legacy pasteboard types in the case where there is only one item.
3634
3635         * platform/win/PasteboardWin.cpp:
3636         (WebCore::Pasteboard::writeCustomData):
3637
3638 2019-10-14  Ryosuke Niwa  <rniwa@webkit.org>
3639
3640         Deploy smart pointers in RadioButtonGroups and RadioButtonGroup
3641         https://bugs.webkit.org/show_bug.cgi?id=202942
3642
3643         Reviewed by Zalan Bujtas.
3644
3645         Use Ref & WeakPtr instead of raw pointers in RadioButtonGroups and RadioButtonGroup.
3646
3647         Also made RadioButtonGroups::m_nameToGroupMap a HashMap instead of a unique_ptr of HashMap
3648         since RadioButtonGroups is lazily created in TreeScope as of r250708.
3649
3650         No new tests since there should be no observable behavioral change.
3651
3652         * accessibility/AccessibilityRenderObject.cpp:
3653         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
3654         * dom/RadioButtonGroups.cpp:
3655         (WebCore::RadioButtonGroup): Use WeakHashSet and WeakPtr instead of raw pointers.
3656         (WebCore::RadioButtonGroup::isEmpty const):
3657         (WebCore::RadioButtonGroup::checkedButton const):
3658         (WebCore::RadioButtonGroup::members const):
3659         (WebCore::RadioButtonGroup::setCheckedButton):
3660         (WebCore::RadioButtonGroup::updateCheckedState):
3661         (WebCore::RadioButtonGroup::requiredStateChanged):
3662         (WebCore::RadioButtonGroup::remove):
3663         (WebCore::RadioButtonGroup::setNeedsStyleRecalcForAllButtons):
3664         (WebCore::RadioButtonGroup::updateValidityForAllButtons):
3665         (WebCore::RadioButtonGroup::contains const):
3666         (WebCore::RadioButtonGroups::addButton):
3667         (WebCore::RadioButtonGroups::groupMembers const):
3668         (WebCore::RadioButtonGroups::updateCheckedState):
3669         (WebCore::RadioButtonGroups::requiredStateChanged):
3670         (WebCore::RadioButtonGroups::checkedButtonForGroup const):
3671         (WebCore::RadioButtonGroups::hasCheckedButton const):
3672         (WebCore::RadioButtonGroups::isInRequiredGroup const):
3673         (WebCore::RadioButtonGroups::removeButton):
3674         * dom/RadioButtonGroups.h:
3675         (WebCore::RadioButtonGroups):
3676         * html/HTMLInputElement.cpp:
3677         (WebCore::HTMLInputElement::radioButtonGroup const):
3678         (WebCore::HTMLInputElement::checkedRadioButtonForGroup const):
3679         * html/HTMLInputElement.h:
3680
3681 2019-10-14  David Quesada  <david_quesada@apple.com>
3682
3683         Remove WebCore::IOSApplication::isWebApp()
3684         https://bugs.webkit.org/show_bug.cgi?id=181259
3685
3686         Reviewed by Alex Christensen.
3687
3688         As of iOS 11, the Web.app process no longer uses WebKit directly, so IOSApplication::isWebApp()
3689         is never true. Since it's no longer needed, remove it.
3690
3691         * platform/RuntimeApplicationChecks.h:
3692         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3693         (WebCore::IOSApplication::isWebApp): Deleted.
3694
3695 2019-10-14  Andy Estes  <aestes@apple.com>
3696
3697         REGRESSION (r243682): Quick Look previews loaded from the memory cache render with the wrong content type
3698         https://bugs.webkit.org/show_bug.cgi?id=202935
3699         <rdar://problem/54318133>
3700
3701         Reviewed by Tim Horton.
3702
3703         When loading a Quick Look preview after deciding content policy, PreviewLoader would update
3704         DocumentLoader with the preview response (the response that contains the preview's
3705         Content-Type). It would not update the CachedResource representing the preview main
3706         resource, however, which caches the underlying ResourceResponse in m_response.
3707
3708         When loading from the memory cache, it's the CachedResource's response that's used to
3709         synthesize DocumentLoader::responseReceived. When loading Quick Look previews *before*
3710         deciding content policy, this response would be the preview response, but as described
3711         above, when loading after deciding content policy it's the underlying response.
3712
3713         This patch updates a Quick Look preview's CachedResource with the preview response along
3714         with updating DocumentLoader so that there is not a mismatch between the resource's content
3715         type and its underlying data.
3716
3717         Added a new API test.
3718
3719         * loader/DocumentLoader.cpp:
3720         (WebCore::DocumentLoader::previewResponseReceived):
3721         * loader/DocumentLoader.h:
3722         * loader/ResourceLoader.h:
3723         (WebCore::ResourceLoader::didReceivePreviewResponse):
3724         * loader/SubresourceLoader.cpp:
3725         (WebCore::SubresourceLoader::didReceivePreviewResponse):
3726         * loader/SubresourceLoader.h:
3727         * loader/cache/CachedRawResource.cpp:
3728         (WebCore::CachedRawResource::previewResponseReceived):
3729         * loader/cache/CachedRawResource.h:
3730         * loader/cache/CachedRawResourceClient.h:
3731         (WebCore::CachedRawResourceClient::previewResponseReceived):
3732         * loader/cache/CachedResource.cpp:
3733         (WebCore::CachedResource::previewResponseReceived):
3734         * loader/cache/CachedResource.h:
3735         * loader/ios/PreviewLoader.mm:
3736         (-[WebPreviewLoader _loadPreviewIfNeeded]):
3737
3738 2019-10-14  Youenn Fablet  <youenn@apple.com>
3739
3740         A response body promise should be rejected in case of a failure happening after the HTTP response
3741         https://bugs.webkit.org/show_bug.cgi?id=202792
3742
3743         Reviewed by Chris Dumez.
3744
3745         Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-error.https.html
3746
3747         * Modules/fetch/FetchResponse.cpp:
3748         (WebCore::FetchResponse::BodyLoader::didFail):
3749         Propagate error to fetch body consumer if any.
3750
3751 2019-10-14  Wenson Hsieh  <wenson_hsieh@apple.com>
3752
3753         [Clipboard API] Support writing multiple PasteboardCustomData with SharedBuffers to the pasteboard
3754         https://bugs.webkit.org/show_bug.cgi?id=202851
3755
3756         Reviewed by Darin Adler.
3757
3758         This patch refactors some logic around WebCore::PasteboardCustomData, in preparation for implementing the async
3759         clipboard API. There are two main goals of this refactoring:
3760
3761         1. Enable writing multiple items (each backed by PasteboardCustomData) to the platform pasteboard.
3762         2. Enable writing platform data in the form of SharedBuffers to the platform pasteboard.
3763
3764         See below for more details; no tests, as there is no change in behavior yet.
3765
3766         * Headers.cmake:
3767         * Sources.txt:
3768         * SourcesCocoa.txt:
3769         * WebCore.xcodeproj/project.pbxproj:
3770
3771         Move PasteboardCustomData out of Pasteboard.h and into its own file.
3772
3773         * dom/DataTransfer.cpp:
3774         (WebCore::DataTransfer::commitToPasteboard):
3775         * editing/cocoa/EditorCocoa.mm:
3776         (WebCore::Editor::getPasteboardTypesAndDataForAttachment):
3777         * platform/Pasteboard.cpp:
3778         (WebCore::PasteboardCustomData::createSharedBuffer const): Deleted.
3779         (WebCore::PasteboardCustomData::fromSharedBuffer): Deleted.
3780
3781         Moved these method implementations to PasteboardCustomData.cpp.
3782
3783         * platform/Pasteboard.h:
3784
3785         Refactor PasteboardCustomData so that its member variables are now private, and encapsulated behind methods
3786         Additionally, make it so that the only way to set data on PasteboardCustomData is to use the writeString,
3787         writeData, and writeStringInCustomData methods, which ensure that the PasteboardCustomData is always in a
3788         consistent state.
3789
3790         * platform/PasteboardCustomData.cpp: Added.
3791         (WebCore::copyPlatformData):
3792         (WebCore::PasteboardCustomData::Entry::Entry):
3793         (WebCore::PasteboardCustomData::Entry::operator=):
3794
3795         Refactor the implementation of PasteboardCustomData, so that it contains a list of PasteboardCustomData entries
3796         instead of individual Vectors and HashMaps.
3797
3798         (WebCore::PasteboardCustomData::PasteboardCustomData):
3799         (WebCore::PasteboardCustomData::createSharedBuffer const):
3800         (WebCore::PasteboardCustomData::fromSharedBuffer):
3801         (WebCore::PasteboardCustomData::writeString):
3802         (WebCore::PasteboardCustomData::writeData):
3803         (WebCore::PasteboardCustomData::writeStringInCustomData):
3804         (WebCore::PasteboardCustomData::addOrMoveEntryToEnd):
3805
3806         Move logic from StaticPasteboard into PasteboardCustomData, and refactor these methods to handle
3807         Vector<PasteboardCustomData::Entry>.
3808
3809         (WebCore::PasteboardCustomData::clear):
3810         (WebCore::PasteboardCustomData::operator=):
3811         (WebCore::PasteboardCustomData::orderedTypes const):
3812         (WebCore::PasteboardCustomData::hasData const):
3813         (WebCore::PasteboardCustomData::hasSameOriginCustomData const):
3814         (WebCore::PasteboardCustomData::sameOriginCustomStringData const):
3815         (WebCore::PasteboardCustomData::readBuffer const):
3816         (WebCore::PasteboardCustomData::readString const):
3817         (WebCore::PasteboardCustomData::readStringInCustomData const):
3818         (WebCore::PasteboardCustomData::forEachType const):
3819         (WebCore::PasteboardCustomData::forEachPlatformString const):
3820         (WebCore::PasteboardCustomData::forEachCustomString const):
3821         (WebCore::PasteboardCustomData::forEachPlatformStringOrBuffer const):
3822
3823         Moved these method implementations from StaticPasteboard to PasteboardCustomData, and also introduced some new
3824         methods to help iterate through types and data.
3825
3826         * platform/PasteboardCustomData.h: Added.
3827         (WebCore::PasteboardCustomData::origin const):
3828         (WebCore::PasteboardCustomData::setOrigin):
3829         (WebCore::PasteboardCustomData::data const):
3830         * platform/PasteboardStrategy.h:
3831         * platform/PlatformPasteboard.h:
3832         * platform/SharedBuffer.cpp:
3833         (WebCore::SharedBuffer::decoder const):
3834         * platform/SharedBuffer.h:
3835         * platform/StaticPasteboard.cpp:
3836         (WebCore::StaticPasteboard::hasData):
3837         (WebCore::StaticPasteboard::typesSafeForBindings):
3838         (WebCore::StaticPasteboard::typesForLegacyUnsafeBindings):
3839         (WebCore::StaticPasteboard::readString):
3840         (WebCore::StaticPasteboard::readStringInCustomData):
3841         (WebCore::StaticPasteboard::writeString):
3842         (WebCore::StaticPasteboard::writeData):
3843         (WebCore::StaticPasteboard::writeStringInCustomData):
3844         (WebCore::StaticPasteboard::clear):
3845         (WebCore::StaticPasteboard::takeCustomData):
3846         (WebCore::StaticPasteboard::StaticPasteboard): Deleted.
3847
3848         Refactor StaticPasteboard to now contain a PasteboardCustomData; additionally, adjust several methods in
3849         StaticPasteboard to simply call into PasteboardCustomData to write, read, or clear data.
3850
3851         (WebCore::updateTypes): Deleted.
3852         * platform/StaticPasteboard.h:
3853         * platform/cocoa/PasteboardCocoa.mm:
3854         (WebCore::Pasteboard::readStringInCustomData):
3855         (WebCore::Pasteboard::readOrigin):
3856         (WebCore::PasteboardCustomData::cocoaType): Deleted.
3857
3858         Moved the implementation of PasteboardCustomData::cocoaType from PasteboardCocoa.mm to
3859         PasteboardCustomDataCocoa.mm.
3860
3861         * platform/cocoa/PasteboardCustomDataCocoa.mm: Added.
3862         (WebCore::PasteboardCustomData::cocoaType):
3863         * platform/ios/AbstractPasteboard.h:
3864         * platform/ios/PlatformPasteboardIOS.mm:
3865         (WebCore::PlatformPasteboard::changeCount const):
3866         (WebCore::registerItemsToPasteboard):
3867         (WebCore::registerItemToPasteboard):
3868         (WebCore::PlatformPasteboard::write):
3869
3870         Support writing multiple PasteboardCustomData objects to the platform pasteboard on iOS, by generating
3871         NSItemProviders for each one. This refactors the existing `registerItemToPasteboard` helper to handle multiple
3872         registration lists, renames it to `registerItemsToPasteboard` (plural), and then reimplements
3873         `registerItemToPasteboard` in terms of `registerItemsToPasteboard`.
3874
3875         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3876         (WebCore::createItemProviderRegistrationList):
3877
3878         Adjust these to use getters on PasteboardCustomData instead of accessing the member variables directly.
3879
3880         * platform/ios/WebItemProviderPasteboard.mm:
3881         (-[WebItemProviderPasteboard init]):
3882         (-[WebItemProviderPasteboard stageRegistrationLists:]):
3883         (-[WebItemProviderPasteboard clearRegistrationLists]):
3884         (-[WebItemProviderPasteboard takeRegistrationLists]):
3885
3886         Refactor registration list staging on WebItemProviderPasteboard to support multiple registration lists, each
3887         representing a single item provider.
3888
3889         (-[WebItemProviderPasteboard stageRegistrationList:]): Deleted.
3890         (-[WebItemProviderPasteboard takeRegistrationList]): Deleted.
3891         * platform/mac/PasteboardMac.mm:
3892         (WebCore::Pasteboard::write):
3893         * platform/mac/PasteboardWriter.mm:
3894         (WebCore::createPasteboardWriter):
3895         * platform/mac/PlatformPasteboardMac.mm:
3896         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
3897         (WebCore::PlatformPasteboard::write):
3898
3899         Support writing multiple PasteboardCustomData objects to the platform pasteboard on macOS, by creating and
3900         setting NSPasteboardItems for each custom data. This means that instead of using legacy macOS pasteboard types,
3901         we need to use the "modern" NSPasteboardTypes when writing each item. This is because NSPasteboardItem quietly
3902         fails when attempting to set data for a legacy pasteboard type.
3903
3904         (WebCore::createPasteboardItem):
3905
3906 2019-10-14  Truitt Savell  <tsavell@apple.com>
3907
3908         Unreviewed, rolling out r251081.
3909
3910         Broke macOS and iOS builds
3911
3912         Reverted changeset:
3913
3914         "transform-box: content-box, stroke-box missing"
3915         https://bugs.webkit.org/show_bug.cgi?id=201892
3916         https://trac.webkit.org/changeset/251081
3917
3918 2019-10-14  Dean Jackson  <dino@apple.com>
3919
3920         Reset maxCanvasPixelMemory between tests
3921         https://bugs.webkit.org/show_bug.cgi?id=202941
3922         <rdar://problem/56260865>
3923
3924         Reviewed by Wenson Hsieh.
3925
3926         Reset the maximum canvas memory between tests.
3927
3928         * testing/Internals.cpp:
3929         (WebCore::Internals::resetToConsistentState):
3930
3931 2019-10-14  Myles C. Maxfield  <mmaxfield@apple.com>
3932
3933         [Cocoa] font-family:system-ui on Chinese systems don't get Chinese quote marks
3934         https://bugs.webkit.org/show_bug.cgi?id=202778
3935
3936         Unreviewed.
3937
3938         Addressing post-review comment.
3939
3940         * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
3941         (WebCore::SystemFontDatabaseCoreText::createSystemUIFont):
3942
3943 2019-10-14  Alex Christensen  <achristensen@webkit.org>
3944
3945         REGRESSION: [iOS 13?] TestWebKitAPI.SharedBufferTest.tryCreateArrayBufferLargeSegments is failing
3946         https://bugs.webkit.org/show_bug.cgi?id=201902
3947
3948         Reviewed by Ryosuke Niwa.
3949
3950         * Modules/webauthn/fido/U2fResponseConverter.cpp:
3951         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
3952
3953 2019-10-14  Russell Epstein  <russell_e@apple.com>
3954
3955         Unreviewed, rolling out r251081.
3956
3957         Broke macOS and iOS builds.
3958
3959         Reverted changeset:
3960
3961         "transform-box: content-box, stroke-box missing"
3962         https://bugs.webkit.org/show_bug.cgi?id=201892
3963         https://trac.webkit.org/changeset/251081
3964
3965 2019-10-14  Dirk Schulze  <krit@webkit.org>
3966
3967         transform-box: content-box, stroke-box missing
3968         https://bugs.webkit.org/show_bug.cgi?id=201892
3969
3970         Reviewed by Simon Fraser.
3971