3b4335a4e8134421705d4ec50a19d2eb8ec3acf3
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-26  Alex Christensen  <achristensen@webkit.org>
2
3         Fix Windows build after r244695
4        ​https://bugs.webkit.org/show_bug.cgi?id=197165
5
6         * loader/PingLoader.cpp:
7
8 2019-04-26  Alex Christensen  <achristensen@webkit.org>
9
10         Fix internal High Sierra build after r244653
11         https://bugs.webkit.org/show_bug.cgi?id=197131
12
13         * DerivedSources.make:
14         -std=gnu++17 didn't exist yet.  -std=gnu++1z did.
15
16 2019-04-26  Alex Christensen  <achristensen@webkit.org>
17
18         Add ENABLE(CONTENT_EXTENSIONS) and namespace ContentExtensions to ResourceLoadInfo.h
19         https://bugs.webkit.org/show_bug.cgi?id=197165
20
21         Reviewed by Youenn Fablet.
22
23         No change in behavior.  This will just make it harder for people working on the loader to mistake
24         these ContentExtension specific structures for other structures general to loading.
25         One such mistake was made in r244248.
26
27         * Modules/websockets/WebSocketChannel.cpp:
28         (WebCore::WebSocketChannel::connect):
29         * contentextensions/ContentExtensionsBackend.h:
30         * css/StyleSheetContents.cpp:
31         (WebCore::StyleSheetContents::subresourcesAllowReuse const):
32         * html/HTMLMediaElement.cpp:
33         (WebCore::HTMLMediaElement::loadResource):
34         * loader/FrameLoader.cpp:
35         (WebCore::FrameLoader::loadResourceSynchronously):
36         * loader/NetscapePlugInStreamLoader.cpp:
37         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
38         * loader/PingLoader.cpp:
39         (WebCore::processContentRuleListsForLoad):
40         (WebCore::PingLoader::loadImage):
41         (WebCore::PingLoader::sendPing):
42         (WebCore::PingLoader::sendViolationReport):
43         * loader/ResourceLoadInfo.cpp:
44         (WebCore::toResourceType): Deleted.
45         (WebCore::readResourceType): Deleted.
46         (WebCore::readLoadType): Deleted.
47         (WebCore::ResourceLoadInfo::isThirdParty const): Deleted.
48         (WebCore::ResourceLoadInfo::getResourceFlags const): Deleted.
49         * loader/ResourceLoadInfo.h:
50         * loader/ResourceLoader.cpp:
51         (WebCore::ResourceLoader::willSendRequestInternal):
52         * loader/ResourceLoader.h:
53         * loader/SubresourceLoader.cpp:
54         (WebCore::SubresourceLoader::SubresourceLoader):
55         * loader/cache/CachedResourceLoader.cpp:
56         (WebCore::CachedResourceLoader::requestResource):
57         * page/DOMWindow.cpp:
58         (WebCore::DOMWindow::open):
59         * page/UserContentProvider.cpp:
60         (WebCore::UserContentProvider::processContentRuleListsForLoad):
61         (WebCore::UserContentProvider::actionsForResourceLoad):
62         * page/UserContentProvider.h:
63
64 2019-04-26  Alex Christensen  <achristensen@webkit.org>
65
66         Fix an internal High Sierra build after r244653
67        ​https://bugs.webkit.org/show_bug.cgi?id=197131
68
69         * DerivedSources.make:
70         Apparently we can't use gnu++17 when preprocessing Platform.h in the makefile.
71
72 2019-04-26  Chris Fleizach  <cfleizach@apple.com>
73
74         AX: Provide iOS method for setting focus
75         https://bugs.webkit.org/show_bug.cgi?id=197200
76         <rdar://problem/50131679>
77
78         Reviewed by Alex Christensen.
79
80         Put the focus setting code in a place that iOS and macOS can access.
81         Override a platform level method for setting focus on iOS.
82
83         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
84         (-[WebAccessibilityObjectWrapper _accessibilitySetFocus:]):
85         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
86         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
87         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySetFocus:]):
88         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
89         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
90
91 2019-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
92
93         propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement
94         https://bugs.webkit.org/show_bug.cgi?id=197303
95
96         Reviewed by Alex Christensen.
97
98         Therefore SVGElement::propertyRegistry() was called instead. This means
99         these two elements will not have access to the properties of the base
100         class SVGFilterPrimitiveStandardAttributes.
101
102         Tests: svg/dom/SVGFEFloodElement-filter-standard-attributes.svg
103
104         * svg/SVGElement.cpp:
105         (WebCore::SVGElement::commitPropertyChange):
106         * svg/SVGFEFloodElement.h:
107         * svg/SVGFEMergeElement.h:
108
109 2019-04-26  Youenn Fablet  <youenn@apple.com>
110
111         [Mac WK2 iOS Sim] Layout Test imported/w3c/web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https.html is a flaky failure
112         https://bugs.webkit.org/show_bug.cgi?id=196633
113         <rdar://problem/49627667>
114
115         Reviewed by Alex Christensen.
116
117         Use formula defined in https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats-audiolevel
118         to compute the audio level from the RTP header information.
119         Covered by rebased test.
120
121         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
122         (WebCore::fillRTCRtpContributingSource):
123
124 2019-04-26  Sihui Liu  <sihui_liu@apple.com>
125
126         Stop IDB transactions to release locked database files when network process is ready to suspend
127         https://bugs.webkit.org/show_bug.cgi?id=196372
128         <rdar://problem/48930116>
129
130         Reviewed by Brady Eidson.
131
132         Suspend IDB database thread and finish ongoing IDB transactions on the main thread before suspending network 
133         process.
134
135         API test: IndexedDB.IndexedDBSuspendImminently
136
137         * Modules/indexeddb/server/IDBBackingStore.h:
138         * Modules/indexeddb/server/IDBServer.cpp:
139         (WebCore::IDBServer::IDBServer::tryStop):
140         (WebCore::IDBServer::IDBServer::resume):
141         * Modules/indexeddb/server/IDBServer.h:
142         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
143         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Remove some error log messages, because now we may try
144         performing database operations without an active transaction if the transaction is finished on the main thread.
145         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
146         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
147         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
148         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
149         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
150         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
151         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
152         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
153         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
154         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
155         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
156         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
157         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
158         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
159         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
160         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
161         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
162         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
163         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
164         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
165         (WebCore::IDBServer::SQLiteIDBBackingStore::hasTransaction const):
166         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
167         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
168         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
169         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionAfterQuotaCheck):
170         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
171         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
172         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
173         (WebCore::IDBServer::UniqueIDBDatabase::abortTransactionOnMainThread):
174         (WebCore::IDBServer::UniqueIDBDatabase::commitTransactionOnMainThread):
175         (WebCore::IDBServer::UniqueIDBDatabase::finishActiveTransactions):
176         * Modules/indexeddb/server/UniqueIDBDatabase.h:
177         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
178         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setState):
179         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::state const):
180         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::setResult):
181         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::result const):
182         * platform/sql/SQLiteDatabaseTracker.cpp:
183         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
184         * platform/sql/SQLiteDatabaseTracker.h:
185
186 2019-04-26  Takashi Komori  <Takashi.Komori@sony.com>
187
188         [Curl] Fix Curl Request Scheduler not to release wrong Curl handle when request is cancelled.
189         https://bugs.webkit.org/show_bug.cgi?id=191650
190
191         Reviewed by Fujii Hironori.
192
193         Test: http/tests/misc/repeat-open-cancel.html
194
195         * platform/network/curl/CurlRequest.cpp:
196         (WebCore::CurlRequest::cancel):
197         (WebCore::CurlRequest::isCancelled):
198         (WebCore::CurlRequest::isCompletedOrCancelled):
199         (WebCore::CurlRequest::didCompleteTransfer):
200         (WebCore::CurlRequest::completeDidReceiveResponse):
201         (WebCore::CurlRequest::pausedStatusChanged):
202         * platform/network/curl/CurlRequest.h:
203         (WebCore::CurlRequest::isCompleted const): Deleted.
204         (WebCore::CurlRequest::isCancelled const): Deleted.
205         (WebCore::CurlRequest::isCompletedOrCancelled const): Deleted.
206         * platform/network/curl/CurlRequestScheduler.cpp:
207         (WebCore::CurlRequestScheduler::cancel):
208         (WebCore::CurlRequestScheduler::callOnWorkerThread):
209         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
210         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
211         (WebCore::CurlRequestScheduler::stopThread):
212         (WebCore::CurlRequestScheduler::executeTasks):
213         (WebCore::CurlRequestScheduler::workerThread):
214         (WebCore::CurlRequestScheduler::startTransfer):
215         (WebCore::CurlRequestScheduler::completeTransfer):
216         (WebCore::CurlRequestScheduler::cancelTransfer):
217         (WebCore::CurlRequestScheduler::finalizeTransfer):
218         * platform/network/curl/CurlRequestScheduler.h:
219
220 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
221
222         [iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
223         https://bugs.webkit.org/show_bug.cgi?id=197275
224         <rdar://problem/50211019>
225
226         Reviewed by Simon Fraser.
227
228         This setting makes it easier to investigate the autosizing work we've been doing
229         in https://bugs.webkit.org/show_bug.cgi?id=197250.
230
231         * page/Settings.yaml:
232         * rendering/RenderBlockFlow.cpp:
233         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
234         * rendering/TextAutoSizing.cpp:
235         (WebCore::TextAutoSizingValue::adjustTextNodeSizes):
236
237 2019-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
238
239         [iOS] Implement idempotent mode for text autosizing
240         https://bugs.webkit.org/show_bug.cgi?id=197250
241         <rdar://problem/50211034>
242
243         Reviewed by Jon Lee.
244
245         Our text autosizing code has this interesting behavior where it is sensitive to the width of the text's container
246         and the number of lines of text inside the element. Not only is it sensitive to those things, but as those things
247         change, their values are stored inside the RenderObject itself and then never recomputed. This means that the text
248         autosizing parameters are sensitive to the entire history of an element. So, a newly created element with the same
249         style as an existing element can have dramatically different results.
250
251         This patch adds a new mode for text autosizing, which isn't sensitive to either of those things, and therefore
252         maintains the invariant that a newly created element will behave the same as an existing element with the same style.
253         Instead of using container size, it instead uses the viewport's initial scale. As the viewport's initial scale
254         changes, new layouts will be triggered, which will cause the autosizing code to use the new value.
255
256         Tests: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-identity.html
257                fast/text-autosizing/ios/idempotentmode/idempotent-autosizing.html
258
259         * page/FrameViewLayoutContext.cpp:
260         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
261         * page/Page.cpp:
262         (WebCore::Page::setInitialScale): WebKit will push the initial scale down into the page.
263         * page/Page.h:
264         (WebCore::Page::initialScale const):
265         * page/SettingsBase.h:
266         * page/cocoa/SettingsBaseCocoa.mm:
267         (WebCore::SettingsBase::textAutosizingUsesIdempotentMode):
268         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
269         * rendering/RenderBlockFlow.cpp:
270         (WebCore::idempotentTextSize): Describe a piecewise-linear curve for the text size to follow. The curve scales
271         depending on the viewport's initial scale.
272         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
273         * rendering/RenderBlockFlow.h:
274         * rendering/RenderElement.cpp:
275         (WebCore::includeNonFixedHeight): This new mode should consider max-height as well as height when determining if
276         content overflows.
277         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
278         (WebCore::RenderElement::resetTextAutosizing):
279         * rendering/RenderElement.h:
280         * rendering/RenderObject.h:
281
282 2019-04-25  Simon Fraser  <simon.fraser@apple.com>
283
284         REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
285         https://bugs.webkit.org/show_bug.cgi?id=188357
286         <rdar://problem/42986633>
287
288         Reviewed by Dean Jackson.
289
290         DumpRenderTree had no code that set page.setCompositingPolicyOverride() to Normal, so some
291         tests would fall into low memory mode and have different behavior.
292         
293         Fix by moving the code that calls setCompositingPolicyOverride(Normal) from the WK2 layer
294         to Internals, so it's shared by DRT and WTR.
295         
296         We no longer need the WK2 C SPI glue.
297
298         * testing/Internals.cpp:
299         (WebCore::Internals::resetToConsistentState):
300
301 2019-04-25  Sihui Liu  <sihui_liu@apple.com>
302
303         [ iOS Sim ] REGRESSION (r242986) Layout Test storage/indexeddb/modern/idbtransaction-objectstore-failures-private.html is a flaky failure
304         https://bugs.webkit.org/show_bug.cgi?id=196357
305         <rdar://problem/49386836>
306
307         Reviewed by Geoffrey Garen.
308
309         Dispatch IDBRequest event to IDBTransaction if event of IDBTransaction has not been dispatched.
310
311         Covered by existing tests.
312
313         * Modules/indexeddb/IDBRequest.cpp:
314         (WebCore::IDBRequest::dispatchEvent):
315         * Modules/indexeddb/IDBTransaction.cpp:
316         (WebCore::IDBTransaction::dispatchEvent):
317         * Modules/indexeddb/IDBTransaction.h:
318
319 2019-04-25  Chris Dumez  <cdumez@apple.com>
320
321         ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired()
322         https://bugs.webkit.org/show_bug.cgi?id=197300
323         <rdar://problem/49965990>
324
325         Reviewed by Youenn Fablet.
326
327         We crash because the scriptExecutionContext has been destroyed by the time the m_resourceTimingBufferFullTimer
328         timer fires. However, r241598 already makes sure that we stop the timer when the script execution context
329         is destroyed. This makes me think that somebody restarts the timer *after* the script execution context has
330         been destroyed. The thing is that we only start the timer in Performance::addResourceTiming() and there are
331         only 2 call sites for this method. Both call sites get the Performance object from the Window object, which
332         they get from the Document object. As a result, I would believe that the Window's document is alive, even
333         though the Performance object's scriptExecutionContext is not. This could indicate that the Performance
334         object's scriptExecutionContext gets out of sync with its Window's document. I have found one place where
335         it could happen in theory (DOMWindow::didSecureTransitionTo()). I have not been able to write a test
336         confirming my theory though so this is a speculative fix. I have also added a few assertions to help us
337         track down the issue if my speculative fix turns out to be ineffective.
338
339         No new tests, we do not know how to reproduce.
340
341         * page/DOMWindow.cpp:
342         (WebCore::DOMWindow::didSecureTransitionTo):
343         This is a speculative fix for the crash. When a DOMWindow transitions from one document to
344         another, reset its data members which store the DOMWindow's document to make sure that they
345         do not get out of sync.
346
347         (WebCore::DOMWindow::crypto const):
348         (WebCore::DOMWindow::navigator):
349         (WebCore::DOMWindow::performance const):
350         Add assertions to make sure that the member's scriptExecutionContext is in sync with
351         the window's.
352
353         * page/Performance.cpp:
354         (WebCore::Performance::addResourceTiming):
355         Add assertion to make sure that the scriptExecutionContext() is non-null when calling this
356         as this may start the m_resourceTimingBufferFullTimer timer. If my speculative fix above
357         does not work, we should hit this and this should tell us which call site is causing this.
358
359 2019-04-25  Timothy Hatcher  <timothy@apple.com>
360
361         Disable ContentChangeObserver on iOSMac.
362         https://bugs.webkit.org/show_bug.cgi?id=197292
363         rdar://problem/49039957
364
365         Reviewed by Zalan Bujtas.
366
367         We don’t need to run any of ContentChangeObserver, because we have hover events on iOSMac.
368         Disabling it skips the synthetic mouse move events and speeds up clicks.
369
370         * page/SettingsBase.cpp:
371         (WebCore::SettingsBase::defaultContentChangeObserverEnabled): Return false for PLATFORM(IOSMAC).
372
373 2019-04-25  Timothy Hatcher  <timothy@apple.com>
374
375         Disable date and time inputs on iOSMac.
376         https://bugs.webkit.org/show_bug.cgi?id=197287
377         rdar://problem/46794376
378
379         Reviewed by Wenson Hsieh.
380
381         * Configurations/FeatureDefines.xcconfig:
382         * platform/text/mac/LocaleMac.h:
383         * platform/text/mac/LocaleMac.mm:
384         (WebCore::LocaleMac::formatDateTime):
385
386 2019-04-25  Alex Christensen  <achristensen@webkit.org>
387
388         Fix more Windows builds after r244653
389         https://bugs.webkit.org/show_bug.cgi?id=197131
390
391         * svg/properties/SVGAnimatedPropertyList.h:
392         * svg/properties/SVGProperty.h:
393         * svg/properties/SVGPropertyList.h:
394
395 2019-04-25  Alex Christensen  <achristensen@webkit.org>
396
397         Fix more builds after r244653
398         https://bugs.webkit.org/show_bug.cgi?id=197131
399
400         * svg/properties/SVGValuePropertyList.h:
401         Something is preventing MSVC from seeing protected constructors from subclasses.
402
403 2019-04-25  Per Arne Vollan  <pvollan@apple.com>
404
405         -[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
406         https://bugs.webkit.org/show_bug.cgi?id=196991
407         <rdar://problem/45507423>
408
409         Reviewed by Alex Christensen.
410
411         Add method to get all origins with persistent credentials from credential storage.
412
413         API tests: WKWebsiteDataStore.FetchNonPersistentCredentials
414                    WKWebsiteDataStore.FetchPersistentCredentials
415
416         * platform/network/CredentialStorage.h:
417         * platform/network/mac/CredentialStorageMac.mm:
418         (WebCore::CredentialStorage::originsWithPersistentCredentials):
419
420 2019-04-25  Alex Christensen  <achristensen@webkit.org>
421
422         Fix MSVC build after r244653
423         https://bugs.webkit.org/show_bug.cgi?id=197131
424
425         * svg/properties/SVGValueProperty.h:
426         MSVC doesn't think it can access these protected constructors from subclasses.
427         Make the build work and investigate this later.
428
429 2019-04-25  Alex Christensen  <achristensen@webkit.org>
430
431         Start using C++17
432         https://bugs.webkit.org/show_bug.cgi?id=197131
433
434         Reviewed by Darin Adler.
435
436         * Configurations/Base.xcconfig:
437         * DerivedSources.make:
438
439 2019-04-25  Commit Queue  <commit-queue@webkit.org>
440
441         Unreviewed, rolling out r244627.
442         https://bugs.webkit.org/show_bug.cgi?id=197282
443
444         Causing internal build failures (Requested by ShawnRoberts on
445         #webkit).
446
447         Reverted changeset:
448
449         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
450         https://bugs.webkit.org/show_bug.cgi?id=197171
451         https://trac.webkit.org/changeset/244627
452
453 2019-04-25  Antti Koivisto  <antti@apple.com>
454
455         redefinition of enumerator 'NSAttachmentCharacter' with Apple internal build
456         https://bugs.webkit.org/show_bug.cgi?id=197279
457
458         Reviewed by Antoine Quint.
459
460         Try to fix the build.
461
462         * platform/mac/WebNSAttributedStringExtras.mm:
463
464 2019-04-25  Antti Koivisto  <antti@apple.com>
465
466         Visited link hash should be computed only once
467         https://bugs.webkit.org/show_bug.cgi?id=197229
468         <rdar://problem/48438924>
469
470         Reviewed by Alex Christensen.
471
472         Test: fast/history/visited-href-mutation.html
473
474         Visited link style is now based on the first target URL of the link element. Further href mutations don't affect styling.
475
476         * dom/Document.cpp:
477         (WebCore::Document::updateBaseURL):
478         * dom/VisitedLinkState.cpp:
479         (WebCore::linkAttribute):
480         (WebCore::linkHashForElement):
481
482         Visited link support is now limited to HTML and SVG <a> elements.
483
484         (WebCore::VisitedLinkState::invalidateStyleForLink):
485         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
486         * html/HTMLAnchorElement.cpp:
487         (WebCore::HTMLAnchorElement::HTMLAnchorElement):
488         (WebCore::HTMLAnchorElement::parseAttribute):
489         * html/HTMLAnchorElement.h:
490         (WebCore::HTMLAnchorElement::visitedLinkHash const):
491         (WebCore::HTMLAnchorElement::invalidateCachedVisitedLinkHash): Deleted.
492         * svg/SVGAElement.cpp:
493         (WebCore::SVGAElement::visitedLinkHash const):
494         * svg/SVGAElement.h:
495
496 2019-04-25  Philippe Normand  <pnormand@igalia.com>
497
498         [GStreamer] gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed in WebCore::MediaPlayerPrivateGStreamer::paused
499         https://bugs.webkit.org/show_bug.cgi?id=196691
500
501         Reviewed by Eric Carlson.
502
503         For gif assets, fail media loading early and notify the
504         MediaPlayer by setting both network and ready states, so that the
505         MediaPlayer will try with with the next media engine or pass the
506         error to HTMLMediaElement if there are none.
507
508         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
509         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
510         (WebCore::MediaPlayerPrivateGStreamer::loadingFailed):
511         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
512
513 2019-04-25  Philippe Normand  <pnormand@igalia.com>
514
515         [REGRESSION(r243197)][GStreamer] http/tests/media/clearkey/collect-webkit-media-session.html hits an ASSERT
516         https://bugs.webkit.org/show_bug.cgi?id=197230
517
518         Reviewed by Xabier Rodriguez-Calvar.
519
520         Perform the resource loader disposal and destruction from the main
521         thread. Also ensure there's no circular reference between the
522         CachedResourceStreamingClient and WebKitWebSrc when disposing of
523         the private WebKitWebSrc storage.
524
525         * platform/graphics/gstreamer/MainThreadNotifier.h:
526         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
527         (_WebKitWebSrcPrivate::~_WebKitWebSrcPrivate):
528         (webkit_web_src_class_init):
529         (webKitWebSrcDispose):
530         (webKitWebSrcCloseSession):
531         (webKitWebSrcFinalize): Deleted.
532
533 2019-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
534
535         [GTK] Hardcoded text color in input fields
536         https://bugs.webkit.org/show_bug.cgi?id=126907
537
538         Reviewed by Michael Catanzaro.
539
540         Enable HAVE_OS_DARK_MODE_SUPPORT for GTK port to ensure that dark mode is used when Page::useDarkAppearance()
541         returns true. This patch reverts r232913, I'll reopen the bug, I think we need to find a better solution for
542         that.
543
544         * CMakeLists.txt: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_DEFINES_WITH_SPACE_SEPARATOR if enabled.
545         * css/CSSDefaultStyleSheets.cpp: Ensure html{color:text} is used in simple style sheet when
546         HAVE_OS_DARK_MODE_SUPPORT is enabled.
547         * page/FrameView.cpp:
548         (WebCore::FrameView::updateBackgroundRecursively): Use CSSValueWindowframe to get the frame view background
549         color when HAVE_OS_DARK_MODE_SUPPORT is enabled for non-mac ports.
550         * platform/gtk/RenderThemeWidget.cpp:
551         (WebCore::RenderThemeWidget::getOrCreate): Create window widget.
552         (WebCore::RenderThemeWindow::RenderThemeWindow): Add window widget.
553         * platform/gtk/RenderThemeWidget.h:
554         * rendering/RenderThemeGtk.cpp:
555         (WebCore::RenderThemeGtk::disabledTextColor const): Always use the color from the theme for consistency with
556         other form controls.
557         (WebCore::RenderThemeGtk::systemColor const): Get the color from the theme for CSSValueText, CSSValueGraytext
558         and CSSValueWindowframe.
559         * rendering/RenderThemeGtk.h:
560
561 2019-04-24  Zalan Bujtas  <zalan@apple.com>
562
563         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
564         https://bugs.webkit.org/show_bug.cgi?id=196948
565         <rdar://problem/49927131>
566
567         Reviewed by Tim Horton.
568
569         Covered by existing tests.
570
571         * loader/EmptyClients.h:
572         * page/ChromeClient.h:
573         * page/FrameView.cpp:
574         (WebCore::FrameView::autoSizeIfEnabled):
575         (WebCore::FrameView::enableAutoSizeMode):
576         * page/FrameView.h:
577
578 2019-04-24  Youenn Fablet  <youenn@apple.com>
579
580         Do not restart WebRTC stats timer if backend is stopped
581         https://bugs.webkit.org/show_bug.cgi?id=197257
582         <rdar://problem/50095879>
583
584         Reviewed by Eric Carlson.
585
586         We used to stop and reschedule the stat gathering timer in case the
587         gathering delay is changing. Timer should not be rescheduled if the backend is stopped.
588
589         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
590         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
591
592 2019-04-24  Andres Gonzalez  <andresg_22@apple.com>
593
594         Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
595         https://bugs.webkit.org/show_bug.cgi?id=187391
596         <rdar://problem/40681396
597
598         Check for null value returned by AccessibilityObject::axObjectCache.
599
600         Reviewed by Chris Fleizach.
601
602         No need for new test since existing tests caught this problem.
603
604         * accessibility/AccessibilityNodeObject.cpp:
605         (WebCore::AccessibilityNodeObject::firstChild const):
606         (WebCore::AccessibilityNodeObject::lastChild const):
607         (WebCore::AccessibilityNodeObject::previousSibling const):
608         (WebCore::AccessibilityNodeObject::nextSibling const):
609         (WebCore::AccessibilityNodeObject::addChildren):
610         (WebCore::AccessibilityNodeObject::anchorElement const):
611         (WebCore::AccessibilityNodeObject::changeValueByStep):
612         (WebCore::AccessibilityNodeObject::changeValueByPercent):
613         (WebCore::AccessibilityNodeObject::textForLabelElement const):
614         (WebCore::AccessibilityNodeObject::titleElementText const):
615         (WebCore::AccessibilityNodeObject::alternativeText const):
616         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
617         (WebCore::AccessibilityNodeObject::helpText const):
618
619 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
620
621         REGRESSION (r242132): Nested position:sticky elements move incorrectly
622         https://bugs.webkit.org/show_bug.cgi?id=197255
623         rdar://problem/50137744
624
625         Reviewed by Zalan Bujtas.
626         
627         Revert to the behavior of the code before r242132, where we looked at the direct parent
628         scrolling tree node instead of walking up the ancestor chain to find an enclosing scrolling node.
629         This fixes nested sticky behavior.
630
631         Test: scrollingcoordinator/mac/nested-sticky.html
632
633         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
634         (WebCore::ScrollingTreeStickyNode::applyLayerPositions):
635
636 2019-04-24  Eric Carlson  <eric.carlson@apple.com>
637
638         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
639         https://bugs.webkit.org/show_bug.cgi?id=197171
640         <rdar://problem/47454979>
641
642         Reviewed by Youenn Fablet.
643
644         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
645
646         * Modules/plugins/QuickTimePluginReplacement.mm:
647         (WebCore::jsValueWithValueInContext):
648         (WebCore::jsValueWithAVMetadataItemInContext):
649         * WebCore.xcodeproj/project.pbxproj:
650         * platform/audio/ios/AudioSessionIOS.mm:
651         (WebCore::AudioSession::setCategory):
652         (WebCore::AudioSession::category const):
653         (WebCore::AudioSession::routeSharingPolicy const):
654         (WebCore::AudioSession::routingContextUID const):
655         (WebCore::AudioSession::sampleRate const):
656         (WebCore::AudioSession::bufferSize const):
657         (WebCore::AudioSession::numberOfOutputChannels const):
658         (WebCore::AudioSession::tryToSetActiveInternal):
659         (WebCore::AudioSession::preferredBufferSize const):
660         (WebCore::AudioSession::setPreferredBufferSize):
661         * platform/audio/ios/MediaSessionManagerIOS.mm:
662         (-[WebMediaSessionHelper initWithCallback:]):
663         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
664         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
665         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
666         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
667         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
668         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
669         (WebCore::AudioSourceProviderAVFObjC::createMix):
670         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
671         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
672         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
673         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
674         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
675         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
676         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
677         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
678         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
679         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
680         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
681         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
682         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
683         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
684         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
685         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
686         (WebCore::CDMSessionAVContentKeySession::isAvailable):
687         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
688         (WebCore::CDMSessionAVContentKeySession::update):
689         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
690         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
691         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
692         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
693         (WebCore::CDMSessionAVStreamSession::releaseKeys):
694         (WebCore::CDMSessionAVStreamSession::update):
695         (WebCore::CDMSessionAVStreamSession::setStreamSession):
696         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
697         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
698         (WebCore::imageDecoderAssetOptions):
699         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
700         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
701         (WebCore::ImageDecoderAVFObjC::readSamples):
702         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
703         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
704         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
705         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
706         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
707         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
708         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
709         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
710         (WebCore::assetCacheForPath):
711         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
712         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
713         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
714         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
715         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
716         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
717         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
718         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
719         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
720         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
721         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
722         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
723         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
724         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
725         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
726         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
727         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
728         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
729         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
730         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
731         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
732         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
733         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
734         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
735         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
736         (WebCore::exernalDeviceDisplayNameForPlayer):
737         (WebCore::metadataType):
738         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
739         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
740         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
741         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
742         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
743         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
744         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
745         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
746         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
747         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
748         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
749         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
750         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
751         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
752         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
753         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
754         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
755         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
756         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
757         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
758         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
759         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
760         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
761         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
762         (WebCore::PlatformCALayerCocoa::clone const):
763         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
764         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
765         (WebCore::validateHEVCParameters):
766         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
767         (getAVSpeechUtteranceDefaultSpeechRate):
768         (getAVSpeechUtteranceMaximumSpeechRate):
769         (-[WebSpeechSynthesisWrapper speakUtterance:]):
770         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
771         (SOFT_LINK_CONSTANT): Deleted.
772         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
773         (-[WebAVPlayerLayer init]):
774         (-[WebAVPlayerLayer layoutSublayers]):
775         (-[WebAVPlayerLayer setVideoGravity:]):
776         (-[WebAVPlayerLayer videoRect]):
777         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
778         * platform/mac/SerializedPlatformRepresentationMac.mm:
779         (WebCore::jsValueWithValueInContext):
780         (WebCore::jsValueWithAVMetadataItemInContext):
781         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
782         (WebCore::getAVFormatIDKeyWithFallback):
783         (WebCore::getAVNumberOfChannelsKeyWithFallback):
784         (WebCore::getAVSampleRateKeyWithFallback):
785         (WebCore::getAVEncoderBitRateKeyWithFallback):
786         (WebCore::MediaRecorderPrivateWriter::create):
787         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
788         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
789         * platform/mediastream/RealtimeVideoSource.h:
790         * platform/mediastream/VideoPreset.h:
791         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
792         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
793         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
794         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
795         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
796         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
797         (WebCore::deviceIsAvailable):
798         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
799         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
800         (WebCore::AVCaptureDeviceManager::isAvailable):
801         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
802         * platform/mediastream/mac/AVVideoCaptureSource.mm:
803         (WebCore::AVVideoPreset::create):
804         (WebCore::AVVideoPreset::AVVideoPreset):
805         (WebCore::AVVideoCaptureSource::create):
806         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
807         (WebCore::AVVideoCaptureSource::capabilities):
808         (WebCore::sensorOrientationFromVideoOutput):
809         (WebCore::AVVideoCaptureSource::setupSession):
810         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
811         (WebCore::AVVideoCaptureSource::setupCaptureSession):
812         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
813         (WebCore::AVVideoCaptureSource::generatePresets):
814         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
815         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
816
817 2019-04-24  Brady Eidson  <beidson@apple.com>
818
819         XMLHTTPRequest POSTs to a custom WKURLSchemeHandler protocol are missing the HTTP body.
820         https://bugs.webkit.org/show_bug.cgi?id=191362
821
822         Reviewed by Alex Christensen.
823
824         Covered by new API tests.
825
826         In 2008 some refactoring added an HTTP(S)-only restriction to copying the form body for
827         XHRs that POST, and it added that restriction with no explanation.
828
829         We definitely want to allow that.
830
831         Blobs are broken at this time (covered by bug 197237)
832
833         * xml/XMLHttpRequest.cpp:
834         (WebCore::XMLHttpRequest::send):
835         (WebCore::XMLHttpRequest::sendBytesData):
836
837 2019-04-24  John Wilander  <wilander@apple.com>
838
839         Age out unconverted Ad Click Attributions after one week.
840         https://bugs.webkit.org/show_bug.cgi?id=197238
841         <rdar://problem/50177349>
842
843         Reviewed by Chris Dumez.
844
845         This patch adds the two functions AdClickAttribution::markAsExpired()
846         and AdClickAttribution::hasExpired() which make use of the existing
847         m_timeOfAdClick member.
848
849         Test: http/tests/adClickAttribution/expired-attributions-removed.html
850
851         * loader/AdClickAttribution.cpp:
852         (WebCore::AdClickAttribution::markAsExpired):
853         (WebCore::AdClickAttribution::hasExpired const):
854         * loader/AdClickAttribution.h:
855
856 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
857
858         REGRESSION (iOS 12.2): CSS perspective property value can only be set correctly once
859         https://bugs.webkit.org/show_bug.cgi?id=197105
860         rdar://problem/50068230
861
862         Reviewed by Zalan Bujtas.
863
864         Make sure we trigger a geometry update when style properties change that
865         result in a StyleDifference::RecompositeLayer, and which are updated on layers
866         via RenderLayerBacking::updateGeometry().
867
868         Tests: compositing/style-change/backface-visibility-change.html
869                compositing/style-change/perspective-change.html
870                compositing/style-change/perspective-origin-change.html
871                compositing/style-change/transform-origin-change.html
872                compositing/style-change/transform-style-change.html
873
874         * rendering/RenderLayerCompositor.cpp:
875         (WebCore::recompositeChangeRequiresGeometryUpdate):
876         (WebCore::RenderLayerCompositor::layerStyleChanged):
877
878 2019-04-24  Simon Fraser  <simon.fraser@apple.com>
879
880         Make it possible to control the renderTreeAsText output by setting options on testRunner
881         https://bugs.webkit.org/show_bug.cgi?id=197133
882
883         Reviewed by Sam Weinig.
884
885         Add testRunner.setRenderTreeDumpOptions() and expose the subset of RenderAsTextFlag flags
886         that make sense in testing (those that don't dump unstable data like addresses), and plumb
887         these flags through the various framework layers.
888
889         Convert RenderAsTextBehavior to an OptionSet<RenderAsTextFlag>.
890
891         Fix code generation in WebKitTestRunner to generate bindings for IDL const values,
892         and hand-code DumpRenderTree bindings.
893
894         Some cleanup of the TestRunners, using member initializers.
895
896         Test: fast/harness/render-tree-as-text-options.html
897
898         * rendering/RenderLayer.cpp:
899         (WebCore::showLayerTree):
900         * rendering/RenderTreeAsText.cpp:
901         (WebCore::RenderTreeAsText::writeRenderObject):
902         (WebCore::writeDebugInfo):
903         (WebCore::write):
904         (WebCore::writeLayer):
905         (WebCore::writeLayerRenderers):
906         (WebCore::writeLayers):
907         (WebCore::externalRepresentation):
908         * rendering/RenderTreeAsText.h:
909         (WebCore::externalRepresentation):
910         (WebCore::write):
911         (WebCore::writeDebugInfo):
912         (): Deleted.
913         * rendering/svg/SVGRenderTreeAsText.cpp:
914         (WebCore::writePositionAndStyle):
915         (WebCore::writeStandardPrefix):
916         (WebCore::writeChildren):
917         (WebCore::writeSVGResourceContainer):
918         (WebCore::writeSVGContainer):
919         (WebCore::write):
920         (WebCore::writeSVGText):
921         (WebCore::writeSVGInlineText):
922         (WebCore::writeSVGImage):
923         (WebCore::writeSVGGradientStop):
924         (WebCore::writeResources):
925         * rendering/svg/SVGRenderTreeAsText.h:
926
927 2019-04-24  Antoine Quint  <graouts@apple.com>
928
929         [iOS] Calling preventDefault() when handling a pointerdown event should not prevent panning, zooming or click event dispatch
930         https://bugs.webkit.org/show_bug.cgi?id=195839
931         <rdar://problem/48946154>
932
933         Reviewed by Brent Fulgham.
934
935         Tests: pointerevents/ios/pointer-events-prevent-default-allows-click-event.html
936                pointerevents/ios/pointer-events-prevent-default-allows-scrolling.html
937
938         The Pointer Events specification defines that the default action of any and all pointer events MUST NOT
939         be a manipulation of the viewport (e.g. panning or zooming). In practice, this means that calling
940         preventDefault() while handling a Pointer Event has no effect on the inner workings of the user agent,
941         so we change the method signature of PointerCaptureController::dispatchEventForTouchAtIndex() to return
942         void since we don't need to know whether preventDefault() was called.
943
944         https://www.w3.org/TR/pointerevents/#declaring-candidate-regions-for-default-touch-behaviors
945
946         * page/PointerCaptureController.cpp:
947         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):
948         * page/PointerCaptureController.h:
949
950 2019-04-24  Frederic Wang  <fwang@igalia.com>
951
952         With async scrolling enabled, this MathML test asserts
953         https://bugs.webkit.org/show_bug.cgi?id=196123
954
955         This patch ensures that updateScrollInfoAfterLayout() is called during MathML layout. This
956         fixes assertions when async scrolling is enabled and MathML elements have non-visible overflow.
957
958         Reviewed by Rob Buis.
959
960         Test: mathml/mathml-overflow-crash.html
961
962         * rendering/mathml/RenderMathMLBlock.cpp:
963         (WebCore::RenderMathMLBlock::layoutBlock):
964         (WebCore::RenderMathMLBlock::layoutInvalidMarkup):
965         * rendering/mathml/RenderMathMLFraction.cpp:
966         (WebCore::RenderMathMLFraction::layoutBlock):
967         * rendering/mathml/RenderMathMLMath.cpp:
968         (WebCore::RenderMathMLMath::layoutBlock):
969         * rendering/mathml/RenderMathMLMenclose.cpp:
970         (WebCore::RenderMathMLMenclose::layoutBlock):
971         * rendering/mathml/RenderMathMLOperator.cpp:
972         (WebCore::RenderMathMLOperator::layoutBlock):
973         * rendering/mathml/RenderMathMLPadded.cpp:
974         (WebCore::RenderMathMLPadded::layoutBlock):
975         * rendering/mathml/RenderMathMLRoot.cpp:
976         (WebCore::RenderMathMLRoot::layoutBlock):
977         * rendering/mathml/RenderMathMLRow.cpp:
978         (WebCore::RenderMathMLRow::layoutBlock):
979         * rendering/mathml/RenderMathMLScripts.cpp:
980         (WebCore::RenderMathMLScripts::layoutBlock):
981         * rendering/mathml/RenderMathMLSpace.cpp:
982         (WebCore::RenderMathMLSpace::layoutBlock):
983         * rendering/mathml/RenderMathMLToken.cpp:
984         (WebCore::RenderMathMLToken::layoutBlock):
985         * rendering/mathml/RenderMathMLUnderOver.cpp:
986         (WebCore::RenderMathMLUnderOver::layoutBlock):
987
988 2019-04-24  Greg V  <greg@unrelenting.technology>
989
990         Fix -Wc++11-narrowing on unsigned char platforms like FreeBSD/aarch64
991         https://bugs.webkit.org/show_bug.cgi?id=197148
992
993         Reviewed by Alex Christensen.
994
995         * contentextensions/DFACombiner.cpp:
996         * contentextensions/NFAToDFA.cpp:
997
998 2019-04-24  Chris Dumez  <cdumez@apple.com>
999
1000         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
1001         https://bugs.webkit.org/show_bug.cgi?id=197226
1002         <rdar://problem/50155649>
1003
1004         Reviewed by Alex Christensen.
1005
1006         X-Frame-Options header should be ignored when frame-ancestors CSP directive is present:
1007         - https://www.w3.org/TR/CSP3/#frame-ancestors-and-frame-options
1008
1009         Specification says:
1010         """
1011         In order to allow backwards-compatible deployment, the frame-ancestors directive _obsoletes_ the
1012         X-Frame-Options header. If a resource is delivered with an policy that includes a directive named
1013         frame-ancestors and whose disposition is "enforce", then the X-Frame-Options header MUST be ignored.
1014         """
1015
1016         Gecko and Blink follow the specification, WebKit does not. As a result, page [1] is broken with
1017         WebKit-only on Schwab.com. The page height is wrong and you cannot see all the ETFs as a result.
1018
1019         [1] https://www.schwab.com/public/schwab/investing/investment_help/investment_research/etf_research/etfs.html?&path=/Prospect/Research/etfs/overview/oneSourceETFs.asp
1020
1021         Test: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-overrides-X-Frames-Options.html
1022
1023         * loader/DocumentLoader.cpp:
1024         (WebCore::DocumentLoader::responseReceived):
1025         * page/csp/ContentSecurityPolicy.cpp:
1026         (WebCore::ContentSecurityPolicy::overridesXFrameOptions const):
1027         * page/csp/ContentSecurityPolicy.h:
1028         * page/csp/ContentSecurityPolicyDirectiveList.h:
1029         (WebCore::ContentSecurityPolicyDirectiveList::hasFrameAncestorsDirective const):
1030
1031 2019-04-24  Zalan Bujtas  <zalan@apple.com>
1032
1033         [ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy
1034         https://bugs.webkit.org/show_bug.cgi?id=196286
1035         <rdar://problem/49364417>
1036
1037         Reviewed by Simon Fraser.
1038
1039         By reporting WKContentIndeterminateChange in sendMouseMoveEvent enables us to remove the global _WKContentChange state.
1040         Using _WKContentChange is fine as long as only the observed frame reports content change during the synthetic click event.
1041         In case of multiple frames, we should really consult the local state instead.
1042         Unfortunately sendMouseMoveEvent has no access to the observed Document object so we can't really identify the observed content change.
1043         WKContentIndeterminateChange triggers asynchronous decision making at the callsite and in the callback we have access
1044         to the active Document/ContentChangeObverver object and can report the correct state.
1045         This is inline with current WebKit(WK2) behaviour.
1046
1047         Manually tested with a WebKitLegacy test app.
1048
1049         * SourcesCocoa.txt:
1050         * WebCore.xcodeproj/project.pbxproj:
1051         * page/ios/ContentChangeObserver.h:
1052         (WebCore::ContentChangeObserver::setHasNoChangeState):
1053         (WebCore::ContentChangeObserver::setHasIndeterminateState):
1054         (WebCore::ContentChangeObserver::setHasVisibleChangeState):
1055         (WebCore::ContentChangeObserver::setObservedContentState): Deleted.
1056         * page/ios/EventHandlerIOS.mm:
1057         (WebCore::EventHandler::mouseMoved):
1058         * platform/ios/wak/WAKWindow.mm:
1059         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
1060         * platform/ios/wak/WKContentObservation.cpp: Removed.
1061         * platform/ios/wak/WKContentObservation.h:
1062
1063 2019-04-24  Philippe Normand  <pnormand@igalia.com>
1064
1065         [GTK][GStreamer] Flaky ASSERTION FAILED: m_lock.isHeld() in TextureMapperPlatformLayerProxy
1066         https://bugs.webkit.org/show_bug.cgi?id=196739
1067
1068         Reviewed by Xabier Rodriguez-Calvar.
1069
1070         The crash was triggered because m_videoDecoderPlatform not being
1071         explicitely set, its value would be inferred as one of the enum
1072         class values. Making it Optional avoids this issue.
1073
1074         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1075
1076 2019-04-24  Philippe Normand  <pnormand@igalia.com>
1077
1078         [GStreamer] Crash in AudioTrackPrivate with playbin3 enabled
1079         https://bugs.webkit.org/show_bug.cgi?id=196913
1080
1081         Reviewed by Xabier Rodriguez-Calvar.
1082
1083         The crash was due to a playbin3 code path being triggered during
1084         MSE playback, which is not supposed to work in playbin3 anyway.
1085         The problem is that setting the USE_PLAYBIN3 environment variable
1086         to "1" makes the GStreamer playback plugin register the playbin3
1087         element under the playbin name. So that leads to playbin3 being
1088         used everywhere in WebKit where we assume the playbin element is
1089         used. So the proposed solution is to:
1090
1091         - use a WebKit-specific environment variable instead of the
1092         GStreamer USE_PLAYBIN3 variable.
1093         - emit a warning if the USE_PLAYBIN3 environment variable is
1094         detected. We can't unset it ourselves for security reasons.
1095
1096         The patch also includes a code cleanup of the player method
1097         handling the pipeline creation. The previous code had a bug
1098         leading to playbin3 being used for MSE.
1099
1100         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1101         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1102
1103 2019-04-24  chris fleizach  <cfleizach@apple.com>
1104
1105         AX: Remove deprecated Accessibility Object Model events
1106         https://bugs.webkit.org/show_bug.cgi?id=197073
1107         <rdar://problem/50027819>
1108
1109         Reviewed by Ryosuke Niwa.
1110
1111         Test: accessibility/mac/replace-text-with-range.html
1112
1113         * DerivedSources.make:
1114         * Sources.txt:
1115         * WebCore.xcodeproj/project.pbxproj:
1116         * accessibility/AccessibilityListBoxOption.cpp:
1117         (WebCore::AccessibilityListBoxOption::setSelected):
1118         * accessibility/AccessibilityMediaObject.cpp:
1119         (WebCore::AccessibilityMediaObject::increment):
1120         (WebCore::AccessibilityMediaObject::decrement):
1121         * accessibility/AccessibilityMenuListOption.cpp:
1122         (WebCore::AccessibilityMenuListOption::setSelected):
1123         * accessibility/AccessibilityNodeObject.cpp:
1124         (WebCore::AccessibilityNodeObject::increment):
1125         (WebCore::AccessibilityNodeObject::decrement):
1126         * accessibility/AccessibilityObject.cpp:
1127         (WebCore::AccessibilityObject::press):
1128         (WebCore::AccessibilityObject::replaceTextInRange):
1129         (WebCore::AccessibilityObject::scrollToMakeVisible const):
1130         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const): Deleted.
1131         (WebCore::AccessibilityObject::dispatchAccessibilityEvent const): Deleted.
1132         (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const): Deleted.
1133         (WebCore::AccessibilityObject::dispatchAccessibleSetValueEvent const): Deleted.
1134         * accessibility/AccessibilityObject.h:
1135         * accessibility/AccessibilityRenderObject.cpp:
1136         (WebCore::AccessibilityRenderObject::setFocused):
1137         (WebCore::AccessibilityRenderObject::setValue):
1138         * accessibility/AccessibilityScrollbar.cpp:
1139         (WebCore::AccessibilityScrollbar::setValue):
1140         * accessibility/AccessibilitySlider.cpp:
1141         (WebCore::AccessibilitySlider::setValue):
1142         * accessibility/ios/AccessibilityObjectIOS.mm:
1143         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
1144         (WebCore::AccessibilityObject::hasAccessibleDismissEventListener const): Deleted.
1145         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1146         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]): Deleted.
1147         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]): Deleted.
1148         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1149         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
1150         * dom/Element.idl:
1151         * dom/EventNames.h:
1152         * dom/EventNames.in:
1153         * html/HTMLAttributeNames.in:
1154         * html/HTMLElement.cpp:
1155         (WebCore::HTMLElement::createEventHandlerNameMap):
1156         * page/Settings.yaml:
1157         * testing/InternalSettings.cpp:
1158         (WebCore::InternalSettings::Backup::Backup):
1159         (WebCore::InternalSettings::Backup::restoreTo):
1160         (WebCore::InternalSettings::setAccessibilityEventsEnabled): Deleted.
1161         * testing/InternalSettings.h:
1162         * testing/InternalSettings.idl:
1163
1164 2019-04-23  Andy Estes  <aestes@apple.com>
1165
1166         [iOS] QuickLook documents loaded from file: URLs should be allowed to perform same-document navigations
1167         https://bugs.webkit.org/show_bug.cgi?id=196749
1168         <rdar://problem/35773454>
1169
1170         Reviewed by Daniel Bates.
1171
1172         QuickLook previews are in a non-local origin defined by a unique x-apple-ql-id: URL, which
1173         isolates the origin that hosted the document from the document preview itself. When a
1174         QuickLook document is loaded as a file: URL, SecurityOrigin's protections against loading
1175         local resources from non-local origins prevented navigations like location.reload() and
1176         fragment navigations.
1177
1178         To allow reloads and same-document navigations in QuickLook documents loaded from file: URLs,
1179         we should grant the QuickLook document's SecurityOrigin access to the file path that loaded
1180         the preview.
1181
1182         Added a new API test.
1183
1184         * dom/Document.cpp:
1185         (WebCore::Document::applyQuickLookSandbox):
1186         * page/SecurityOrigin.cpp:
1187         (WebCore::SecurityOrigin::createNonLocalWithAllowedFilePath):
1188         (WebCore::SecurityOrigin::canDisplay const):
1189         * page/SecurityOrigin.h:
1190
1191 2019-04-23  Devin Rousso  <drousso@apple.com>
1192
1193         Web Inspector: Debugger: remove ASSERT_NOT_REACHED where it's possible to reach
1194         https://bugs.webkit.org/show_bug.cgi?id=197210
1195         <rdar://problem/48462912>
1196
1197         Reviewed by Joseph Pecoraro.
1198
1199         * inspector/agents/page/PageDebuggerAgent.cpp:
1200         (WebCore::PageDebuggerAgent::didAddEventListener):
1201         (WebCore::PageDebuggerAgent::didPostMessage):
1202
1203         * inspector/InspectorInstrumentation.cpp:
1204         (WebCore::InspectorInstrumentation::consoleAgentEnabled):
1205         (WebCore::InspectorInstrumentation::timelineAgentEnabled):
1206         Drive-by: add additional `FAST_RETURN_IF_NO_FRONTENDS`.
1207
1208 2019-04-23  Commit Queue  <commit-queue@webkit.org>
1209
1210         Unreviewed, rolling out r244556.
1211         https://bugs.webkit.org/show_bug.cgi?id=197212
1212
1213         Causing build failures on multiple builders (Requested by
1214         ShawnRoberts on #webkit).
1215
1216         Reverted changeset:
1217
1218         "Create AVFoundationSoftLink.{h,mm} to reduce duplicate code"
1219         https://bugs.webkit.org/show_bug.cgi?id=197171
1220         https://trac.webkit.org/changeset/244556
1221
1222 2019-04-23  Devin Rousso  <drousso@apple.com>
1223
1224         Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
1225         https://bugs.webkit.org/show_bug.cgi?id=196420
1226         <rdar://problem/49444205>
1227
1228         Reviewed by Timothy Hatcher.
1229
1230         Modify the existing `frameId` to represent the owner frame of the node, rather than the
1231         frame it holds (in the case of an `<iframe>`).
1232
1233         * inspector/agents/InspectorDOMAgent.cpp:
1234         (WebCore::InspectorDOMAgent::buildObjectForNode):
1235
1236 2019-04-23  Devin Rousso  <drousso@apple.com>
1237
1238         ContentSecurityPolicy::logToConsole should include line/column number and source location
1239         https://bugs.webkit.org/show_bug.cgi?id=114317
1240         <rdar://problem/13614617>
1241
1242         Reviewed by Timothy Hatcher.
1243
1244         No change in functionality.
1245
1246         * page/csp/ContentSecurityPolicy.h:
1247         * page/csp/ContentSecurityPolicy.cpp:
1248         (WebCore::ContentSecurityPolicy::reportViolation const):
1249         (WebCore::ContentSecurityPolicy::logToConsole const):
1250
1251 2019-04-23  Devin Rousso  <drousso@apple.com>
1252
1253         Web Inspector: Canvas: support recording TypedOMCSSImageValue
1254         https://bugs.webkit.org/show_bug.cgi?id=192609
1255
1256         Reviewed by Timothy Hatcher.
1257
1258         * inspector/InspectorCanvas.h:
1259         * inspector/InspectorCanvas.cpp:
1260         (WebCore::InspectorCanvas::indexForData):
1261         (WebCore::InspectorCanvas::buildAction):
1262
1263 2019-04-23  Andres Gonzalez  <andresg_22@apple.com>
1264
1265         Accessibility text search and selection API enhancements.
1266         https://bugs.webkit.org/show_bug.cgi?id=197095
1267         <rdar://problem/48181791>
1268
1269         Reviewed by Chris Fleizach.
1270
1271         - Split the existing SelectTextWithCriteria API into two: search text API (SearchTextWithCriteria) and a text operation API (TextOperation: select, replace, capitalize...).
1272         - This allows for more flexibility and extensibility.
1273         - Added the ability to retrieve text markers for multiple search hits.
1274         - Various code clean up and consolidation.
1275         - Added LayoutTest for search API.
1276         - Previous API is marked with "To be deprecated", and is implemented with new implementation. May be removed in a future change.
1277
1278         Test: accessibility/mac/search-text/search-text.html
1279
1280         * accessibility/AccessibilityObject.cpp:
1281         (WebCore::rangeClosestToRange):
1282         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
1283         (WebCore::AccessibilityObject::findTextRange const):
1284         (WebCore::AccessibilityObject::findTextRanges const):
1285         (WebCore::AccessibilityObject::performTextOperation):
1286         (WebCore::AccessibilityObject::frame const):
1287         (WebCore::AccessibilityObject::selectText): Deleted.
1288         * accessibility/AccessibilityObject.h:
1289         (WebCore::AccessibilitySearchTextCriteria::AccessibilitySearchTextCriteria):
1290         (WebCore::AccessibilityTextOperation::AccessibilityTextOperation):
1291         (WebCore::AccessibilitySelectTextCriteria::AccessibilitySelectTextCriteria): Deleted.
1292         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1293         (accessibilityTextCriteriaForParameterizedAttribute):
1294         (accessibilitySearchTextCriteriaForParameterizedAttribute):
1295         (accessibilityTextOperationForParameterizedAttribute):
1296         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
1297         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1298         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute): Deleted.
1299
1300 2019-04-23  Guy Lewin  <guy@lewin.co.il>
1301
1302         Multiple File Input Icon Set Regardless of File List
1303         https://bugs.webkit.org/show_bug.cgi?id=195537
1304
1305         Reviewed by Alexey Proskuryakov.
1306
1307         File input elements display icon with an empty file list after
1308         resetting the file list in 'change' event handler - on iOS
1309
1310         Test: fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html
1311
1312         * html/FileInputType.cpp:
1313         (WebCore::FileInputType::filesChosen):
1314
1315 2019-04-23  Eric Carlson  <eric.carlson@apple.com>
1316
1317         Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
1318         https://bugs.webkit.org/show_bug.cgi?id=197171
1319         <rdar://problem/47454979>
1320
1321         Reviewed by Youenn Fablet.
1322
1323         Tests: TestWebKitAPI/Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm
1324
1325         * Modules/plugins/QuickTimePluginReplacement.mm:
1326         (WebCore::jsValueWithValueInContext):
1327         (WebCore::jsValueWithAVMetadataItemInContext):
1328         * WebCore.xcodeproj/project.pbxproj:
1329         * platform/audio/ios/AudioSessionIOS.mm:
1330         (WebCore::AudioSession::setCategory):
1331         (WebCore::AudioSession::category const):
1332         (WebCore::AudioSession::routeSharingPolicy const):
1333         (WebCore::AudioSession::routingContextUID const):
1334         (WebCore::AudioSession::sampleRate const):
1335         (WebCore::AudioSession::bufferSize const):
1336         (WebCore::AudioSession::numberOfOutputChannels const):
1337         (WebCore::AudioSession::tryToSetActiveInternal):
1338         (WebCore::AudioSession::preferredBufferSize const):
1339         (WebCore::AudioSession::setPreferredBufferSize):
1340         * platform/audio/ios/MediaSessionManagerIOS.mm:
1341         (-[WebMediaSessionHelper initWithCallback:]):
1342         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
1343         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1344         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const):
1345         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const):
1346         (WebCore::AVTrackPrivateAVFObjCImpl::label const):
1347         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1348         (WebCore::AudioSourceProviderAVFObjC::createMix):
1349         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
1350         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1351         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
1352         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
1353         (WebCore::AVFoundationMIMETypeCache::canDecodeType):
1354         (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
1355         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
1356         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistableState):
1357         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
1358         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
1359         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
1360         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
1361         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
1362         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
1363         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
1364         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1365         (WebCore::CDMSessionAVContentKeySession::isAvailable):
1366         (WebCore::CDMSessionAVContentKeySession::releaseKeys):
1367         (WebCore::CDMSessionAVContentKeySession::update):
1368         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
1369         (WebCore::CDMSessionAVContentKeySession::contentKeySession):
1370         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1371         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1372         (WebCore::CDMSessionAVStreamSession::releaseKeys):
1373         (WebCore::CDMSessionAVStreamSession::update):
1374         (WebCore::CDMSessionAVStreamSession::setStreamSession):
1375         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
1376         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1377         (WebCore::imageDecoderAssetOptions):
1378         (WebCore::ImageDecoderAVFObjC::ImageDecoderAVFObjC):
1379         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack):
1380         (WebCore::ImageDecoderAVFObjC::readSamples):
1381         (SOFT_LINK_CONSTANT_MAY_FAIL): Deleted.
1382         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1383         (WebCore::InbandTextTrackPrivateAVFObjC::label const):
1384         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1385         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label const):
1386         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1387         (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
1388         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1389         (WebCore::assetCacheForPath):
1390         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
1391         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins):
1392         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1393         (WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
1394         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1395         (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState):
1396         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1397         (WebCore::MediaPlayerPrivateAVFoundationObjC::setAVPlayerItem):
1398         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
1399         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1400         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1401         (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
1402         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1403         (WebCore::determineChangedTracksFromNewTracksAndOldItems):
1404         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1405         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1406         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1407         (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
1408         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForLegibleMedia):
1409         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForAudibleMedia):
1410         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeMediaSelectionGroupForVisualMedia):
1411         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
1412         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
1413         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
1414         (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
1415         (WebCore::exernalDeviceDisplayNameForPlayer):
1416         (WebCore::metadataType):
1417         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1418         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1419         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
1420         (-[WebCoreAVFPullDelegate outputSequenceWasFlushed:]):
1421         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks): Deleted.
1422         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1423         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1424         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
1425         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
1426         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
1427         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
1428         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1429         (-[WebAVSampleBufferStatusChangeListener observeValueForKeyPath:ofObject:change:context:]):
1430         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
1431         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
1432         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1433         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1434         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1435         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1436         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1437         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1438         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1439         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
1440         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1441         (WebCore::PlatformCALayerCocoa::clone const):
1442         (WebCore::PlatformCALayerCocoa::avPlayerLayer const):
1443         * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
1444         (WebCore::validateHEVCParameters):
1445         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
1446         (getAVSpeechUtteranceDefaultSpeechRate):
1447         (getAVSpeechUtteranceMaximumSpeechRate):
1448         (-[WebSpeechSynthesisWrapper speakUtterance:]):
1449         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1450         (SOFT_LINK_CONSTANT): Deleted.
1451         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1452         (-[WebAVPlayerLayer init]):
1453         (-[WebAVPlayerLayer layoutSublayers]):
1454         (-[WebAVPlayerLayer setVideoGravity:]):
1455         (-[WebAVPlayerLayer videoRect]):
1456         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
1457         * platform/mac/SerializedPlatformRepresentationMac.mm:
1458         (WebCore::jsValueWithValueInContext):
1459         (WebCore::jsValueWithAVMetadataItemInContext):
1460         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1461         (WebCore::getAVFormatIDKeyWithFallback):
1462         (WebCore::getAVNumberOfChannelsKeyWithFallback):
1463         (WebCore::getAVSampleRateKeyWithFallback):
1464         (WebCore::getAVEncoderBitRateKeyWithFallback):
1465         (WebCore::MediaRecorderPrivateWriter::create):
1466         (WebCore::MediaRecorderPrivateWriter::setVideoInput):
1467         (WebCore::MediaRecorderPrivateWriter::setAudioInput):
1468         * platform/mediastream/RealtimeVideoSource.h:
1469         * platform/mediastream/VideoPreset.h:
1470         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
1471         (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices):
1472         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1473         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
1474         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
1475         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1476         (WebCore::deviceIsAvailable):
1477         (WebCore::AVCaptureDeviceManager::updateCachedAVCaptureDevices):
1478         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
1479         (WebCore::AVCaptureDeviceManager::isAvailable):
1480         (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager):
1481         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1482         (WebCore::AVVideoPreset::create):
1483         (WebCore::AVVideoPreset::AVVideoPreset):
1484         (WebCore::AVVideoCaptureSource::create):
1485         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
1486         (WebCore::AVVideoCaptureSource::capabilities):
1487         (WebCore::sensorOrientationFromVideoOutput):
1488         (WebCore::AVVideoCaptureSource::setupSession):
1489         (WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
1490         (WebCore::AVVideoCaptureSource::setupCaptureSession):
1491         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
1492         (WebCore::AVVideoCaptureSource::generatePresets):
1493         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
1494         (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
1495
1496 2019-04-23  Timothy Hatcher  <timothy@apple.com>
1497
1498         Speed up RenderTheme::systemColor on Speedometer2.
1499         https://bugs.webkit.org/show_bug.cgi?id=197203
1500         rdar://problem/50056756
1501
1502         Reviewed by Tim Horton.
1503
1504         * rendering/RenderThemeIOS.mm:
1505         (WebCore::RenderThemeIOS::systemColor const): Remove some unused code. And fetch the cache after an early return.
1506         * rendering/RenderThemeMac.mm:
1507         (WebCore::RenderThemeMac::systemColor const): Avoid some allocations in LocalDefaultSystemAppearance
1508         when a CSS color is in the system color cache.
1509
1510 2019-04-23  Ryosuke Niwa  <rniwa@webkit.org>
1511
1512         [iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
1513         https://bugs.webkit.org/show_bug.cgi?id=197188
1514
1515         Reviewed by Wenson Hsieh.
1516
1517         The bug was caused by the scroll-to-reveal code triggered by Element::updateFocusAppearance updating
1518         the scroll position via scrolling tree update in a layer tree commit which happens after
1519         _zoomToRevealFocusedElement in WKContentView had already scrolled the frame view.
1520
1521         To fix this problem, we need to defer the editor state update until the layer commit (see r244494),
1522         and update the scrolling tree before invoking WebPageProxy::editorStateChanged which brings up
1523         the keyboard and scroll-to-reveal the caret in the UI process side.
1524
1525         We also avoid revealing the focus for the second time via Document::scheduleScrollToFocusedElement
1526         in Element::updateFocusAppearance as this timer based scrolling also happens after we had already
1527         revealed the caret in _zoomToRevealFocusedElement. This is a bit hacky but works for most cases since
1528         we wouldn't bring up a keyboard if the focused element was not editable anyway.
1529
1530         Test: editing/selection/ios/scrolling-to-focused-element-inside-iframe.html
1531
1532         * dom/Element.cpp:
1533         (WebCore::Element::updateFocusAppearance): Avoid scheduling a timer based reavel of the focused element
1534         when we're already revealing the element via selection change.
1535
1536 2019-04-23  Remy Demarest  <rdemarest@apple.com>
1537
1538         Fix layout issues occuring when entering full screen mode.
1539         https://bugs.webkit.org/show_bug.cgi?id=197086
1540         <rdar://problem/47733671>.
1541
1542         Reviewed by Darin Adler.
1543
1544         This issue is the result of changing the style mask of the window after entering
1545         full screen mode. Safari adds an invisible toolbar to display the URL of the page
1546         which ends up breaking the layout. Having that window use a style that includes a
1547         titlebar fixes the bug.
1548
1549         * platform/mac/WebCoreFullScreenWindow.mm:
1550         (-[WebCoreFullScreenWindow constrainFrameRect:toScreen:]): Ensure that the window
1551         can fill the entire screen including the underlapping the menu bar, so that the
1552         window does not resize when the animation is done.
1553         (-[WebCoreFullScreenWindow canBecomeMainWindow]): Borderless windows cannot become
1554         main by default, adding the titlebar allows it to become main, prevent this from
1555         happening at all to preserve the existing behavior.
1556
1557 2019-04-23  Chris Dumez  <cdumez@apple.com>
1558
1559         [Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
1560         https://bugs.webkit.org/show_bug.cgi?id=197097
1561         <rdar://problem/50048318>
1562
1563         Reviewed by Alex Christensen.
1564
1565         * loader/EmptyFrameLoaderClient.h:
1566         * loader/FrameLoader.cpp:
1567         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1568         If we still have a provisional item (new load has been started or we did not clear it because we're about to retry),
1569         then let the client know the load will continue by passing an extra flag with the didFailProvisionalLoad.
1570
1571         * loader/FrameLoaderClient.h:
1572         * loader/FrameLoaderTypes.h:
1573
1574 2019-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1575
1576         [ATK] Implement AtkComponentIface scroll_to methods
1577         https://bugs.webkit.org/show_bug.cgi?id=196856
1578
1579         Reviewed by Michael Catanzaro.
1580
1581         Implement scroll_to and scroll_to_point when ATK >= 2.30.
1582
1583         Fixes: accessibility/scroll-to-global-point-iframe-nested.html
1584                accessibility/scroll-to-global-point-iframe.html
1585                accessibility/scroll-to-global-point-main-window.html
1586                accessibility/scroll-to-global-point-nested.html
1587                accessibility/scroll-to-make-visible-div-overflow.html
1588                accessibility/scroll-to-make-visible-iframe.html
1589                accessibility/scroll-to-make-visible-nested-2.html
1590                accessibility/scroll-to-make-visible-nested.html
1591
1592         * accessibility/AccessibilityObject.cpp:
1593         (WebCore::AccessibilityObject::scrollToMakeVisible const): Add new method receiving the
1594         ScrollRectToVisibleOptions since ATK interface has a parameter to decide how to scroll.
1595         * accessibility/AccessibilityObject.h:
1596         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1597         (atkToContents):
1598         (webkitAccessibleComponentRefAccessibleAtPoint):
1599         (webkitAccessibleComponentGetExtents):
1600         (webkitAccessibleComponentGrabFocus):
1601         (webkitAccessibleComponentScrollTo):
1602         (webkitAccessibleComponentScrollToPoint):
1603         (webkitAccessibleComponentInterfaceInit):
1604         (core): Deleted.
1605
1606 2019-04-22  Youenn Fablet  <youenn@apple.com>
1607
1608         Update libwebrtc logging when WebCore WebRTC logging is updated
1609         https://bugs.webkit.org/show_bug.cgi?id=197166
1610         <rdar://problem/50107696>
1611
1612         Unreviewed.
1613
1614         Build fix after https://trac.webkit.org/changeset/244511.
1615
1616         * page/Page.cpp:
1617         (WebCore::Page::configureLoggingChannel):
1618
1619 2019-04-22  Youenn Fablet  <youenn@apple.com>
1620
1621         Cache API should return Abort error in case of putting an aborted fetch
1622         https://bugs.webkit.org/show_bug.cgi?id=196757
1623
1624         Reviewed by Darin Adler.
1625
1626         In case of an aborted fetch, call consume callback with an AbortError.
1627         Update the code that handles load cancelling as the loader callback is called.
1628         Covered by rebased tests.
1629
1630         * Modules/fetch/FetchResponse.cpp:
1631         (WebCore::FetchResponse::addAbortSteps):
1632         (WebCore::FetchResponse::BodyLoader::didFail):
1633         (WebCore::FetchResponse::BodyLoader::BodyLoader):
1634         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
1635         (WebCore::FetchResponse::stop):
1636         * Modules/fetch/FetchResponse.h:
1637
1638 2019-04-22  Youenn Fablet  <youenn@apple.com>
1639
1640         Update libwebrtc logging when WebCore WebRTC logging is updated
1641         https://bugs.webkit.org/show_bug.cgi?id=197166
1642
1643         Reviewed by Eric Carlson.
1644
1645         When updating WebRTC logging from Web Inspector, update libwebrtc logging so that no page reload is required.
1646         Manually tested.
1647
1648         * page/Page.cpp:
1649         (WebCore::Page::configureLoggingChannel):
1650
1651 2019-04-22  Simon Fraser  <simon.fraser@apple.com>
1652
1653         Introduce the concept of "opportunistic" stacking contexts
1654         https://bugs.webkit.org/show_bug.cgi?id=197077
1655
1656         Reviewed by Zalan Bujtas.
1657
1658         Bring back a variant of some code removed in r236424, which allows a RenderLayer
1659         to be stacking context for painting, without actually being on in terms of CSS.
1660         
1661         Internally, RenderLayer will call setIsOpportunisticStackingContext() to make a layer
1662         into a stacking context for painting. External callers deal with isStackingContext()
1663         or isCSSStackingContext().
1664
1665         Sadly we can't make m_forcedStackingContext (set on media element layers) trigger a
1666         non-CSS stacking context; media controls use mix-blend-mode, and rely on the fake-stacking
1667         media layer to be the "isolateBlending" ancestor.
1668
1669         No code uses this yet.
1670
1671         * rendering/RenderLayer.cpp:
1672         (WebCore::RenderLayer::RenderLayer):
1673         (WebCore::RenderLayer::shouldBeCSSStackingContext const):
1674         (WebCore::RenderLayer::isStackingContextChanged):
1675         (WebCore::RenderLayer::setIsOpportunisticStackingContext):
1676         (WebCore::RenderLayer::setIsCSSStackingContext):
1677         (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
1678         (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
1679         (WebCore::RenderLayer::beginTransparencyLayers):
1680         (WebCore::RenderLayer::calculateClipRects const):
1681         (WebCore::outputPaintOrderTreeLegend):
1682         (WebCore::outputPaintOrderTreeRecursive):
1683         (WebCore::RenderLayer::shouldBeStackingContext const): Deleted.
1684         (WebCore::RenderLayer::setIsStackingContext): Deleted.
1685         * rendering/RenderLayer.h:
1686         * rendering/RenderLayerBacking.cpp:
1687         (WebCore::RenderLayerBacking::compositingOpacity const):
1688
1689 2019-04-22  Justin Fan  <justin_fan@apple.com>
1690
1691         [WebGPU] Move swap chain methods from GPUDevice to GPUCanvasContext
1692         https://bugs.webkit.org/show_bug.cgi?id=197126
1693
1694         Reviewed by Dean Jackson.
1695
1696         GPUSwapChains are now configured via GPUCanvasContext instead of GPUDevice. Covers WebGPU API 
1697         pull request #262.
1698
1699         Existing WebGPU tests updated to match.
1700
1701         * Modules/webgpu/GPUCanvasContext.cpp:
1702         (WebCore::GPUCanvasContext::configureSwapChain):
1703         (WebCore::GPUCanvasContext::replaceSwapChain): Deleted.
1704         * Modules/webgpu/GPUCanvasContext.h:
1705         * Modules/webgpu/GPUCanvasContext.idl:
1706         * Modules/webgpu/WebGPUDevice.cpp:
1707         (WebCore::WebGPUDevice::createSwapChain const): Deleted.
1708         * Modules/webgpu/WebGPUDevice.h:
1709         (WebCore::WebGPUDevice::device):
1710         * Modules/webgpu/WebGPUDevice.idl:
1711         * Modules/webgpu/WebGPUSwapChainDescriptor.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUSwapChainDescriptor.h.
1712         (WebCore::WebGPUSwapChainDescriptor::asGPUSwapChainDescriptor const):
1713         * Modules/webgpu/WebGPUSwapChainDescriptor.h:
1714         * Sources.txt:
1715         * WebCore.xcodeproj/project.pbxproj:
1716         * platform/graphics/gpu/GPUDevice.cpp:
1717         (WebCore::GPUDevice::setSwapChain):
1718         (WebCore::GPUDevice::tryCreateSwapChain const): Deleted.
1719         * platform/graphics/gpu/GPUDevice.h:
1720         * platform/graphics/gpu/GPUSwapChain.h:
1721         * platform/graphics/gpu/GPUSwapChainDescriptor.h:
1722         (WebCore::GPUSwapChainDescriptor::GPUSwapChainDescriptor):
1723         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
1724         (WebCore::GPUSwapChain::tryCreate):
1725
1726 2019-04-22  Said Abou-Hallawa  <said@apple.com>
1727
1728         Mark SVGStringList properties '[SameObject]' in the IDL files
1729         Followup to https://bugs.webkit.org/show_bug.cgi?id=197137
1730
1731         Reviewed by Darin Adler.
1732
1733         The SVG elements do not create tear-off wrappers for SVGStrigList DOM
1734         objects anymore. Instead they return Ref pointers to the same RefCounted
1735         objects. So they should be marked '[SameObject]' in their IDL files.
1736
1737         * svg/SVGTests.idl:
1738         * svg/SVGViewElement.idl:
1739
1740 2019-04-22  Commit Queue  <commit-queue@webkit.org>
1741
1742         Unreviewed, rolling out r244495.
1743         https://bugs.webkit.org/show_bug.cgi?id=197159
1744
1745         Causing build failures on OpenSource and Internal bots
1746         (Requested by ShawnRoberts on #webkit).
1747
1748         Reverted changeset:
1749
1750         "WHLSLPrepare.cpp always recompiles, even if nothing was
1751         changed"
1752         https://bugs.webkit.org/show_bug.cgi?id=197151
1753         https://trac.webkit.org/changeset/244495
1754
1755 2019-04-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1756
1757         REGRESSION(r241289): [GTK] accessibility/removed-continuation-element-causes-crash.html and accessibility/removed-anonymous-block-child-causes-crash.html crashes
1758         https://bugs.webkit.org/show_bug.cgi?id=194630
1759
1760         Reviewed by Michael Catanzaro.
1761
1762         Do not assume core object always has a wrapper in webkitAccessibleRefChild().
1763
1764         Fixes: accessibility/removed-continuation-element-causes-crash.html
1765                accessibility/removed-anonymous-block-child-causes-crash.html
1766
1767         * accessibility/atk/WebKitAccessible.cpp:
1768         (webkitAccessibleRefChild): Return early if wrapper is nullptr.
1769
1770 2019-04-21  Darin Adler  <darin@apple.com>
1771
1772         WHLSLPrepare.cpp always recompiles, even if nothing was changed
1773         https://bugs.webkit.org/show_bug.cgi?id=197151
1774
1775         Reviewed by Dan Bernstein.
1776
1777         * DerivedSources-input.xcfilelist: Script updated this automatically after
1778         DerivedSources.make was corrected.
1779         * DerivedSources-output.xcfilelist: Ditto, although I had to manually remove
1780         one bogus leftover reference to WHLSLStandardLibrary.cpp.
1781
1782         * DerivedSources.make: Updated the rule that builds WHSLStandardLibrary.h to
1783         no longer refer to nonexistent WHLSLStandardLibrary.cpp. Because the dependency
1784         was on a file that was never created, the rule to regenerate WHSLStandardLibrary.h
1785         was running on every build, instead of only when one of the dependencies changed.
1786
1787 2019-04-20  Said Abou-Hallawa  <said@apple.com>
1788
1789         REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
1790         https://bugs.webkit.org/show_bug.cgi?id=197137
1791
1792         Reviewed by Darin Adler.
1793
1794         All the DOM objects accessing the viewTarget of the same SVGViewElement 
1795         should hold a Ref pointer to the same SVGStringList property.
1796
1797         Test: svg/dom/SVGViewElement-viewTarget.html
1798
1799         * svg/SVGViewElement.idl:
1800
1801 2019-04-20  Jer Noble  <jer.noble@apple.com>
1802
1803         REGRESSION(r243958): Unnecessary deactivation of AudioSession (PLT Regression)
1804         https://bugs.webkit.org/show_bug.cgi?id=197123
1805         <rdar://problem/49783264>
1806
1807         Reviewed by Per Arne Vollan.
1808
1809         Only set m_becameActive if we actually activated the AudioSession before starting playback. This
1810         avoids unnecessarily deactivating the AudioSession in processWillSuspend().
1811
1812         * platform/audio/PlatformMediaSessionManager.cpp:
1813         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
1814
1815 2019-04-19  Devin Rousso  <drousso@apple.com>
1816
1817         Web Inspector: Timelines: CPU: ensure that tracking stops when disconnecting Web Inspector
1818         https://bugs.webkit.org/show_bug.cgi?id=197115
1819         <rdar://problem/49877875>
1820
1821         Reviewed by Joseph Pecoraro.
1822
1823         * inspector/agents/InspectorCPUProfilerAgent.cpp:
1824         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
1825
1826 2019-04-19  Devin Rousso  <drousso@apple.com>
1827
1828         Web Inspector: REGRESSION: Elements: "Inspect Element" context menu often doesn't select that element
1829         https://bugs.webkit.org/show_bug.cgi?id=197091
1830         <rdar://problem/49953728>
1831
1832         Reviewed by Joseph Pecoraro.
1833
1834         Delay the `inspect` event fron firing with the focued node until the frontend has had a
1835         chance to request the document. Otherwise, requesting the document clears the mapping of
1836         node-to-id, so the focused node's id would no longer be valid.
1837
1838         * inspector/agents/InspectorDOMAgent.cpp:
1839         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1840         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
1841         (WebCore::InspectorDOMAgent::getDocument):
1842         (WebCore::InspectorDOMAgent::focusNode):
1843         (WebCore::InspectorDOMAgent::didCommitLoad):
1844
1845 2019-04-19  John Wilander  <wilander@apple.com>
1846
1847         Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
1848         https://bugs.webkit.org/show_bug.cgi?id=197108
1849         <rdar://problem/49918702>
1850
1851         Reviewed by Alex Christensen.
1852
1853         Tests: http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
1854                http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html
1855
1856         * html/HTMLAnchorElement.cpp:
1857         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1858             Early return for ephemeral sessions.
1859         * loader/ResourceLoader.cpp:
1860         (WebCore::ResourceLoader::shouldUseCredentialStorage):
1861             Now returns false for StoredCredentialsPolicy:EphemeralStatelessCookieless.
1862         * platform/network/StoredCredentialsPolicy.h:
1863             Added enum value EphemeralStatelessCookieless.
1864
1865 2019-04-19  Timothy Hatcher  <timothy@apple.com>
1866
1867         Standardize the <meta name="color-scheme"> separator.
1868         https://bugs.webkit.org/show_bug.cgi?id=193931
1869         rdar://problem/49995929
1870
1871         Reviewed by Darin Adler.
1872
1873         Tests: css-dark-mode/color-scheme-meta.html
1874
1875         * dom/Document.cpp:
1876         (WebCore::processColorSchemeString): Use isHTMLSpace insead of isColorSchemeSeparator and isASCIISpace.
1877         (WebCore::isColorSchemeSeparator): Deleted.
1878
1879 2019-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
1880
1881         [iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
1882         https://bugs.webkit.org/show_bug.cgi?id=197102
1883         <rdar://problem/49864669>
1884
1885         Reviewed by Ryosuke Niwa.
1886
1887         Add a quirk to disable autocorrection and autocapitalization in hidden editable areas.
1888
1889         * page/Quirks.cpp:
1890         (WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
1891         (WebCore::Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas const):
1892         * page/Quirks.h:
1893
1894 2019-04-18  Fujii Hironori  <Hironori.Fujii@sony.com>
1895
1896         Implement KeyedDecoderGeneric and KeyedEncoderGeneric
1897         https://bugs.webkit.org/show_bug.cgi?id=186410
1898
1899         Reviewed by Don Olmstead.
1900
1901         Implemented KeyedDecoderGeneric and KeyedEncoderGeneric by using
1902         WTF::Persistence::Decoder and WTF::Persistence::Encoder.
1903
1904         No new tests. Covered by existing tests.
1905
1906         * PlatformWin.cmake: Added KeyedDecoderGeneric.cpp and
1907         KeyedEncoderGeneric.cpp, and removed KeyedDecoderCF.cpp and
1908         KeyedEncoderCF.cpp for WinCairo port.
1909         * platform/generic/KeyedDecoderGeneric.cpp:
1910         * platform/generic/KeyedDecoderGeneric.h:
1911         * platform/generic/KeyedEncoderGeneric.cpp:
1912         * platform/generic/KeyedEncoderGeneric.h:
1913
1914 2019-04-18  Ross Kirsling  <ross.kirsling@sony.com>
1915
1916         [WinCairo] Non-unified build fails to link Tools
1917         https://bugs.webkit.org/show_bug.cgi?id=196866
1918
1919         Reviewed by Fujii Hironori.
1920
1921         * CMakeLists.txt:
1922         Drive-by fix -- don't disable string pooling when building WebCoreTestSupport.
1923         (This should have been part of r235203.)
1924
1925 2019-04-18  Commit Queue  <commit-queue@webkit.org>
1926
1927         Unreviewed, rolling out r244434.
1928         https://bugs.webkit.org/show_bug.cgi?id=197089
1929
1930         caused 1 API test failure (Requested by zalan on #webkit).
1931
1932         Reverted changeset:
1933
1934         "Regression (r244291): Broken API Test
1935         AutoLayoutRenderingProgressRelativeOrdering"
1936         https://bugs.webkit.org/show_bug.cgi?id=196948
1937         https://trac.webkit.org/changeset/244434
1938
1939 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
1940
1941         [CMake] Make WebCore headers copies
1942         https://bugs.webkit.org/show_bug.cgi?id=182512
1943         <rdar://problem/37510435>
1944
1945         Unreviewed build fix.
1946
1947         Add new header from r244440.
1948
1949         * Headers.cmake:
1950
1951 2019-04-18  Don Olmstead  <don.olmstead@sony.com>
1952
1953         [CMake] Make WebCore headers copies
1954         https://bugs.webkit.org/show_bug.cgi?id=182512
1955         <rdar://problem/37510435>
1956
1957         Reviewed by Alex Christensen.
1958
1959         The header copying is moved to a target WebCorePrivateFrameworkHeaders. This target was
1960         originally Windows only but now this is enabled for all CMake based ports.
1961
1962         Enumerated all headers within WebCore that are used for WebKit(Legacy), tools and
1963         tests. Shared headers are within Headers.cmake while port and platform specific headers
1964         are in their respective CMake files. Listing out all headers is preferred because globbing
1965         will break the build whenever a file is added.
1966
1967         All include directories within the WebCore source tree are now PRIVATE. They were
1968         modified to use WebCore_PRIVATE_INCLUDE_DIRECTORIES. They will not propagate to other targets
1969         which will prevent erroneous includes in targets dependent on WebCore.
1970
1971         * CMakeLists.txt:
1972         * Headers.cmake: Added.
1973         * PlatformAppleWin.cmake:
1974         * PlatformGTK.cmake:
1975         * PlatformMac.cmake:
1976         * PlatformPlayStation.cmake:
1977         * PlatformWPE.cmake:
1978         * PlatformWin.cmake:
1979         * PlatformWinCairo.cmake:
1980         * platform/Cairo.cmake:
1981         * platform/Curl.cmake:
1982         * platform/FreeType.cmake:
1983         * platform/GStreamer.cmake:
1984         * platform/HolePunch.cmake:
1985         * platform/ImageDecoders.cmake:
1986         * platform/Soup.cmake: Added.
1987         * platform/TextureMapper.cmake:
1988
1989 2019-04-18  Justin Fan  <justin_fan@apple.com>
1990
1991         [Web GPU] Implement API default values
1992         https://bugs.webkit.org/show_bug.cgi?id=197032
1993
1994         Reviewed by Myles C. Maxfield.
1995
1996         Add default values and 'required' qualifiers recently merged to the WebGPU API.
1997
1998         WebGPU tests specifying these default values have been updated to rely on them for functionality.
1999
2000         * Modules/webgpu/GPUBindGroupLayoutBinding.idl:
2001         * Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
2002         * Modules/webgpu/GPUBlendDescriptor.idl:
2003         * Modules/webgpu/GPUBufferDescriptor.idl:
2004         * Modules/webgpu/GPUColor.idl:
2005         * Modules/webgpu/GPUColorStateDescriptor.idl:
2006         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
2007         * Modules/webgpu/GPUExtent3D.idl:
2008         * Modules/webgpu/GPUInputStateDescriptor.idl:
2009         * Modules/webgpu/GPUOrigin3D.h:
2010         * Modules/webgpu/GPUOrigin3D.idl:
2011         * Modules/webgpu/GPURequestAdapterOptions.idl:
2012         * Modules/webgpu/GPUTextureDescriptor.idl:
2013         * Modules/webgpu/GPUVertexAttributeDescriptor.idl:
2014         * Modules/webgpu/GPUVertexInputDescriptor.idl:
2015         * Modules/webgpu/WebGPUBindGroupBinding.idl:
2016         * Modules/webgpu/WebGPUBindGroupDescriptor.idl:
2017         * Modules/webgpu/WebGPUBufferBinding.h:
2018         * Modules/webgpu/WebGPUBufferBinding.idl:
2019         * Modules/webgpu/WebGPUCommandEncoder.idl:
2020         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
2021         * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
2022         * Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
2023         * Modules/webgpu/WebGPURenderPassDescriptor.idl:
2024         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
2025         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
2026         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
2027         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
2028         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
2029         * platform/graphics/gpu/GPUBlendDescriptor.h:
2030         * platform/graphics/gpu/GPUColorStateDescriptor.h:
2031         * platform/graphics/gpu/GPUCommandBuffer.h:
2032         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
2033         * platform/graphics/gpu/GPURenderPassDescriptor.h:
2034         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
2035         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
2036         * platform/graphics/gpu/GPURequestAdapterOptions.h:
2037         * platform/graphics/gpu/GPUTextureDescriptor.h:
2038         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
2039         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
2040         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2041         (WebCore::convertRenderPipelineDescriptor):
2042         (WebCore::trySetFunctionsForPipelineDescriptor):
2043
2044 2019-04-18  Jer Noble  <jer.noble@apple.com>
2045
2046         Refactoring: Pull all fullscreen code out of Document and into its own helper class
2047         https://bugs.webkit.org/show_bug.cgi?id=197017
2048
2049         Reviewed by Eric Carlson.
2050
2051         * CMakeLists.txt:
2052         * DerivedSources-input.xcfilelist:
2053         * DerivedSources-output.xcfilelist:
2054         * DerivedSources.make:
2055         * Sources.txt:
2056         * WebCore.xcodeproj/project.pbxproj:
2057         * css/CSSDefaultStyleSheets.cpp:
2058         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2059         * css/SelectorCheckerTestFunctions.h:
2060         (WebCore::matchesFullScreenPseudoClass):
2061         (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
2062         (WebCore::matchesFullScreenDocumentPseudoClass):
2063         (WebCore::matchesFullScreenControlsHiddenPseudoClass):
2064         * dom/Document.cpp:
2065         (WebCore::Document::removedLastRef):
2066         (WebCore::Document::prepareForDestruction):
2067         (WebCore::Document::nodeChildrenWillBeRemoved):
2068         (WebCore::Document::nodeWillBeRemoved):
2069         (WebCore::isAttributeOnAllOwners): Deleted.
2070         (WebCore::Document::fullScreenIsAllowedForElement const): Deleted.
2071         (WebCore::Document::requestFullScreenForElement): Deleted.
2072         (WebCore::Document::webkitCancelFullScreen): Deleted.
2073         (WebCore::Document::webkitExitFullscreen): Deleted.
2074         (WebCore::Document::webkitFullscreenEnabled const): Deleted.
2075         (WebCore::unwrapFullScreenRenderer): Deleted.
2076         (WebCore::Document::webkitWillEnterFullScreen): Deleted.
2077         (WebCore::Document::webkitDidEnterFullScreen): Deleted.
2078         (WebCore::Document::webkitWillExitFullScreen): Deleted.
2079         (WebCore::Document::webkitDidExitFullScreen): Deleted.
2080         (WebCore::Document::setFullScreenRenderer): Deleted.
2081         (WebCore::Document::dispatchFullScreenChangeEvents): Deleted.
2082         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): Deleted.
2083         (WebCore::Document::fullScreenElementRemoved): Deleted.
2084         (WebCore::Document::adjustFullScreenElementOnNodeRemoval): Deleted.
2085         (WebCore::Document::isAnimatingFullScreen const): Deleted.
2086         (WebCore::Document::setAnimatingFullScreen): Deleted.
2087         (WebCore::Document::areFullscreenControlsHidden const): Deleted.
2088         (WebCore::Document::setFullscreenControlsHidden): Deleted.
2089         (WebCore::Document::clearFullscreenElementStack): Deleted.
2090         (WebCore::Document::popFullscreenElementStack): Deleted.
2091         (WebCore::Document::pushFullscreenElementStack): Deleted.
2092         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Deleted.
2093         * dom/Document.h:
2094         (WebCore::Document::fullscreenManager):
2095         (WebCore::Document::webkitIsFullScreen const): Deleted.
2096         (WebCore::Document::webkitFullScreenKeyboardInputAllowed const): Deleted.
2097         (WebCore::Document::webkitCurrentFullScreenElement const): Deleted.
2098         (WebCore::Document::webkitCurrentFullScreenElementForBindings const): Deleted.
2099         (WebCore::Document::fullScreenRenderer const): Deleted.
2100         (WebCore::Document::webkitFullscreenElement const): Deleted.
2101         (WebCore::Document::webkitFullscreenElementForBindings const): Deleted.
2102         * dom/Document.idl:
2103         * dom/DocumentFullscreen.h:
2104         (WebCore::DocumentFullscreen::webkitFullscreenEnabled):
2105         (WebCore::DocumentFullscreen::webkitFullscreenElement):
2106         (WebCore::DocumentFullscreen::webkitExitFullscreen):
2107         (WebCore::DocumentFullscreen::webkitIsFullScreen):
2108         (WebCore::DocumentFullscreen::webkitFullScreenKeyboardInputAllowed):
2109         (WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
2110         (WebCore::DocumentFullscreen::webkitCancelFullScreen):
2111         * dom/DocumentFullscreen.idl:
2112         * dom/Element.cpp:
2113         (WebCore::Element::webkitRequestFullscreen):
2114         * dom/EventPath.cpp:
2115         (WebCore::shouldEventCrossShadowBoundary):
2116         * dom/FullscreenManager.cpp: Added.
2117         (WebCore::isAttributeOnAllOwners):
2118         (WebCore::FullscreenManager::FullscreenManager):
2119         (WebCore::FullscreenManager::fullscreenIsAllowedForElement const):
2120         (WebCore::FullscreenManager::requestFullscreenForElement):
2121         (WebCore::FullscreenManager::cancelFullscreen):
2122         (WebCore::FullscreenManager::requestExitFullscreen):
2123         (WebCore::FullscreenManager::exitFullscreen):
2124         (WebCore::FullscreenManager::isFullscreenEnabled const):
2125         (WebCore::unwrapFullscreenRenderer):
2126         (WebCore::FullscreenManager::willEnterFullscreen):
2127         (WebCore::FullscreenManager::didEnterFullscreen):
2128         (WebCore::FullscreenManager::willExitFullscreen):
2129         (WebCore::FullscreenManager::didExitFullscreen):
2130         (WebCore::FullscreenManager::setFullscreenRenderer):
2131         (WebCore::FullscreenManager::dispatchFullscreenChangeEvents):
2132         (WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):
2133         (WebCore::FullscreenManager::fullscreenElementRemoved):
2134         (WebCore::FullscreenManager::adjustFullscreenElementOnNodeRemoval):
2135         (WebCore::FullscreenManager::isAnimatingFullscreen const):
2136         (WebCore::FullscreenManager::setAnimatingFullscreen):
2137         (WebCore::FullscreenManager::areFullscreenControlsHidden const):
2138         (WebCore::FullscreenManager::setFullscreenControlsHidden):
2139         (WebCore::FullscreenManager::clear):
2140         (WebCore::FullscreenManager::emptyEventQueue):
2141         (WebCore::FullscreenManager::clearFullscreenElementStack):
2142         (WebCore::FullscreenManager::popFullscreenElementStack):
2143         (WebCore::FullscreenManager::pushFullscreenElementStack):
2144         (WebCore::FullscreenManager::addDocumentToFullscreenChangeEventQueue):
2145         * dom/FullscreenManager.h: Added.
2146         (WebCore::FullscreenManager::document):
2147         (WebCore::FullscreenManager::document const):
2148         (WebCore::FullscreenManager::topDocument const):
2149         (WebCore::FullscreenManager::page const):
2150         (WebCore::FullscreenManager::frame const):
2151         (WebCore::FullscreenManager::documentElement const):
2152         (WebCore::FullscreenManager::hasLivingRenderTree const):
2153         (WebCore::FullscreenManager::pageCacheState const):
2154         (WebCore::FullscreenManager::scheduleFullStyleRebuild):
2155         (WebCore::FullscreenManager::fullscreenElement const):
2156         (WebCore::FullscreenManager::isFullscreen const):
2157         (WebCore::FullscreenManager::isFullscreenKeyboardInputAllowed const):
2158         (WebCore::FullscreenManager::currentFullscreenElement const):
2159         (WebCore::FullscreenManager::fullscreenRenderer const):
2160         * html/HTMLMediaElement.cpp:
2161         (WebCore::HTMLMediaElement::isFullscreen const):
2162         (WebCore::HTMLMediaElement::isStandardFullscreen const):
2163         (WebCore::HTMLMediaElement::enterFullscreen):
2164         (WebCore::HTMLMediaElement::exitFullscreen):
2165         * html/MediaElementSession.cpp:
2166         (WebCore::MediaElementSession::canShowControlsManager const):
2167         * html/shadow/MediaControlElements.cpp:
2168         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
2169         * inspector/agents/InspectorDOMAgent.cpp:
2170         * page/EventHandler.cpp:
2171         (WebCore::EventHandler::isKeyEventAllowedInFullScreen const):
2172         (WebCore::EventHandler::internalKeyEvent):
2173         * page/Page.cpp:
2174         (WebCore::Page::setFullscreenControlsHidden):
2175         * rendering/RenderFullScreen.cpp:
2176         (WebCore::RenderFullScreen::wrapNewRenderer):
2177         (WebCore::RenderFullScreen::wrapExistingRenderer):
2178         * rendering/RenderLayerCompositor.cpp:
2179         (WebCore::isDescendantOfFullScreenLayer):
2180         * rendering/updating/RenderTreeBuilder.h:
2181         * rendering/updating/RenderTreeBuilderInline.cpp:
2182         (WebCore::RenderTreeBuilder::Inline::splitInlines):
2183         * rendering/updating/RenderTreeUpdater.cpp:
2184         (WebCore::RenderTreeUpdater::createRenderer):
2185         * style/StyleSharingResolver.cpp:
2186         (WebCore::Style::SharingResolver::canShareStyleWithElement const):
2187         * testing/Internals.cpp:
2188         (WebCore::Internals::webkitWillEnterFullScreenForElement):
2189         (WebCore::Internals::webkitDidEnterFullScreenForElement):
2190         (WebCore::Internals::webkitWillExitFullScreenForElement):
2191         (WebCore::Internals::webkitDidExitFullScreenForElement):
2192         (WebCore::Internals::isAnimatingFullScreen const):
2193
2194 2019-04-18  Jer Noble  <jer.noble@apple.com>
2195
2196         Add support for parsing FairPlayStreaming PSSH boxes.
2197         https://bugs.webkit.org/show_bug.cgi?id=197064
2198
2199         Reviewed by Eric Carlson.
2200
2201         API Tests: ISO.ISOFairPlayStreamingPsshBox
2202
2203         Add a new set of ISOBox classes for parsing the contents of a FairPlayStreaming PSSH box,
2204         and add support for this new box to CDMFairPlayStreaming.
2205
2206         Drive-by fix: add an explicit include for MainThread.h to LibWebRTCProviderCocoa.cpp.
2207
2208         * SourcesCocoa.txt:
2209         * WebCore.xcodeproj/project.pbxproj:
2210         * platform/graphics/FourCC.h:
2211         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
2212         (WebCore::CDMPrivateFairPlayStreaming::cencName):
2213         (WebCore::fairPlaySystemID):
2214         (WebCore::extractSchemeAndKeyIdFromCenc):
2215         (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc):
2216         (WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc):
2217         (WebCore::validInitDataTypes):
2218         (WebCore::CDMFactory::platformRegisterFactories):
2219         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
2220         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: Added.
2221         (WebCore::ISOFairPlayStreamingPsshBox::fairPlaySystemID):
2222         (WebCore::ISOFairPlayStreamingInfoBox::parse):
2223         (WebCore::ISOFairPlayStreamingKeyRequestInfoBox::parse):
2224         (WebCore::ISOFairPlayStreamingKeyAssetIdBox::parse):
2225         (WebCore::ISOFairPlayStreamingKeyContextBox::parse):
2226         (WebCore::ISOFairPlayStreamingKeyVersionListBox::parse):
2227         (WebCore::ISOFairPlayStreamingKeyRequestBox::parse):
2228         (WebCore::ISOFairPlayStreamingInitDataBox::parse):
2229         (WebCore::ISOFairPlayStreamingPsshBox::parse):
2230         * platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: Added.
2231         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2232
2233 2019-04-18  Sihui Liu  <sihui_liu@apple.com>
2234
2235         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
2236         https://bugs.webkit.org/show_bug.cgi?id=196128
2237         <rdar://problem/49562115>
2238
2239         Reviewed by Geoffrey Garen.
2240
2241         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
2242         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
2243         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
2244         deserialize types including Blob and File.
2245
2246         To solve this issue, we move the key injection to web process and let network process store the original value 
2247         it gets. In this case, when web process asks for some value, network process should return key, value and key 
2248         path so that web process can decide whether it should perform a key injection before returning the result. Note
2249         that the auto-generated key would always be stored as the key in a ObjectStore record.
2250
2251         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
2252
2253         * Modules/indexeddb/IDBCursor.cpp:
2254         (WebCore::IDBCursor::setGetResult):
2255         * Modules/indexeddb/IDBCursor.h:
2256         (WebCore::IDBCursor::primaryKeyPath):
2257         * Modules/indexeddb/IDBGetAllResult.cpp:
2258         (WebCore::IDBGetAllResult::isolatedCopy):
2259         (WebCore::IDBGetAllResult::addKey):
2260         (WebCore::IDBGetAllResult::addValue):
2261         (WebCore::IDBGetAllResult::keys const):
2262         (WebCore::IDBGetAllResult::values const):
2263         (WebCore::IDBGetAllResult::allBlobFilePaths const):
2264         (WebCore::isolatedCopyOfVariant): Deleted.
2265
2266         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
2267         because we only needed to store either key or value before, and now the stored value could be incomplete.
2268         (WebCore::IDBGetAllResult::IDBGetAllResult):
2269         (WebCore::IDBGetAllResult::keyPath const):
2270         (WebCore::IDBGetAllResult::encode const):
2271         (WebCore::IDBGetAllResult::decode):
2272
2273         * Modules/indexeddb/IDBGetResult.cpp:
2274         (WebCore::IDBGetResult::setValue):
2275         * Modules/indexeddb/IDBGetResult.h:
2276         (WebCore::IDBGetResult::IDBGetResult):
2277         (WebCore::IDBGetResult::keyPath const):
2278         * Modules/indexeddb/IDBRequest.cpp:
2279         (WebCore::IDBRequest::setResult):
2280         (WebCore::IDBRequest::setResultToStructuredClone):
2281         * Modules/indexeddb/IDBRequest.h:
2282         * Modules/indexeddb/IDBTransaction.cpp:
2283         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
2284         (WebCore::IDBTransaction::didGetRecordOnServer):
2285         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2286         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2287         * Modules/indexeddb/server/MemoryIndex.cpp:
2288         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
2289         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
2290         * Modules/indexeddb/server/MemoryIndexCursor.cpp:
2291         (WebCore::IDBServer::MemoryIndexCursor::currentData):
2292         * Modules/indexeddb/server/MemoryObjectStore.cpp:
2293         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
2294         (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
2295         (WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
2296         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
2297         (WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
2298         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2299         (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
2300         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
2301         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2302         (WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
2303         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
2304         (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
2305         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2306         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
2307         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
2308         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
2309         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2310         (WebCore::IDBServer::SQLiteIDBCursor::currentData):
2311         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2312         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2313
2314         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process. 
2315         UniqueIDBDatabase stores any value it gets from IDBClient.
2316
2317         * Modules/indexeddb/shared/IDBResultData.cpp:
2318         (WebCore::IDBResultData::getResultRef):
2319         * Modules/indexeddb/shared/IDBResultData.h:
2320
2321         * bindings/js/IDBBindingUtilities.cpp:
2322         (WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
2323         return null, but we expect it to return result as long as the property value is the same as target. Therefore, 
2324         we can add an early return here.
2325
2326         (WebCore::createKeyPathArray):
2327         (WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
2328         value gets stored does not include auto-generated key, as we remove the key injection from network process. In 
2329         this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
2330         for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in 
2331         database record, we could use value of that key when we find a match in key path.
2332
2333         (WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is 
2334         probably auto-generated, so we could inject the result key into the result value unconditionally.
2335
2336         * bindings/js/IDBBindingUtilities.h:
2337         * bindings/js/JSIDBCursorWithValueCustom.cpp:
2338         (WebCore::JSIDBCursorWithValue::value const):
2339         * bindings/js/JSIDBRequestCustom.cpp:
2340         (WebCore::JSIDBRequest::result const):
2341
2342 2019-04-18  Zalan Bujtas  <zalan@apple.com>
2343
2344         Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
2345         https://bugs.webkit.org/show_bug.cgi?id=196948
2346         <rdar://problem/49927131>
2347
2348         Reviewed by Tim Horton.
2349
2350         * page/FrameView.cpp:
2351         (WebCore::FrameView::setContentsSize):
2352         (WebCore::FrameView::autoSizeIfEnabled):
2353         * page/FrameView.h:
2354
2355 2019-04-18  Shawn Roberts  <sroberts@apple.com>
2356
2357         Unreviewed manual rollout of r244248 and r244409
2358         Causing assertion failures on Mac WK2 Debug builds
2359         https://bugs.webkit.org/show_bug.cgi?id=195623
2360
2361         * loader/LinkLoader.cpp:
2362         (WebCore::LinkLoader::prefetchIfNeeded):
2363         * loader/ResourceLoadInfo.cpp:
2364         (WebCore::toResourceType):
2365         * loader/ResourceLoadInfo.h:
2366         * loader/ResourceLoader.cpp:
2367         (WebCore::ResourceLoader::willSendRequestInternal):
2368         * loader/cache/CachedResourceLoader.cpp:
2369         (WebCore::CachedResourceLoader::requestResource):
2370
2371 2019-04-18  Antti Koivisto  <antti@apple.com>
2372
2373         Tile update problems in iframe after scrolling page too soon after load
2374         https://bugs.webkit.org/show_bug.cgi?id=197057
2375         <rdar://problem/49913663>
2376
2377         Reviewed by Simon Fraser.
2378
2379         We end up destroying FrameHosting scrolling node when we shouldn't.
2380
2381         No test, despite attempts I couldn't get this state to stick. The problem is that in
2382         most cases the destroying scrolling node gets immediately recreated and connected again.
2383         Getting into testably buggy state requires some very specific layer tree configuration update.
2384
2385         * rendering/RenderLayerBacking.cpp:
2386         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2387
2388         Test the right thing.
2389
2390 2019-04-18  Antoine Quint  <graouts@apple.com>
2391
2392         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
2393         https://bugs.webkit.org/show_bug.cgi?id=197004
2394
2395         Reviewed by Antti Koivisto.
2396
2397         We need to release pointer capture when an element that has pointer capture is disconnected from the DOM.
2398
2399         * dom/Element.cpp:
2400         (WebCore::Element::removedFromAncestor): Notify the PointerCaptureController that an element was disconnected.
2401         * dom/PointerEvent.cpp:
2402         (WebCore::PointerEvent::create): Broaden createPointerCancelEvent() to take in an event type so that we may use it to create a
2403         lostpointercapture event as well.
2404         (WebCore::PointerEvent::createPointerCancelEvent): Deleted.
2405         * dom/PointerEvent.h:
2406         * page/PointerCaptureController.cpp:
2407         (WebCore::PointerCaptureController::elementWasRemoved): Check whether the provided element matches one of the target overrides recorded
2408         in the map of captured pointer IDs.
2409         (WebCore::PointerCaptureController::pointerEventWasDispatched): This block of code was actually useless in this location, the new code
2410         added in elementWasRemoved() performs the actions that the spec text mandates.
2411         (WebCore::PointerCaptureController::cancelPointer): Replace the call to createPointerCancelEvent() with one to create().
2412         * page/PointerCaptureController.h:
2413
2414 2019-04-17  Antoine Quint  <graouts@apple.com>
2415
2416         [Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
2417         https://bugs.webkit.org/show_bug.cgi?id=197006
2418
2419         Reviewed by Antti Koivisto.
2420
2421         Add support for on* HTML attributes and JS properties for pointer events.
2422
2423         * dom/GlobalEventHandlers.idl:
2424         * html/HTMLAttributeNames.in:
2425         * html/HTMLElement.cpp:
2426         (WebCore::HTMLElement::createEventHandlerNameMap):
2427
2428 2019-04-17  Timothy Hatcher  <timothy@apple.com>
2429
2430         Standardize the `<meta name="color-scheme">` separator.
2431         https://bugs.webkit.org/show_bug.cgi?id=193931
2432
2433         Reviewed by Simon Fraser.
2434
2435         Drop support for comma as a valid seperator in <meta name="color-scheme"> to
2436         match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
2437
2438         Tests: css-dark-mode/color-scheme-meta.html
2439                css-dark-mode/older-syntax/supported-color-schemes-meta.html
2440
2441         * dom/Document.cpp:
2442         (WebCore::isColorSchemeSeparator): Drop support for comma.
2443
2444 2019-04-17  Timothy Hatcher  <timothy@apple.com>
2445
2446         Rename `supported-color-schemes` to `color-scheme`.
2447         https://bugs.webkit.org/show_bug.cgi?id=197016
2448         rdar://problem/49980259
2449
2450         Reviewed by Simon Fraser.
2451
2452         Changed `supported-color-schemes` to `color-scheme` to follow the spec changes
2453         being tracked by: https://github.com/w3c/csswg-drafts/issues/3807
2454
2455         The old `supported-color-schemes` is now an alias of `color-scheme` for compatibility.
2456
2457         Tests: css-dark-mode/color-scheme-css-parse.html
2458                css-dark-mode/color-scheme-css.html
2459                css-dark-mode/color-scheme-meta.html
2460                css-dark-mode/color-scheme-priority.html
2461                css-dark-mode/color-scheme-scrollbar.html
2462                css-dark-mode/older-syntax/supported-color-schemes-css.html
2463                css-dark-mode/older-syntax/supported-color-schemes-meta.html
2464                css-dark-mode/older-systems/color-scheme-css.html
2465                css-dark-mode/older-systems/color-scheme-meta.html
2466
2467         * WebCore.xcodeproj/project.pbxproj:
2468         * css/CSSComputedStyleDeclaration.cpp:
2469         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2470         * css/CSSProperties.json:
2471         * css/CSSValueKeywords.in:
2472         * css/StyleBuilderConverter.h:
2473         (WebCore::StyleBuilderConverter::updateColorScheme):
2474         (WebCore::StyleBuilderConverter::convertColorScheme):
2475         (WebCore::StyleBuilderConverter::updateSupportedColorSchemes): Deleted.
2476         (WebCore::StyleBuilderConverter::convertSupportedColorSchemes): Deleted.
2477         * css/StyleBuilderCustom.h:
2478         (WebCore::StyleBuilderCustom::applyValueColorScheme):
2479         (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes): Deleted.
2480         * css/StyleResolver.cpp:
2481         (WebCore::StyleResolver::applyMatchedProperties):
2482         * css/parser/CSSPropertyParser.cpp:
2483         (WebCore::consumeColorScheme):
2484         (WebCore::CSSPropertyParser::parseSingleValue):
2485         (WebCore::consumeSupportedColorSchemes): Deleted.
2486         * dom/Document.cpp:
2487         (WebCore::processColorSchemeString):
2488         (WebCore::Document::processColorScheme):
2489         (WebCore::Document::useDarkAppearance const):
2490         (WebCore::processColorSchemes): Deleted.
2491         (WebCore::Document::processSupportedColorSchemes): Deleted.
2492         * dom/Document.h:
2493         * html/HTMLMetaElement.cpp:
2494         (WebCore::HTMLMetaElement::process):
2495         * page/FrameView.cpp:
2496         (WebCore::FrameView::rendererForColorScheme const):
2497         (WebCore::FrameView::useDarkAppearance const):
2498         (WebCore::FrameView::styleColorOptions const):
2499         (WebCore::FrameView::rendererForSupportedColorSchemes const): Deleted.
2500         * page/FrameView.h:
2501         * rendering/style/RenderStyle.cpp:
2502         (WebCore::rareInheritedDataChangeRequiresRepaint):
2503         * rendering/style/RenderStyle.h:
2504         (WebCore::RenderStyle::colorScheme const):
2505         (WebCore::RenderStyle::setHasExplicitlySetColorScheme):
2506         (WebCore::RenderStyle::hasExplicitlySetColorScheme const):
2507         (WebCore::RenderStyle::setColorScheme):
2508         (WebCore::RenderStyle::initialColorScheme):
2509         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2510         (WebCore::RenderStyle::supportedColorSchemes const): Deleted.
2511         (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Deleted.
2512         (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Deleted.
2513         (WebCore::RenderStyle::setSupportedColorSchemes): Deleted.
2514         (WebCore::RenderStyle::initialSupportedColorSchemes): Deleted.
2515         * rendering/style/RenderStyleConstants.h:
2516         * rendering/style/StyleColorScheme.h: Renamed from Source/WebCore/rendering/style/StyleSupportedColorSchemes.h.
2517         (WebCore::StyleColorScheme::StyleColorScheme):
2518         (WebCore::StyleColorScheme::operator== const):
2519         (WebCore::StyleColorScheme::operator!= const):
2520         (WebCore::StyleColorScheme::isAuto const):
2521         (WebCore::StyleColorScheme::isOnly const):
2522         (WebCore::StyleColorScheme::colorScheme const):
2523         (WebCore::StyleColorScheme::add):
2524         (WebCore::StyleColorScheme::contains const):
2525         (WebCore::StyleColorScheme::setAllowsTransformations):
2526         (WebCore::StyleColorScheme::allowsTransformations const):
2527         * rendering/style/StyleRareInheritedData.cpp:
2528         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2529         (WebCore::StyleRareInheritedData::operator== const):
2530         * rendering/style/StyleRareInheritedData.h:
2531
2532 2019-04-17  Justin Fan  <justin_fan@apple.com>
2533
2534         [Web GPU] GPUComputePassEncoder::dispatch number of thread groups, not grid size
2535         https://bugs.webkit.org/show_bug.cgi?id=196984
2536
2537         Reviewed by Myles C. Maxfield.
2538
2539         Test: Updated compute-squares.html.
2540
2541         * platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
2542         (WebCore::GPUComputePassEncoder::dispatch):
2543
2544 2019-04-17  Andy Estes  <aestes@apple.com>
2545
2546         [iOS] Support multiple file selection in UIDocumentPickerViewController
2547         https://bugs.webkit.org/show_bug.cgi?id=197014
2548         <rdar://problem/49963514>
2549
2550         Reviewed by Tim Horton.
2551
2552         * platform/LocalizedStrings.h:
2553         Exported multipleFileUploadText().
2554
2555 2019-04-17  John Wilander  <wilander@apple.com>
2556
2557         Add prioritization of ad click conversions and cleaning of sent ad click conversions
2558         https://bugs.webkit.org/show_bug.cgi?id=196934
2559         <rdar://problem/49917773>
2560
2561         Reviewed by Chris Dumez.
2562
2563         Tests: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html
2564                http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html
2565                http/tests/adClickAttribution/second-conversion-with-higher-priority.html
2566                http/tests/adClickAttribution/second-conversion-with-lower-priority.html
2567
2568         * loader/AdClickAttribution.cpp:
2569         (WebCore::AdClickAttribution::hasHigherPriorityThan const):
2570             Added to facilitate priority comparison between two attributions.
2571         * loader/AdClickAttribution.h:
2572         (WebCore::AdClickAttribution::Destination::Destination):
2573             Added a WTF::HashTableDeletedValueType constructor and changed the copy constructor to
2574             a move constructor.
2575         (WebCore::AdClickAttribution::isEmpty const):
2576
2577 2019-04-17  Devin Rousso  <drousso@apple.com>
2578
2579         AX: AccessibilityObject::parentObject() doesn't need to be pure virtual
2580         https://bugs.webkit.org/show_bug.cgi?id=197026
2581         <rdar://problem/49448209>
2582
2583         Reviewed by Timothy Hatcher.
2584
2585         * accessibility/AccessibilityObject.h:
2586         (WebCore::AccessibilityObject::parentObject const):
2587
2588 2019-04-17  Zalan Bujtas  <zalan@apple.com>
2589
2590         [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
2591         https://bugs.webkit.org/show_bug.cgi?id=196988
2592         <rdar://problem/49955328>
2593
2594         Reviewed by Simon Fraser.
2595
2596         Test: fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html
2597
2598         * accessibility/AccessibilityObject.h:
2599
2600 2019-04-17  Alex Christensen  <achristensen@webkit.org>
2601
2602         WebSocketHandshake should not know about a Document
2603         https://bugs.webkit.org/show_bug.cgi?id=196468
2604
2605         Reviewed by Tim Horton.
2606
2607         I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
2608         It currently uses the Document pointer for 3 things:
2609         1. To get the user agent, which we can pass in as a creation parameter.
2610         2. To get the origin, which we can also pass in as a creation parameter.
2611         3. To get cookies for the web inspector.  We can pass in a functor instead and have the inspector provide cookies itself.
2612
2613         * Modules/websockets/WebSocketChannel.cpp:
2614         (WebCore::WebSocketChannel::connect):
2615         (WebCore::WebSocketChannel::disconnect):
2616         (WebCore::WebSocketChannel::didOpenSocketStream):
2617         (WebCore::WebSocketChannel::clientHandshakeRequest):
2618         * Modules/websockets/WebSocketChannel.h:
2619         (WebCore::WebSocketChannel::document):
2620         * Modules/websockets/WebSocketHandshake.cpp:
2621         (WebCore::WebSocketHandshake::WebSocketHandshake):
2622         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
2623         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
2624         (WebCore::WebSocketHandshake::clientOrigin const): Deleted.
2625         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
2626         (WebCore::WebSocketHandshake::clearDocument): Deleted.
2627         * Modules/websockets/WebSocketHandshake.h:
2628         * inspector/agents/InspectorNetworkAgent.cpp:
2629         (WebCore::InspectorNetworkAgent::enable):
2630
2631 2019-04-17  Timothy Hatcher  <timothy@apple.com>
2632
2633         Unreviewed build fix for iOSMac after r244223.
2634
2635         * platform/audio/ios/AudioSessionIOS.mm:
2636         (WebCore::AudioSession::routeSharingPolicy const): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
2637         around AVAudioSessionRouteSharingPolicyLongForm use.
2638
2639 2019-04-17  Chris Dumez  <cdumez@apple.com>
2640
2641         Remember device orientation permission for the duration of the browsing session
2642         https://bugs.webkit.org/show_bug.cgi?id=196992
2643         <rdar://problem/49946067>
2644
2645         Reviewed by Alex Christensen.
2646
2647         Use DeviceOrientationOrMotionPermissionState type more consistently in the code base
2648         instead of bool or Optional<bool>. Added "Prompt" value to this enumeration which is the
2649         default state and which indicates we should ask the client.
2650
2651         * WebCore.xcodeproj/project.pbxproj:
2652         * dom/DeviceOrientationAndMotionAccessController.cpp:
2653         (WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
2654         (WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
2655         * dom/DeviceOrientationAndMotionAccessController.h:
2656         (WebCore::DeviceOrientationAndMotionAccessController::accessState const):
2657         * dom/DeviceOrientationOrMotionEvent.cpp:
2658         (WebCore::DeviceOrientationOrMotionEvent::requestPermission):
2659         * dom/DeviceOrientationOrMotionPermissionState.h:
2660         * loader/DocumentLoader.h:
2661         (WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
2662         (WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
2663         * page/ChromeClient.h:
2664         * page/DOMWindow.cpp:
2665         (WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
2666
2667 2019-04-17  Rob Buis  <rbuis@igalia.com>
2668
2669         XMLHttpRequest has the wrong fallback encoding
2670         https://bugs.webkit.org/show_bug.cgi?id=191741
2671
2672         Reviewed by Alex Christensen.
2673
2674         Allow overriding the response charset as specified here:
2675         https://xhr.spec.whatwg.org/#final-charset
2676
2677         Behavior matches Firefox and Chrome.
2678
2679         Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
2680                imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
2681                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
2682                imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html
2683
2684         * xml/XMLHttpRequest.cpp:
2685         (WebCore::XMLHttpRequest::finalResponseCharset const):
2686         (WebCore::XMLHttpRequest::createDecoder const):
2687         * xml/XMLHttpRequest.h:
2688
2689 2019-04-16  Antoine Quint  <graouts@apple.com>
2690
2691         Opt Google Maps into simulated mouse events dispatch quirk
2692         https://bugs.webkit.org/show_bug.cgi?id=196965
2693         <rdar://problem/49934766>
2694
2695         Reviewed by Dean Jackson.
2696
2697         Use the correct Google Maps path.
2698
2699         * page/Quirks.cpp:
2700         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2701
2702 2019-04-16  Antoine Quint  <graouts@apple.com>
2703
2704         Opt flipkart.com into simulated mouse events dispatch quirk
2705         https://bugs.webkit.org/show_bug.cgi?id=196961
2706         <rdar://problem/49648520>
2707
2708         Reviewed by Dean Jackson.
2709
2710         * page/Quirks.cpp:
2711         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2712
2713 2019-04-16  Antoine Quint  <graouts@apple.com>
2714
2715         Opt MSN.com into simulated mouse events dispatch quirk
2716         https://bugs.webkit.org/show_bug.cgi?id=196960
2717         <rdar://problem/49403260>
2718
2719         Reviewed by Dean Jackson.
2720
2721         * page/Quirks.cpp:
2722         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2723
2724 2019-04-16  Zan Dobersek  <zdobersek@igalia.com>
2725
2726         ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
2727         https://bugs.webkit.org/show_bug.cgi?id=191354
2728         <rdar://problem/46123406>
2729
2730         Reviewed by Michael Catanzaro.
2731
2732         ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
2733         index validity and, if the index is valid, check for completeness of the
2734         corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
2735         also only retrieve duration for already-complete frames, or expand the
2736         default 0-second value according to the flashing-protection rule when
2737         the target frame is not yet complete.
2738
2739         Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
2740         as that method goes on and decodes image data to determine specific
2741         information. The ImageSource class that's querying this information
2742         doesn't anticipate this, and doesn't handle the increased memory
2743         consumption of the decoded data, leaving MemoryCache in the blind about
2744         the image resource's actual amount of consumed memory. ImageSource can
2745         instead gracefully handle any incomplete frame by marking the decoding
2746         status for this frame as only partial.
2747
2748         * platform/image-decoders/ScalableImageDecoder.cpp:
2749         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
2750         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
2751         (WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2752
2753 2019-04-16  Ross Kirsling  <ross.kirsling@sony.com>
2754
2755         Unreviewed non-unified build fix after r244307.
2756
2757         * page/DiagnosticLoggingClient.h:
2758
2759 2019-04-16  Chris Dumez  <cdumez@apple.com>
2760
2761         URL set by document.open() is not communicated to the UIProcess
2762         https://bugs.webkit.org/show_bug.cgi?id=196941
2763         <rdar://problem/49237544>
2764
2765         Reviewed by Geoff Garen.
2766
2767         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
2768         the latest document URL.
2769
2770         * loader/FrameLoader.cpp:
2771         (WebCore::FrameLoader::didExplicitOpen):
2772         * loader/FrameLoaderClient.h:
2773
2774 2019-04-16  Timothy Hatcher  <timothy@apple.com>
2775
2776         FrameView base background color always starts white.
2777         https://bugs.webkit.org/show_bug.cgi?id=196976
2778
2779         Reviewed by Beth Dakin.
2780
2781         * page/FrameView.cpp:
2782         (WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
2783         color did not change.
2784
2785 2019-04-16  Devin Rousso  <drousso@apple.com>
2786
2787         Unprefix -webkit-sticky
2788         https://bugs.webkit.org/show_bug.cgi?id=196962
2789         <rdar://problem/40903458>
2790
2791         Reviewed by Simon Fraser.
2792
2793         Updated existing tests.
2794
2795         This change doesn't modify functionality, only exposing a new unprefixed CSS value.
2796
2797         * css/CSSProperties.json:
2798         * css/CSSValueKeywords.in:
2799
2800         * css/CSSPrimitiveValueMappings.h:
2801         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2802         (WebCore::CSSPrimitiveValue::operator PositionType const):
2803
2804         * css/parser/CSSParserFastPaths.cpp:
2805         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2806
2807         * editing/EditingStyle.cpp:
2808         (WebCore::EditingStyle::convertPositionStyle):
2809
2810 2019-04-16  Commit Queue  <commit-queue@webkit.org>
2811
2812         Unreviewed, rolling out r244321.
2813         https://bugs.webkit.org/show_bug.cgi?id=196968
2814
2815         Causing all WK2 Debug builds to exit early after Assertion
2816         failures. (Requested by ShawnRoberts on #webkit).
2817
2818         Reverted changeset:
2819
2820         "URL set by document.open() is not communicated to the
2821         UIProcess"
2822         https://bugs.webkit.org/show_bug.cgi?id=196941
2823         https://trac.webkit.org/changeset/244321
2824
2825 2019-04-16  Caitlin Potter  <caitp@igalia.com>
2826
2827         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
2828         https://bugs.webkit.org/show_bug.cgi?id=176810
2829
2830         Reviewed by Saam Barati.
2831
2832         Previously, there was a comment here indicating uncertainty of whether it
2833         was necessary to filter DontEnum properties explicitly or not. It turns
2834         out that it was necessary in the case of JSC ProxyObjects.
2835
2836         This patch adds DontEnum filtering for ProxyObjects, however we continue
2837         to explicitly filter them in JSDOMConvertRecord, which needs to use the
2838         property descriptor after filtering. This change prevents observably
2839         fetching the property descriptor twice per property.
2840
2841         * bindings/js/JSDOMConvertRecord.h:
2842
2843 2019-04-15  Antoine Quint  <graouts@apple.com>
2844
2845         [iOS] Redundant pointer events causes material design buttons to flush twice
2846         https://bugs.webkit.org/show_bug.cgi?id=196914
2847         <rdar://problem/49571860>
2848
2849         Reviewed by Dean Jackson.
2850
2851         Test: pointerevents/ios/pointer-event-order.html
2852
2853         Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.
2854
2855         * dom/Element.cpp:
2856         (WebCore::Element::dispatchMouseEvent):
2857
2858 2019-04-15  John Wilander  <wilander@apple.com>
2859
2860         Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
2861         https://bugs.webkit.org/show_bug.cgi?id=196955
2862
2863         Unreviewed test gardening. The WebCore change is only in a dedicated
2864         test function.
2865
2866         No new tests. Existing test updated.
2867
2868         * loader/AdClickAttribution.cpp:
2869         (WebCore::AdClickAttribution::urlForTesting const):
2870             Now preserves the query string in the test URL.
2871
2872 2019-04-15  Chris Dumez  <cdumez@apple.com>
2873
2874         URL set by document.open() is not communicated to the UIProcess
2875         https://bugs.webkit.org/show_bug.cgi?id=196941
2876         <rdar://problem/49237544>
2877
2878         Reviewed by Geoffrey Garen.
2879
2880         Notify the FrameLoaderClient whenever an explicit open was done and provide it with
2881         the latest document URL.
2882
2883         * loader/FrameLoader.cpp:
2884         (WebCore::FrameLoader::didExplicitOpen):
2885         * loader/FrameLoaderClient.h:
2886
2887 2019-04-15  Eike Rathke  <erack@redhat.com>
2888
2889         Fix logic flow for error log
2890         https://bugs.webkit.org/show_bug.cgi?id=196933
2891
2892         Reviewed by Alexey Proskuryakov.
2893
2894         Missing block braces logged an error always, not just
2895         if (actionIfInvalid == Complain).
2896
2897         * html/HTMLMediaElement.cpp:
2898         (WebCore::HTMLMediaElement::isSafeToLoadURL):
2899
2900 2019-04-15  Myles C. Maxfield  <mmaxfield@apple.com>
2901
2902         [Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
2903         https://bugs.webkit.org/show_bug.cgi?id=196846
2904         <rdar://problem/49499971>
2905
2906         Reviewed by Simon Fraser and Darin Adler.
2907
2908         When adding the special codepath for system-ui to behave as an entire list of fonts rather than a single item,
2909         I never added a cache for the FontPlatformData objects that codepath creates. The non-system-ui codepath already
2910         has a cache in fontPlatformDataCache() in FontCache.cpp.
2911
2912         This patch causes a 16.8x performance improvement on the attached benchmark.
2913
2914         Test: PerformanceTests/Layout/system-ui-rebuild-emoji.html
2915
2916         * page/cocoa/MemoryReleaseCocoa.mm:
2917         (WebCore::platformReleaseMemory):
2918         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2919         (WebCore::invalidateFontCache):
2920         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2921         (WebCore::FontFamilySpecificationKey::FontFamilySpecificationKey):
2922         (WebCore::FontFamilySpecificationKey::operator== const):
2923         (WebCore::FontFamilySpecificationKey::operator!= const):
2924         (WebCore::FontFamilySpecificationKey::isHashTableDeletedValue const):
2925         (WebCore::FontFamilySpecificationKey::computeHash const):
2926         (WebCore::FontFamilySpecificationKeyHash::hash):
2927         (WebCore::FontFamilySpecificationKeyHash::equal):
2928         (WebCore::fontMap):
2929         (WebCore::clearFontFamilySpecificationCoreTextCache):
2930         (WebCore::FontFamilySpecificationCoreText::fontRanges const):
2931         * platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
2932         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2933         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2934         (WebCore::safeCFEqual): Deleted.
2935
2936 2019-04-15  Devin Rousso  <drousso@apple.com>
2937
2938         Web Inspector: fake value descriptors for promises add a catch handler, preventing "rejectionhandled" events from being fired
2939         https://bugs.webkit.org/show_bug.cgi?id=196484
2940         <rdar://problem/49114725>
2941
2942         Reviewed by Joseph Pecoraro.
2943
2944         Test: inspector/runtime/promise-native-getter.html
2945
2946         Mark errors created from getters as being `isNativeGetterTypeError`.
2947
2948         * bindings/js/JSDOMExceptionHandling.cpp:
2949         (WebCore::throwGetterTypeError):
2950         (WebCore::rejectPromiseWithGetterTypeError):
2951         (WebCore::rejectPromiseWithThisTypeError):
2952
2953         * bindings/js/JSDOMGlobalObject.cpp:
2954         (WebCore::makeGetterTypeErrorForBuiltins):
2955
2956         * bindings/js/JSDOMPromiseDeferred.h:
2957         * bindings/js/JSDOMPromiseDeferred.cpp:
2958         (WebCore::createRejectedPromiseWithTypeError):
2959
2960         * Modules/streams/WritableStream.js:
2961         (getter.closed):
2962         (getter.ready):
2963
2964 2019-04-15  Jer Noble  <jer.noble@apple.com>
2965
2966         Add a DiagnosticLogging method taking an arbitrary dictionary of values.
2967         https://bugs.webkit.org/show_bug.cgi?id=196773
2968
2969         Reviewed by Alex Christensen.
2970
2971         * page/DiagnosticLoggingClient.h:
2972
2973 2019-04-15  Justin Fan  <justin_fan@apple.com>
2974
2975         Let WTF::convertSafely deduce types from arguments.
2976
2977         Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.
2978
2979         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2980         (WebCore::GPUBuffer::tryCreate):
2981         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
2982         (WebCore::GPUCommandBuffer::copyBufferToTexture):
2983         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
2984         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2985         (WebCore::trySetInputStateForPipelineDescriptor):
2986
2987 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
2988
2989         Throw TypeError when custom element constructor returns a wrong element or tries to create itself
2990         https://bugs.webkit.org/show_bug.cgi?id=196892
2991
2992         Reviewed by Dean Jackson.
2993
2994         Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
2995         implementation for https://github.com/whatwg/html/pull/4525.
2996
2997         Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
2998                imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html
2999
3000         * bindings/js/JSCustomElementInterface.cpp:
3001         (WebCore::JSCustomElementInterface::upgradeElement):
3002         * bindings/js/JSHTMLElementCustom.cpp:
3003         (WebCore::constructJSHTMLElement):
3004
3005 2019-04-15  Don Olmstead  <don.olmstead@sony.com>
3006
3007         [CMake] WebCore derived sources should only be referenced inside WebCore
3008         https://bugs.webkit.org/show_bug.cgi?id=196904
3009
3010         Reviewed by Konstantin Tokarev.
3011
3012         Use WebCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_WEBCORE_DIR.
3013
3014         * CMakeLists.txt:
3015         * PlatformGTK.cmake:
3016         * PlatformWin.cmake:
3017         * WebCoreMacros.cmake:
3018
3019 2019-04-15  John Wilander  <wilander@apple.com>
3020
3021         Send delayed Ad Click Attribution conversion requests to the click source
3022         https://bugs.webkit.org/show_bug.cgi?id=196838
3023         <rdar://problem/47650157>
3024
3025         Reviewed by Chris Dumez and Youenn Fablet.
3026
3027         WebCore::AdClickAttribution now:
3028         - Sets m_earliestTimeToSend correctly based on WallTime::now().
3029         - Allows for a test override of the base URL for conversions.
3030         - Holds state for whether or not a conversion request has been sent.
3031         - Outputs m_earliestTimeToSend and m_conversion->hasBeenSent in toString().
3032         - Returns m_earliestTimeToSend as a result of a call to
3033         convertAndGetEarliestTimeToSend() which used to be called setConversion().
3034
3035         Test: http/tests/adClickAttribution/send-attribution-conversion-request.html
3036
3037         * loader/AdClickAttribution.cpp:
3038         (WebCore::AdClickAttribution::convertAndGetEarliestTimeToSend):
3039         (WebCore::AdClickAttribution::url const):
3040         (WebCore::AdClickAttribution::urlForTesting const):
3041         (WebCore::AdClickAttribution::markConversionAsSent):
3042         (WebCore::AdClickAttribution::wasConversionSent const):
3043         (WebCore::AdClickAttribution::toString const):
3044         (WebCore::AdClickAttribution::setConversion): Deleted.
3045             Renamed convertAndGetEarliestTimeToSend().
3046         * loader/AdClickAttribution.h:
3047         (WebCore::AdClickAttribution::Conversion::Conversion):
3048         (WebCore::AdClickAttribution::Conversion::encode const):
3049         (WebCore::AdClickAttribution::Conversion::decode):
3050         * platform/Timer.h:
3051             Now exports nextFireInterval.
3052
3053 2019-04-15  Chris Dumez  <cdumez@apple.com>
3054
3055         Regression(r237903) Speedometer 2 is 1-2% regressed on iOS
3056         https://bugs.webkit.org/show_bug.cgi?id=196841
3057         <rdar://problem/45957016>
3058
3059         Reviewed by Myles C. Maxfield.
3060
3061         Speedometer 2 content does not use the text-underline-offset and text-decoration-thickness
3062         features that were added in r237903 so I looked for behavior changes in the context of
3063         Speedometer from r237903. I found that RenderStyle::changeAffectsVisualOverflow() started
3064         returning true a lot more often after r237903. The reason is that r237903 dropped the
3065         visualOverflowForDecorations() checks in this method and started returning true a lot
3066         more as a result.
3067
3068         To restore previous behavior, this patch adds back the visualOverflowForDecorations() checks
3069         that were dropped in r237903. I have verified that with this patch,
3070         RenderStyle::changeAffectsVisualOverflow() returns true as many times as it used to before
3071         r237903.
3072
3073         * rendering/style/RenderStyle.cpp:
3074         (WebCore::RenderStyle::changeAffectsVisualOverflow const):
3075
3076 2019-04-15  Said Abou-Hallawa  <said@apple.com>
3077
3078         ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element
3079         https://bugs.webkit.org/show_bug.cgi?id=196895
3080
3081         Reviewed by Darin Adler.
3082
3083         When cloning elements to the shadow tree of an SVGUseElement, the
3084         corresponding element links are set from the clones to the originals.
3085         Later some of the elements may be disallowed to exist in the shadow tree.
3086         For example the SVGPatternElement is disallowed and has to be removed 
3087         even after cloning. The problem is the corresponding elements are not
3088         reset to null. Usually this is not a problem because the removed elements
3089         will be deleted and the destructor of SVGElement will reset the corresponding
3090         element links. However in some cases, the cloned element is referenced
3091         from another SVGElement, for example the target of a SVGTRefElement. In
3092         this case the clone won't be deleted but it will be linked to the original
3093         and the event listeners won't be copied from the original. When the
3094         original is deleted, its event listeners have to be removed. The event
3095         listeners of the clones also ave to be removed. But because the event
3096         listeners of the original were not copied when cloning, the assertion in
3097         SVGElement::removeEventListener() fires.
3098
3099         Test: svg/custom/use-disallowed-element-clear-corresponding-element.html
3100
3101         * svg/SVGUseElement.cpp:
3102         (WebCore::disassociateAndRemoveClones):
3103
3104 2019-04-15  Devin Rousso  <drousso@apple.com>
3105
3106         Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute
3107         https://bugs.webkit.org/show_bug.cgi?id=196556
3108         <rdar://problem/49570681>
3109
3110         Reviewed by Timothy Hatcher.
3111
3112         Test: inspector/dom-debugger/attribute-modified-style.html
3113
3114         * css/PropertySetCSSStyleDeclaration.h:
3115         * css/PropertySetCSSStyleDeclaration.cpp:
3116         (WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope):
3117         (WebCore::InlineCSSStyleDeclaration::willMutate): Added.
3118
3119         * dom/StyledElement.cpp:
3120         (WebCore::StyledElement::styleAttributeChanged):
3121         (WebCore::StyledElement::inlineStyleChanged):
3122
3123         * inspector/InspectorInstrumentation.h:
3124         (WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added.
3125         (WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
3126         * inspector/InspectorInstrumentation.cpp:
3127         (WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added.
3128         (WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):
3129
3130         * inspector/agents/InspectorDOMAgent.h:
3131         * inspector/agents/InspectorDOMAgent.cpp:
3132         (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
3133
3134         * inspector/agents/InspectorDOMDebuggerAgent.h:
3135         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
3136         (WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added.
3137         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted.
3138
3139 2019-04-15  Devin Rousso  <drousso@apple.com>
3140
3141         Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
3142         https://bugs.webkit.org/show_bug.cgi?id=196887
3143         <rdar://problem/49870627>
3144
3145         Reviewed by Timothy Hatcher.
3146
3147         Test: inspector/dom/event-listener-add-remove.html
3148               inspector/dom/event-listener-inspected-node.html
3149
3150         * inspector/agents/InspectorDOMAgent.h:
3151         * inspector/agents/InspectorDOMAgent.cpp:
3152         (WebCore::InspectorDOMAgent::getEventListenersForNode):
3153         (WebCore::InspectorDOMAgent::setInspectedNode):
3154         (WebCore::InspectorDOMAgent::didAddEventListener):
3155         (WebCore::InspectorDOMAgent::willRemoveEventListener):
3156
3157 2019-04-15  Antoine Quint  <graouts@apple.com>
3158
3159         Ensure iOS layout traits are used for media controls in modern compatibility mode
3160         https://bugs.webkit.org/show_bug.cgi?id=196812
3161         <rdar://problem/47460637>
3162
3163         Unreviewed. Speculative fix for test regressions on open-source bots.
3164
3165         * Modules/modern-media-controls/media/media-controller.js:
3166         (MediaController.prototype.get layoutTraits):
3167
3168 2019-04-11  Antoine Quint  <graouts@apple.com>
3169
3170         Ensure iOS layout traits are used for media controls in modern compatibility mode
3171         https://bugs.webkit.org/show_bug.cgi?id=196812
3172         <rdar://problem/47460637>
3173
3174         Reviewed by Dean Jackson.
3175
3176         Test: media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html
3177
3178         Instead of looking at the UA string, check whether we support touches which is the correct indicator of whether we should
3179         be using the iOS layout traits for media controls.
3180
3181         * Modules/modern-media-controls/media/media-controller.js:
3182         (MediaController.prototype.get layoutTraits):
3183
3184 2019-04-14  Rob Buis  <rbuis@igalia.com>
3185
3186         Link prefetch not useful for top-level navigation
3187         https://bugs.webkit.org/show_bug.cgi?id=195623
3188
3189         Reviewed by Youenn Fablet.
3190
3191         Cache cross-domain top-level prefetches in a dedicated cache and not in the
3192         memory cache. Ignore prefetches for content extension checks.
3193
3194         Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
3195                http/tests/cache/link-prefetch-main-resource.html
3196
3197         * loader/LinkLoader.cpp:
3198         (WebCore::LinkLoader::prefetchIfNeeded):
3199         * loader/ResourceLoadInfo.cpp:
3200         (WebCore::toResourceType):
3201         * loader/ResourceLoadInfo.h:
3202         * loader/ResourceLoader.cpp:
3203         (WebCore::ResourceLoader::willSendRequestInternal):
3204         * loader/cache/CachedResourceLoader.cpp:
3205         (WebCore::CachedResourceLoader::requestResource):
3206
3207 2019-04-14  Dean Jackson  <dino@apple.com>
3208
3209         Extract UTI mapping and allow for additions
3210         https://bugs.webkit.org/show_bug.cgi?id=196822
3211         <rdar://problem/49822339>
3212
3213         Reviewed by Darin Adler
3214
3215         Post landing feedback on minimizing String constructors.
3216
3217         * platform/network/mac/UTIUtilities.mm:
3218         (WebCore::MIMETypeFromUTITree):
3219         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
3220
3221 2019-04-14  Don Olmstead  <don.olmstead@sony.com>
3222
3223         [CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
3224         https://bugs.webkit.org/show_bug.cgi?id=196742
3225
3226         Reviewed by Konstantin Tokarev.
3227
3228         Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
3229
3230         * CMakeLists.txt:
3231
3232 2019-04-12  Antoine Quint  <graouts@apple.com>
3233
3234         Provide a quirk to disable Pointer Events
3235         https://bugs.webkit.org/show_bug.cgi?id=196877
3236         <rdar://problem/49863470>
3237
3238         Reviewed by Dean Jackson.
3239
3240         Add a quirk to disable Pointer Events. We also opt a website that has compatibility issues with Pointer Events into this new quirk.
3241
3242         * dom/PointerEvent.idl:
3243         * page/Quirks.cpp:
3244         (WebCore::Quirks::shouldDisablePointerEventsQuirk const):
3245         * page/Quirks.h:
3246         * page/scrolling/ScrollingCoordinator.cpp:
3247         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
3248         * style/StyleTreeResolver.cpp:
3249         (WebCore::Style::TreeResolver::resolveElement):
3250
3251 2019-04-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3252
3253         Enable modern compatibility mode by default in WKWebView on some devices
3254         https://bugs.webkit.org/show_bug.cgi?id=196883
3255         <rdar://problem/49864527>
3256
3257         Reviewed by Tim Horton.
3258
3259         Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring
3260         compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with
3261         a bundle ID that begins with "com.apple.".
3262
3263         * platform/RuntimeApplicationChecks.h:
3264         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3265         (WebCore::setApplicationBundleIdentifier):
3266         (WebCore::applicationBundleStartsWith):
3267         (WebCore::IOSApplication::isAppleApplication):
3268
3269 2019-04-12  Justin Fan  <justin_fan@apple.com>
3270
3271         [Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
3272         https://bugs.webkit.org/show_bug.cgi?id=196793
3273
3274         Reviewed by Darin Adler.
3275
3276         On 32-bit platforms, NSUInteger is 32-bit, which limits certain Web GPU parameters. 
3277         Ensure that valid parameters are properly converted to NSUInteger for Metal calls, regardless of platform.
3278
3279         * platform/graphics/gpu/GPUBuffer.h:
3280         (WebCore::GPUBuffer::byteLength const):
3281         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
3282         (WebCore::tryGetResourceAsBufferBinding):
3283         (WebCore::setBufferOnEncoder):
3284         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3285         (WebCore::GPUBuffer::validateBufferUsage):
3286         (WebCore::GPUBuffer::tryCreate):
3287         (WebCore::GPUBuffer::GPUBuffer):
3288         (WebCore::GPUBuffer::setSubData):
3289         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3290         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
3291         (WebCore::GPUCommandBuffer::copyBufferToTexture):
3292         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
3293         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3294         (WebCore::GPURenderPassEncoder::drawIndexed):
3295         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3296         (WebCore::trySetInputStateForPipelineDescriptor):
3297
3298 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
3299
3300         Unreviewed fix for non-unified build.
3301
3302         * dom/ScriptedAnimationController.h:
3303         Add missing include from r244182.
3304
3305 2019-04-11  Ryosuke Niwa  <rniwa@webkit.org>
3306
3307         WebThread should run at a higher priority than user initiated
3308         https://bugs.webkit.org/show_bug.cgi?id=196849
3309         <rdar://problem/46851062>
3310
3311         Reviewed by Geoffrey Garen.
3312
3313         Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
3314         won't wait for other threads with priority 30-37 but does not content with the main thread.
3315
3316         Also removed the call to pthread_attr_setschedparam which disables QoS.
3317
3318         This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
3319         iBooks to an opened book.
3320
3321         * platform/ios/wak/WebCoreThread.mm:
3322         (StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
3323
3324 2019-04-12  Ryosuke Niwa  <rniwa@webkit.org>
3325
3326         Add CSS Shadow Parts as a feature under consideration
3327         https://bugs.webkit.org/show_bug.cgi?id=196835
3328
3329         Reviewed by Antti Koivisto.
3330
3331         This feature is under consideration.
3332
3333         * features.json:
3334
3335 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
3336
3337         WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
3338         https://bugs.webkit.org/show_bug.cgi?id=196845
3339
3340         Reviewed by Ryosuke Niwa.
3341
3342         * html/canvas/CanvasRenderingContext2DBase.cpp:
3343         (WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
3344         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
3345         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
3346         (WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
3347         (WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
3348         (WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
3349         (WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
3350         Remove inline specifier to address linking errors (regardless of CMake platform).
3351         Doing this in a .cpp file interferes with symbol creation.
3352
3353         * Modules/mediastream/MediaStreamTrack.cpp:
3354         * Modules/webvr/VREyeParameters.cpp:
3355         * Modules/webvr/VRFrameData.cpp:
3356         * Modules/webvr/VRPose.cpp:
3357         * accessibility/AccessibilityList.cpp:
3358         * accessibility/isolatedtree/AXIsolatedTree.cpp:
3359         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
3360         * bindings/js/JSDOMConvertWebGL.cpp:
3361         * bindings/js/JSHistoryCustom.cpp:
3362         * bindings/js/JSIDBCursorWithValueCustom.cpp:
3363         * bindings/js/JSPerformanceObserverCustom.cpp:
3364         * bindings/js/WindowProxy.cpp:
3365         * platform/ColorData.gperf:
3366         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3367         * platform/network/DNSResolveQueue.cpp:
3368         * workers/service/ServiceWorkerClientQueryOptions.h:
3369         * workers/service/ServiceWorkerContainer.cpp:
3370         Add missing includes to address compiler errors on GTK.
3371
3372 2019-04-12  Zalan Bujtas  <zalan@apple.com>
3373
3374         REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
3375         https://bugs.webkit.org/show_bug.cgi?id=196789
3376         <rdar://problem/49855255>
3377
3378         Reviewed by Tim Horton.
3379
3380         Disable auto-sizing mode at the start of each test.
3381
3382         * testing/Internals.cpp:
3383         (WebCore::Internals::resetToConsistentState):
3384
3385 2019-04-12  Eric Carlson  <eric.carlson@apple.com>
3386
3387         Update AudioSession route sharing policy
3388         https://bugs.webkit.org/show_bug.cgi?id=196776
3389         <rdar://problem/46501611>
3390
3391         Reviewed by Jer Noble.
3392
3393         No new tests, updated an API test.
3394
3395         * platform/audio/AudioSession.cpp:
3396         (WebCore::convertEnumerationToString):
3397         * platform/audio/AudioSession.h:
3398         (WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
3399         (WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
3400         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3401         (MediaSessionManagerCocoa::updateSessionState):
3402         * platform/audio/ios/AudioSessionIOS.mm:
3403         (WebCore::AudioSession::setCategory):
3404         (WebCore::AudioSession::routeSharingPolicy const):
3405         * platform/audio/mac/AudioSessionMac.cpp:
3406         (WebCore::AudioSession::setCategory):
3407
3408 2019-04-12  Antoine Quint  <graouts@apple.com>
3409
3410         Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
3411         https://bugs.webkit.org/show_bug.cgi?id=196830
3412         <rdar://problem/49124313>
3413
3414         Reviewed by Wenson Hsieh.
3415
3416         We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
3417         simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
3418         document to see if it matches some known websites that require this quirk.
3419
3420         We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
3421         flag to ensure we correctly created touch regions for simulated mouse events.
3422
3423         * dom/EventNames.h:
3424         (WebCore::EventNames::isTouchRelatedEventType const):
3425         * dom/Node.cpp:
3426         (WebCore::Node::moveNodeToNewDocument):
3427         (WebCore::tryAddEventListener):
3428         (WebCore::tryRemoveEventListener):
3429         (WebCore::Node::defaultEventHandler):
3430         * loader/DocumentLoader.h:
3431         (WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
3432         (WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
3433         * page/DOMWindow.cpp:
3434         (WebCore::DOMWindow::addEventListener):
3435         (WebCore::DOMWindow::removeEventListener):
3436         * page/Quirks.cpp:
3437         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
3438         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
3439         * page/Quirks.h:
3440
3441 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
3442
3443         [iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
3444         https://bugs.webkit.org/show_bug.cgi?id=196146
3445
3446         Reviewed by Antti Koivisto.
3447         
3448         computeCoordinatedPositioningForLayer() failed to handle nested positions elements
3449         inside overflow scroll, because it only walked up to the first containing block of
3450         a nested position:absolute. We need to walk all the way up the ancestor layer chain,
3451         looking at containing block, scroller and composited ancestor relationships.
3452
3453         Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
3454         trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
3455         more ancestor traversals, but we now only run this code if there's composited scrolling
3456         in the ancestor chain.
3457
3458         Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
3459                scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
3460                scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
3461                scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
3462
3463         * rendering/RenderLayerCompositor.cpp:
3464         (WebCore::enclosingCompositedScrollingLayer):
3465         (WebCore::isScrolledByOverflowScrollLayer):
3466         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
3467         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
3468         (WebCore::collectStationaryLayerRelatedOverflowNodes):
3469         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
3470         (WebCore::collectRelatedCoordinatedScrollingNodes):
3471         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.
3472
3473 2019-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
3474
3475         [css-flex][css-grid] Fix synthesized baseline
3476         https://bugs.webkit.org/show_bug.cgi?id=196312
3477
3478         Reviewed by Javier Fernandez.
3479
3480         When a flex or grid container has no baseline,
3481         its baseline should be synthesized from the border edges.
3482         The same happens for flex and grid items.
3483         
3484         Right now we were using the content box in some cases
3485         and even using the margin box in a particular scenario.
3486         The patch fixes this.
3487         
3488         At the same time this is also fixing the baseline for
3489         inline flex/grid containers to make it interoperable with Firefox.
3490         Inline blocks have a special behavior per legacy reasons,
3491         which applies to inline flex/grid containers when they have no items;
3492         otherwise the items should be used to compute its baseline.
3493         See more at: https://github.com/w3c/csswg-drafts/issues/3416
3494
3495         Note that we need to keep current behavior for buttons,
3496         as the flexbox spec doesn't apply to them.
3497
3498         Tests: css3/flexbox/flexbox-baseline-margins.html
3499                fast/css-grid-layout/grid-baseline-margins-1.html
3500                fast/css-grid-layout/grid-baseline-margins-2.html
3501                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
3502                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
3503                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html
3504
3505         * rendering/RenderButton.cpp:
3506         (WebCore::synthesizedBaselineFromContentBox):
3507         (WebCore::RenderButton::baselinePosition const):
3508         * rendering/RenderButton.h:
3509         * rendering/RenderFlexibleBox.cpp:
3510         (WebCore::synthesizedBaselineFromBorderBox):
3511         (WebCore::RenderFlexibleBox::baselinePosition const):
3512         (WebCore::RenderFlexibleBox::firstLineBaseline const):
3513         (WebCore::RenderFlexibleBox::inlineBlockBaseline const):
3514         * rendering/RenderGrid.cpp:
3515         (WebCore::RenderGrid::baselinePosition const):
3516         (WebCore::RenderGrid::inlineBlockBaseline const):
3517
3518 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
3519
3520         Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
3521         https://bugs.webkit.org/show_bug.cgi?id=196848
3522
3523         Reviewed by Zalan Bujtas.
3524
3525         Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
3526         in the layer tree. We only need to do work related to making positioned scrolling tree nodes
3527         for layers which are layer tree descendants of overflow:scroll.
3528
3529         * rendering/RenderLayer.cpp:
3530         (WebCore::RenderLayer::RenderLayer):
3531         (WebCore::RenderLayer::updateLayerPositions):
3532         (WebCore::outputPaintOrderTreeLegend):
3533         (WebCore::outputPaintOrderTreeRecursive):
3534         * rendering/RenderLayer.h:
3535         * rendering/RenderLayerCompositor.cpp:
3536         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
3537         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
3538         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
3539         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
3540         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
3541
3542 2019-04-11  Zalan Bujtas  <zalan@apple.com>
3543
3544         Try to fix Windows build.
3545
3546         * page/PrintContext.cpp:
3547         (WebCore::PrintContext::computedPageMargin):
3548
3549 2019-04-11  Megan Gardner  <megan_gardner@apple.com>
3550
3551         Update 'Save Image' to more clear instructions
3552         https://bugs.webkit.org/show_bug.cgi?id=196833
3553         <rdar://problem/47446845>
3554
3555         Reviewed by Wenson Hsieh.
3556
3557         Not testable, UI change only.
3558
3559         * en.lproj/Localizable.strings:
3560
3561 2019-04-11  Zalan Bujtas  <zalan@apple.com>
3562
3563         Add @page margin support
3564         https://bugs.webkit.org/show_bug.cgi?id=196680
3565         <rdar://problem/45217707>
3566
3567         Reviewed by Tim Horton.
3568
3569         This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
3570         We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
3571         UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
3572         in the WebProcess if needed (see PrintInfo for current printer margins).
3573
3574         Tests: printing/page-with-10mm-left-margin.html
3575                printing/page-with-zero-margin.html
3576
3577         * page/PrintContext.cpp:
3578         (WebCore::PrintContext::computedPageMargin):
3579         (WebCore::PrintContext::computedPageSize):
3580         * page/PrintContext.h:
3581         * page/RuntimeEnabledFeatures.h:
3582         (WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
3583         (WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):
3584
3585 2019-04-11  Dean Jackson  <dino@apple.com>
3586
3587         Extract UTI mapping and allow for additions
3588         https://bugs.webkit.org/show_bug.cgi?id=196822
3589         <rdar://problem/49822339>
3590
3591         Reviewed by Tim Horton.
3592
3593         Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
3594         of accepted MIME types. And add a new helper to map
3595         MIME types to UTI types when the system was unable to
3596         find an existing type.
3597
3598         * platform/MIMETypeRegistry.cpp:
3599         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
3600         * platform/network/mac/UTIUtilities.mm:
3601         (WebCore::UTIFromUnknownMIMEType):
3602         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
3603
3604 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
3605
3606         [iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
3607         https://bugs.webkit.org/show_bug.cgi?id=196670
3608
3609         Reviewed by Wenson Hsieh.
3610
3611         The bug was ultimately caused by two reasons:
3612          1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
3613          2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.
3614
3615         When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
3616         and then previousWordPositionBoundary would identify it as a word boundary.
3617
3618         Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
3619         character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
3620         to make SimplifiedBackwardsTextIterator directly testable in layout tests.
3621
3622         This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
3623         In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
3624         which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
3625         of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
3626         the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
3627         granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
3628         with sentence granularity at the beginning of a line as indicated by the new tests.
3629
3630         Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
3631                editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
3632                editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
3633                editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
3634                editing/text-iterator/backwards-text-iterator-basic.html
3635
3636         * accessibility/AXObjectCache.cpp:
3637         (WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
3638         the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
3639         an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
3640         (WebCore::AXObjectCache::startCharacterOffsetOfSentence):
3641         * accessibility/AXObjectCache.h:
3642         (WebCore::CharacterOffset::isEqual const):
3643         * editing/TextIterator.cpp:
3644         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
3645         lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
3646         of a line fails on iOS.
3647         (WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
3648         * editing/TextIterator.h:
3649         * editing/VisibleUnits.cpp:
3650         (WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
3651         This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
3652         Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
3653         the current position, and fixed a bug that an early return for the text node was not taking the suffix length
3654         into account when deciding whether next position resides in the starting container node or not.
3655         (WebCore::startSentenceBoundary):
3656         (WebCore::startOfSentence):
3657         * testing/Internals.cpp:
3658         (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Added.
3659         * testing/Internals.h:
3660         * testing/Internals.idl:
3661
3662 2019-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3663
3664         Allow the MediaSource API to be enabled via website policy
3665         https://bugs.webkit.org/show_bug.cgi?id=196429
3666         <rdar://problem/48774333>
3667
3668         Reviewed by Tim Horton.
3669
3670         Add support in DocumentLoader for adjusting page settings using its per-site policies. See WebKit ChangeLog for
3671         more detail (in particular, the implementation of applyToDocumentLoader).
3672
3673         Test: fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html
3674
3675         * loader/DocumentLoader.cpp:
3676         (WebCore::DocumentLoader::applyPoliciesToSettings const):
3677         (WebCore::DocumentLoader::attachToFrame):
3678         * loader/DocumentLoader.h:
3679
3680         Add an enum class for MediaSource policies; while we're at it, make all of these enum values 8 bits wide.
3681
3682         (WebCore::DocumentLoader::mediaSourcePolicy const):
3683         (WebCore::DocumentLoader::setMediaSourcePolicy):
3684
3685 2019-04-11  Youenn Fablet  <youenn@apple.com>
3686
3687         Support RTCDataChannel blob binaryType
3688         https://bugs.webkit.org/show_bug.cgi?id=196821
3689
3690         Reviewed by Eric Carlson.
3691
3692         Add support for receiving blobs.
3693         Default value is still left to 'arraybuffer' which is not spec compliant.
3694         Covered by rebased test.
3695
3696         * Modules/mediastream/RTCDataChannel.cpp:
3697         (WebCore::RTCDataChannel::setBinaryType):
3698         (WebCore::RTCDataChannel::didReceiveRawData):
3699
3700 2019-04-11  Devin Rousso  <drousso@apple.com>
3701
3702         Web Inspector: Timelines: can't reliably stop/start a recording
3703         https://bugs.webkit.org/show_bug.cgi?id=196778
3704         <rdar://problem/47606798>
3705
3706         Reviewed by Timothy Hatcher.
3707
3708         * inspector/agents/InspectorTimelineAgent.cpp:
3709         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
3710         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
3711         It is possible to determine when programmatic capturing starts/stops in the frontend based
3712         on the state when the backend causes the state to change, such as if the state is "inactive"
3713         when the frontend is told that the backend has started capturing.
3714
3715         * inspector/agents/InspectorCPUProfilerAgent.cpp:
3716         (WebCore::InspectorCPUProfilerAgent::stopTracking):
3717         * inspector/agents/InspectorMemoryAgent.cpp:
3718         (WebCore::InspectorMemoryAgent::stopTracking):
3719         Send an end timestamp to match other instruments.
3720
3721 2019-04-11  Truitt Savell  <tsavell@apple.com>
3722
3723         Unreviewed, rolling out r244158.
3724
3725         Casued 8 inspector/timeline/ test failures.
3726
3727         Reverted changeset:
3728
3729         "Web Inspector: Timelines: can't reliably stop/start a
3730         recording"
3731         https://bugs.webkit.org/show_bug.cgi?id=196778
3732         https://trac.webkit.org/changeset/244158
3733
3734 2019-04-11  Pablo Saavedra  <psaavedra@igalia.com>
3735
3736         [WPE] Build error with ENABLE_VIDEO=OFF after r244078
3737         https://bugs.webkit.org/show_bug.cgi?id=196811
3738
3739         createGenericCue() is only defined when VIDEO_TRACK is enabled.
3740
3741         Reviewed by Eric Carlson.
3742
3743         * testing/Internals.cpp:
3744         (WebCore::Internals::createGenericCue):
3745         * testing/Internals.h:
3746
3747 2019-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3748
3749         [GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
3750         https://bugs.webkit.org/show_bug.cgi?id=146718
3751         <rdar://problem/21722487>
3752
3753         Reviewed by Joanmarie Diggs.
3754
3755         Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
3756         aria-hidden="false".
3757
3758         Fixes: accessibility/aria-hidden-false-works-in-subtrees.html
3759
3760         * accessibility/AccessibilityNodeObject.cpp:
3761         (WebCore::AccessibilityNodeObject::textUnderElement const):
3762         * accessibility/atk/WebKitAccessible.cpp:
3763         (roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
3764         <div role="roup">test</div>.
3765
3766 2019-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
3767
3768         requestAnimationFrame should execute before the next frame
3769         https://bugs.webkit.org/show_bug.cgi?id=177484
3770
3771         Reviewed by Simon Fraser.
3772
3773         This change fixes these issues with animation timing:
3774
3775         1. Calling the requestAnimationFrame callbacks would have happened when
3776            the DisplayLink fires. This may have happened even if the frame is
3777            missed and no display is committed.
3778
3779         2. Style changes and layout triggered by script could trigger painting
3780            at more than 60fps. CoreAnimation commits could happen at more than
3781            60fps, although WindowServer will throttle those, and only some will
3782            be shown on the screen.
3783
3784         This change introduces a new paint scheduling model where painting is
3785         driven by a "RenderingUpdateScheduler", which only triggers paints once
3786         per 16.7ms frame.
3787
3788         Code that previously scheduled a compositing layer flush now schedules a
3789         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
3790         callback. When the render happens, we service requestAnimationFrame callbacks,
3791         Web Animations, intersection observations and resize observations per the
3792         "Update the rendering" step of the HTML Event Loop specification:
3793         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
3794
3795         In the future, more rendering steps will be added to this code.
3796
3797         * Sources.txt:
3798         * WebCore.xcodeproj/project.pbxproj:
3799         * accessibility/mac/AXObjectCacheMac.mm:
3800         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
3801         Fix layout tests by adding null check.
3802
3803         * animation/DocumentAnimationScheduler.cpp: Removed.
3804         * animation/DocumentAnimationScheduler.h: Removed.
3805         * animation/DocumentTimeline.cpp:
3806         (WebCore::DocumentTimeline::DocumentTimeline):
3807         (WebCore::DocumentTimeline::updateThrottlingState):
3808         (WebCore::DocumentTimeline::suspendAnimations):
3809         (WebCore::DocumentTimeline::resumeAnimations):
3810         (WebCore::DocumentTimeline::liveCurrentTime const):
3811         (WebCore::DocumentTimeline::currentTime):
3812         (WebCore::DocumentTimeline::cacheCurrentTime):
3813         (WebCore::DocumentTimeline::animationTimingDidChange):
3814         (WebCore::DocumentTimeline::scheduleAnimationResolution):
3815         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
3816         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
3817         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
3818         (WebCore::DocumentTimeline::scheduleNextTick):
3819         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
3820         Simplify this function by handling the case of no-animations separately.
3821
3822         (WebCore::DocumentTimeline::resolveAnimationsForElement):
3823         Simplify the loop and delete hasPendingAcceleratedAnimations because it
3824         is initialized to true and is not changed inside the loop.
3825
3826         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
3827         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
3828         * animation/DocumentTimeline.h:
3829         * dom/Document.cpp:
3830         (WebCore::Document::resolveStyle):
3831         There is no need to force update in resolveStyle(). notifyFlushRequired()
3832         will be called eventually which will scheduleRenderingUpdate().
3833
3834         (WebCore::Document::prepareForDestruction):
3835         (WebCore::Document::updateAnimationsAndSendEvents):
3836         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
3837         (WebCore::Document::windowScreenDidChange):
3838         (WebCore::Document::scheduleRenderingUpdate):
3839         (WebCore::Document::updateIntersectionObservations):
3840         (WebCore::Document::addResizeObserver):
3841         (WebCore::Document::updateResizeObservations):
3842         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
3843         (WebCore::Document::scheduleResizeObservations): Deleted.
3844         (WebCore::Document::animationScheduler): Deleted.
3845         No need to schedule web-animations, intersection observations and resize
3846         observations updates separately. All of them will be updated through the
3847         "Update the rendering" step, i.e. Page::updateRendering().        
3848
3849         * dom/Document.h:
3850         (WebCore::Document::numberOfIntersectionObservers const):
3851         * dom/ScriptedAnimationController.cpp:
3852         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
3853         (WebCore::ScriptedAnimationController::scheduleAnimation):
3854         (WebCore::ScriptedAnimationController::animationTimerFired):
3855         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
3856         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
3857         * dom/ScriptedAnimationController.h:
3858         * page/FrameView.cpp:
3859         (WebCore::FrameView::didLayout):
3860         (WebCore::FrameView::viewportContentsChanged):
3861         * page/FrameViewLayoutContext.cpp:
3862         (WebCore::FrameViewLayoutContext::layoutTimerFired):
3863         * page/IntersectionObserver.cpp:
3864         (WebCore::IntersectionObserver::observe):
3865         * page/Page.cpp:
3866         (WebCore::Page::Page):
3867         (WebCore::Page::layoutIfNeeded):
3868         (WebCore::Page::updateRendering):
3869         (WebCore::Page::renderingUpdateScheduler):
3870         (WebCore::Page::willDisplayPage): Deleted.
3871         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
3872         (WebCore::Page::updateIntersectionObservations): Deleted.
3873         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
3874         (WebCore::Page::hasResizeObservers const): Deleted.
3875         (WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
3876         (WebCore::Page::checkResizeObservations): Deleted.
3877         (WebCore::Page::scheduleResizeObservations): Deleted.
3878         (WebCore::Page::notifyResizeObservers): Deleted.
3879         * page/Page.h:
3880         (WebCore::Page::setNeedsCheckResizeObservations): Deleted.
3881         (WebCore::Page::needsCheckResizeObservations const): Deleted.
3882         The IntersectionObserver and the ResizeObserver do not need to schedule
3883         their own timers. The RenderingUpdateScheduler will schedule the "Update
3884         the rendering" step in which these obverses will be served.
3885
3886         * page/PageOverlayController.cpp:
3887         (WebCore::PageOverlayController::didChangeViewExposedRect):
3888         (WebCore::PageOverlayController::notifyFlushRequired):
3889         Force committing the layers to be 60 fps at maximum.
3890
3891         * page/RenderingUpdateScheduler.cpp: Added.
3892         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
3893         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
3894         (WebCore::RenderingUpdateScheduler::isScheduled const):
3895         (WebCore::RenderingUpdateScheduler::startTimer):
3896         (WebCore::RenderingUpdateScheduler::clearScheduled):
3897         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
3898         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
3899         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
3900         (WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
3901         * page/RenderingUpdateScheduler.h: Added.
3902         (WebCore::RenderingUpdateScheduler::create):
3903         * page/ResizeObserver.cpp:
3904         (WebCore::ResizeObserver::observe):
3905         (WebCore::ResizeObserver::scheduleObservations): Deleted.
3906         * page/ResizeObserver.h:
3907         (WebCore::ResizeObserver::hasActiveObservations const):
3908         * page/ios/ContentChangeObserver.h:
3909         * page/mac/ServicesOverlayController.mm:
3910         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
3911         * page/scrolling/ScrollingStateTree.cpp:
3912         * rendering/RenderLayerCompositor.cpp:
3913         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
3914         (WebCore::RenderLayerCompositor::layerTreeAsText):
3915
3916 2019-04-10  Ryosuke Niwa  <rniwa@webkit.org>
3917
3918         Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
3919         https://bugs.webkit.org/show_bug.cgi?id=193027
3920
3921         Reviewed by Wenson Hsieh.
3922
3923         Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
3924         during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
3925         like removing contenteditable content attribute during DOM mutations or when the destination becomes
3926         disconnected (orphaned) from the document due to bugs elsewhere in the codebase.
3927
3928         Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html
3929
3930         * editing/CompositeEditCommand.cpp:
3931         (WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.
3932
3933 2019-04-10  Devin Rousso  <drousso@apple.com>
3934
3935         Web Inspector: save sheet should be anchored underneath the tab bar when detached
3936         https://bugs.webkit.org/show_bug.cgi?id=196722
3937         <rdar://problem/49613280>
3938
3939         Reviewed by Timothy Hatcher.
3940
3941         No web observable change.
3942
3943         * inspector/InspectorFrontendClient.h:
3944         (WebCore::InspectorFrontendClient::changeSheetRect): Added.
3945
3946         * inspector/InspectorFrontendClientLocal.h:
3947         * inspector/InspectorFrontendClientLocal.cpp:
3948         (WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.
3949
3950         * inspector/InspectorFrontendHost.idl:
3951         * inspector/InspectorFrontendHost.h:
3952         * inspector/InspectorFrontendHost.cpp:
3953         (WebCore::InspectorFrontendHost::setSheetRect): Added.
3954
3955         * testing/Internals.cpp:
3956         (WebCore::InspectorStubFrontend::setSheetRect): Added.
3957
3958 2019-04-10  Devin Rousso  <drousso@apple.com>
3959
3960         Web Inspector: Inspector: lazily create the agent
3961         https://bugs.webkit.org/show_bug.cgi?id=195971
3962         <rdar://problem/49039645>
3963
3964         Reviewed by Joseph Pecoraro.
3965
3966         No change in functionality.
3967
3968         * inspector/InspectorController.h:
3969         * inspector/InspectorController.cpp:
3970         (WebCore::InspectorController::InspectorController):
3971         (WebCore::InspectorController::createLazyAgents):
3972         (WebCore::InspectorController::evaluateForTestInFrontend):
3973         (WebCore::InspectorController::ensureInspectorAgent):
3974
3975 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
3976
3977         Remove unneeded extern C
3978         https://bugs.webkit.org/show_bug.cgi?id=196786
3979
3980         Reviewed by Tim Horton.
3981
3982         No tests needed, just needs to compile.
3983
3984         Removing staging hack for Reveal framework.
3985
3986         * editing/cocoa/DictionaryLookup.mm:
3987
3988 2019-04-10  Devin Rousso  <drousso@apple.com>
3989
3990         Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
3991         https://bugs.webkit.org/show_bug.cgi?id=196725
3992         <rdar://problem/49669810>
3993
3994         Reviewed by Timothy Hatcher.
3995
3996         Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
3997         functions so that callers into `InspectorController` can be guaranteed to have a valid
3998         instance of the agent.
3999
4000         This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
4001         There is no `DOM.enable` command, so there's no issue there either.
4002
4003         * inspector/InspectorController.h:
4004         (WebCore::InspectorController::pageAgent): Deleted.
4005         * inspector/InspectorController.cpp:
4006         (WebCore::InspectorController::createLazyAgents):
4007         (WebCore::InspectorController::inspect):