d0c87cfc30df22fbe2b159b69c6b141f7056f205
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-15  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: Canvas: remove agent as observer when disabling
4         https://bugs.webkit.org/show_bug.cgi?id=195825
5         <rdar://problem/48940255>
6
7         Reviewed by Joseph Pecoraro.
8
9         No change in functionality.
10
11         * inspector/agents/InspectorCanvasAgent.cpp:
12         (WebCore::InspectorCanvasAgent::disable):
13
14 2019-03-15  Ryosuke Niwa  <rniwa@webkit.org>
15
16         REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
17         https://bugs.webkit.org/show_bug.cgi?id=194196
18
19         Reviewed by Simon Fraser.
20
21         Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
22         instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
23
24         Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
25
26         * platform/Timer.cpp:
27         (WebCore::TimerBase::TimerBase):
28         (WebCore::TimerBase::~TimerBase):
29         (WebCore::TimerBase::setNextFireTime):
30         (WebCore::TimerBase::nextUnalignedFireInterval const):
31         * platform/Timer.h:
32
33 2019-03-15  Sihui Liu  <sihui_liu@apple.com>
34
35         [ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
36         https://bugs.webkit.org/show_bug.cgi?id=190350
37         <rdar://problem/45089503>
38
39         Reviewed by Geoffrey Garen.
40
41         Start to use hash for database file names so that the files can work on any filesystem.
42
43         We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded 
44         databases.
45
46         Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
47                TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
48                TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
49                TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
50                TestWebKitAPI.IndexedDB.HashCollision
51
52         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
53         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
54         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
55         * Modules/indexeddb/IDBDatabaseIdentifier.h:
56         * Modules/indexeddb/server/IDBServer.cpp:
57         (WebCore::IDBServer::m_quotaManagerGetter):
58         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
59         (WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
60         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
61         (WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
62         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
63         (WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
64         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
65         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
66         (WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
67         * Modules/indexeddb/server/IDBServer.h:
68         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
69         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
70         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
71         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
72         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
73         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
74         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
75         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
76         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
77         (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
78         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
79         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
80         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
81         (WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
82         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
83         (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
84         (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
85         * platform/sql/SQLiteFileSystem.cpp:
86         (WebCore::SQLiteFileSystem::computeHashForFileName):
87         * platform/sql/SQLiteFileSystem.h:
88
89 2019-03-15  Zalan Bujtas  <zalan@apple.com>
90
91         [ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
92         https://bugs.webkit.org/show_bug.cgi?id=195657
93         <rdar://problem/48834987>
94
95         Reviewed by Simon Fraser.
96
97         Images should not trigger hover by default (only when they actually respond to mouse events).
98
99         Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
100
101         * page/ios/ContentChangeObserver.cpp:
102         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
103
104 2019-03-15  Jer Noble  <jer.noble@apple.com>
105
106         Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
107         https://bugs.webkit.org/show_bug.cgi?id=195763
108
109         Reviewed by Jon Lee.
110
111         Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
112
113         Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
114         to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
115         answering a decodeInfo() or enocdeInfo() query.
116
117         * CMakeLists.txt:
118         * DerivedSources-input.xcfilelist:
119         * DerivedSources-output.xcfilelist:
120         * DerivedSources.make:
121         * Modules/mediacapabilities/AudioConfiguration.idl:
122         * Modules/mediacapabilities/MediaCapabilities.cpp:
123         (WebCore::MediaCapabilities::decodingInfo):
124         (WebCore::MediaCapabilities::encodingInfo):
125         * Modules/mediacapabilities/MediaCapabilities.idl:
126         * Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
127         * Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
128         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
129         * Modules/mediacapabilities/MediaDecodingConfiguration.idl:
130         * Modules/mediacapabilities/MediaEncodingConfiguration.idl:
131         * Modules/mediacapabilities/VideoConfiguration.idl:
132         * Sources.txt:
133         * WebCore.xcodeproj/project.pbxproj:
134         * platform/MediaCapabilitiesDecodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
135         (WebCore::MediaCapabilitiesDecodingInfo::MediaCapabilitiesDecodingInfo):
136         * platform/MediaCapabilitiesEncodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
137         (WebCore::MediaCapabilitiesEncodingInfo::MediaCapabilitiesEncodingInfo):
138         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
139         (WebCore::createMediaPlayerDecodingConfigurationCocoa):
140         * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h:
141         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp:
142         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
143         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h:
144         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
145         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
146         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
147         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
148         * platform/mock/MediaEngineConfigurationFactoryMock.cpp:
149         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
150         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
151         * platform/mock/MediaEngineConfigurationFactoryMock.h:
152
153 2019-03-15  Antti Koivisto  <antti@apple.com>
154
155         Use Region for event region even when it is a rectangle
156         https://bugs.webkit.org/show_bug.cgi?id=195803
157
158         Reviewed by Simon Fraser.
159
160         Region type is now optimized for the common single-rectangle case so we can simplify code.
161
162         * platform/graphics/GraphicsLayer.cpp:
163         (WebCore::GraphicsLayer::setEventRegion):
164         * platform/graphics/GraphicsLayer.h:
165         (WebCore::GraphicsLayer::eventRegion const):
166         * platform/graphics/ca/GraphicsLayerCA.cpp:
167         (WebCore::GraphicsLayerCA::setEventRegion):
168         * platform/graphics/ca/GraphicsLayerCA.h:
169         * platform/graphics/ca/PlatformCALayer.h:
170         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
171         * rendering/RenderLayerBacking.cpp:
172         (WebCore::RenderLayerBacking::paintIntoLayer):
173
174 2019-03-15  Jer Noble  <jer.noble@apple.com>
175
176         Unreviewed unified build fix: GPUBindGroup has a default public constructor and destructor, so all its member
177         variables must be fully defined.
178
179         * platform/graphics/gpu/GPUBindGroup.h:
180
181 2019-03-15  Per Arne Vollan  <pvollan@apple.com>
182
183         [macOS] Broker access to Speech Synthesis
184         https://bugs.webkit.org/show_bug.cgi?id=195645
185         <rdar://problem/35369026>
186
187         Reviewed by Brent Fulgham.
188
189         To be able to close the connection to the speech synthesis daemon in the WebContent process,
190         speech synthesis should be performed in the UI process. This patch forwards speech synthesis
191         requests to the UI process by sending messages. On the UI process side, the speech synthesis
192         is performed by simply using the existing platform speech synthesizer. Speech synthesis
193         events are sent back to the WebContent process. All messages are async, except for the
194         message to get the list of available voices.
195
196         No new tests, covered by existing tests.
197
198         * Modules/speech/DOMWindowSpeechSynthesis.cpp:
199         (WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
200         * Modules/speech/SpeechSynthesis.cpp:
201         (WebCore::SpeechSynthesis::create):
202         (WebCore::SpeechSynthesis::SpeechSynthesis):
203         (WebCore::SpeechSynthesis::setPlatformSynthesizer):
204         (WebCore::SpeechSynthesis::getVoices):
205         (WebCore::SpeechSynthesis::startSpeakingImmediately):
206         (WebCore::SpeechSynthesis::cancel):
207         (WebCore::SpeechSynthesis::pause):
208         (WebCore::SpeechSynthesis::resume):
209         (WebCore::SpeechSynthesis::boundaryEventOccurred):
210         (WebCore::SpeechSynthesis::didStartSpeaking):
211         (WebCore::SpeechSynthesis::didFinishSpeaking):
212         (WebCore::SpeechSynthesis::didPauseSpeaking):
213         (WebCore::SpeechSynthesis::didResumeSpeaking):
214         (WebCore::SpeechSynthesis::speakingErrorOccurred):
215         (WebCore::SpeechSynthesis::voicesChanged):
216         * Modules/speech/SpeechSynthesis.h:
217         * WebCore.xcodeproj/project.pbxproj:
218         * page/Page.cpp:
219         (WebCore::Page::Page):
220         * page/Page.h:
221         (WebCore::Page::speechSynthesisClient const):
222         * page/PageConfiguration.cpp:
223         * page/PageConfiguration.h:
224         * page/SpeechSynthesisClient.h: Added.
225         * platform/PlatformSpeechSynthesisUtterance.h:
226         * platform/PlatformSpeechSynthesizer.h:
227         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
228         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
229         * platform/mac/PlatformSpeechSynthesizerMac.mm:
230         (-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakWord:ofString:]):
231         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
232         (WebCore::PlatformSpeechSynthesizerMock::speak):
233
234 2019-03-15  Antti Koivisto  <antti@apple.com>
235
236         Try to fix watchOS build.
237
238         * platform/graphics/Region.h:
239         (WebCore::Region::Span::decode):
240
241 2019-03-15  Simon Fraser  <simon.fraser@apple.com>
242
243         [Async overflow Scrolling] Update positioned node layers when overflows are scrolled
244         https://bugs.webkit.org/show_bug.cgi?id=195733
245         rdar://problem/11642295
246
247         Reviewed by Antti Koivisto.
248
249         Make ScrollingTree positioned nodes in the two cases where we need them, as
250         detected by RenderLayerCompositor::computeCoordinatedPositioningForLayer().
251
252         For "Moves" layers we know that the overflow is not in the z-order ancestor chain,
253         so ScrollingTree needs a map of overflow node -> affected positioned nodes which
254         notifyRelatedNodesAfterScrollPositionChange() uses to find nodes to update after
255         a scroll. Computing these dependent nodes in RenderLayerCompositor() would require
256         correct dependency analysis between an overflow layers and "positioned" layers which
257         is hard. It's easier to have "positioned" layers figure out which overflow nodes
258         affect them, then compute the inverse relationship when the scrolling tree is updated
259         which happens in ScrollingTreePositionedNode::commitStateBeforeChildren().
260
261         Tests: scrollingcoordinator/ios/absolute-layer-should-not-move-with-scroll.html
262                scrollingcoordinator/ios/relative-layer-should-move-with-scroll.html
263
264         * page/scrolling/ScrollingTree.cpp:
265         (WebCore::ScrollingTree::commitTreeState):
266         (WebCore::ScrollingTree::applyLayerPositions):
267         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
268         (WebCore::ScrollingTree::scrollingTreeAsText):
269         * page/scrolling/ScrollingTree.h:
270         (WebCore::ScrollingTree::overflowRelatedNodes):
271         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
272         (WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
273         * page/scrolling/ScrollingTreeOverflowScrollingNode.h:
274         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
275         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
276         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
277         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
278         * rendering/RenderLayerCompositor.cpp:
279         (WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary):
280         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
281         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
282         (WebCore::collectRelatedCoordinatedScrollingNodes):
283         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
284
285 2019-03-15  Antti Koivisto  <antti@apple.com>
286
287         Optimize Region for single rectangle case
288         https://bugs.webkit.org/show_bug.cgi?id=195743
289
290         Reviewed by Simon Fraser.
291
292         Instrumentation shows vast majority of Region objects consist of a single rectangle. However it always allocates
293         the large Shape data structure. This makes it unsuitable to use as a member in any popular objects.
294
295         This patch optimizes the single rectangle case by using only the bounds rectangle to describe it.
296         Shape is allocated on demand. This makes it safe to use Region as a data member where a rectangle is the common case.
297
298         The patch also modernizes Region encoding/decoding support.
299
300         * platform/graphics/Region.cpp:
301         (WebCore::Region::Region):
302         (WebCore::Region::~Region):
303         (WebCore::Region::operator=):
304         (WebCore::Region::rects const):
305         (WebCore::Region::contains const):
306         (WebCore::Region::intersects const):
307         (WebCore::Region::Shape::Shape):
308         (WebCore::Region::Shape::appendSpan):
309         (WebCore::Region::dump const):
310         (WebCore::Region::intersect):
311         (WebCore::Region::unite):
312         (WebCore::Region::subtract):
313         (WebCore::Region::translate):
314         (WebCore::Region::setShape):
315         (WebCore::Region::Shape::isValid const): Deleted.
316         (WebCore::Region::Shape::swap): Deleted.
317         (WebCore::Region::updateBoundsFromShape): Deleted.
318
319         Remove some now unused function.
320
321         * platform/graphics/Region.h:
322         (WebCore::Region::isRect const):
323         (WebCore::Region::gridSize const):
324         (WebCore::Region::copyShape const):
325         (WebCore::operator==):
326         (WebCore::Region::Span::encode const):
327         (WebCore::Region::Span::decode):
328         (WebCore::Region::Shape::encode const):
329         (WebCore::Region::Shape::decode):
330         (WebCore::Region::encode const):
331         (WebCore::Region::decode):
332
333         This is now part of type.
334
335         (WebCore::Region::isValid const): Deleted.
336         (WebCore::Region::Span::Span): Deleted.
337         (WebCore::Region::shapeSegments const): Deleted.
338         (WebCore::Region::shapeSpans const): Deleted.
339         (WebCore::Region::setShapeSegments): Deleted.
340         (WebCore::Region::setShapeSpans): Deleted.
341         (WebCore::Region::Shape::segments const): Deleted.
342         (WebCore::Region::Shape::spans const): Deleted.
343         (WebCore::Region::Shape::setSegments): Deleted.
344         (WebCore::Region::Shape::setSpans): Deleted.
345
346         No need to expose these for encoding anymore.
347
348 2019-03-15  Devin Rousso  <drousso@apple.com>
349
350         Web Inspector: provide a way to capture a screenshot of a node from within the page
351         https://bugs.webkit.org/show_bug.cgi?id=194279
352         <rdar://problem/10731573>
353
354         Reviewed by Joseph Pecoraro.
355
356         Test: inspector/console/console-screenshot.html
357
358         Add `console.screenshot` functionality, which displays a screenshot of a given object (if
359         able) within Web Inspector's Console tab. From there, it can be viewed and saved.
360
361         Currently, `console.screenshot` will
362          - capture an image of a `Node` (if provided)
363          - capture an image of the viewport if nothing is provided
364
365         * page/PageConsoleClient.h:
366         * page/PageConsoleClient.cpp:
367         (WebCore::PageConsoleClient::addMessage):
368         (WebCore::PageConsoleClient::screenshot): Added.
369
370         * workers/WorkerConsoleClient.h:
371         * workers/WorkerConsoleClient.cpp:
372         (WebCore::WorkerConsoleClient::screenshot): Added.
373         * worklets/WorkletConsoleClient.h:
374         * worklets/WorkletConsoleClient.cpp:
375         (WebCore::WorkletConsoleClient::screenshot): Added.
376
377         * inspector/CommandLineAPIModuleSource.js:
378         (CommandLineAPIImpl.prototype.screenshot): Added.
379
380         * inspector/InspectorInstrumentation.h:
381
382 2019-03-14  Yusuke Suzuki  <ysuzuki@apple.com>
383
384         [JSC] Retain PrivateName of Symbol before passing it to operations potentially incurring GC
385         https://bugs.webkit.org/show_bug.cgi?id=195791
386         <rdar://problem/48806130>
387
388         Reviewed by Mark Lam.
389
390         * bindings/js/ScriptController.cpp:
391         (WebCore::ScriptController::setupModuleScriptHandlers):
392
393 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
394
395         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
396         https://bugs.webkit.org/show_bug.cgi?id=195754
397         <rdar://problem/48591957>
398
399         Reviewed by Jiewen Tan.
400
401         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
402         Update the const correctness of one function call to match new SDK declaration.
403
404         No tests because there are no changes in behavior.
405
406         * crypto/CommonCryptoUtilities.h:
407         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
408         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
409
410 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
411
412         IndexedDB: re-enable some leak tests
413         https://bugs.webkit.org/show_bug.cgi?id=194806
414
415         Reviewed by Geoffrey Garen.
416
417         Protected JSIDBCursor object when advance/continue request on IDBCursor is not finished, because after the 
418         advance operation completes on success, we need to return the same JSIDBCursor object as before the advance, 
419         and during the wait for advance operation to complete, we need to return error as the result. 
420  
421         Covered by existing tests.
422
423         * Modules/indexeddb/IDBCursor.cpp:
424         (WebCore::IDBCursor::setGetResult):
425         (WebCore::IDBCursor::clearWrappers):
426         * Modules/indexeddb/IDBCursor.h:
427         * Modules/indexeddb/IDBRequest.cpp:
428         (WebCore::IDBRequest::stop):
429         (WebCore::IDBRequest::setResult):
430         (WebCore::IDBRequest::setResultToStructuredClone):
431         (WebCore::IDBRequest::setResultToUndefined):
432         (WebCore::IDBRequest::willIterateCursor):
433         (WebCore::IDBRequest::didOpenOrIterateCursor):
434         (WebCore::IDBRequest::clearWrappers):
435         * Modules/indexeddb/IDBRequest.h:
436         (WebCore::IDBRequest::cursorWrapper):
437         * bindings/js/JSIDBRequestCustom.cpp:
438         (WebCore::JSIDBRequest::visitAdditionalChildren):
439         * bindings/js/JSValueInWrappedObject.h:
440         (WebCore::JSValueInWrappedObject::JSValueInWrappedObject):
441         (WebCore::JSValueInWrappedObject::operator=):
442         (WebCore::JSValueInWrappedObject::clear):
443
444 2019-03-14  Shawn Roberts  <sroberts@apple.com>
445
446         Unreviewed, rolling out r242981.
447
448         Causing internal build failures on watch/tv OS
449
450         Reverted changeset:
451
452         "Move CoreCrypto SPI declarations to an appropriate PAL/spi
453         header"
454         https://bugs.webkit.org/show_bug.cgi?id=195754
455         https://trac.webkit.org/changeset/242981
456
457 2019-03-14  Sihui Liu  <sihui_liu@apple.com>
458
459         Web process is put to suspended when holding locked WebSQL files
460         https://bugs.webkit.org/show_bug.cgi?id=195768
461
462         Reviewed by Geoffrey Garen.
463
464         We need to keep processes active during database close, because SQLite database may run a checkpoint operation
465         and lock database files.
466
467         * platform/sql/SQLiteDatabase.cpp:
468         (WebCore::SQLiteDatabase::useWALJournalMode):
469         (WebCore::SQLiteDatabase::close):
470         * platform/sql/SQLiteDatabase.h:
471
472 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
473
474         Move CoreCrypto SPI declarations to an appropriate PAL/spi header
475         https://bugs.webkit.org/show_bug.cgi?id=195754
476         <rdar://problem/48591957>
477
478         Reviewed by Jiewen Tan.
479
480         Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
481         Update the const correctness of one function call to match new SDK declaration.
482
483         No tests because there are no changes in behavior.
484
485         * crypto/CommonCryptoUtilities.h:
486         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
487         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
488
489 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
490
491         Rename SVGProperty to SVGLegacyProperty and rename SVGAnimatedProperty to SVGLegacyAnimatedProperty
492         https://bugs.webkit.org/show_bug.cgi?id=195767
493
494         Reviewed by Tim Horton.
495
496         This is a step towards removing the SVG properties tear off objects.
497
498         * Sources.txt:
499         * WebCore.xcodeproj/project.pbxproj:
500         * svg/SVGAngle.h:
501         (WebCore::SVGAngle::create):
502         (WebCore::SVGAngle::SVGAngle):
503         * svg/SVGAnimateElement.h:
504         * svg/SVGAnimatedTypeAnimator.h:
505         (WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
506         * svg/SVGElement.h:
507         (WebCore::SVGElement::lookupAnimatedProperty const):
508         (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
509         (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
510         * svg/SVGLength.h:
511         (WebCore::SVGLength::create):
512         (WebCore::SVGLength::SVGLength):
513         * svg/SVGMatrix.h:
514         (WebCore::SVGMatrix::create):
515         (WebCore::SVGMatrix::SVGMatrix):
516         * svg/SVGNumber.h:
517         (WebCore::SVGNumber::create):
518         (WebCore::SVGNumber::SVGNumber):
519         * svg/SVGPathElement.cpp:
520         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
521         * svg/SVGPathElement.h:
522         * svg/SVGPathSegList.cpp:
523         (WebCore::SVGPathSegList::processIncomingListItemValue):
524         * svg/SVGPathSegWithContext.h:
525         (WebCore::SVGPathSegWithContext::animatedProperty const):
526         * svg/SVGPoint.h:
527         (WebCore::SVGPoint::create):
528         (WebCore::SVGPoint::SVGPoint):
529         * svg/SVGPreserveAspectRatio.h:
530         (WebCore::SVGPreserveAspectRatio::create):
531         (WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
532         * svg/SVGRect.h:
533         (WebCore::SVGRect::create):
534         (WebCore::SVGRect::SVGRect):
535         * svg/SVGTransform.h:
536         (WebCore::SVGTransform::create):
537         (WebCore::SVGTransform::SVGTransform):
538         * svg/properties/SVGAnimatedListPropertyTearOff.h:
539         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
540         (WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
541         * svg/properties/SVGAnimatedProperty.cpp: Removed.
542         * svg/properties/SVGAnimatedProperty.h: Removed.
543         * svg/properties/SVGAnimatedPropertyTearOff.h:
544         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
545         (WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
546         * svg/properties/SVGAttributeAccessor.h:
547         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
548         (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
549         (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
550         (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
551         (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
552         * svg/properties/SVGAttributeOwnerProxy.h:
553         * svg/properties/SVGAttributeOwnerProxyImpl.h:
554         * svg/properties/SVGAttributeRegistry.h:
555         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
556         (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
557         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
558         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
559         (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
560         (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
561         * svg/properties/SVGLegacyAnimatedProperty.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.cpp.
562         (WebCore::SVGLegacyAnimatedProperty::SVGLegacyAnimatedProperty):
563         (WebCore::SVGLegacyAnimatedProperty::~SVGLegacyAnimatedProperty):
564         (WebCore::SVGLegacyAnimatedProperty::commitChange):
565         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted.
566         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted.
567         (WebCore::SVGAnimatedProperty::commitChange): Deleted.
568         * svg/properties/SVGLegacyAnimatedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.h.
569         (WebCore::SVGLegacyAnimatedProperty::lookupOrCreateAnimatedProperty):
570         (WebCore::SVGLegacyAnimatedProperty::lookupAnimatedProperty):
571         (WebCore::SVGAnimatedProperty::isAnimating const): Deleted.
572         (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted.
573         (WebCore::SVGAnimatedProperty::contextElement const): Deleted.
574         (WebCore::SVGAnimatedProperty::attributeName const): Deleted.
575         (WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted.
576         (WebCore::SVGAnimatedProperty::isReadOnly const): Deleted.
577         (WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted.
578         (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted.
579         (WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted.
580         (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
581         * svg/properties/SVGLegacyProperty.h: Copied from Source/WebCore/svg/properties/SVGProperty.h.
582         * svg/properties/SVGListProperty.h:
583         * svg/properties/SVGProperty.h: Removed.
584         * svg/properties/SVGPropertyTearOff.h:
585         (WebCore::SVGPropertyTearOff::create):
586         (WebCore::SVGPropertyTearOff::animatedProperty const):
587         (WebCore::SVGPropertyTearOff::setAnimatedProperty):
588         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
589
590 2019-03-14  Ryan Haddad  <ryanhaddad@apple.com>
591
592         Unreviewed, rolling out r242963.
593
594         Breaks watchOS build.
595
596         Reverted changeset:
597
598         "Move CommonCrypto SPI declarations to an appropriate PAL/spi
599         header"
600         https://bugs.webkit.org/show_bug.cgi?id=195754
601         https://trac.webkit.org/changeset/242963
602
603 2019-03-14  Chris Dumez  <cdumez@apple.com>
604
605         Unreviewed, update xcfilelist files as they are out of sync.
606
607         * DerivedSources-input.xcfilelist:
608         * DerivedSources-output.xcfilelist:
609
610 2019-03-14  Justin Fan  <justin_fan@apple.com>
611
612         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
613         https://bugs.webkit.org/show_bug.cgi?id=195083
614         <rdar://problem/48423591>
615
616         Reviewed by Dean Jackson.
617
618         Fixing build error and re-introducing rolled-out changes.
619         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
620         is now WebGPUCommandEncoder.
621
622         Affected Web GPU tests updated to match new API.
623
624         New files and symbols:
625         * CMakeLists.txt:
626         * DerivedSources.make:
627         * Sources.txt:
628         * WebCore.xcodeproj/project.pbxproj:
629         * bindings/js/WebCoreBuiltinNames.h:
630
631         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
632         * Modules/webgpu/WebGPUCommandBuffer.cpp:
633         (WebCore::WebGPUCommandBuffer::create):
634         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
635         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
636         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
637         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
638         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
639         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
640         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
641         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
642         * Modules/webgpu/WebGPUCommandBuffer.h:
643         (WebCore::WebGPUCommandBuffer::commandBuffer):
644         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
645         * Modules/webgpu/WebGPUCommandBuffer.idl:
646
647         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
648         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
649         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
650         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
651         (WebCore::WebGPUCommandEncoder::create):
652         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
653         (WebCore::WebGPUCommandEncoder::beginRenderPass):
654         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
655         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
656         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
657         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
658         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
659         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
660         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
661         * Modules/webgpu/WebGPUDevice.cpp:
662         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
663         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
664         * Modules/webgpu/WebGPUDevice.h:
665         * Modules/webgpu/WebGPUDevice.idl:
666         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
667         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
668         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
669         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
670         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
671         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
672         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
673         * Modules/webgpu/WebGPUQueue.cpp:
674         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
675         * Modules/webgpu/WebGPUQueue.h:
676         * Modules/webgpu/WebGPUQueue.idl:
677         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
678         (WebCore::WebGPURenderPassEncoder::create):
679         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
680         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
681         (WebCore::WebGPURenderPassEncoder::draw):
682         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
683         * Modules/webgpu/WebGPURenderPassEncoder.h:
684         * Modules/webgpu/WebGPUSwapChain.cpp:
685         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
686         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
687         * platform/graphics/gpu/GPUDevice.cpp:
688         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
689         (WebCore::GPUDevice::createCommandBuffer): Deleted.
690         * platform/graphics/gpu/GPUDevice.h:
691         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
692         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
693         (WebCore::GPUCommandBuffer::create): Deleted.
694
695 2019-03-14  Justin Fan  <justin_fan@apple.com>
696
697         [Web GPU] Enum cleanup
698         https://bugs.webkit.org/show_bug.cgi?id=195766
699
700         Reviewed by Myles C. Maxfield.
701
702         Clean up enum implementations in Web GPU. Enums referenced by only one class now share implementation files with that class to reduce clutter.
703         
704         No change in behavior.
705
706         * DerivedSources.make:
707         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
708         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
709         * Modules/webgpu/GPUInputStateDescriptor.idl:
710         * Modules/webgpu/GPURequestAdapterOptions.idl:
711         * Modules/webgpu/GPUSamplerDescriptor.idl:
712         * Modules/webgpu/GPUTextureDescriptor.idl:
713         * Modules/webgpu/GPUTextureDimension.idl: Removed.
714         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
715         * Modules/webgpu/GPUVertexInputDescriptor.idl:
716         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
717         (WebCore::validateBufferBindingType):
718         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
719         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
720         * Sources.txt:
721         * WebCore.xcodeproj/project.pbxproj:
722         * platform/graphics/gpu/GPUInputStateDescriptor.h:
723         * platform/graphics/gpu/GPURequestAdapterOptions.h:
724         * platform/graphics/gpu/GPUSamplerDescriptor.h:
725         * platform/graphics/gpu/GPUTextureDescriptor.h:
726         * platform/graphics/gpu/GPUTextureDimension.h: Removed.
727         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
728         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
729         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
730         (WebCore::MTLDataTypeForBindingType):
731         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
732         (WebCore::GPUBindGroup::tryCreate):
733         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
734         (WebCore::GPUDevice::create):
735         * platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
736         (WebCore::mtlAddressModeForAddressMode):
737         (WebCore::mtlMinMagFilterForFilterMode):
738         (WebCore::mtlMipFilterForFilterMode):
739
740 2019-03-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
741
742         Use enum class for AnimationMode
743         https://bugs.webkit.org/show_bug.cgi?id=195762
744
745         Reviewed by Tim Horton.
746
747         Convert AnimationMode into an enum class.
748
749         * svg/SVGAnimateElementBase.cpp:
750         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
751         (WebCore::SVGAnimateElementBase::isAdditive const):
752         * svg/SVGAnimateMotionElement.cpp:
753         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
754         (WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
755         (WebCore::SVGAnimateMotionElement::updateAnimationMode):
756         * svg/SVGAnimatedAngle.cpp:
757         (WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
758         * svg/SVGAnimatedBoolean.cpp:
759         (WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
760         * svg/SVGAnimatedColor.cpp:
761         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
762         * svg/SVGAnimatedEnumeration.cpp:
763         (WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
764         * svg/SVGAnimatedInteger.cpp:
765         (WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
766         * svg/SVGAnimatedIntegerOptionalInteger.cpp:
767         (WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
768         * svg/SVGAnimatedLength.cpp:
769         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
770         * svg/SVGAnimatedLengthList.cpp:
771         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
772         * svg/SVGAnimatedNumber.cpp:
773         (WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
774         * svg/SVGAnimatedNumberList.cpp:
775         (WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
776         * svg/SVGAnimatedNumberOptionalNumber.cpp:
777         (WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
778         * svg/SVGAnimatedPath.cpp:
779         (WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
780         * svg/SVGAnimatedPointList.cpp:
781         (WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
782         * svg/SVGAnimatedPreserveAspectRatio.cpp:
783         (WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
784         * svg/SVGAnimatedRect.cpp:
785         (WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
786         * svg/SVGAnimatedTransformList.cpp:
787         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
788         * svg/SVGAnimationElement.cpp:
789         (WebCore::SVGAnimationElement::updateAnimationMode):
790         (WebCore::SVGAnimationElement::isAdditive const):
791         (WebCore::SVGAnimationElement::isAccumulated const):
792         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
793         (WebCore::SVGAnimationElement::startedActiveInterval):
794         (WebCore::SVGAnimationElement::updateAnimation):
795         * svg/SVGAnimationElement.h:
796         (WebCore::SVGAnimationElement::adjustFromToListValues):
797         (WebCore::SVGAnimationElement::animateDiscreteType):
798         (WebCore::SVGAnimationElement::animateAdditiveNumber):
799         * svg/SVGSetElement.cpp:
800         (WebCore::SVGSetElement::SVGSetElement):
801         (WebCore::SVGSetElement::updateAnimationMode):
802
803 2019-03-14  Ryosuke Niwa  <rniwa@webkit.org>
804
805         Storing a Node in Ref/RefPtr inside its destructor results in double delete
806         https://bugs.webkit.org/show_bug.cgi?id=195661
807
808         Reviewed by Brent Fulgham.
809
810         Set Node::m_refCount to 1 before calling its virtual destructor.
811
812         This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr
813         inside the destructor, which is a programming error caught by debug assertions, from triggering
814         a double-delete on the same Node.
815
816         Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction
817         had been set to true by then.
818
819         * dom/Document.cpp:
820         (WebCore::Document::removedLastRef):
821         * dom/Document.h:
822         (WebCore::Document::decrementReferencingNodeCount):
823         * dom/Node.cpp:
824         (WebCore::Node::~Node):
825         (WebCore::Node::removedLastRef):
826
827 2019-03-14  Brent Fulgham  <bfulgham@apple.com>
828
829         Move CommonCrypto SPI declarations to an appropriate PAL/spi header
830         https://bugs.webkit.org/show_bug.cgi?id=195754
831         <rdar://problem/48591957>
832
833         Reviewed by Jiewen Tan.
834
835         Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
836         Update the const correctness of one function call to match new SDK declaration.
837
838         No tests because there are no changes in behavior.
839
840         * crypto/CommonCryptoUtilities.h:
841         * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
842         (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
843
844 2019-03-14  Chris Dumez  <cdumez@apple.com>
845
846         Add WebsitePolicy for the client to specify the device orientation & motion access policy
847         https://bugs.webkit.org/show_bug.cgi?id=195750
848
849         Reviewed by Geoffrey Garen.
850
851         Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
852         the client already knows access to the device motion & orientation API will be granted / denied,
853         it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
854         permission is requested by JS.
855
856         * dom/DeviceOrientationAndMotionAccessController.cpp:
857         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
858         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
859         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
860         * dom/DeviceOrientationAndMotionAccessController.h:
861         * loader/DocumentLoader.h:
862         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
863         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
864         * page/DOMWindow.cpp:
865         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
866
867 2019-03-14  Shawn Roberts  <sroberts@apple.com>
868
869         Unreviewed, rolling out r242931.
870
871         Causing internal watch/tv OS build failures
872
873         Reverted changeset:
874
875         "[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue
876         concept"
877         https://bugs.webkit.org/show_bug.cgi?id=195083
878         https://trac.webkit.org/changeset/242931
879
880 2019-03-14  Chris Dumez  <cdumez@apple.com>
881
882         Device orientation's permission should only require a user gesture to prompt the user
883         https://bugs.webkit.org/show_bug.cgi?id=195731
884
885         Reviewed by Geoffrey Garen.
886
887         Device orientation's permission should only require a user gesture to prompt the user. If the
888         user already made a decision, we should resolve the promise with this decision, even without
889         user gesture.
890
891         This is useful for JS to figure out if they are access to device orientation or not because
892         showing UI for the user to give permission.
893
894         No new tests, updated existing tests.
895
896         * dom/DeviceOrientationAndMotionAccessController.cpp:
897         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
898         * dom/DeviceOrientationAndMotionAccessController.h:
899         * dom/DeviceOrientationOrMotionEvent.cpp:
900         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
901
902 2019-03-14  Youenn Fablet  <youenn@apple.com>
903
904         Reset storage quota when clearing IDB/Cache API entries
905         https://bugs.webkit.org/show_bug.cgi?id=195716
906
907         Reviewed by Chris Dumez.
908
909         On clearing of databases, reset all quota users.
910         This will ensure all layout test runs start with a clean state.
911
912         * Modules/indexeddb/server/IDBServer.cpp:
913         (WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
914         * storage/StorageQuotaManager.h:
915         (WebCore::StorageQuotaManager::resetQuota):
916
917 2019-03-14  Jer Noble  <jer.noble@apple.com>
918
919         Certain videos are causing a crash when used as WebGL texture
920         https://bugs.webkit.org/show_bug.cgi?id=195700
921         <rdar://problem/48869347>
922
923         Reviewed by Eric Carlson.
924
925         CFEqual is not null-safe, so perform a null and type check before comparing.
926
927         * platform/graphics/cv/VideoTextureCopierCV.cpp:
928         (WebCore::transferFunctionFromString):
929
930 2019-03-14  Zalan Bujtas  <zalan@apple.com>
931
932         Cleanup inline boxes when list marker gets blockified
933         https://bugs.webkit.org/show_bug.cgi?id=195746
934         <rdar://problem/48049175>
935
936         Reviewed by Antti Koivisto.
937
938         Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
939         During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
940         change does not require a new renderer.
941         This patch takes care of destroying the inline boxtree when the marker gains block display type. 
942
943         Test: fast/block/float/list-marker-is-float-crash.html
944
945         * rendering/RenderListMarker.cpp:
946         (WebCore::RenderListMarker::styleDidChange):
947
948 2019-03-14  Devin Rousso  <drousso@apple.com>
949
950         Web Inspector: Audit: provide a way to get the contents of resources
951         https://bugs.webkit.org/show_bug.cgi?id=195266
952         <rdar://problem/48550911>
953
954         Reviewed by Joseph Pecoraro.
955
956         Test: inspector/audit/run-resources.html
957
958         * inspector/InspectorAuditResourcesObject.idl: Added.
959         * inspector/InspectorAuditResourcesObject.h: Added.
960         (WebCore::InspectorAuditResourcesObject::create):
961         (WebCore::InspectorAuditResourcesObject::Resource):
962         (WebCore::InspectorAuditResourcesObject::ResourceContent):
963         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
964         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
965         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
966         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
967         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
968         (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
969         * inspector/InspectorAuditResourcesObject.cpp: Added.
970         (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
971         (WebCore::InspectorAuditResourcesObject::getResources):
972         (WebCore::InspectorAuditResourcesObject::getResourceContent):
973         (WebCore::InspectorAuditResourcesObject::clientForResource):
974
975         * inspector/agents/InspectorPageAgent.h:
976         * inspector/agents/InspectorPageAgent.cpp:
977         (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
978         (WebCore::allResourcesURLsForFrame):
979         Moved a file static function to be a class static function so it can be used elsewhere.
980
981         * CMakeLists.txt:
982         * DerivedSources-input.xcfilelist:
983         * DerivedSources-output.xcfilelist:
984         * DerivedSources.make:
985         * Sources.txt:
986         * WebCore.xcodeproj/project.pbxproj:
987
988 2019-03-14  Devin Rousso  <drousso@apple.com>
989
990         Web Inspector: Console: getEventListeners should work for any EventTarget
991         https://bugs.webkit.org/show_bug.cgi?id=195713
992
993         Reviewed by Joseph Pecoraro.
994
995         Test: inspector/console/command-line-api-getEventListeners.html
996
997         * dom/EventTarget.h:
998         * dom/EventTarget.cpp:
999         (WebCore::EventTarget::eventTypes): Added.
1000
1001         * inspector/CommandLineAPIHost.idl:
1002         * inspector/CommandLineAPIHost.h:
1003         (WebCore::CommandLineAPIHost::init):
1004         * inspector/CommandLineAPIHost.cpp:
1005         (WebCore::CommandLineAPIHost::disconnect):
1006         (WebCore::CommandLineAPIHost::getEventListeners):
1007         (WebCore::listenerEntriesFromListenerInfo): Deleted.
1008
1009         * inspector/CommandLineAPIModuleSource.js:
1010         (CommandLineAPIImpl.prototype.getEventListeners):
1011
1012         * inspector/InspectorController.cpp:
1013         (WebCore::InspectorController::InspectorController):
1014         * inspector/WorkerInspectorController.cpp:
1015         (WebCore::WorkerInspectorController::WorkerInspectorController):
1016
1017 2019-03-14  Devin Rousso  <drousso@apple.com>
1018
1019         Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
1020         https://bugs.webkit.org/show_bug.cgi?id=195123
1021         <rdar://problem/48450148>
1022
1023         Reviewed by Joseph Pecoraro.
1024
1025         Test: inspector/css/getMatchedStylesForNode.html
1026
1027         * inspector/agents/InspectorCSSAgent.cpp:
1028         (WebCore::protocolValueForPseudoId): Added.
1029         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
1030
1031 2019-03-13  Benjamin Poulain  <benjamin@webkit.org>
1032
1033         Fix the argument type of RenderView::resumePausedImageAnimationsIfNeeded()
1034         https://bugs.webkit.org/show_bug.cgi?id=195659
1035
1036         Reviewed by Saam Barati.
1037
1038         The two callers of resumePausedImageAnimationsIfNeeded() both get the IntRect
1039         as a reference. The rect was going on the stack then used as a reference again.
1040
1041         * rendering/RenderView.cpp:
1042         (WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
1043         * rendering/RenderView.h:
1044
1045 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1046
1047         [ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
1048         https://bugs.webkit.org/show_bug.cgi?id=195724
1049         <rdar://problem/48873456>
1050
1051         Reviewed by Simon Fraser.
1052
1053         Call willNotProceedWithClick on preventDefault. This is very similar to the long press case.
1054
1055         * page/ios/ContentChangeObserver.cpp:
1056         (WebCore::willNotProceedWithClick):
1057         (WebCore::ContentChangeObserver::didRecognizeLongPress):
1058         (WebCore::ContentChangeObserver::didPreventDefaultForEvent):
1059         * page/ios/ContentChangeObserver.h:
1060
1061 2019-03-13  Justin Fan  <justin_fan@apple.com>
1062
1063         [Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue concept
1064         https://bugs.webkit.org/show_bug.cgi?id=195083
1065         <rdar://problem/48423591>
1066
1067         Reviewed by Dean Jackson.
1068
1069         WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
1070         is now WebGPUCommandEncoder.
1071
1072         Affected Web GPU tests updated to match new API.
1073
1074         New files and symbols:
1075         * CMakeLists.txt:
1076         * DerivedSources.make:
1077         * Sources.txt:
1078         * WebCore.xcodeproj/project.pbxproj:
1079         * bindings/js/WebCoreBuiltinNames.h:
1080
1081         Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
1082         * Modules/webgpu/WebGPUCommandBuffer.cpp:
1083         (WebCore::WebGPUCommandBuffer::create):
1084         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
1085         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
1086         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
1087         (WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
1088         (WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
1089         (WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
1090         (WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
1091         (WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
1092         * Modules/webgpu/WebGPUCommandBuffer.h:
1093         (WebCore::WebGPUCommandBuffer::commandBuffer):
1094         (WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
1095         * Modules/webgpu/WebGPUCommandBuffer.idl:
1096
1097         Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
1098         * Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
1099         (WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
1100         (WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
1101         (WebCore::WebGPUCommandEncoder::create):
1102         (WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
1103         (WebCore::WebGPUCommandEncoder::beginRenderPass):
1104         (WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
1105         (WebCore::WebGPUCommandEncoder::copyBufferToTexture):
1106         (WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
1107         (WebCore::WebGPUCommandEncoder::copyTextureToTexture):
1108         (WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
1109         * Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
1110         * Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
1111         * Modules/webgpu/WebGPUDevice.cpp:
1112         (WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
1113         (WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
1114         * Modules/webgpu/WebGPUDevice.h:
1115         * Modules/webgpu/WebGPUDevice.idl:
1116         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1117         (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
1118         (WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
1119         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
1120         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
1121         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1122         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
1123         * Modules/webgpu/WebGPUQueue.cpp:
1124         (WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
1125         * Modules/webgpu/WebGPUQueue.h:
1126         * Modules/webgpu/WebGPUQueue.idl:
1127         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1128         (WebCore::WebGPURenderPassEncoder::create):
1129         (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
1130         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
1131         (WebCore::WebGPURenderPassEncoder::draw):
1132         (WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
1133         * Modules/webgpu/WebGPURenderPassEncoder.h:
1134         * Modules/webgpu/WebGPUSwapChain.cpp:
1135         (WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
1136         * platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
1137         * platform/graphics/gpu/GPUDevice.cpp:
1138         (WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
1139         (WebCore::GPUDevice::createCommandBuffer): Deleted.
1140         * platform/graphics/gpu/GPUDevice.h:
1141         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1142         (WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
1143         (WebCore::GPUCommandBuffer::create): Deleted.
1144
1145 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1146
1147         [WeakPtr] RenderListMarker::m_listItem should be a WeakPtr
1148         https://bugs.webkit.org/show_bug.cgi?id=195704
1149         <rdar://problem/48486278>
1150
1151         Reviewed by Simon Fraser.
1152
1153         * rendering/RenderListMarker.cpp:
1154         (WebCore::RenderListMarker::RenderListMarker):
1155         (WebCore::RenderListMarker::paint):
1156         (WebCore::RenderListMarker::layout):
1157         (WebCore::RenderListMarker::updateContent):
1158         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1159         (WebCore::RenderListMarker::lineHeight const):
1160         (WebCore::RenderListMarker::baselinePosition const):
1161         (WebCore::RenderListMarker::suffix const):
1162         (WebCore::RenderListMarker::isInside const):
1163         (WebCore::RenderListMarker::getRelativeMarkerRect):
1164         * rendering/RenderListMarker.h:
1165
1166 2019-03-13  Dean Jackson  <dino@apple.com>
1167
1168         Block all plugins smaller than 5x5px
1169         https://bugs.webkit.org/show_bug.cgi?id=195702
1170         <rdar://problem/28435204>
1171
1172         Reviewed by Sam Weinig.
1173
1174         Block all plugins that are smaller than a threshold, in this case
1175         5px x 5px. Other browsers have implemented this for a while, and now
1176         that we have Intersection Observers, small plugins are no longer
1177         necessary.
1178
1179         Test: plugins/small-plugin-blocked.html
1180
1181         * en.lproj/Localizable.strings: New message for a small plugin.
1182         * platform/LocalizedStrings.cpp:
1183         (WebCore::pluginTooSmallText):
1184         * platform/LocalizedStrings.h:
1185
1186         * html/HTMLPlugInElement.cpp: Helper function for Internals testing.
1187         (WebCore::HTMLPlugInElement::isBelowSizeThreshold const):
1188         * html/HTMLPlugInElement.h:
1189
1190         * loader/EmptyClients.cpp: Removed an unused function.
1191         (WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted.
1192         * loader/EmptyFrameLoaderClient.h:
1193         * loader/FrameLoaderClient.h:
1194
1195         * page/Settings.yaml: Add flag for new feature.
1196
1197         * rendering/RenderEmbeddedObject.cpp: New unavailability reason for
1198         embedded objects.
1199         (WebCore::unavailablePluginReplacementText):
1200         * rendering/RenderEmbeddedObject.h:
1201         (WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const):
1202
1203         * testing/Internals.cpp: Helper function for testing.
1204         (WebCore::Internals::pluginIsBelowSizeThreshold):
1205         * testing/Internals.h:
1206         * testing/Internals.idl:
1207
1208 2019-03-13  Zalan Bujtas  <zalan@apple.com>
1209
1210         Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow
1211         https://bugs.webkit.org/show_bug.cgi?id=195701
1212         <rdar://problem/48448658>
1213
1214         Reviewed by Simon Fraser.
1215
1216         It's safer to use existing RenderBox functions to get sibling boxes.
1217
1218         Test: fast/ruby/crash-when-paginated-ruby.html
1219
1220         * rendering/RenderMultiColumnFlow.cpp:
1221         (WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
1222         (WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
1223
1224 2019-03-13  Keith Rollin  <krollin@apple.com>
1225
1226         Add support for new StagedFrameworks layout
1227         https://bugs.webkit.org/show_bug.cgi?id=195543
1228
1229         Reviewed by Alexey Proskuryakov.
1230
1231         When creating the WebKit layout for out-of-band Safari/WebKit updates,
1232         use an optional path prefix when called for.
1233
1234         No new tests since there should be no observable behavior difference.
1235
1236         * Configurations/WebCore.xcconfig:
1237
1238 2019-03-13  Wenson Hsieh  <wenson_hsieh@apple.com>
1239
1240         Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element
1241         https://bugs.webkit.org/show_bug.cgi?id=195663
1242         <rdar://problem/48576391>
1243
1244         Reviewed by Ryosuke Niwa.
1245
1246         Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form
1247         control element is ref'd while carrying out its destructor's logic. This may happen in two places in
1248         HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a
1249         protected reference to the form control element since they should never result in any script execution.
1250
1251         To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that
1252         we don't change these codepaths in the future, such that they trigger arbitrary script execution.
1253
1254         Test: fast/forms/remove-associated-element-after-gc.html
1255
1256         * html/HTMLFormControlElement.cpp:
1257         (WebCore::HTMLFormControlElement::didChangeForm):
1258         * html/HTMLFormElement.cpp:
1259         (WebCore::HTMLFormElement::resetDefaultButton):
1260
1261 2019-03-13  Daniel Bates  <dabates@apple.com>
1262
1263         Remove some unnecessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards
1264         https://bugs.webkit.org/show_bug.cgi?id=195703
1265
1266         Reviewed by Tim Horton.
1267
1268         Remove out-of-date comment and unncessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards. Following
1269         r240604 we now make use of WebCore::windowsKeyCodeForCharCode() even for hardware key events
1270         when USE(UIKIT_KEYBOARD_ADDITIONS) is enabled.
1271
1272         No functionality changed. So, no new tests.
1273
1274         * platform/ios/KeyEventIOS.mm:
1275         (WebCore::windowsKeyCodeForCharCode):
1276         * platform/ios/WebEvent.mm:
1277         (normalizedStringWithAppKitCompatibilityMapping):
1278
1279 2019-03-13  Simon Fraser  <simon.fraser@apple.com>
1280
1281         Scrolling tree should reposition non-stacking order descendents of overflow:scroll
1282         https://bugs.webkit.org/show_bug.cgi?id=195608
1283
1284         Reviewed by Zalan Bujtas.
1285         
1286         Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
1287
1288         Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
1289         an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
1290         the values of ScrollPositioningBehavior:
1291
1292         ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
1293             async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
1294             When the overflow scrolls, this layer has to move along with the overflow.
1295
1296         ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
1297             overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
1298             This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
1299
1300         PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
1301         
1302         This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
1303         is just a stub so the new node types aren't created yet.
1304         
1305         RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
1306         role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
1307         the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
1308
1309         Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html
1310
1311         * Sources.txt:
1312         * SourcesCocoa.txt:
1313         * WebCore.xcodeproj/project.pbxproj:
1314         * page/scrolling/AsyncScrollingCoordinator.cpp:
1315         (WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry):
1316         (WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
1317         * page/scrolling/AsyncScrollingCoordinator.h:
1318         * page/scrolling/ScrollingConstraints.cpp:
1319         (WebCore::operator<<):
1320         * page/scrolling/ScrollingConstraints.h:
1321         (WebCore::LayoutConstraints::LayoutConstraints):
1322         (WebCore::LayoutConstraints::operator== const):
1323         (WebCore::LayoutConstraints::operator!= const):
1324         (WebCore::LayoutConstraints::alignmentOffset const):
1325         (WebCore::LayoutConstraints::setAlignmentOffset):
1326         (WebCore::LayoutConstraints::layerPositionAtLastLayout const):
1327         (WebCore::LayoutConstraints::setLayerPositionAtLastLayout):
1328         (WebCore::LayoutConstraints::scrollPositioningBehavior const):
1329         (WebCore::LayoutConstraints::setScrollPositioningBehavior):
1330         * page/scrolling/ScrollingCoordinator.cpp:
1331         (WebCore::operator<<):
1332         * page/scrolling/ScrollingCoordinator.h:
1333         (WebCore::ScrollingCoordinator::setPositionedNodeGeometry):
1334         (WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes):
1335         * page/scrolling/ScrollingCoordinatorTypes.h:
1336         * page/scrolling/ScrollingStateNode.h:
1337         (WebCore::ScrollingStateNode::isPositionedNode const):
1338         * page/scrolling/ScrollingStatePositionedNode.cpp: Added.
1339         (WebCore::ScrollingStatePositionedNode::create):
1340         (WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode):
1341         (WebCore::ScrollingStatePositionedNode::clone):
1342         (WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged):
1343         (WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes):
1344         (WebCore::ScrollingStatePositionedNode::updateConstraints):
1345         (WebCore::ScrollingStatePositionedNode::dumpProperties const):
1346         * page/scrolling/ScrollingStatePositionedNode.h: Added.
1347         * page/scrolling/ScrollingStateTree.cpp:
1348         (WebCore::ScrollingStateTree::createNode):
1349         * page/scrolling/ScrollingTree.cpp:
1350         (WebCore::ScrollingTree::updateTreeFromStateNode):
1351         * page/scrolling/ScrollingTree.h:
1352         * page/scrolling/ScrollingTreeNode.h:
1353         (WebCore::ScrollingTreeNode::isPositionedNode const):
1354         * page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h.
1355         * page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added.
1356         (WebCore::ScrollingTreePositionedNode::create):
1357         (WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
1358         (WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode):
1359         (WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
1360         (WebCore::ScrollingTreePositionedNode::applyLayerPositions):
1361         (WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
1362         (WebCore::ScrollingTreePositionedNode::dumpProperties const):
1363         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1364         * page/scrolling/mac/ScrollingTreeMac.cpp:
1365         (ScrollingTreeMac::createScrollingTreeNode):
1366         * platform/ScrollTypes.h:
1367         * rendering/RenderLayerBacking.cpp:
1368         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
1369         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1370         * rendering/RenderLayerBacking.h:
1371         * rendering/RenderLayerCompositor.cpp:
1372         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
1373         (WebCore::scrollCoordinationRoleForNodeType):
1374         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
1375         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1376         (WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
1377         (WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
1378         * rendering/RenderLayerCompositor.h:
1379
1380 2019-03-13  Youenn Fablet  <youenn@apple.com>
1381
1382         Check IDB quota usage through QuotaManager
1383         https://bugs.webkit.org/show_bug.cgi?id=195302
1384
1385         Reviewed by Chris Dumez.
1386
1387         For every write operation, compute an estimate size and check for quota before proceeding.
1388         When proceeding, store the estimate size in a map.
1389         If size of the database is to be computed when the task is not done,
1390         the estimate size will be added to the current size of the databases.
1391         At the end of the task, the estimate size is removed from the map,
1392         and the databases size is refreshed.
1393
1394         This patch implements size estimation for write tasks.
1395         Put/add operations might overestimate the size
1396         when an old value will be replaced by a new value.
1397         In that case, we do not substract the old value size since we do not know it.
1398
1399         This patch implements database opening by adding a fixed small cost,
1400         as we do not know whether the database is new or not.
1401
1402         For the first IDB request, we have not computed the size of the database.
1403         To do so, we need to go to a background thread and do that file size computation.
1404         For that purpose, we add support for being-initialized quota user.
1405         Quota manager is calling whenInitialized on its quota user and will
1406         delay any quota check requests until its quota user is answering this callback.
1407
1408         For in process IDB, use the default storage quota per origin and do not increase it.
1409         Future work should move it to NetworkProcess and implement some quota checking.
1410
1411         Cache API and IDB quota management are not yet fully unified.
1412         If IDB is used on start-up, we should check for Cache API storage size.
1413         Conversely, on Cache API first wite task, even if IDB is not being used,
1414         we should compute the size of the IDB data for the given origin.
1415
1416         Test: http/tests/IndexedDB/storage-limit.https.html
1417
1418         * Modules/indexeddb/server/IDBBackingStore.h:
1419         * Modules/indexeddb/server/IDBServer.cpp:
1420         (WebCore::IDBServer::IDBServer::create):
1421         (WebCore::IDBServer::IDBServer::IDBServer):
1422         (WebCore::IDBServer::m_quotaManagerGetter):
1423         (WebCore::IDBServer::IDBServer::QuotaUser::QuotaUser):
1424         (WebCore::IDBServer::IDBServer::QuotaUser::~QuotaUser):
1425         (WebCore::IDBServer::IDBServer::QuotaUser::clearSpaceUsed):
1426         (WebCore::IDBServer::IDBServer::QuotaUser::whenInitialized):
1427         (WebCore::IDBServer::IDBServer::QuotaUser::initializeSpaceUsed):
1428         (WebCore::IDBServer::IDBServer::quotaUser):
1429         (WebCore::IDBServer::IDBServer::startComputingSpaceUsedForOrigin):
1430         (WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
1431         (WebCore::IDBServer::IDBServer::finishComputingSpaceUsedForOrigin):
1432         (WebCore::IDBServer::IDBServer::requestSpace):
1433         (WebCore::IDBServer::IDBServer::clearSpaceUsed):
1434         (WebCore::IDBServer::IDBServer::setSpaceUsed):
1435         (WebCore::IDBServer::IDBServer::increasePotentialSpaceUsed):
1436         (WebCore::IDBServer::IDBServer::decreasePotentialSpaceUsed):
1437         * Modules/indexeddb/server/IDBServer.h:
1438         (WebCore::IDBServer::IDBServer::create):
1439         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1440         (WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const):
1441         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1442         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1443         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder):
1444         (WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
1445         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
1446         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1447         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1448         (WebCore::IDBServer::estimateSize):
1449         (WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
1450         (WebCore::IDBServer::quotaErrorMessageName):
1451         (WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
1452         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1453         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
1454         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
1455         (WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
1456         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
1457         (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
1458         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
1459         (WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
1460         (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
1461         (WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
1462         (WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
1463         (WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
1464         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
1465         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1466         (WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
1467         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
1468         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
1469         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1470         (WebCore::IDBServer::UniqueIDBDatabase::server):
1471         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1472         (WebCore::InProcessIDBServer::create):
1473         (WebCore::InProcessIDBServer::quotaManager):
1474         (WebCore::storageQuotaManagerGetter):
1475         (WebCore::InProcessIDBServer::InProcessIDBServer):
1476         * Modules/indexeddb/shared/InProcessIDBServer.h:
1477         * loader/EmptyClients.cpp:
1478         * storage/StorageQuotaManager.cpp:
1479         (WebCore::StorageQuotaManager::addUser):
1480         (WebCore::StorageQuotaManager::requestSpace):
1481         * storage/StorageQuotaManager.h:
1482         (WebCore::StorageQuotaManager::defaultQuota):
1483         (WebCore::StorageQuotaManager::removeUser):
1484         * storage/StorageQuotaUser.h:
1485         (WebCore::StorageQuotaUser::whenInitialized):
1486
1487 2019-03-13  Chris Dumez  <cdumez@apple.com>
1488
1489         Better build fix after r242901.
1490
1491         Reviewed by Jer Noble.
1492
1493         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1494         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
1495         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1496
1497 2019-03-13  Timothy Hatcher  <timothy@apple.com>
1498
1499         Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
1500         https://bugs.webkit.org/show_bug.cgi?id=195636
1501         rdar://problem/45055697
1502
1503         Reviewed by Ryosuke Niwa.
1504
1505         * editing/DictionaryPopupInfo.h:
1506         (WebCore::DictionaryPopupInfo::encodingRequiresPlatformData const): Added.
1507         * editing/FontAttributes.h:
1508         (WebCore::FontAttributes::encodingRequiresPlatformData const): Added.
1509
1510 2019-03-13  Chris Dumez  <cdumez@apple.com>
1511
1512         Unreviewed build fix after r242901.
1513
1514         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1515         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1516
1517 2019-03-13  Chris Dumez  <cdumez@apple.com>
1518
1519         Use a ServiceWorker process per registrable domain
1520         https://bugs.webkit.org/show_bug.cgi?id=195649
1521
1522         Reviewed by Youenn Fablet.
1523
1524         Use a ServiceWorker process per registrable domain instead of one per security origin. This is
1525         more in line with PSON and avoids launching too many processes.
1526
1527         * page/ClientOrigin.h:
1528         (WebCore::ClientOrigin::clientRegistrableDomain const):
1529         * workers/service/server/SWServer.cpp:
1530         (WebCore::SWServer::tryInstallContextData):
1531         (WebCore::SWServer::serverToContextConnectionCreated):
1532         (WebCore::SWServer::runServiceWorkerIfNecessary):
1533         (WebCore::SWServer::markAllWorkersForRegistrableDomainAsTerminated):
1534         (WebCore::SWServer::registerServiceWorkerClient):
1535         (WebCore::SWServer::unregisterServiceWorkerClient):
1536         (WebCore::SWServer::needsServerToContextConnectionForRegistrableDomain const):
1537         * workers/service/server/SWServer.h:
1538         * workers/service/server/SWServerToContextConnection.cpp:
1539         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1540         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1541         (WebCore::SWServerToContextConnection::connectionForRegistrableDomain):
1542         * workers/service/server/SWServerToContextConnection.h:
1543         (WebCore::SWServerToContextConnection::registrableDomain const):
1544         * workers/service/server/SWServerWorker.cpp:
1545         (WebCore::SWServerWorker::contextConnection):
1546         * workers/service/server/SWServerWorker.h:
1547         (WebCore::SWServerWorker::registrableDomain const):
1548
1549 2019-03-13  Chris Dumez  <cdumez@apple.com>
1550
1551         REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
1552         https://bugs.webkit.org/show_bug.cgi?id=195684
1553         <rdar://problem/48294714>
1554
1555         Reviewed by Antti Koivisto.
1556
1557         The issue was caused by us failing to suspend the current page on navigation because the source and
1558         target WebBackForwardListItem are identical. The source WebBackForwardListItem was wrong.
1559
1560         When a navigation is triggered by the WebContent process (and not the UIProcess), we create the Navigation
1561         object in WebPageProxy::decidePolicyForNavigationAction(). For the navigation's targetItem, we use the
1562         target item identifier provided by the WebContent process via the NavigationActionData. However,
1563         for the source item, we would use the WebBackForwardList's currentItem in the UIProcess. The issue
1564         is that the WebBackForwardList's currentItem usually has already been updated to be the target
1565         item via a WebPageProxy::BackForwardGoToItem() synchronous IPC.
1566
1567         To avoid raciness and given that the current history management is fragile (as it is managed by
1568         both the UIProcess and the WebProcess), I am now passing the source item identifier in
1569         addition to the target item identifier in the NavigationActionData that is sent by the WebProcess.
1570         This is a lot less error prone, the WebProcess knows more accurately which history items it is going
1571         from and to.
1572
1573         * loader/FrameLoader.cpp:
1574         (WebCore::FrameLoader::loadURLIntoChildFrame):
1575         (WebCore::FrameLoader::loadDifferentDocumentItem):
1576         (WebCore::FrameLoader::loadItem):
1577         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
1578         * loader/FrameLoader.h:
1579         * loader/HistoryController.cpp:
1580         (WebCore::HistoryController::recursiveGoToItem):
1581         * loader/NavigationAction.cpp:
1582         (WebCore::NavigationAction::setSourceBackForwardItem):
1583         * loader/NavigationAction.h:
1584         (WebCore::NavigationAction::sourceBackForwardItemIdentifier const):
1585
1586 2019-03-13  Jer Noble  <jer.noble@apple.com>
1587
1588         Add AggregateLogger, a Logger specialization for singleton classes.
1589         https://bugs.webkit.org/show_bug.cgi?id=195644
1590
1591         Reviewed by Eric Carlson.
1592
1593         Convert debug logging over to release logging through the use of AggregateLogger.
1594
1595         * platform/audio/PlatformMediaSession.h:
1596         (WebCore::PlatformMediaSession::client const):
1597         * platform/audio/PlatformMediaSessionManager.cpp:
1598         (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
1599         (WebCore::PlatformMediaSessionManager::beginInterruption):
1600         (WebCore::PlatformMediaSessionManager::endInterruption):
1601         (WebCore::PlatformMediaSessionManager::addSession):
1602         (WebCore::PlatformMediaSessionManager::removeSession):
1603         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1604         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
1605         (WebCore::PlatformMediaSessionManager::setCurrentSession):
1606         (WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
1607         (WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
1608         (WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
1609         (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
1610         (WebCore::PlatformMediaSessionManager::logChannel const):
1611         * platform/audio/PlatformMediaSessionManager.h:
1612         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
1613         (MediaSessionManagerCocoa::updateSessionState):
1614         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
1615         (MediaSessionManagerCocoa::removeSession):
1616         (MediaSessionManagerCocoa::sessionWillEndPlayback):
1617         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
1618         (MediaSessionManagerCocoa::updateNowPlayingInfo):
1619         * platform/audio/ios/MediaSessionManagerIOS.mm:
1620         (WebCore::MediaSessionManageriOS::resetRestrictions):
1621         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1622
1623 2019-03-13  Chris Dumez  <cdumez@apple.com>
1624
1625         Drop legacy WebCore::toRegistrableDomain() utility function
1626         https://bugs.webkit.org/show_bug.cgi?id=195637
1627
1628         Reviewed by Geoffrey Garen.
1629
1630         Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
1631         Update call sites to use modern RegistrableDomain type instead.
1632
1633         * loader/CrossOriginAccessControl.cpp:
1634         (WebCore::shouldCrossOriginResourcePolicyCancelLoad):
1635         * loader/FrameLoader.cpp:
1636         (WebCore::FrameLoader::setFirstPartyForCookies):
1637         * page/DOMWindow.cpp:
1638         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
1639         * platform/RegistrableDomain.h:
1640         (WebCore::registrableDomainsAreEqual):
1641         * platform/network/ResourceRequestBase.h:
1642         * platform/network/cf/ResourceRequestCFNet.cpp:
1643         * platform/network/cocoa/ResourceRequestCocoa.mm:
1644
1645 2019-03-13  Alex Christensen  <achristensen@webkit.org>
1646
1647         Prevent checked_cf_cast crashes in ResourceResponse::platformCertificateInfo
1648         https://bugs.webkit.org/show_bug.cgi?id=195686
1649
1650         Reviewed by Tim Horton.
1651
1652         This covers up a type confusion bug on some OSes until rdar://problem/48853137 is resolved.
1653
1654         * SourcesCocoa.txt:
1655         * WebCore.xcodeproj/project.pbxproj:
1656         * platform/network/cocoa/ResourceResponseCocoa.mm:
1657
1658 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
1659
1660         [GStreamer][WebRTC] Add support for omxh264enc encoder
1661         https://bugs.webkit.org/show_bug.cgi?id=195676
1662
1663         Reviewed by Philippe Normand.
1664
1665         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
1666         (setup_omxh264enc):
1667         (set_bitrate_bit_per_sec):
1668         (gst_webrtc_video_encoder_class_init):
1669
1670 2019-03-13  Antoine Quint  <graouts@apple.com>
1671
1672         REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
1673         https://bugs.webkit.org/show_bug.cgi?id=195683
1674         <rdar://problem/48659950>
1675
1676         Reviewed by Alex Christensen.
1677
1678         While PointerID is defined as int32_t, we now use int64_t as the key of the HashMap mapping PointerID to CapturingData so that we use
1679         a value outside of the int32_t range as a safe empty and removed values, allowing any int32_t to be provided through the API for
1680         lookup in this HashMap.
1681
1682         Test: pointerevents/pointer-id-crash.html
1683
1684         * page/PointerCaptureController.h:
1685
1686 2019-03-12  Brady Eidson  <beidson@apple.com>
1687
1688         Take UnboundedNetworking assertion when a file upload is in progress.
1689         https://bugs.webkit.org/show_bug.cgi?id=195497
1690
1691         Reviewed by Geoff Garen.
1692
1693         * platform/network/ResourceRequestBase.cpp:
1694         (WebCore::ResourceRequestBase::hasUpload const):
1695         * platform/network/ResourceRequestBase.h:
1696
1697 2019-03-13  Youenn Fablet  <youenn@apple.com>
1698
1699         Enable libwebrtc logging control through WebCore
1700         https://bugs.webkit.org/show_bug.cgi?id=195658
1701
1702         Reviewed by Eric Carlson.
1703
1704         Add support for WebCore logging of libwebrtc messages.
1705         This is controlled by WebRTC log channel state and level.
1706         In case of private browsing mode, any logging is disabled.
1707         This will stay for the lifetime of the process.
1708         No change of behavior.
1709
1710         * Modules/mediastream/RTCPeerConnection.cpp:
1711         (WebCore::RTCPeerConnection::create):
1712         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1713         (WebCore::doReleaseLogging):
1714         (WebCore::setLogging):
1715         (WebCore::computeLogLevel):
1716         (WebCore::initializePeerConnectionFactoryAndThreads):
1717         (WebCore::LibWebRTCProvider::setEnableLogging):
1718         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1719
1720 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
1721
1722         [GStreamer][WebRTC] Do not sync encoder on the clock
1723         https://bugs.webkit.org/show_bug.cgi?id=195673
1724
1725         we should encode as fast as possible and totally ignore timestamp while
1726         doing so.
1727
1728         Reviewed by Philippe Normand.
1729
1730         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1731         (WebCore::GStreamerVideoEncoder::InitEncode):
1732
1733 2019-03-13  Thibault Saunier  <tsaunier@igalia.com>
1734
1735         [GStreamer][WebRTC]: Use codec setting video height/width as fallback
1736         https://bugs.webkit.org/show_bug.cgi?id=195675
1737
1738         Reviewed by Philippe Normand.
1739
1740         In some cases the frame height and width is not set (not sure why/ in
1741         what conditions but it happens) so make sure to get the information from
1742         the VideoCodec when configuring the encoder.
1743
1744         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
1745         (WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
1746         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
1747
1748 2019-03-13  Miguel Gomez  <magomez@igalia.com>
1749
1750         [CoordinatedGraphics] Null dereference in CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded
1751         https://bugs.webkit.org/show_bug.cgi?id=195615
1752
1753         Reviewed by Carlos Garcia Campos.
1754
1755         Exit early if we don't receive a valid coordinator.
1756
1757         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1758         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
1759
1760 2019-03-13  Fujii Hironori  <Hironori.Fujii@sony.com>
1761
1762         [Win][PlayStation] Remove WebCore::standardUserAgentForURL
1763         https://bugs.webkit.org/show_bug.cgi?id=195662
1764
1765         Reviewed by Ryosuke Niwa.
1766
1767         WebCore::standardUserAgentForURL is just a stub in Windows port.
1768
1769         No new tests because there is no behavior change.
1770
1771         * platform/win/UserAgentWin.cpp:
1772         (WebCore::standardUserAgentForURL): Deleted.
1773         * platform/playstation/UserAgentPlayStation.cpp:
1774         (WebCore::standardUserAgentForURL): Deleted.
1775
1776 2019-03-12  Ross Kirsling  <ross.kirsling@sony.com>
1777
1778         [Win] Fix a slew of simple clang-cl warnings.
1779         https://bugs.webkit.org/show_bug.cgi?id=195652
1780
1781         Reviewed by Don Olmstead.
1782
1783         * page/AutoscrollController.cpp:
1784         (WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
1785         * platform/network/curl/CurlContext.cpp:
1786         (WebCore::CurlHandle::willSetupSslCtx):
1787         (WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
1788         * platform/network/curl/CurlFormDataStream.cpp:
1789         (WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
1790         * platform/network/curl/CurlRequest.cpp:
1791         (WebCore::CurlRequest::CurlRequest): -Wreorder
1792         (WebCore::CurlRequest::setupTransfer): -Wunused-variable
1793         * platform/network/curl/CurlSSLVerifier.cpp:
1794         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
1795         * platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
1796         * platform/win/LoggingWin.cpp:
1797         (WebCore::logLevelString): -Wwritable-strings
1798         * rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
1799         (WebCore::RenderThemeWin::getThemeData): -Wswitch
1800
1801 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
1802
1803         Move the code for determining the need for touch bar quirks to Quirks class
1804         https://bugs.webkit.org/show_bug.cgi?id=195654
1805
1806         Reviewed by Brent Fulgham.
1807
1808         Moved the code to determine whether the touch bar quirks are needed or not from WebKit2.
1809
1810         * WebCore.xcodeproj/project.pbxproj:
1811         * page/Quirks.cpp:
1812         (WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
1813         (WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
1814         * page/Quirks.h:
1815
1816 2019-03-12  Justin Fan  <justin_fan@apple.com>
1817
1818         [Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
1819         https://bugs.webkit.org/show_bug.cgi?id=195518
1820         <rdar://problem/46322356>
1821
1822         Reviewed by Myles C. Maxfield.
1823
1824         Upgrade the implementation of GPURenderPipelineDescriptor and GPURenderPipeline and match the updated Web GPU API.
1825         Add stubs for GPUColorStateDescriptor so attachment format can be provided by GPURenderPipelineDescriptor.
1826
1827         All affected Web GPU tests updated to cover existing behavior.
1828
1829         Update file names and symbols:
1830         * CMakeLists.txt:
1831         * DerivedSources-input.xcfilelist:
1832         * DerivedSources-output.xcfilelist:
1833         * DerivedSources.make:
1834         * Sources.txt:
1835         * WebCore.xcodeproj/project.pbxproj:
1836         * bindings/js/WebCoreBuiltinNames.h:
1837
1838         Updates to GPURenderPipeline, GPURenderPipelineDescriptor, and its components:
1839         * Modules/webgpu/GPUColorStateDescriptor.idl: Added. Provide the expected texture format of the render pipeline's color attachments.
1840         * Modules/webgpu/GPUInputStateDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUInputStateDescriptor.idl.
1841         * Modules/webgpu/GPUTextureFormat.idl: Update the existing values to match the new style.
1842         * Modules/webgpu/GPUVertexAttributeDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexAttributeDescriptor.idl.
1843         * Modules/webgpu/GPUVertexInputDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexInputDescriptor.idl.
1844         * Modules/webgpu/WebGPUDevice.cpp:
1845         (WebCore::WebGPUDevice::createPipelineLayout const): Remove unnecessary comment.
1846         (WebCore::WebGPUDevice::createRenderPipeline const): Descriptor validation and conversion moved into WebGPURenderPipelineDescriptor.
1847         (WebCore::validateAndConvertPipelineStage): Deleted.
1848         * Modules/webgpu/WebGPUDevice.h: create* functions should not return nullable.
1849         * Modules/webgpu/WebGPUIndexFormat.h: Removed. Moved into GPUInputStateDescriptor.idl.
1850         * Modules/webgpu/WebGPUInputStateDescriptor.h: Removed.
1851         * Modules/webgpu/WebGPUInputStepMode.idl: Removed. Moved into GPUVertexInputDescriptor.idl.
1852         * Modules/webgpu/WebGPUPipelineLayout.h:
1853         (WebCore::WebGPUPipelineLayout::pipelineLayout): Getters should return raw references.
1854         * Modules/webgpu/WebGPUPipelineStageDescriptor.h: Now shares a common base with GPUPipelineStageDescriptor.
1855         * Modules/webgpu/WebGPURenderPipeline.cpp:
1856         (WebCore::WebGPURenderPipeline::create):
1857         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
1858         * Modules/webgpu/WebGPURenderPipeline.h:  Now internally nullable.
1859         (WebCore::WebGPURenderPipeline::renderPipeline const):
1860         (WebCore::WebGPURenderPipeline::renderPipeline): Deleted.
1861         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
1862         (WebCore::WebGPUPipelineStageDescriptor::asGPUPipelineStageDescriptor const): Validate and convert a WebGPUPipelineStageDescriptor to GPU version.
1863         (WebCore::WebGPURenderPipelineDescriptor::asGPURenderPipelineDescriptor const): Ditto for WebGPURenderPipelineDescriptor.
1864         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Now shares a base class and some instance variables with GPURenderPipelineDescriptor.
1865         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Update GPUPrimitiveTopology for new style and add colorStates.
1866         * Modules/webgpu/WebGPUShaderModule.idl: Small pilot to test using InterfaceName to easily rename DOM-facing interfaces.
1867         * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Removed.
1868         * Modules/webgpu/WebGPUVertexFormat.idl: Removed. Moved and updated in GPUVertexAttributeDescriptor.idl.
1869         * Modules/webgpu/WebGPUVertexInputDescriptor.h: Removed.
1870         * platform/graphics/gpu/GPUInputStateDescriptor.h:
1871         * platform/graphics/gpu/GPUPipelineStageDescriptor.h:
1872         (WebCore::GPUPipelineStageDescriptor::GPUPipelineStageDescriptor):
1873         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Add shared base class for Web/GPURenderPipelineDescriptor.
1874         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
1875         * platform/graphics/gpu/GPUTextureFormat.h:
1876         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
1877         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
1878         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1879         (WebCore::setFunctionsForPipelineDescriptor): Make fragment required since descriptor validation fails if fragment function is not found right now.
1880         (WebCore::mtlVertexFormatForGPUVertexFormat): Renamed from validateAndConvertVertexFormatToMTLVertexFormat.
1881         (WebCore::mtlStepFunctionForGPUInputStepMode): Renamed from validateAndConvertStepModeToMTLStepFunction
1882         (WebCore::trySetInputStateForPipelineDescriptor):
1883         (WebCore::trySetColorStatesForColorAttachmentArray):
1884         (WebCore::tryCreateMtlRenderPipelineState):
1885         (WebCore::GPURenderPipeline::create):
1886         (WebCore::validateAndConvertVertexFormatToMTLVertexFormat): Deleted.
1887         (WebCore::validateAndConvertStepModeToMTLStepFunction): Deleted.
1888         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
1889         (WebCore::platformTextureFormatForGPUTextureFormat):
1890         * platform/graphics/gpu/GPUColorStateDescriptor.h: Added.
1891
1892         Misc:
1893         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1894         (WebCore::WebGPUProgrammablePassEncoder::setPipeline):
1895         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
1896         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1897         * platform/graphics/gpu/GPURenderPassEncoder.h:
1898         * platform/graphics/gpu/GPURenderPipeline.h:
1899         (WebCore::GPURenderPipeline::primitiveTopology const):
1900         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1901         (WebCore::GPURenderPassEncoder::setPipeline):
1902         (WebCore::primitiveTypeForGPUPrimitiveTopology):
1903        
1904 2019-03-12  Zalan Bujtas  <zalan@apple.com>
1905
1906         [ContentChangeObserver] Reset state when touchStart does not turn into click.
1907         https://bugs.webkit.org/show_bug.cgi?id=195603
1908         <rdar://problem/48796582>
1909
1910         Reviewed by Simon Fraser.
1911
1912         Add reset() function to assert and reset the current state.
1913
1914         * page/ios/ContentChangeObserver.cpp:
1915         (WebCore::ContentChangeObserver::willNotProceedWithClick):
1916         (WebCore::ContentChangeObserver::adjustObservedState):
1917         * page/ios/ContentChangeObserver.h:
1918
1919 2019-03-12  Timothy Hatcher  <timothy@apple.com>
1920
1921         Expose document attributes and body background color through HTMLConverter.
1922         https://bugs.webkit.org/show_bug.cgi?id=195636
1923         rdar://problem/45055697
1924
1925         Reviewed by Tim Horton.
1926
1927         * editing/cocoa/HTMLConverter.h:
1928         * editing/cocoa/HTMLConverter.mm:
1929         (HTMLConverter::convert):
1930         (WebCore::attributedStringFromRange):
1931         (WebCore::attributedStringFromSelection):
1932         (WebCore::attributedStringBetweenStartAndEnd):
1933
1934 2019-03-12  Antti Koivisto  <antti@apple.com>
1935
1936         Compositing layer that renders two positioned elements should not hit test
1937         https://bugs.webkit.org/show_bug.cgi?id=195371
1938         <rdar://problem/48649586>
1939
1940         Reviewed by Simon Fraser.
1941
1942         Followup to fix the test case (fast/scrolling/ios/overflow-scroll-overlap-2.html)
1943
1944         * platform/graphics/ca/GraphicsLayerCA.cpp:
1945         (WebCore::GraphicsLayerCA::setEventRegion):
1946
1947         Revert a last minute change (that was done to fix a Mac displaylist test).
1948
1949         * rendering/RenderLayerBacking.cpp:
1950         (WebCore::RenderLayerBacking::paintIntoLayer):
1951
1952         Compute the region on iOS only for now (it is not used on other platforms).
1953
1954 2019-03-12  Dean Jackson  <dino@apple.com>
1955
1956         [WebGL] WebGLBuffer can be too large
1957         https://bugs.webkit.org/show_bug.cgi?id=195068
1958         <rdar://problem/48414289>
1959
1960         Reviewed by Antoine Quint.
1961
1962         When creating an element array buffer, make sure to
1963         test against the maximum size of an ArrayBuffer, rather
1964         than just assume it can be created.
1965
1966         Test: fast/canvas/webgl/largeBuffer.html
1967
1968         * html/canvas/WebGLBuffer.cpp:
1969         (WebCore::WebGLBuffer::associateBufferDataImpl):
1970
1971 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
1972
1973         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-*-event-exception.html are failing
1974         https://bugs.webkit.org/show_bug.cgi?id=195581
1975
1976         Reviewed by Brady Eidson.
1977
1978         Uncaught exceptions should be handled after IDBRequest dispatches events so that IDBTransaction would stay 
1979         active during event dispatch.
1980
1981         * Modules/indexeddb/IDBRequest.cpp:
1982         (WebCore::IDBRequest::dispatchEvent):
1983         (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
1984         * Modules/indexeddb/IDBRequest.h:
1985
1986 2019-03-12  Sihui Liu  <sihui_liu@apple.com>
1987
1988         Layout Test imported/w3c/web-platform-tests/IndexedDB/transaction-abort-request-error.html is failing
1989         https://bugs.webkit.org/show_bug.cgi?id=195570
1990
1991         Reviewed by Brady Eidson.
1992
1993         IDBRequest result should be undefined if it is never set.
1994
1995         * Modules/indexeddb/IDBRequest.cpp:
1996         (WebCore::IDBRequest::IDBRequest):
1997
1998 2019-03-12  Youenn Fablet  <youenn@apple.com>
1999
2000         Rename originsMatch in originSerializationsMatch
2001         https://bugs.webkit.org/show_bug.cgi?id=195572
2002
2003         Reviewed by Jiewen Tan.
2004
2005         In addition to renaming, make use of SecurityOrigin::isSameOriginAs
2006         where it makes more sense than to compare origin serialization.
2007         The main difference is that isSameOriginAs will return false for two different unique origins
2008         while originsSerializationsMatch will not.
2009
2010         * Modules/credentialmanagement/CredentialsContainer.cpp:
2011         (WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
2012         * Modules/mediastream/RTCController.cpp:
2013         (WebCore::matchDocumentOrigin):
2014         * Modules/mediastream/RTCPeerConnection.cpp:
2015         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2016         * loader/DocumentLoader.cpp:
2017         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const):
2018         * loader/cache/CachedResourceLoader.cpp:
2019         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
2020         * page/SecurityOrigin.cpp:
2021         (WebCore::serializedOriginsMatch):
2022         (WebCore::originsMatch): Deleted.
2023         * page/SecurityOrigin.h:
2024
2025 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2026
2027         [Synthetic Click] Dispatch mouseout soon after mouseup
2028         https://bugs.webkit.org/show_bug.cgi?id=195575
2029         <rdar://problem/47093049>
2030
2031         Reviewed by Simon Fraser.
2032
2033         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
2034
2035         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
2036
2037         * page/EventHandler.h:
2038         * page/ios/EventHandlerIOS.mm:
2039         (WebCore::EventHandler::dispatchFakeMouseOut):
2040
2041 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2042
2043         In CachedFrame's constructor, release-assert that DOMWindow still has a frame after page-caching subframes
2044         https://bugs.webkit.org/show_bug.cgi?id=195609
2045
2046         Reviewed by Chris Dumez.
2047
2048         r242677 added release assertions to DOMWindow::suspendForPageCache. But when the first release assert in
2049         that function is hit, we still can't tell whether active DOM objects are detaching frames, or if creating
2050         CachedFrame's on one of subframes is causing the frame to go way.
2051
2052         Add a release assertion immediately after creating CachedFrame on subframes to detect this case.
2053
2054         * history/CachedFrame.cpp:
2055         (WebCore::CachedFrame::CachedFrame):
2056
2057 2019-03-12  Zalan Bujtas  <zalan@apple.com>
2058
2059         [ContentChangeObserver] Stop content change observation when the touch event turns into long press
2060         https://bugs.webkit.org/show_bug.cgi?id=195601
2061         <rdar://problem/48796324>
2062
2063         Reviewed by Wenson Hsieh.
2064
2065         Cancel the ongoing content observation (started at touchStart) when the touch event does not turn into a tap gesture.
2066
2067         Not testable because any subsequent tap would reset the state anyway (though it might be measurable through some code triggering heavy content change).
2068
2069         * page/ios/ContentChangeObserver.cpp:
2070         (WebCore::ContentChangeObserver::didRecognizeLongPress):
2071         (WebCore::ContentChangeObserver::willNotProceedWithClick):
2072         * page/ios/ContentChangeObserver.h:
2073
2074 2019-03-12  Antti Koivisto  <antti@apple.com>
2075
2076         Compositing layer that renders two positioned elements should not hit test
2077         https://bugs.webkit.org/show_bug.cgi?id=195371
2078         <rdar://problem/48649586>
2079
2080         Reviewed by Simon Fraser.
2081
2082         Compute and pass an event region for layers if it differs from layer bounds.
2083
2084         This patch fixes various block overflow and layer expansion cases. It does not handle
2085         overflowing line boxes yet (it adds tests for those too).
2086
2087         Test: fast/scrolling/ios/overflow-scroll-overlap-2.html
2088
2089         * platform/graphics/GraphicsLayer.cpp:
2090         (WebCore::GraphicsLayer::setEventRegion):
2091         * platform/graphics/GraphicsLayer.h:
2092         (WebCore::GraphicsLayer::eventRegion):
2093         * platform/graphics/Region.h:
2094         * platform/graphics/ca/GraphicsLayerCA.cpp:
2095         (WebCore::GraphicsLayerCA::setEventRegion):
2096         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2097         (WebCore::GraphicsLayerCA::updateEventRegion):
2098
2099         Pass the region via the main platform layer of the graphics layer.
2100
2101         * platform/graphics/ca/GraphicsLayerCA.h:
2102         * platform/graphics/ca/PlatformCALayer.h:
2103         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2104         * rendering/PaintInfo.h:
2105         * rendering/PaintPhase.h:
2106
2107         Add EventRegion paint phase that computes the region instead of painting anything.
2108
2109         * rendering/RenderBlock.cpp:
2110         (WebCore::RenderBlock::paintObject):
2111         * rendering/RenderLayer.cpp:
2112         (WebCore::RenderLayer::paintForegroundForFragments):
2113         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
2114
2115         Invoke EventRegion paint phase.
2116
2117         * rendering/RenderLayer.h:
2118         * rendering/RenderLayerBacking.cpp:
2119         (WebCore::RenderLayerBacking::paintIntoLayer):
2120
2121         Request event region when pointing a layer.
2122
2123 2019-03-12  Philippe Normand  <pnormand@igalia.com>
2124
2125         [GStreamer][v4l2] Synchronous video texture flushing support
2126         https://bugs.webkit.org/show_bug.cgi?id=195453
2127
2128         Reviewed by Xabier Rodriguez-Calvar.
2129
2130         The v4l2 video decoder currently requires that downstream users of
2131         the graphics resources complete any pending draw call and release
2132         resources before returning from the DRAIN query.
2133
2134         To accomplish this the player monitors the pipeline and whenever a
2135         v4l2 decoder is added, synchronous video texture flushing support
2136         is enabled. Additionally and for all decoder configurations, a
2137         flush is performed before disposing of the player.
2138
2139         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2140         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
2141         Monitor elements added to the decodebin bin.
2142         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
2143         a flag if a v4l2 decoder was added in decodebin.
2144         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
2145         to the deep-element-added signal so as to monitor pipeline
2146         topology updates.
2147         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2148         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2149         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2150         Flush video texture before disposing of the player.
2151         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2152         Synchronously flush if the pipeline contains a v4l2 decoder.
2153         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
2154         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2155         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2156         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
2157         boolean flag used mostly to trigger synchronous flush conditions.
2158         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2159         Optionally drop the current buffer in a synchronous manner. By
2160         default the method keeps operating asynchronously.
2161         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2162
2163 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2164
2165         Move the remaining code to decide whether site specific quirks are needed to Quirks class
2166         https://bugs.webkit.org/show_bug.cgi?id=195610
2167
2168         Reviewed by Antti Koivisto.
2169
2170         Moved the remaining code scattered across WebCore to decide whether a site specific quirk
2171         is needed or not to Quirks class introduced in r236818.
2172
2173         * Modules/fetch/FetchRequest.cpp:
2174         (WebCore::needsSignalQuirk): Deleted.
2175         (WebCore::processInvalidSignal):
2176         * html/HTMLFormControlElement.cpp:
2177         (WebCore::HTMLFormControlElement::needsMouseFocusableQuirk const):
2178         * html/HTMLMediaElement.cpp:
2179         (WebCore::needsAutoplayPlayPauseEventsQuirk): Deleted.
2180         (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
2181         (WebCore::needsSeekingSupportQuirk): Deleted.
2182         (WebCore::HTMLMediaElement::supportsSeeking const):
2183         * html/MediaElementSession.cpp:
2184         (WebCore::needsArbitraryUserGestureAutoplayQuirk): Deleted.
2185         (WebCore::needsPerDocumentAutoplayBehaviorQuirk): Deleted.
2186         (WebCore::MediaElementSession::playbackPermitted const):
2187         * page/Quirks.cpp:
2188         (WebCore::allowedAutoplayQuirks): Added.
2189         (WebCore::Quirks::needsQuirks const): Added.
2190         (WebCore::Quirks::shouldIgnoreInvalidSignal const): Added.
2191         (WebCore::Quirks::needsFormControlToBeMouseFocusable const): Added.
2192         (WebCore::Quirks::needsAutoplayPlayPauseEvents const): Added.
2193         (WebCore::Quirks::needsSeekingSupportDisabled const): Addd.
2194         (WebCore::Quirks::needsPerDocumentAutoplayBehavior const): Added.
2195         (WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const): Added.
2196         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): Added.
2197         (WebCore::Quirks::hasWebSQLSupportQuirk const): Fixed the coding style.
2198         * page/Quirks.h:
2199
2200 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
2201
2202         [Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed
2203         https://bugs.webkit.org/show_bug.cgi?id=195454
2204
2205         Reviewed by Jer Noble.
2206
2207         This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy"
2208         and "27. HFRPausedAccuracy".
2209
2210         The first timeUpdate event after play() is omitted, because currentTime
2211         doesn't actually change in that scenario.
2212
2213         Tests 26 and 27 measure the time drift (real time vs. media time) on playback
2214         and start counting since the first timeUpdate event. In WebKit, that event
2215         happens at play(), before the pipeline has completed the transition to playing.
2216         Therefore, the real time inherits this startup delay and the test thinks that
2217         the player has drifted.
2218
2219         * html/HTMLMediaElement.cpp:
2220         (WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed.
2221
2222 2019-03-12  Enrique Ocaña González  <eocanha@igalia.com>
2223
2224         [EME][GStreamer] Speculative build fix
2225         https://bugs.webkit.org/show_bug.cgi?id=195614
2226
2227         Unreviewed speculative WPE build fix after r242776.
2228
2229         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added missing include.
2230
2231 2019-03-12  Philippe Normand  <pnormand@igalia.com>
2232
2233         [GStreamer] remove legacy GStreamer version checks
2234         https://bugs.webkit.org/show_bug.cgi?id=195552
2235
2236         Reviewed by Xabier Rodriguez-Calvar.
2237
2238         We require GStreamer 1.8.x so version checks below that make
2239         little sense. Also checks for odd minor version numbers make sense
2240         only for the latest GStreamer git development version.
2241
2242         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2243         (WebCore::initializeGStreamerAndRegisterWebKitElements):
2244         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2245         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
2246         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2247         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2248         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2249
2250 2019-03-12  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2251
2252         [EME] generateRequest was not using the sanitized init data
2253         https://bugs.webkit.org/show_bug.cgi?id=195555
2254
2255         Reviewed by Jer Noble.
2256
2257         * Modules/encryptedmedia/MediaKeySession.cpp:
2258         (WebCore::MediaKeySession::generateRequest): Use sanitized init
2259         data instead of the original one.
2260
2261 2019-03-12  Rob Buis  <rbuis@igalia.com>
2262
2263         Implement further CORS restrictions
2264         https://bugs.webkit.org/show_bug.cgi?id=188644
2265
2266         Reviewed by Darin Adler.
2267
2268         Verify that header value length is not greater than 128 [1]. Also implement
2269         Step 5 of [2] to append values to existing header value when calling
2270         Headers.append.
2271
2272         Tests: fetch/api/cors/cors-preflight-not-cors-safelisted.any.html
2273                fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker.html
2274                fetch/api/headers/headers-no-cors.window.html
2275
2276         [1] https://fetch.spec.whatwg.org/#cors-safelisted-request-header
2277         [2] https://fetch.spec.whatwg.org/#concept-headers-append
2278
2279         * Modules/fetch/FetchHeaders.cpp:
2280         (WebCore::canWriteHeader):
2281         (WebCore::appendToHeaderMap):
2282         (WebCore::FetchHeaders::remove):
2283         (WebCore::FetchHeaders::set):
2284         (WebCore::FetchHeaders::filterAndFill):
2285         * platform/network/HTTPParsers.cpp:
2286         (WebCore::isCrossOriginSafeRequestHeader): verify that header length is not greater than 128
2287
2288 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2289
2290         Remove OS X Server QuickTime plugin quirks
2291         https://bugs.webkit.org/show_bug.cgi?id=195607
2292
2293         Reviewed by Brent Fulgham.
2294
2295         r87244 added a site specific quirk for Mac OS X Sever wiki pages.
2296         However, the issue has since been resolved as of OS X Mountain Lion,
2297         of which Apple has ended the support in September 2015.
2298
2299         Because the latest versions of Safari no longer supports non-Flash plugins,
2300         the only scenario in which this quirk comes into play is when a third party app
2301         which embeds WKWebView or WebKitLegacy loaded web pages on a OS X Server
2302         running OS X Mountain Lion or earlier.
2303
2304         Given these observations, it's probably safe to remove this quirk from WebKit.
2305
2306         * html/HTMLObjectElement.cpp:
2307         (WebCore::HTMLObjectElement::hasFallbackContent const):
2308         (WebCore::HTMLObjectElement::hasValidClassId):
2309         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Deleted.
2310         * html/HTMLObjectElement.h:
2311
2312 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
2313
2314         Unreviewed speculative WPE build fix after r195586.
2315
2316         * platform/encryptedmedia/CDMInstance.h:
2317
2318 2019-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2319
2320         Remove MediaWiki site specific quirks
2321         https://bugs.webkit.org/show_bug.cgi?id=195597
2322
2323         Reviewed by Simon Fraser.
2324
2325         r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
2326
2327         Blink since removed this workaround:
2328         https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
2329
2330         Given Chrome has been shipping without this quirk for six years, it's safe to assume
2331         this site specific quirk is no longer neeed for Web compatibility.
2332
2333         * css/StyleSheetContents.cpp:
2334         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2335         * css/parser/CSSParserContext.cpp:
2336         (WebCore::CSSParserContext::CSSParserContext):
2337         (WebCore::operator==):
2338         * css/parser/CSSParserContext.h:
2339         (WebCore::CSSParserContextHash::hash):
2340
2341 2019-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2342
2343         Remove OpenCube QuickMenu quirks from navigator.appVersion
2344         https://bugs.webkit.org/show_bug.cgi?id=195600
2345
2346         Reviewed by Simon Fraser.
2347
2348         Remove the site specific quirk added in r35050 for OpenCube QuickMenu library for nwa.com
2349
2350         Blink removed this code back in 2013. The fact Chrome has been shipping successfully without
2351         this quirk for six years is a good evidence that it's no longer needed for the Web compatibility.
2352
2353         * page/Navigator.cpp:
2354         (WebCore::Navigator::appVersion const):
2355         (WebCore::shouldHideFourDot): Deleted.
2356
2357 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
2358
2359         Unreviewed, rolling out r242763.
2360
2361         Causes layout test crashes on iOS simulator
2362
2363         Reverted changeset:
2364
2365         "[Synthetic Click] Dispatch mouseout soon after mouseup"
2366         https://bugs.webkit.org/show_bug.cgi?id=195575
2367         https://trac.webkit.org/changeset/242763
2368
2369 2019-03-11  Ross Kirsling  <ross.kirsling@sony.com>
2370
2371         Add Optional to Forward.h.
2372         https://bugs.webkit.org/show_bug.cgi?id=195586
2373
2374         Reviewed by Darin Adler.
2375
2376         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
2377         * Modules/encryptedmedia/MediaKeyStatusMap.h:
2378         * Modules/webauthn/apdu/ApduCommand.cpp:
2379         * Modules/webauthn/apdu/ApduCommand.h:
2380         * Modules/webauthn/apdu/ApduResponse.cpp:
2381         * Modules/webauthn/apdu/ApduResponse.h:
2382         * Modules/webauthn/fido/FidoHidMessage.cpp:
2383         * Modules/webauthn/fido/FidoHidMessage.h:
2384         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
2385         * Modules/webauthn/fido/U2fCommandConstructor.h:
2386         * Modules/webdatabase/SQLTransaction.cpp:
2387         * Modules/webdatabase/SQLTransaction.h:
2388         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
2389         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
2390         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
2391         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2392         * Modules/webgpu/WHLSL/WHLSLPrepare.h:
2393         * Modules/webgpu/WebGPU.cpp:
2394         * Modules/webgpu/WebGPU.h:
2395         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2396         * Modules/webgpu/WebGPUCommandBuffer.h:
2397         * animation/WebAnimation.cpp:
2398         * animation/WebAnimation.h:
2399         * crypto/gcrypt/GCryptUtilities.cpp:
2400         * crypto/gcrypt/GCryptUtilities.h:
2401         * css/CSSStyleDeclaration.cpp:
2402         * css/CSSStyleDeclaration.h:
2403         * dom/TextDecoder.cpp:
2404         * dom/TextDecoder.h:
2405         * dom/UserGestureIndicator.cpp:
2406         * dom/UserGestureIndicator.h:
2407         * editing/ChangeListTypeCommand.cpp:
2408         * editing/ChangeListTypeCommand.h:
2409         * editing/EditingStyle.cpp:
2410         * editing/EditingStyle.h:
2411         * html/DOMFormData.cpp:
2412         * html/DOMFormData.h:
2413         * html/HTMLAllCollection.cpp:
2414         * html/HTMLAllCollection.h:
2415         * html/HTMLAnchorElement.cpp:
2416         * html/HTMLAnchorElement.h:
2417         * html/ImageBitmap.cpp:
2418         * html/ImageBitmap.h:
2419         * html/canvas/Path2D.h:
2420         * html/canvas/WebMetalEnums.cpp:
2421         * html/canvas/WebMetalEnums.h:
2422         * html/parser/HTMLParserIdioms.cpp:
2423         * html/parser/HTMLParserIdioms.h:
2424         * loader/ResourceCryptographicDigest.cpp:
2425         * loader/ResourceCryptographicDigest.h:
2426         * mathml/MathMLOperatorDictionary.cpp:
2427         * mathml/MathMLOperatorDictionary.h:
2428         * page/PerformanceEntry.cpp:
2429         * page/PerformanceEntry.h:
2430         * page/ResourceUsageData.h:
2431         * platform/ReferrerPolicy.cpp:
2432         * platform/ReferrerPolicy.h:
2433         * platform/Theme.cpp:
2434         * platform/Theme.h:
2435         * platform/encryptedmedia/CDMInstance.h:
2436         * platform/graphics/gpu/GPUDevice.cpp:
2437         * platform/graphics/gpu/GPUDevice.h:
2438         * platform/graphics/transforms/AffineTransform.cpp:
2439         * platform/graphics/transforms/AffineTransform.h:
2440         * platform/graphics/transforms/TransformState.cpp:
2441         * platform/graphics/transforms/TransformState.h:
2442         * platform/graphics/transforms/TransformationMatrix.cpp:
2443         * platform/graphics/transforms/TransformationMatrix.h:
2444         * platform/graphics/win/ImageDecoderDirect2D.cpp:
2445         * platform/graphics/win/ImageDecoderDirect2D.h:
2446         * platform/mediacapabilities/AudioConfiguration.h:
2447         * platform/network/CacheValidation.cpp:
2448         * platform/network/CacheValidation.h:
2449         * platform/network/DataURLDecoder.cpp:
2450         * platform/network/DataURLDecoder.h:
2451         * platform/network/HTTPParsers.cpp:
2452         * platform/network/HTTPParsers.h:
2453         * platform/network/curl/CookieJarDB.cpp:
2454         * platform/network/curl/CookieJarDB.h:
2455         * platform/win/SearchPopupMenuDB.cpp:
2456         * platform/win/SearchPopupMenuDB.h:
2457         * rendering/ImageQualityController.cpp:
2458         * rendering/ImageQualityController.h:
2459         * svg/SVGToOTFFontConversion.cpp:
2460         * svg/SVGToOTFFontConversion.h:
2461         Remove unnecessary includes from headers.
2462
2463 2019-03-11  Jer Noble  <jer.noble@apple.com>
2464
2465         REGRESSION(r236281): YouTube Movies fail with "video format" error
2466         https://bugs.webkit.org/show_bug.cgi?id=195598
2467         <rdar://problem/48782842>
2468
2469         Reviewed by Jon Lee.
2470
2471         Partially revert r236281 for YouTube.com.
2472
2473         * page/Quirks.cpp:
2474         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
2475
2476 2019-03-11  Justin Fan  <justin_fan@apple.com>
2477
2478         [Web GPU] BindGroups/Argument buffers: Move MTLBuffer creation from and GPUBindGroup validation to GPUDevice.createBindGroup
2479         https://bugs.webkit.org/show_bug.cgi?id=195519
2480         <rdar://problem/48781297>
2481
2482         Reviewed by Myles C. Maxfield.
2483
2484         Metal's Argument Buffers should not be tied directly to GPUBindGroupLayout; rather, create the MTLBuffer 
2485         in GPUBindGroup creation process.
2486         Move GPUBindGroup validation out of setBindGroup and to GPUBindGroup creation for performance.
2487
2488         Covered by existing tests. No behavior change.
2489
2490         * Modules/webgpu/WebGPUDevice.cpp:
2491         (WebCore::WebGPUDevice::createBindGroup const):
2492         * Sources.txt:
2493         * SourcesCocoa.txt:
2494         * WebCore.xcodeproj/project.pbxproj:
2495         * platform/graphics/gpu/GPUBindGroup.cpp: Removed.
2496         * platform/graphics/gpu/GPUBindGroup.h:
2497         (WebCore::GPUBindGroup::vertexArgsBuffer): A buffer that arguments will be encoded into during setBindGroup.
2498         (WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
2499         (WebCore::GPUBindGroup::boundBuffers const): A list of resources that are bound by this GPUBindGroup.
2500         (WebCore::GPUBindGroup::boundTextures const): Ditto.
2501         (WebCore::GPUBindGroup::layout const): Deleted.
2502         (WebCore::GPUBindGroup::bindings const): Deleted.
2503         * platform/graphics/gpu/GPUBindGroupLayout.h: No longer creating and retaining MTLBuffers.
2504         (WebCore::GPUBindGroupLayout::vertexEncoder const):
2505         (WebCore::GPUBindGroupLayout::fragmentEncoder const):
2506         (WebCore::GPUBindGroupLayout::computeEncoder const):
2507         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::isValid const): Deleted.
2508         (WebCore::GPUBindGroupLayout::vertexArguments const): Deleted.
2509         (WebCore::GPUBindGroupLayout::fragmentArguments const): Deleted.
2510         (WebCore::GPUBindGroupLayout::computeArguments const): Deleted.
2511         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
2512         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2513         (WebCore::tryCreateMtlArgumentEncoder):
2514         (WebCore::GPUBindGroupLayout::tryCreate):
2515         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2516         (WebCore::tryCreateArgumentEncoderAndBuffer): Deleted.
2517         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Added.
2518         (WebCore::tryCreateArgumentBuffer): Create and associate the MTLBuffer that backs the MTLArgumentEncoder.
2519         (WebCore::tryGetResourceAsBufferBinding): Validate a GPUBindingResource.
2520         (WebCore::trySetBufferOnEncoder): Encodes a GPUBufferBinding's MTLBuffer on a MTLArgumentEncoder.
2521         (WebCore::tryGetResourceAsSampler): Ditto, for GPUSamplers.
2522         (WebCore::trySetSamplerOnEncoder):
2523         (WebCore::tryGetResourceAsTexture): Ditto, for GPUTextures.
2524         (WebCore::trySetTextureOnEncoder):
2525         (WebCore::GPUBindGroup::tryCreate): Most setBindGroup validation moved here.
2526         (WebCore::GPUBindGroup::GPUBindGroup): Retains the resource references needed for setBindGroup. 
2527         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2528         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Most validation moved to GPUBindGroup::tryCreate().
2529         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Deleted.
2530         (WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Deleted.
2531         (WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder): Deleted.
2532         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2533         (WebCore::GPURenderPassEncoder::useResource):
2534         (WebCore::GPURenderPassEncoder::setVertexBuffer):
2535         (WebCore::GPURenderPassEncoder::setFragmentBuffer):
2536
2537         Misc:
2538         * platform/graphics/gpu/GPUCommandBuffer.cpp/h: Move missing includes to header.
2539
2540 2019-03-11  Zalan Bujtas  <zalan@apple.com>
2541
2542         [Synthetic Click] Dispatch mouseout soon after mouseup
2543         https://bugs.webkit.org/show_bug.cgi?id=195575
2544         <rdar://problem/47093049>
2545
2546         Reviewed by Simon Fraser.
2547
2548         Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
2549
2550         Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
2551
2552         * page/EventHandler.h:
2553         * page/ios/EventHandlerIOS.mm:
2554         (WebCore::EventHandler::dispatchFakeMouseOut):
2555
2556 2019-03-11  Youenn Fablet  <youenn@apple.com>
2557
2558         REGRESSION: (r242181) API test DragAndDropTests.ExternalSourcePlainTextToIFrame is Timing out
2559         https://bugs.webkit.org/show_bug.cgi?id=195362
2560
2561         Reviewed by Alexey Proskuryakov.
2562
2563         Covered by API test no longer crashing.
2564
2565         * page/SecurityOrigin.cpp:
2566         (WebCore::originsMatch):
2567         String representation should only match if originsMatch returns true.
2568
2569 2019-03-11  Justin Fan  <justin_fan@apple.com>
2570
2571         [Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
2572         https://bugs.webkit.org/show_bug.cgi?id=194406
2573         <rdar://problem/47892466>
2574
2575         Reviewed by Myles C. Maxfield.
2576
2577         GPUSwapChain no longer inherits from GPUBasedRenderingContext, and is now created from a GPUDevice. 
2578         WebGPURenderingContext is now GPUCanvasContext and delegates functionality to the GPUSwapChain, if it exists. 
2579         GPUQueue now implicitly presents the GPUSwapChain's current drawable at the task boundary, if one exists.
2580         Creating a new GPUSwapChain with the same GPUCanvasContext invalidates the previous one and its drawable and pipeline attachments.
2581         Calling GPUSwapChain::getCurrentTexture returns the same drawable within one task cycle. 
2582         Some mentions of "WebGPU" have been renamed to "Web GPU" and "gpu".
2583
2584         All Web GPU tests updated to match.
2585
2586         Add new files and symbols.
2587         * CMakeLists.txt:
2588         * DerivedSources-input.xcfilelist:
2589         * DerivedSources-output.xcfilelist:
2590         * DerivedSources.make:
2591         * Sources.txt:
2592         * WebCore.xcodeproj/project.pbxproj:
2593         * bindings/js/WebCoreBuiltinNames.h:
2594
2595         Rename some mentions of "webgpu" to "gpu".
2596         * Modules/webgpu/DOMWindowWebGPU.cpp:
2597         (WebCore::DOMWindowWebGPU::gpu):
2598         (WebCore::DOMWindowWebGPU::gpu const):
2599         * Modules/webgpu/DOMWindowWebGPU.h:
2600         * Modules/webgpu/DOMWindowWebGPU.idl:
2601
2602         Replace WebGPURenderingContext with GPUCanvasContext.
2603         * Modules/webgpu/GPUCanvasContext.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.cpp.
2604         (WebCore::GPUCanvasContext::create):
2605         (WebCore::GPUCanvasContext::GPUCanvasContext):
2606         (WebCore::GPUCanvasContext::replaceSwapChain):
2607         (WebCore::GPUCanvasContext::platformLayer const):
2608         (WebCore::GPUCanvasContext::reshape):
2609         (WebCore::GPUCanvasContext::markLayerComposited):
2610         * Modules/webgpu/GPUCanvasContext.h: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.h.
2611         * Modules/webgpu/GPUCanvasContext.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.idl.
2612         * dom/Document.cpp:
2613         (WebCore::Document::getCSSCanvasContext):
2614         * dom/Document.h:
2615         * dom/Document.idl:
2616         * html/HTMLCanvasElement.cpp:
2617         (WebCore::HTMLCanvasElement::getContext):
2618         (WebCore::HTMLCanvasElement::isWebGPUType):
2619         (WebCore::HTMLCanvasElement::createContextWebGPU):
2620         (WebCore::HTMLCanvasElement::getContextWebGPU):
2621         * html/HTMLCanvasElement.h:
2622         * html/HTMLCanvasElement.idl:
2623         * inspector/InspectorCanvas.cpp:
2624         (WebCore::InspectorCanvas::buildObjectForCanvas):
2625         * inspector/agents/InspectorCanvasAgent.cpp:
2626         (WebCore::contextAsScriptValue):
2627
2628         Update WebGPUSwapChain.
2629         * Modules/webgpu/GPUTextureDescriptor.idl:
2630         * Modules/webgpu/GPUTextureFormat.idl: Add the other two texture formats supported by CAMetalLayer.
2631         * Modules/webgpu/WebGPUDevice.cpp: Implement createSwapChain.
2632         (WebCore::WebGPUDevice::createSwapChain const):
2633         (WebCore::WebGPUDevice::getQueue const):
2634         (WebCore::WebGPUDevice::getQueue): Deleted.
2635         * Modules/webgpu/WebGPUDevice.h:
2636         * Modules/webgpu/WebGPUDevice.idl:
2637         * Modules/webgpu/WebGPUSwapChain.cpp:
2638         (WebCore::WebGPUSwapChain::create):
2639         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
2640         (WebCore::WebGPUSwapChain::getCurrentTexture): Renamed from getNextTexture. Only returns the next drawable if the last was presented.
2641         (WebCore::WebGPUSwapChain::destroy): Invalidate this GPUSwapChain and its textures and views.
2642         (WebCore::WebGPUSwapChain::configure): Deleted.
2643         (WebCore::WebGPUSwapChain::getNextTexture): Deleted.
2644         (WebCore::WebGPUSwapChain::present): Deleted.
2645         (WebCore::WebGPUSwapChain::reshape): Deleted.
2646         (WebCore::WebGPUSwapChain::markLayerComposited): Deleted.
2647         * Modules/webgpu/WebGPUSwapChain.h: Now a device-based object rather than a rendering context.
2648         (WebCore::WebGPUSwapChain::swapChain const):
2649         (WebCore::WebGPUSwapChain::WebGPUSwapChain): Deleted.
2650         * Modules/webgpu/WebGPUSwapChain.idl:
2651         * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
2652         * platform/graphics/gpu/GPUDevice.cpp: Implement tryCreateSwapChain.
2653         (WebCore::GPUDevice::tryCreateSwapChain const):
2654         (WebCore::GPUDevice::getQueue const):
2655         (WebCore::GPUDevice::getQueue): Deleted.
2656         * platform/graphics/gpu/GPUDevice.h: Retain a reference to the current GPUSwapChain, if one exists.
2657         (WebCore::GPUDevice::swapChain const):
2658         * platform/graphics/gpu/GPUQueue.h:
2659         * platform/graphics/gpu/GPUSwapChain.h:
2660         (WebCore::GPUSwapChain::destroy):
2661         * platform/graphics/gpu/GPUSwapChainDescriptor.h: Added.
2662         * platform/graphics/gpu/GPUTextureFormat.h: Add the other two texture formats supported by CAMetalLayer.
2663         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2664         (WebCore::GPUBuffer::commandBufferCommitted):
2665         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
2666         (WebCore::GPUQueue::tryCreate): Renamed from create to better fit functionality. Now retain a reference to the GPUDevice.
2667         (WebCore::GPUQueue::GPUQueue):
2668         (WebCore::GPUQueue::submit): Now checks state of all resources before marking them as committed or committing any resource.
2669                 In addition, schedules the current drawable to be presented after all commands have been submitted during this task cycle.
2670         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
2671         (WebCore::useAttachments): Ensure that the command buffer is aware of any texture resources used as attachments.
2672         (WebCore::GPURenderPassEncoder::tryCreate):
2673         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
2674         (WebCore::tryGetSupportedPixelFormat): Supported texture formats are the intersection of Web GPU's texture formats and CAMetalLayer's.
2675         (WebCore::setLayerShape):
2676         (WebCore::tryCreateSwapLayer): Create and configure the CAMetalLayer backing the swap chain.
2677         (WebCore::GPUSwapChain::tryCreate):
2678         (WebCore::GPUSwapChain::GPUSwapChain):
2679         (WebCore::GPUSwapChain::tryGetCurrentTexture): Renamed from getNextTexture. Only returns a texture if the last one was presented.
2680         (WebCore::GPUSwapChain::present):
2681         (WebCore::GPUSwapChain::reshape):
2682         (WebCore::GPUSwapChain::takeDrawable): Swaps out the current drawable so that it can be presented. The GPUSwapChain thus releases its reference to it.
2683         (WebCore::GPUSwapChain::create): Deleted.
2684         (WebCore::GPUSwapChain::setDevice): Deleted.
2685         (WebCore::GPUSwapChain::setFormat): Deleted.
2686         (WebCore::GPUSwapChain::getNextTexture): Deleted.
2687         * platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
2688         (WebCore::platformTextureFormatForGPUTextureFormat):
2689
2690         Misc:
2691         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Missing include.
2692
2693 2019-03-11  Chris Dumez  <cdumez@apple.com>
2694
2695         Update device orientation & motion permission native SPI as per latest proposal
2696         https://bugs.webkit.org/show_bug.cgi?id=195567
2697
2698         Reviewed by Youenn Fablet.
2699
2700         * dom/DeviceOrientationAndMotionAccessController.cpp:
2701         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
2702         * page/ChromeClient.h:
2703
2704 2019-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2705
2706         [macOS] Dispatching reentrant "contextmenu" events may cause crashes
2707         https://bugs.webkit.org/show_bug.cgi?id=195571
2708         <rdar://problem/48086046>
2709
2710         Reviewed by Andy Estes.
2711
2712         Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag.
2713         As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a
2714         synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as
2715         a result of handling a context menu event.
2716
2717         Test: fast/events/contextmenu-reentrancy-crash.html
2718
2719         * page/ContextMenuController.cpp:
2720         (WebCore::ContextMenuController::handleContextMenuEvent):
2721         * page/ContextMenuController.h:
2722
2723 2019-03-11  Andy Estes  <aestes@apple.com>
2724
2725         [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
2726         https://bugs.webkit.org/show_bug.cgi?id=195530
2727         <rdar://problem/48747164>
2728
2729         Reviewed by Alex Christensen.
2730
2731         * Modules/applepay/PaymentCoordinatorClient.h: Defined isWebPaymentCoordinator.
2732         * page/Settings.yaml: Defined the applePayRemoteUIEnabled setting and reordered the other
2733         Apple Pay settings.
2734
2735 2019-03-11  Alex Christensen  <achristensen@webkit.org>
2736
2737         Soft linking to Reveal framework should be optional
2738         https://bugs.webkit.org/show_bug.cgi?id=195576
2739         <rdar://problem/46822452>
2740
2741         Reviewed by Megan Gardner.
2742
2743         Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.
2744
2745         * editing/cocoa/DictionaryLookup.mm:
2746         (WebCore::showPopupOrCreateAnimationController):
2747
2748 2019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
2749
2750         [JSC] Reduce # of structures in JSGlobalObject initialization
2751         https://bugs.webkit.org/show_bug.cgi?id=195498
2752
2753         Reviewed by Darin Adler.
2754
2755         * bindings/js/SerializedScriptValue.cpp:
2756         (WebCore::CloneSerializer::serialize):
2757
2758 2019-03-11  Brent Fulgham  <bfulgham@apple.com>
2759
2760         Remove obsolete runtime flag for StorageAccess API Prompt
2761         https://bugs.webkit.org/show_bug.cgi?id=195564
2762         <rdar://problem/37279014>
2763
2764         Reviewed by Chris Dumez.
2765
2766         This bug tracks the work of removing the obsolete flag that had been used to optionally
2767         prevent display of the StorageAccess API prompt. We have since shipped the final version
2768         of this feature with an always-on prompt, and should have removed this runtime flag.
2769
2770         No test changes because this has no change in behavior. Tests already assume the prompt
2771         behavior, and did not test turning the flag off.
2772
2773         * page/RuntimeEnabledFeatures.h:
2774         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled): Deleted.
2775         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const): Deleted.
2776         * testing/InternalSettings.cpp:
2777         (WebCore::InternalSettings::Backup::Backup):
2778         (WebCore::InternalSettings::Backup::restoreTo):
2779         (WebCore::InternalSettings::setStorageAccessPromptsEnabled): Deleted.
2780         * testing/InternalSettings.h:
2781         (): Deleted.
2782         * testing/InternalSettings.idl:
2783
2784 2019-03-11  Eric Carlson  <eric.carlson@apple.com>
2785
2786         Add web audio release logging
2787         https://bugs.webkit.org/show_bug.cgi?id=195554
2788         <rdar://problem/48767211>
2789
2790         Reviewed by Jer Noble.
2791
2792         No new tests, no functional change.
2793
2794         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2795         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
2796         * Modules/webaudio/AudioBufferSourceNode.cpp:
2797         (WebCore::AudioBufferSourceNode::setBuffer):
2798         (WebCore::AudioBufferSourceNode::startPlaying):
2799         * Modules/webaudio/AudioContext.cpp:
2800         (WebCore::nextLogIdentifier):
2801         (WebCore::AudioContext::AudioContext):
2802         (WebCore::AudioContext::uninitialize):
2803         (WebCore::AudioContext::stop):
2804         (WebCore::AudioContext::createBufferSource):
2805         (WebCore::AudioContext::createMediaElementSource):
2806         (WebCore::AudioContext::createMediaStreamSource):
2807         (WebCore::AudioContext::createScriptProcessor):
2808         (WebCore::AudioContext::createBiquadFilter):
2809         (WebCore::AudioContext::createWaveShaper):
2810         (WebCore::AudioContext::createPanner):
2811         (WebCore::AudioContext::createConvolver):
2812         (WebCore::AudioContext::createDynamicsCompressor):
2813         (WebCore::AudioContext::createAnalyser):
2814         (WebCore::AudioContext::createGain):
2815         (WebCore::AudioContext::createDelay):
2816         (WebCore::AudioContext::createChannelSplitter):
2817         (WebCore::AudioContext::createChannelMerger):
2818         (WebCore::AudioContext::createOscillator):
2819         (WebCore::AudioContext::createPeriodicWave):
2820         (WebCore::AudioContext::willBeginPlayback):
2821         (WebCore::AudioContext::startRendering):
2822         (WebCore::AudioContext::fireCompletionEvent):
2823         (WebCore::AudioContext::logChannel const):
2824         * Modules/webaudio/AudioContext.h:
2825         (WebCore::AudioContext::nextAudioNodeLogIdentifier):
2826         (WebCore::AudioContext::nextAudioParameterLogIdentifier):
2827         * Modules/webaudio/AudioDestinationNode.cpp:
2828         (WebCore::AudioDestinationNode::AudioDestinationNode):
2829         * Modules/webaudio/AudioNode.cpp:
2830         (WebCore::convertEnumerationToString):
2831         (WebCore::AudioNode::AudioNode):
2832         (WebCore::AudioNode::~AudioNode):
2833         (WebCore::AudioNode::setNodeType):
2834         (WebCore::AudioNode::addInput):
2835         (WebCore::AudioNode::addOutput):
2836         (WebCore::AudioNode::connect):
2837         (WebCore::AudioNode::disconnect):
2838         (WebCore::AudioNode::setChannelCount):
2839         (WebCore::AudioNode::setChannelCountMode):
2840         (WebCore::AudioNode::setChannelInterpretation):
2841         (WebCore::AudioNode::logChannel const):
2842         * Modules/webaudio/AudioNode.h:
2843         (WTF::LogArgument<WebCore::AudioNode::NodeType>::toString):
2844         * Modules/webaudio/AudioParam.cpp:
2845         (WebCore::AudioParam::AudioParam):
2846         (WebCore::AudioParam::setValue):
2847         (WebCore::AudioParam::connect):
2848         (WebCore::AudioParam::disconnect):
2849         (WebCore::AudioParam::logChannel const):
2850         * Modules/webaudio/AudioParam.h:
2851         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2852         (WebCore::AudioScheduledSourceNode::start):
2853         (WebCore::AudioScheduledSourceNode::stop):
2854         * Modules/webaudio/BiquadFilterNode.cpp:
2855         (WebCore::BiquadFilterNode::BiquadFilterNode):
2856         * Modules/webaudio/ChannelMergerNode.cpp:
2857         (WebCore::ChannelMergerNode::ChannelMergerNode):
2858         * Modules/webaudio/ChannelSplitterNode.cpp:
2859         (WebCore::ChannelSplitterNode::ChannelSplitterNode):
2860         * Modules/webaudio/ConvolverNode.cpp:
2861         (WebCore::ConvolverNode::ConvolverNode):
2862         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2863         (WebCore::DefaultAudioDestinationNode::initialize):
2864         (WebCore::DefaultAudioDestinationNode::uninitialize):
2865         (WebCore::DefaultAudioDestinationNode::enableInput):
2866         (WebCore::DefaultAudioDestinationNode::setChannelCount):
2867         * Modules/webaudio/DelayNode.cpp:
2868         (WebCore::DelayNode::DelayNode):
2869         * Modules/webaudio/DynamicsCompressorNode.cpp:
2870         (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
2871         * Modules/webaudio/GainNode.cpp:
2872         (WebCore::GainNode::GainNode):
2873         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2874         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
2875         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2876         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
2877         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2878         (WebCore::OfflineAudioDestinationNode::startRendering):
2879         * Modules/webaudio/OscillatorNode.cpp:
2880         (WebCore::OscillatorNode::setType):
2881         (WebCore::OscillatorNode::setPeriodicWave):
2882         * Modules/webaudio/OscillatorNode.h:
2883         (WTF::LogArgument<WebCore::OscillatorNode::Type>::toString):
2884         * Modules/webaudio/PannerNode.cpp:
2885         (WebCore::PannerNode::PannerNode):
2886         * Modules/webaudio/ScriptProcessorNode.cpp:
2887         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
2888         * Modules/webaudio/WaveShaperNode.cpp:
2889         (WebCore::WaveShaperNode::WaveShaperNode):
2890         (WebCore::WaveShaperNode::setCurve):
2891         (WebCore::WaveShaperNode::setOversample):
2892         * Modules/webaudio/WaveShaperNode.h:
2893         (WTF::LogArgument<WebCore::WaveShaperNode::OverSampleType>::toString):
2894
2895 2019-03-11  Youenn Fablet  <youenn@apple.com>
2896
2897         Make IDBDatabaseIdentifier take a ClientOrigin as member
2898         https://bugs.webkit.org/show_bug.cgi?id=195544
2899
2900         Reviewed by Geoffrey Garen.
2901
2902         Instead of taking a top and a frame origin, make
2903         make IDBDatabaseIdentifier take a ClientOrigin.
2904
2905         This allows reusing some ClientOrigin code
2906         and will ease implementation of storage quota checking in
2907         NetworkProcess, as quota managers are keyed by client origins.
2908
2909         No change of behavior.
2910
2911         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2912         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
2913         (WebCore::IDBDatabaseIdentifier::isolatedCopy const):
2914         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
2915         (WebCore::IDBDatabaseIdentifier::debugString const):
2916         * Modules/indexeddb/IDBDatabaseIdentifier.h:
2917         (WebCore::IDBDatabaseIdentifier::hash const):
2918         (WebCore::IDBDatabaseIdentifier::operator== const):
2919         (WebCore::IDBDatabaseIdentifier::origin const):
2920         (WebCore::IDBDatabaseIdentifier::isRelatedToOrigin const):
2921         (WebCore::IDBDatabaseIdentifier::encode const):
2922         (WebCore::IDBDatabaseIdentifier::decode):
2923         * page/ClientOrigin.h:
2924         (WebCore::ClientOrigin::isRelated const):
2925
2926 2019-03-11  Zan Dobersek  <zdobersek@igalia.com>
2927
2928         Unreviewed. Manually rolling out r242701 and r242703 since the changes
2929         are causing test timeouts and crashes on GTK and WPE.
2930
2931         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2932         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2933         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2934         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2935         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2936         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2937         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2938         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
2939         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer):
2940         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
2941         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2942         (): Deleted.
2943
2944 2019-03-11  Jer Noble  <jer.noble@apple.com>
2945
2946         Use AVContentKeySession for "com.apple.fps.2_0" CDM version when AVStreamSession is absent
2947         https://bugs.webkit.org/show_bug.cgi?id=195462
2948         <rdar://problem/48712306>
2949
2950         Reviewed by Eric Carlson.
2951
2952         The difference between "com.apple.fps.2_0" and "3_0" is a protocol difference more than an
2953         implementation difference. In "2_0", the "EME nitialization" data comes in the form of a "content
2954         identifier", while the true initialization data is retrieved through a side channel directly from
2955         the attached element. In "3_0", the "EME initialization data" is the exact initialization data
2956         given by the parser, with no "content identifier" at all.
2957
2958         In the original implementation, the "2_0" used AVStreamSession, and "3_0" used AVContentKeySession,
2959         but in the absense of AVStreamSession, those protocol differences are minor and can be implemented
2960         using AVContentKeySession.
2961
2962         Changes:
2963
2964         - Add a new helper struct in CDMPrivateMediaSourceAVFObjC that represents the parsed parameters
2965           of the CDM string.
2966         - Add an "initData()" accessor to SourceBufferPrivateAVFObjC so that the "2_0" path can implement
2967           the side channel access to the necessary initialization data.
2968         - Refactor some of the SPI code to not re-declare unnecessary APIs.
2969         - In CDMSessionAVContentKeySession::generateKeyRequest(), this function can never be called twice
2970           so it is a logical impossibility to have a certificate at this point. Remove all this if() code.
2971
2972         * Modules/encryptedmedia/legacy/LegacyCDM.cpp:
2973         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
2974         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
2975         (WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):
2976         (WebCore::queryDecoderAvailability):
2977         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
2978         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
2979         (WebCore::validKeySystemRE): Deleted.
2980         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2981         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2982         (WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
2983         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
2984         (WebCore::CDMSessionAVContentKeySession::update):
2985         (WebCore::CDMSessionAVContentKeySession::addParser):
2986         (WebCore::CDMSessionAVContentKeySession::removeParser):
2987         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
2988         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2989         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2990         (WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
2991         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2992         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2993         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2994         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2995         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2996         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2997
2998 2019-03-11  Ryan Haddad  <ryanhaddad@apple.com>
2999
3000         Unreviewed, rolling out r242688, r242643, r242624.
3001
3002         Caused multiple layout test failures and crashes on iOS and macOS.
3003
3004         Reverted changeset:
3005
3006         "requestAnimationFrame should execute before the next frame"
3007         https://bugs.webkit.org/show_bug.cgi?id=177484
3008         https://trac.webkit.org/changeset/242624/webkit
3009
3010         * Sources.txt:
3011         * WebCore.xcodeproj/project.pbxproj:
3012         * accessibility/mac/AXObjectCacheMac.mm:
3013         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
3014         * animation/DocumentAnimationScheduler.cpp: Added.
3015         (WebCore::DocumentAnimationScheduler::create):
3016         (WebCore::DocumentAnimationScheduler::DocumentAnimationScheduler):
3017         (WebCore::DocumentAnimationScheduler::detachFromDocument):
3018         (WebCore::DocumentAnimationScheduler::scheduleWebAnimationsResolution):
3019         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution):
3020         (WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution):
3021         (WebCore::DocumentAnimationScheduler::displayRefreshFired):
3022         (WebCore::DocumentAnimationScheduler::windowScreenDidChange):
3023         (WebCore::DocumentAnimationScheduler::createDisplayRefreshMonitor const):
3024         * animation/DocumentAnimationScheduler.h: Renamed from Source/WebCore/page/RenderingUpdateScheduler.h.
3025         (WebCore::DocumentAnimationScheduler::lastTimestamp):
3026         (WebCore::DocumentAnimationScheduler::isFiring const):
3027         * animation/DocumentTimeline.cpp:
3028         (WebCore::DocumentTimeline::DocumentTimeline):
3029         (WebCore::DocumentTimeline::updateThrottlingState):
3030         (WebCore::DocumentTimeline::suspendAnimations):
3031         (WebCore::DocumentTimeline::resumeAnimations):
3032         (WebCore::DocumentTimeline::liveCurrentTime const):
3033         (WebCore::DocumentTimeline::currentTime):
3034         (WebCore::DocumentTimeline::cacheCurrentTime):
3035         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded):
3036         (WebCore::DocumentTimeline::animationTimingDidChange):
3037         (WebCore::DocumentTimeline::scheduleAnimationResolution):
3038         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
3039         (WebCore::DocumentTimeline::animationResolutionTimerFired):
3040         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
3041         (WebCore::DocumentTimeline::scheduleNextTick):
3042         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
3043         (WebCore::DocumentTimeline::resolveAnimationsForElement):
3044         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted.
3045         * animation/DocumentTimeline.h:
3046         * dom/Document.cpp:
3047         (WebCore::Document::resolveStyle):
3048         (WebCore::Document::prepareForDestruction):
3049         (WebCore::Document::windowScreenDidChange):
3050         (WebCore::Document::updateIntersectionObservations):
3051         (WebCore::Document::scheduleForcedIntersectionObservationUpdate):
3052         (WebCore::Document::animationScheduler):
3053         (WebCore::Document::updateAnimationsAndSendEvents): Deleted.
3054         (WebCore::Document::serviceRequestAnimationFrameCallbacks): Deleted.
3055         * dom/Document.h:
3056         * dom/ScriptedAnimationController.cpp:
3057         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3058         (WebCore::ScriptedAnimationController::scheduleAnimation):
3059         (WebCore::ScriptedAnimationController::animationTimerFired):
3060         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
3061         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): Deleted.
3062         * dom/ScriptedAnimationController.h:
3063         * page/FrameView.cpp:
3064         (WebCore::FrameView::viewportContentsChanged):
3065         * page/IntersectionObserver.cpp:
3066         (WebCore::IntersectionObserver::observe):
3067         * page/Page.cpp:
3068         (WebCore::Page::Page):
3069         (WebCore::Page::willDisplayPage):
3070         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
3071         (WebCore::Page::updateIntersectionObservations):
3072         (WebCore::Page::scheduleForcedIntersectionObservationUpdate):
3073         (WebCore::Page::layoutIfNeeded): Deleted.
3074         (WebCore::Page::renderingUpdate): Deleted.
3075         (WebCore::Page::renderingUpdateScheduler): Deleted.
3076         * page/Page.h:
3077         * page/PageOverlayController.cpp:
3078         (WebCore::PageOverlayController::didChangeViewExposedRect):
3079         (WebCore::PageOverlayController::notifyFlushRequired):
3080         * page/RenderingUpdateScheduler.cpp: Removed.
3081         * page/ios/ContentChangeObserver.h:
3082         * page/mac/ServicesOverlayController.mm:
3083         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
3084         * rendering/RenderLayerCompositor.cpp:
3085         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
3086
3087 2019-03-11  Darin Adler  <darin@apple.com>
3088
3089         Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
3090         https://bugs.webkit.org/show_bug.cgi?id=195533
3091
3092         Reviewed by Brent Fulgham.
3093
3094         * accessibility/AccessibilityNodeObject.cpp:
3095         (WebCore::AccessibilityNodeObject::changeValueByStep): Use numberToStringFixedPrecision.
3096         (WebCore::AccessibilityNodeObject::changeValueByPercent): Ditto.
3097         * accessibility/AccessibilityScrollbar.cpp:
3098         (WebCore::AccessibilityScrollbar::setValue): Ditto.
3099         * css/CSSFontVariationValue.cpp:
3100         (WebCore::CSSFontVariationValue::customCSSText const): Use appendFixedPrecisionNumber.
3101         * css/CSSGradientValue.cpp:
3102         (WebCore::CSSLinearGradientValue::customCSSText const): Ditto.
3103         (WebCore::CSSRadialGradientValue::customCSSText const): Ditto.
3104         * css/CSSKeyframeRule.cpp:
3105         (WebCore::StyleRuleKeyframe::keyText const): Ditto.
3106         * css/CSSTimingFunctionValue.cpp:
3107         (WebCore::CSSCubicBezierTimingFunctionValue::customCSSText const): Ditto.
3108         (WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto.
3109         * css/parser/CSSParserToken.cpp:
3110         (WebCore::CSSParserToken::serialize const): Ditto.
3111         * html/HTMLImageElement.cpp:
3112         (WebCore::HTMLImageElement::completeURLsInAttributeValue const): Ditto.
3113         * inspector/InspectorOverlay.cpp:
3114         (WebCore::InspectorOverlay::drawRulers): Use numberToStringFixedPrecision.
3115         * loader/ResourceLoadStatistics.cpp:
3116         (WebCore::ResourceLoadStatistics::toString const): Use appendFixedPrecisionNumber.
3117         * page/PrintContext.cpp:
3118         (WebCore::PrintContext::pageProperty): Use numberToStringFixedPrecision.
3119         * page/cocoa/ResourceUsageOverlayCocoa.mm:
3120         (WebCore::gcTimerString): Use numberToStringFixedPrecision.
3121         * platform/LayoutUnit.h:
3122         (WTF::ValueToString<WebCore::LayoutUnit>::string): Ditto.
3123         * platform/graphics/Color.cpp:
3124         (WebCore::Color::cssText const): Use appendFixedPrecisionNumber.
3125         * platform/graphics/ExtendedColor.cpp:
3126         (WebCore::ExtendedColor::cssText const): Ditto.
3127         * svg/SVGAngleValue.cpp:
3128         (WebCore::SVGAngleValue::valueAsString const): Use numberToStringFixedPrecision.
3129         * svg/SVGNumberListValues.cpp:
3130         (WebCore::SVGNumberListValues::valueAsString const): Use appendFixedPrecisionNumber.
3131         * svg/SVGPathStringBuilder.cpp:
3132         (WebCore::appendNumber): Ditto.
3133         (WebCore::appendPoint): Ditto.
3134         * svg/SVGPointListValues.cpp:
3135         (WebCore::SVGPointListValues::valueAsString const): Ditto.
3136         * svg/SVGTransformValue.cpp:
3137         (WebCore::SVGTransformValue::valueAsString const): Ditto.
3138         * svg/properties/SVGPropertyTraits.h:
3139         (WebCore::SVGPropertyTraits<float>::toString): Use numberToStringFixedPrecision.
3140         (WebCore::SVGPropertyTraits<FloatPoint>::toString): Use appendFixedPrecisionNumber.
3141         (WebCore::SVGPropertyTraits<FloatRect>::toString): Ditto.
3142         * testing/Internals.cpp:
3143         (WebCore::Internals::dumpMarkerRects): Use appendFixedPrecisionNumber.
3144         (WebCore::Internals::getCurrentCursorInfo): Ditto.
3145         * xml/XPathValue.cpp:
3146         (WebCore::XPath::Value::toString const): Use numberToStringFixedPrecision.
3147
3148 2019-03-11  Philippe Normand  <pnormand@igalia.com>
3149
3150         Unreviewed, Non-GStreamer-GL build fix after r242701.
3151
3152         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3153         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3154
3155 2019-03-11  Philippe Normand  <pnormand@igalia.com>
3156
3157         [GStreamer][v4l2] Synchronous video texture flushing support
3158         https://bugs.webkit.org/show_bug.cgi?id=195453
3159
3160         Reviewed by Xabier Rodriguez-Calvar.
3161
3162         The v4l2 video decoder currently requires that downstream users of
3163         the graphics resources complete any pending draw call and release
3164         resources before returning from the DRAIN query.
3165
3166         To accomplish this the player monitors the pipeline and whenever a
3167         v4l2 decoder is added, synchronous video texture flushing support
3168         is enabled. Additionally and for all decoder configurations, a
3169         flush is performed before disposing of the player.
3170
3171         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3172         (WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
3173         Monitor elements added to the decodebin bin.
3174         (WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
3175         a flag if a v4l2 decoder was added in decodebin.
3176         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
3177         to the deep-element-added signal so as to monitor pipeline
3178         topology updates.
3179         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3180         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3181         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3182         Flush video texture before disposing of the player.
3183         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
3184         Synchronously flush if the pipeline contains a v4l2 decoder.
3185         (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
3186         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3187         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
3188         (WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
3189         boolean flag used mostly to trigger synchronous flush conditions.
3190         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
3191         Optionally drop the current buffer in a synchronous manner. By
3192         default the method keeps operating asynchronously.
3193         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
3194
3195 2019-03-11  Antti Koivisto  <antti@apple.com>
3196
3197         Rename contentOffsetInCompostingLayer to contentOffsetInCompositingLayer
3198         https://bugs.webkit.org/show_bug.cgi?id=195553
3199
3200         Reviewed by Simon Fraser.
3201
3202         Less composting, more compositing.
3203
3204         * rendering/RenderLayerBacking.cpp:
3205         (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
3206         (WebCore::RenderLayerBacking::resetContentsRect):
3207         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
3208         (WebCore::RenderLayerBacking::updateImageContents):
3209         (WebCore::RenderLayerBacking::contentOffsetInCompositingLayer const):
3210         (WebCore::RenderLayerBacking::contentsBox const):
3211         (WebCore::RenderLayerBacking::backgroundBoxForSimpleContainerPainting const):
3212         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer const): Deleted.
3213         * rendering/RenderLayerBacking.h:
3214
3215 2019-03-10  Ross Kirsling  <ross.kirsling@sony.com>
3216
3217         Invalid flags in a RegExp literal should be an early SyntaxError
3218         https://bugs.webkit.org/show_bug.cgi?id=195514
3219
3220         Reviewed by Darin Adler.
3221
3222         * bindings/js/SerializedScriptValue.cpp:
3223         (WebCore::CloneDeserializer::readTerminal):
3224         Consume YarrFlags.
3225
3226 2019-03-10  Tim Horton  <timothy_horton@apple.com>
3227
3228         Add SPI to retrieve the set of text inputs in a given rect, and later focus one
3229         https://bugs.webkit.org/show_bug.cgi?id=195499
3230
3231         Reviewed by Darin Adler.
3232
3233         New API tests: WebKit.RequestTextInputContext and WebKit.FocusTextInputContext
3234
3235         * WebCore.xcodeproj/project.pbxproj:
3236         * dom/Document.cpp:
3237         (WebCore::Document::identifierForElement):
3238         (WebCore::Document::elementWithIdentifier):
3239         (WebCore::Document::identifiedElementWasRemovedFromDocument):
3240         * dom/Document.h:
3241         Add a mechanism where Document will vend an ObjectIdentifier for a given
3242         element, and can (if possible) retrieve that element later.
3243
3244         * dom/Element.cpp:
3245         (WebCore::Element::removedFromAncestor):
3246         If an Element has an identifier created for it, inform Document to remove
3247         it from the identifier map when the element is detached.
3248
3249         (WebCore::Element::createElementIdentifier):
3250         * dom/Element.h:
3251         * dom/ElementIdentifier.h: Added.
3252         * dom/ElementRareData.cpp:
3253         * dom/ElementRareData.h:
3254         (WebCore::ElementRareData::hasElementIdentifier const):
3255         (WebCore::ElementRareData::setHasElementIdentifier):
3256         (WebCore::ElementRareData::ElementRareData):
3257         Store a bit indicating if the Element has had a identifier created for it,
3258         so that we can avoid a hash lookup on every Element removal.
3259
3260         * dom/Node.h:
3261         * html/HTMLTextFormControlElement.h:
3262
3263 2019-03-10  Zalan Bujtas  <zalan@apple.com>
3264
3265         [ContentChangeObserver] Fix failing test cases
3266         https://bugs.webkit.org/show_bug.cgi?id=195524
3267         <rdar://problem/48745101>
3268
3269         Reviewed by Simon Fraser.
3270
3271         1. Do not start DOM timer install observation when we already detected change at touchstart.
3272         2. hasPendingActivity() should only care about ContentChangeObserver flags.
3273         3. Do not try to notify the client when we are in the mouseMoved dispatch call (currently it could happen
3274         when a timer gets intalled and removed right away).
3275
3276         * page/ios/ContentChangeObserver.cpp:
3277         (WebCore::ContentChangeObserver::adjustObservedState):
3278         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
3279         * page/ios/ContentChangeObserver.h:
3280         (WebCore::ContentChangeObserver::hasPendingActivity const):
3281         (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
3282
3283 2019-03-10  Simon Fraser  <simon.fraser@apple.com>
3284
3285         ScrollingTree should have the final say on where layers go
3286         https://bugs.webkit.org/show_bug.cgi?id=195507
3287
3288         Reviewed by Antti Koivisto.
3289
3290         Main thread layer flushing can race with scrolling tree layer changes on macOS, causing
3291         flashing as layers jump around sometimes. We go to some lengths to avoid this by trying
3292         not to touch properties on layers that are being interacted with (scrollableArea->setIsUserScroll in
3293         updateScrollPositionAfterAsyncScroll()), but that's fragile.
3294
3295         This patch adds ScrollingTree::applyScrollingTreeLayerPositions(), which enters
3296         ScrollingTree::applyLayerPositions() on the main thread/UI process. This traverses
3297         the tree allowing each node to run their layer positioning logic.
3298
3299         For macOS WK2, this is called from TiledCoreAnimationDrawingArea::flushLayers() after flushCompositingStateIncludingSubframes().
3300         For macOS WK2 with UI-side compositing, RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
3301         calls m_webPageProxy.scrollingCoordinatorProxy()->applyScrollingTreeLayerPositions().
3302         iOS WK2 is unchanged, using viewportChangedViaDelegatedScrolling() which does the same thing, allowing
3303         for the dynamic viewport changes that happen when zooming on iOS.
3304
3305         Testing this requires infrastructure that we don't have yet.
3306
3307         * page/scrolling/AsyncScrollingCoordinator.cpp:
3308         (WebCore::AsyncScrollingCoordinator::applyScrollingTreeLayerPositions):
3309         * page/scrolling/AsyncScrollingCoordinator.h:
3310         * page/scrolling/ScrollingCoordinator.h:
3311         (WebCore::ScrollingCoordinator::applyScrollingTreeLayerPositions):
3312         * page/scrolling/ScrollingTree.cpp:
3313         (WebCore::ScrollingTree::handleWheelEvent):
3314         (WebCore::ScrollingTree::commitTreeState):
3315         (WebCore::ScrollingTree::applyLayerPositions):
3316         (WebCore::ScrollingTree::applyLayerPositionsRecursive):
3317         * page/scrolling/ScrollingTree.h:
3318         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
3319         (WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
3320         * page/scrolling/ScrollingTreeFrameHostingNode.h:
3321         * page/scrolling/ScrollingTreeNode.h:
3322         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3323         (WebCore::ScrollingTreeScrollingNode::applyLayerPositions):
3324         * page/scrolling/ScrollingTreeScrollingNode.h:
3325         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
3326         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
3327         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
3328         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
3329         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3330         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
3331         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
3332         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3333         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3334         (WebCore::ScrollingTreeFrameScrollingNodeMac::applyLayerPositions):
3335
3336 2019-03-09  Andy Estes  <aestes@apple.com>
3337
3338         [Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
3339         https://bugs.webkit.org/show_bug.cgi?id=195526
3340         <rdar://problem/48745636>
3341
3342         Reviewed by Chris Dumez.
3343
3344         * Modules/applepay/PaymentCoordinatorClient.h:
3345         * loader/EmptyClients.cpp:
3346         * testing/MockPaymentCoordinator.cpp:
3347         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
3348         (WebCore::MockPaymentCoordinator::openPaymentSetup):
3349         * testing/MockPaymentCoordinator.h:
3350
3351 2019-03-09  Zalan Bujtas  <zalan@apple.com>
3352
3353         [ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
3354         https://bugs.webkit.org/show_bug.cgi?id=195520
3355         <rdar://problem/48740098>
3356
3357         Reviewed by Simon Fraser.
3358
3359         Unfortunately seriouseats has a 300ms hover intent delay to deal with accidental menupane pop-ups. This page also hides this
3360         non-fixed width menupane using absolute positioning and negative left.  
3361
3362         Test: fast/events/touch/ios/content-observation/move-content-from-offscreen.html
3363
3364         * page/ios/ContentChangeObserver.cpp:
3365         (WebCore::ContentChangeObserver::didInstallDOMTimer):
3366         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3367         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Content auhtors tend to use x - 1 values (where x = 10^y)
3368
3369 2019-03-09  Chris Dumez  <cdumez@apple.com>
3370
3371         Add assertions to help debug crash under DOMWindowExtension::suspendForPageCache()
3372         https://bugs.webkit.org/show_bug.cgi?id=195488
3373
3374         Reviewed by Ryosuke Niwa.
3375
3376         Try and figure out how the document can be detached from its frame while we're suspending
3377         DOMWindowExtensions.
3378
3379         * page/DOMWindow.cpp:
3380         (WebCore::DOMWindow::willDetachDocumentFromFrame):
3381         (WebCore::DOMWindow::suspendForPageCache):
3382         * page/DOMWindow.h:
3383
3384 2019-03-09  Chris Dumez  <cdumez@apple.com>
3385
3386         Simplify DOMWindowProperty code / handling
3387         https://bugs.webkit.org/show_bug.cgi?id=195495
3388
3389         Reviewed by Ryosuke Niwa.
3390
3391         DOMWindowProperty code was unnecessarily complex because DOMWindowExtension inherited
3392         from it and DOMWindowExtension needs a lot of information about the global object's
3393         lifetime to communicate to the injected bbundle client. This subclassing is also
3394         very confusing because a DOMWindowExtension is not a *property* on the Window object.
3395
3396         This patch updates DOMWindowExtension to stop subclassing DOMWindowProperty and
3397         moves all the complexity from DOMWindowProperty to DOMWindowExtension.
3398         DOMWindowProperty is now a very simple base class which merely has a WeakPtr to
3399         the window and getters for the window and the frame.
3400
3401         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
3402         (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
3403         (WebCore::DOMWindowIndexedDatabase::indexedDB):
3404         * Modules/indexeddb/DOMWindowIndexedDatabase.h:
3405         There is no reason for DOMWindowIndexedDatabase to move its IDBFactory to a
3406         separate data member which in PageCache. Script do not run while in PageCache.
3407         Also, frames are nulled out while in the PageCache so the indexedDB() getter
3408         would return null anyway while in PageCache.
3409
3410         * css/StyleMedia.idl:
3411         * loader/appcache/ApplicationCacheHost.cpp:
3412         (WebCore::ApplicationCacheHost::setDOMApplicationCache):
3413         Store a WeakPtr to the DOMApplicationCache for safety.
3414
3415         (WebCore::ApplicationCacheHost::dispatchDOMEvent):
3416         Do not fire events on the DOMApplicationCache if it is frameless to maintain
3417         previous behavior. Previously, the DOMApplicationCache would have been nulled
3418         out when detached from its frame so we would not have fired events.
3419
3420         * loader/appcache/ApplicationCacheHost.h:
3421         * loader/appcache/DOMApplicationCache.cpp:
3422         * loader/appcache/DOMApplicationCache.h:
3423         Remove some unnecessary complexity. The ApplicationCacheHost is owned by the
3424         DocumentLoader, which changes on navigation. There is therefore no reason to
3425         null out the DOMApplicationCache on the ApplicationCacheHost when its gets
3426         detached from its frame or enters PageCache.
3427
3428         * page/BarProp.idl:
3429         * page/DOMSelection.idl:
3430         * page/DOMWindow.cpp:
3431         (WebCore::DOMWindow::willDestroyCachedFrame):
3432         (WebCore::DOMWindow::willDestroyDocumentInFrame):
3433         (WebCore::DOMWindow::willDetachDocumentFromFrame):
3434         (WebCore::DOMWindow::registerExtension):
3435         (WebCore::DOMWindow::unregisterExtension):
3436
3437         (WebCore::DOMWindow::resetDOMWindowProperties): Removed.
3438         Stop clearing some of the DOMWindow's properties when the document gets destroyed or when
3439         the Window for the initial empty document gets reused on navigation. I think we used to
3440         need this because DOMWindowProperty used to hold pointers to their frame. However, this
3441         is no longer the case nowadays as DOMWindowProperty objects get their frame from their
3442         Window.
3443
3444         (WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
3445         (WebCore::DOMWindow::suspendForPageCache):
3446         (WebCore::DOMWindow::resumeFromPageCache):
3447         * page/DOMWindow.h:
3448         * page/DOMWindowExtension.cpp:
3449         (WebCore::DOMWindowExtension::DOMWindowExtension):
3450         (WebCore::DOMWindowExtension::~DOMWindowExtension):
3451         (WebCore::DOMWindowExtension::frame const):
3452         (WebCore::DOMWindowExtension::suspendForPageCache):
3453         (WebCore::DOMWindowExtension::resumeFromPageCache):
3454         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
3455         (WebCore::DOMWindowExtension::willDestroyGlobalObjectInFrame):
3456         (WebCore::DOMWindowExtension::willDetachGlobalObjectFromFrame):
3457         * page/DOMWindowExtension.h:
3458         * page/DOMWindowProperty.cpp:
3459         (WebCore::DOMWindowProperty::DOMWindowProperty):
3460         * page/DOMWindowProperty.h:
3461         (WebCore::DOMWindowProperty::window const):
3462         * page/History.idl:
3463         * page/Location.idl:
3464         * page/Navigator.cpp:
3465         (WebCore::Navigator::plugins):
3466         (WebCore::Navigator::mimeTypes):
3467         * page/PerformanceNavigation.idl:
3468         * page/PerformanceTiming.idl:
3469         * page/Screen.idl:
3470         * page/VisualViewport.cpp:
3471         (WebCore::VisualViewport::scriptExecutionContext const):
3472         * plugins/DOMMimeTypeArray.idl:
3473         * plugins/DOMPluginArray.idl:
3474
3475 2019-03-09  Zalan Bujtas  <zalan@apple.com>
3476
3477         [ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
3478         https://bugs.webkit.org/show_bug.cgi?id=195510
3479         <rdar://problem/48735695>
3480
3481         Reviewed by Simon Fraser.
3482
3483         This patch covers the observation of async changes triggered by touchStart/touchEnd (animations, timers, style recalcs).
3484
3485         Test: fast/events/touch/ios/content-observation/visibility-change-after-touch-end.html
3486
3487         * page/ios/ContentChangeObserver.cpp:
3488         (WebCore::ContentChangeObserver::didCancelTouchEvent):
3489         (WebCore::ContentChangeObserver::adjustObservedState):
3490         * page/ios/ContentChangeObserver.h:
3491         (WebCore::ContentChangeObserver::setIsInBetweenTouchEndAndMouseMoved):
3492         (WebCore::ContentChangeObserver::isInBetweenTouchEndAndMouseMoved const):
3493         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3494
3495 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
3496
3497         Make it clearer which data is protected by the two locks in ScrollingTree
3498         https://bugs.webkit.org/show_bug.cgi?id=195501
3499
3500         Reviewed by Tim Horton.
3501
3502         Gather ScrollingTree member variables into two structs, and name the struct
3503         members and the locks to make it clear which data is protected by each lock.
3504         
3505         We only need to protect data read by multiple threads; these are the scrolling
3506         thread, the event handling thread (which runs ThreadedScrollingTree::tryToHandleWheelEvent()),
3507         and the main thread, which pokes various bits of pin/rubber-banding state.
3508         Ideally the main thread would always push data to the scrolling thread via a commit,
3509         but that's not what happens now.
3510
3511         Suspiciously, ScrollingTree::shouldHandleWheelEventSynchronously() uses the root node,
3512         so should probably hold a lock shared with the scrolling thread (webkit.org/b/195502).
3513         
3514         * page/scrolling/ScrollingTree.cpp:
3515         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3516         (WebCore::ScrollingTree::commitTreeState):
3517         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
3518         (WebCore::ScrollingTree::setMainFrameScrollPosition):
3519         (WebCore::ScrollingTree::eventTrackingTypeForPoint):
3520         (WebCore::ScrollingTree::isRubberBandInProgress):
3521         (WebCore::ScrollingTree::setMainFrameIsRubberBanding):
3522         (WebCore::ScrollingTree::isScrollSnapInProgress):
3523         (WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
3524         (WebCore::ScrollingTree::setMainFramePinState):
3525         (WebCore::ScrollingTree::setCanRubberBandState):
3526         (WebCore::ScrollingTree::setScrollPinningBehavior):
3527         (WebCore::ScrollingTree::scrollPinningBehavior):
3528         (WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
3529         (WebCore::ScrollingTree::latchedNode):
3530         (WebCore::ScrollingTree::setLatchedNode):
3531         (WebCore::ScrollingTree::clearLatchedNode):
3532         (WebCore::ScrollingTree::scrollingTreeAsText):
3533         (WebCore::ScrollingTree::touchActionDataAtPoint const):
3534         (WebCore::ScrollingTree::mainFrameScrollPosition): Deleted.
3535         (WebCore::ScrollingTree::mainFrameLayoutViewport): Deleted.
3536         (WebCore::ScrollingTree::rubberBandsAtLeft): Deleted.
3537         (WebCore::ScrollingTree::rubberBandsAtRight): Deleted.
3538         (WebCore::ScrollingTree::rubberBandsAtBottom): Deleted.
3539         (WebCore::ScrollingTree::rubberBandsAtTop): Deleted.
3540         * page/scrolling/ScrollingTree.h:
3541         (WebCore::ScrollingTree::hasLatchedNode const):
3542         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
3543         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
3544         * platform/graphics/FloatPoint.h:
3545         (WebCore::FloatPoint::isZero const):
3546
3547 2019-03-08  Simon Fraser  <simon.fraser@apple.com>
3548
3549         Share some code that sets CALayer positions
3550         https://bugs.webkit.org/show_bug.cgi?id=195485
3551
3552         Reviewed by Zalan Bujtas.
3553
3554         Share some code between ScrollingTreeStickyNode and ScrollingTreeFixedNode that sets the position
3555         of a CALayer given the top-left location.
3556
3557         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
3558         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
3559         (WebCore::ScrollingTreeFixedNodeInternal::operator*): Deleted.
3560         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
3561         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
3562         (WebCore::ScrollingTreeStickyNodeInternal::operator*): Deleted.
3563         * platform/graphics/cocoa/WebCoreCALayerExtras.h:
3564         * platform/graphics/cocoa/WebCoreCALayerExtras.mm:
3565         (-[CALayer _web_setLayerTopLeftPosition:]):
3566
3567 2019-03-08  Chris Dumez  <cdumez@apple.com>
3568
3569         Add support for Device Orientation / Motion permission API
3570         https://bugs.webkit.org/show_bug.cgi?id=195329
3571         <rdar://problem/47645367>
3572
3573         Reviewed by Geoffrey Garen.
3574
3575         Add support for Device Orientation / Motion permission API:
3576         - https://github.com/w3c/deviceorientation/issues/57
3577
3578         Pages can add event listeners for 'deviceorientation' / 'devicemotion' events but
3579         such events will not be fired until the page's JavaScript calls
3580         DeviceOrientationEvent.requestPermission() / DeviceMotionEvent.requestPermission()
3581         and the user grants the request.
3582
3583         The feature is currently behind an experimental feature flag, off by default.
3584
3585         Tests: fast/device-orientation/device-motion-request-permission-denied.html
3586                fast/device-orientation/device-motion-request-permission-granted.html
3587                fast/device-orientation/device-motion-request-permission-user-gesture.html
3588                fast/device-orientation/device-orientation-request-permission-denied.html
3589                fast/device-orientation/device-orientation-request-permission-granted.html
3590                fast/device-orientation/device-orientation-request-permission-user-gesture.html
3591
3592         * CMakeLists.txt:
3593         * DerivedSources-input.xcfilelist:
3594         * DerivedSources-output.xcfilelist:
3595         * DerivedSources.make:
3596         * Sources.txt:
3597         * WebCore.xcodeproj/project.pbxproj:
3598         * dom/DeviceMotionEvent.h:
3599         * dom/DeviceMotionEvent.idl:
3600         * dom/DeviceOrientationAndMotionAccessController.cpp: Added.
3601         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
3602         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
3603         (WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
3604         * dom/DeviceOrientationAndMotionAccessController.h: Added.
3605         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
3606         * dom/DeviceOrientationEvent.h:
3607         * dom/DeviceOrientationEvent.idl:
3608         * dom/DeviceOrientationOrMotionEvent.cpp: Added.
3609         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
3610         * dom/DeviceOrientationOrMotionEvent.h: Added.
3611         * dom/DeviceOrientationOrMotionEvent.idl: Added.
3612         * dom/DeviceOrientationOrMotionPermissionState.h: Added.
3613         * dom/DeviceOrientationOrMotionPermissionState.idl: Added.
3614         * dom/Document.cpp:
3615         (WebCore::Document::deviceOrientationAndMotionAccessController):
3616         * dom/Document.h:
3617         * dom/Event.cpp:
3618         * dom/MessagePort.cpp:
3619         * dom/Microtasks.cpp:
3620         * page/ChromeClient.h:
3621         * page/DOMWindow.cpp:
3622         (WebCore::DOMWindow::addEventListener):
3623         (WebCore::DOMWindow::deviceOrientationController const):
3624         (WebCore::DOMWindow::deviceMotionController const):
3625         (WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
3626         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
3627         (WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary):
3628         (WebCore::DOMWindow::stopListeningForDeviceOrientationIfNecessary):
3629         (WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary):
3630         (WebCore::DOMWindow::stopListeningForDeviceMotionIfNecessary):
3631         (WebCore::DOMWindow::removeEventListener):
3632         (WebCore::DOMWindow::removeAllEventListeners):
3633         * page/DOMWindow.h:
3634         * page/DeviceController.cpp:
3635         (WebCore::DeviceController::hasDeviceEventListener const):
3636         * page/DeviceController.h:
3637         * page/Settings.yaml:
3638
3639 2019-03-08  Zalan Bujtas  <zalan@apple.com>
3640
3641         [ContentChangeObserver] Expand "isConsideredClickable" to descendants
3642         https://bugs.webkit.org/show_bug.cgi?id=195478
3643         <rdar://problem/48724935>
3644
3645         Reviewed by Simon Fraser.
3646
3647         In StyleChangeScope we try to figure out whether newly visible content should stick (menu panes etc) by checking if it is clickable.
3648         This works fine as long as all the visible elements are gaining new renderers through this style update processs.
3649         However when an element becomes visible by a change other than display: (not)none, it's not sufficient to just check the element itself,
3650         since it might not respond to click at all, while its descendants do.
3651         A concrete example is a max-height value change on usps.com, where the max-height is on a container (menu pane).
3652         This container itself is not clickable while most of its children are (menu items).    
3653
3654         Test: fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html
3655
3656         * page/ios/ContentChangeObserver.cpp:
3657         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3658         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3659         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const):
3660         (WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
3661         (WebCore::isConsideredHidden): Deleted.
3662         * page/ios/ContentChangeObserver.h:
3663
3664 2019-03-08  Zalan Bujtas  <zalan@apple.com>
3665
3666         [ContentChangeObserver] Cleanup adjustObservedState
3667         https://bugs.webkit.org/show_bug.cgi?id=195470
3668         <rdar://problem/48717823>
3669
3670         Reviewed by Simon Fraser.
3671
3672         This is in preparation for introducing an observation window from touchStart -> mouseMoved.
3673         1. Cancel pending activities (future timers, pending stylesheet recalcs) when visible content change is detected.
3674         2. The fixed time window takes care of notifying the client -timers, style recalcs during the window should not signal themselves.  
3675         3. Reset m_isObservingPendingStyleRecalc at StartedStyleRecalc instead of EndedStyleRecalc. 
3676
3677         * page/ios/ContentChangeObserver.cpp:
3678         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
3679         (WebCore::ContentChangeObserver::styleRecalcDidStart):
3680         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
3681         (WebCore::ContentChangeObserver::adjustObservedState):
3682         * page/ios/ContentChangeObserver.h:
3683         (WebCore::ContentChangeObserver::hasPendingActivity const):
3684         (WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
3685
3686 2019-03-08  Zalan Bujtas  <zalan@apple.com>
3687
3688         [ContentChangeObserver] Add StartedDOMTimerExecution and StartedStyleRecalc
3689         https://bugs.webkit.org/show_bug.cgi?id=195463
3690         <rdar://problem/48714762>
3691
3692         Reviewed by Simon Fraser.
3693
3694         This is in preparation for introducing m_isObservingContentChanges flag to track observing state across events (touchStart -> mouseMoved).
3695
3696         * page/ios/ContentChangeObserver.cpp:
3697         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
3698         (WebCore::ContentChangeObserver::styleRecalcDidStart):
3699         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
3700         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
3701         (WebCore::ContentChangeObserver::adjustObservedState):
3702         * page/ios/ContentChangeObserver.h:
3703         (WebCore::ContentChangeObserver::isObservingPendingStyleRecalc const):
3704         (WebCore::ContentChangeObserver::isObservingStyleRecalc const): Deleted.
3705
3706 2019-03-08  Chris Fleizach  <cfleizach@apple.com>
3707
3708         AX: AOM accessibleclick does not work on iOS
3709         https://bugs.webkit.org/show_bug.cgi?id=195423
3710         <rdar://problem/48682110>
3711
3712         Reviewed by Joanmarie Diggs.
3713
3714         Return this value of this method so it can be surfaced to a higher level.
3715
3716         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3717         (-[WebAccessibilityObjectWrapper _accessibilityActivate]):
3718
3719 2019-03-08  Chris Dumez  <cdumez@apple.com>
3720
3721         imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_error.html is a flaky crash
3722         https://bugs.webkit.org/show_bug.cgi?id=195441
3723         <rdar://problem/43437394>
3724
3725         Reviewed by Alexey Proskuryakov.
3726
3727         FileReader is an ActiveDOMObject, which means that FileReader::stop() gets called when
3728         its script execution context is about to get destroyed. FileReader::stop() sets m_state
3729         to DONE. FileReader::abort() would schedule an asynchronous task and then ASSERT that
3730         m_state is not DONE, which would hit if FileReader::stop() had been called in between
3731         the task being scheduled and its execution. To address the issue, have the task abort
3732         early if isContextStopped() returns true.
3733
3734         Also replace calls to setPendingActivity() / unsetPendingActivity() with a
3735         PendingActivity data member as mismatched call to those can lead to leaks.
3736
3737         * fileapi/FileReader.cpp:
3738         (WebCore::FileReader::canSuspendForDocumentSuspension const):
3739         No reason not to suspend if there is no pending read.
3740
3741         (WebCore::FileReader::stop):
3742         (WebCore::FileReader::readInternal):
3743         (WebCore::FileReader::abort):
3744         (WebCore::FileReader::didFinishLoading):
3745         (WebCore::FileReader::didFail):
3746         * fileapi/FileReader.h:
3747
3748 2019-03-08  Zan Dobersek  <zdobersek@igalia.com>
3749
3750         GLContextEGL: desired EGL config should search for 8-bit components by default
3751         https://bugs.webkit.org/show_bug.cgi?id=195413
3752
3753         Reviewed by Carlos Garcia Campos.
3754
3755         The EGL config search in GLContextEGL should by default look for
3756         RGBA8888 configurations while allowing RGB565 as an alternative.
3757         This prevents from accidentally landing on an RGBA1010102
3758         configuration that is available with some graphics stacks, and which is
3759         not expected in e.g. window snapshotting that's done for layout test
3760         output comparison.
3761
3762         * platform/graphics/egl/GLContextEGL.cpp:
3763         (WebCore::GLContextEGL::getEGLConfig): EGL config search should by
3764         default request 8-bit color channels.
3765
3766 2019-03-08  Miguel Gomez  <magomez@igalia.com>
3767
3768         Use a thread safe refcounter for FilterOperation.
3769         https://bugs.webkit.org/show_bug.cgi?id=194149
3770
3771         Reviewed by Carlos Garcia Campos.
3772
3773         Use a thread safe refcounter for FilterOperation.
3774
3775         * platform/graphics/filters/FilterOperation.h:
3776
3777 2019-03-07  Yusuke Suzuki  <ysuzuki@apple.com>
3778
3779         [JSC] Make more fields lazy in JSGlobalObject
3780         https://bugs.webkit.org/show_bug.cgi?id=195449
3781
3782         Reviewed by Mark Lam.
3783
3784         Use arrayBufferConstructor() since getDirect does not work with lazy property.
3785
3786         * bindings/js/JSDOMGlobalObject.cpp:
3787         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3788
3789 2019-03-07  Zalan Bujtas  <zalan@apple.com>
3790
3791         [ContentChangeObserver][REGRESSION] Check if visibility change happens while dispatching mouseMoved
3792         https://bugs.webkit.org/show_bug.cgi?id=195421
3793         <rdar://problem/48682004>
3794
3795         Reviewed by Simon Fraser.
3796
3797         Visibility change might be triggered synchronously while dispatching mouseMoved event.
3798
3799         Test: fast/events/touch/ios/content-observation/visibility-change-happens-while-in-mousemoved.html
3800
3801         * page/ios/ContentChangeObserver.cpp:
3802         (WebCore::ContentChangeObserver::mouseMovedDidStart):
3803         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
3804         (WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
3805         * page/ios/ContentChangeObserver.h:
3806         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3807
3808 2019-03-07  Zalan Bujtas  <zalan@apple.com>
3809
3810         [ContentChangeObserver] Check if max-height change triggers visible content change.
3811         https://bugs.webkit.org/show_bug.cgi?id=195417
3812         <rdar://problem/48680631>
3813
3814         Reviewed by Simon Fraser.
3815
3816         A fixed max-height non-zero value could indicate visible content change. usps.com uses this technique to show menu panes.  
3817
3818         Test: fast/events/touch/ios/content-observation/visibility-change-is-max-height-change.html
3819
3820         * page/ios/ContentChangeObserver.cpp:
3821         (WebCore::isConsideredHidden):
3822         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3823         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3824         (WebCore::elementImplicitVisibility): Deleted.
3825         * page/ios/ContentChangeObserver.h:
3826
3827 2019-03-07  Yusuke Suzuki  <ysuzuki@apple.com>
3828
3829         Unreviewed, fix failing EWS build for ios-sim
3830
3831         * page/ios/ContentChangeObserver.cpp:
3832         (WebCore::ContentChangeObserver::touchEventDidStart):
3833
3834 2019-03-07  Eric Carlson  <eric.carlson@apple.com>
3835
3836         [MSE] Adopt new AVSampleBufferDisplayLayer SPI
3837         https://bugs.webkit.org/show_bug.cgi?id=195445
3838         <rdar://problem/48480516>
3839
3840         Reviewed by Jer Noble.
3841
3842         No new tests, no functional change.
3843
3844         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3845         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): Only register for 
3846         kCMSampleBufferConsumerNotification_BufferConsumed notiication when
3847         -[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] isn't available.
3848         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): Ditto, for unregistering.
3849         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Use 
3850         -[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] when possible.
3851
3852 2019-03-07  Zalan Bujtas  <zalan@apple.com>
3853
3854         [ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com
3855         https://bugs.webkit.org/show_bug.cgi?id=195397
3856
3857         Reviewed by Simon Fraser.
3858
3859         This patch introduces TouchEventScope to track changes triggered by touch start.
3860
3861         Test: fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html
3862
3863         * page/ios/ContentChangeObserver.cpp:
3864         (WebCore::ContentChangeObserver::touchEventDidStart):
3865         (WebCore::ContentChangeObserver::touchEventDidFinish):
3866         (WebCore::ContentChangeObserver::mouseMovedDidStart):
3867         (WebCore::ContentChangeObserver::mouseMovedDidFinish):
3868         (WebCore::ContentChangeObserver::adjustObservedState):
3869         (WebCore::ContentChangeObserver::TouchEventScope::TouchEventScope):
3870         (WebCore::ContentChangeObserver::TouchEventScope::~TouchEventScope):
3871         * page/ios/ContentChangeObserver.h:
3872         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3873
3874 2019-03-07  Zalan Bujtas  <zalan@apple.com>
3875
3876         [ContentChangeObserver] Introduce fixed duration content observation
3877         https://bugs.webkit.org/show_bug.cgi?id=195295
3878         <rdar://problem/48579913>
3879
3880         Reviewed by Simon Fraser.
3881
3882         Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
3883         This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
3884         we stop observing for content changes before they even get fired.
3885
3886         Test: fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html
3887
3888         * page/ios/ContentChangeObserver.cpp:
3889         (WebCore::ContentChangeObserver::ContentChangeObserver):
3890         (WebCore::ContentChangeObserver::startContentObservationForDuration):
3891         (WebCore::ContentChangeObserver::completeDurationBasedContentObservation):
3892         (WebCore::ContentChangeObserver::didInstallDOMTimer):
3893         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
3894         (WebCore::ContentChangeObserver::domTimerExecuteDidStart):
3895         (WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
3896         (WebCore::ContentChangeObserver::styleRecalcDidStart):
3897         (WebCore::ContentChangeObserver::styleRecalcDidFinish):
3898         (WebCore::ContentChangeObserver::cancelPendingActivities):
3899         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
3900         (WebCore::ContentChangeObserver::willDetachPage):
3901         (WebCore::ContentChangeObserver::contentVisibilityDidChange):
3902         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
3903         (WebCore::ContentChangeObserver::adjustObservedState):
3904         (WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
3905         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
3906         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange): Deleted.
3907         * page/ios/ContentChangeObserver.h:
3908         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
3909         (WebCore::ContentChangeObserver::isObservingContentChanges const):
3910         (WebCore::ContentChangeObserver::hasPendingActivity const):
3911
3912 2019-03-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
3913
3914         requestAnimationFrame should execute before the next frame
3915         https://bugs.webkit.org/show_bug.cgi?id=177484
3916
3917         Reviewed by Simon Fraser.
3918
3919         This change fixes two issues with animation timing:
3920
3921         1. Calling the requestAnimationFrame callbacks would have happened when
3922            the DisplayLink fires. This may have happened even if the frame is
3923            missed and no display is committed.
3924
3925         2. Style changes and layout triggered by script could trigger painting
3926            at more than 60fps. CoreAnimation commits could happen at more than
3927            60fps, although WindowServer will throttle those, and only some will
3928            be shown on the screen.
3929
3930         This change introduces a new paint scheduling model where painting is
3931         driven by a "RenderingUpdateScheduler", which only triggers paints once
3932         per 16.7ms frame.
3933
3934         Code that previously scheduled a compositing layer flush now schedules a
3935         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
3936         callback. When the render happens, we service requestAnimationFrame callbacks,
3937         Web Animations and intersection observations per the "Update the rendering"
3938         step of the HTML Event Loop specification
3939         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
3940
3941         In the future, more rendering steps will be added to this code.
3942
3943         * Sources.txt:
3944         * WebCore.xcodeproj/project.pbxproj:
3945         * accessibility/mac/AXObjectCacheMac.mm:
3946         Fix layout tests by adding null check.
3947
3948         * animation/DocumentAnimationScheduler.cpp: Removed.
3949         * animation/DocumentAnimationScheduler.h: Removed.
3950         * animation/DocumentTimeline.cpp:
3951         (WebCore::DocumentTimeline::DocumentTimeline):
3952         (WebCore::DocumentTimeline::updateThrottlingState):
3953         (WebCore::DocumentTimeline::resumeAnimations):
3954         (WebCore::DocumentTimeline::liveCurrentTime const):
3955         (WebCore::DocumentTimeline::currentTime):
3956         (WebCore::DocumentTimeline::animationTimingDidChange):
3957         (WebCore::DocumentTimeline::scheduleAnimationResolution):
3958         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
3959         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
3960         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
3961         (WebCore::DocumentTimeline::scheduleNextTick):
3962         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
3963         Simplify this function by handling the case of no-animations separately.
3964
3965         (WebCore::DocumentTimeline::resolveAnimationsForElement):
3966         Simplify the loop and delete hasPendingAcceleratedAnimations because it
3967         is initialized to true and is not changed inside the loop.
3968
3969         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
3970         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
3971         * animation/DocumentTimeline.h:
3972         * dom/Document.cpp:
3973         (WebCore::Document::resolveStyle):
3974         There is no need to force update in resolveStyle(). notifyFlushRequired()
3975         will be called eventually which will scheduleRenderingUpdate().
3976
3977         (WebCore::Document::prepareForDestruction):