Finish removing String::format
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-03-01  Darin Adler  <darin@apple.com>
2
3         Finish removing String::format
4         https://bugs.webkit.org/show_bug.cgi?id=194893
5
6         Reviewed by Daniel Bates.
7
8         * dom/Document.cpp:
9         (WebCore::Document::lastModified const): Use makeString and pad.
10         * html/FTPDirectoryDocument.cpp:
11         (WebCore::processFileDateString): Ditto.
12
13         * mathml/MathMLElement.cpp:
14         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
15
16         * page/cocoa/ResourceUsageOverlayCocoa.mm:
17         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
18
19         * page/linux/ResourceUsageOverlayLinux.cpp:
20         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
21         (WebCore::gcTimerString): Use String::number.
22
23         * platform/DateComponents.cpp:
24         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
25         (WebCore::DateComponents::toString const): Ditto.
26
27         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
28         and that was also inaccurate.
29
30         * platform/audio/HRTFElevation.cpp:
31         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
32         Use makeString and pad.
33         * platform/mock/MockRealtimeVideoSource.cpp:
34         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
35         * rendering/RenderLayerCompositor.cpp:
36         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
37         * rendering/RenderTheme.cpp:
38         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
39
40 2019-03-01  Chris Dumez  <cdumez@apple.com>
41
42         Do not attempt to set WAL Journal mode on a readonly SQLite database
43         https://bugs.webkit.org/show_bug.cgi?id=195237
44
45         Reviewed by Simon Fraser.
46
47         This avoids logging errors when opening the database.
48
49         * platform/sql/SQLiteDatabase.cpp:
50         (WebCore::SQLiteDatabase::open):
51         (WebCore::SQLiteDatabase::useWALJournalMode):
52         * platform/sql/SQLiteDatabase.h:
53
54 2019-03-01  Antoine Quint  <graouts@apple.com>
55
56         [iOS] Turn mouse event simulation on by default
57         https://bugs.webkit.org/show_bug.cgi?id=195218
58         <rdar://problem/48516794>
59
60         Reviewed by Dean Jackson.
61
62         * page/RuntimeEnabledFeatures.h:
63
64 2019-03-01  Chris Dumez  <cdumez@apple.com>
65
66         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
67         https://bugs.webkit.org/show_bug.cgi?id=195230
68         <rdar://problem/47925359>
69
70         Reviewed by Ryosuke Niwa.
71
72         Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
73         to address crashes on iOS WK1.
74
75         * platform/network/NetworkStateNotifier.cpp:
76         (WebCore::shouldSuppressThreadSafetyCheck):
77         (WebCore::NetworkStateNotifier::singleton):
78
79 2019-03-01  Simon Fraser  <simon.fraser@apple.com>
80
81         Show mouse event regions in the overlay
82         https://bugs.webkit.org/show_bug.cgi?id=195227
83
84         Reviewed by Tim Horton.
85
86         Enhance event region overlays to show more kinds of events.
87
88         * page/DebugPageOverlays.cpp:
89         (WebCore::touchEventRegionColors):
90         (WebCore::NonFastScrollableRegionOverlay::drawRect):
91
92 2019-03-01  Zalan Bujtas  <zalan@apple.com>
93
94         [ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
95         https://bugs.webkit.org/show_bug.cgi?id=195220
96         <rdar://problem/48518979>
97
98         Reviewed by Simon Fraser.
99
100         didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
101         when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
102         Let's just check if we've got a pending style recalc when the DOM timer comes back.
103
104         Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
105
106         * dom/Document.cpp:
107         (WebCore::Document::scheduleStyleRecalc):
108         * page/ios/ContentChangeObserver.cpp:
109         (WebCore::hasPendingStyleRecalc):
110         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
111         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
112         (WebCore::ContentChangeObserver::startObservingContentChanges):
113         (WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
114         * page/ios/ContentChangeObserver.h:
115         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
116         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
117         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
118
119 2019-03-01  John Wilander  <wilander@apple.com>
120
121         Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
122         https://bugs.webkit.org/show_bug.cgi?id=195196
123         <rdar://problem/48006419>
124
125         Reviewed by Brent Fulgham.
126
127         Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
128                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
129                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
130                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
131                http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
132
133         Trackers abuse link query parameters to transport user identifiers cross-site.
134         This patch detects such navigations and applies further restrictions to
135         client-site cookies on the destination page.
136
137         * platform/network/NetworkStorageSession.cpp:
138         (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
139             Now sets the regular 7-day cap and a reduced 1-day cap.
140         (WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
141             Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
142             NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
143             it now clears out two types of page-specific data.
144         (WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
145             This function receives a cross-site navigation and checks if the originating
146             site is a prevalent resource. If so, it marks the page or stricter cookie
147             rules.
148         (WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
149             Test infrastructure. This sets a state that overrides the regular per-page
150             clear of data. The reason is that the double clear was racy and caused test
151             failures.
152         (WebCore::NetworkStorageSession::clientSideCookieCap const):
153             New function that returns the current cookie lifetime cap.
154         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
155             Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
156         * platform/network/NetworkStorageSession.h:
157         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
158         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
159             Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
160
161 2019-03-01  Rob Buis  <rbuis@igalia.com>
162
163         Adjust XMLHttpRequest Content-Type handling
164         https://bugs.webkit.org/show_bug.cgi?id=184645
165
166         Reviewed by Youenn Fablet.
167
168         Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
169
170         Test: web-platform-tests/xhr/send-content-type-charset.htm
171
172         [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
173
174         * platform/network/ParsedContentType.cpp:
175         (WebCore::ParsedContentType::setCharset):
176         * platform/network/ParsedContentType.h:
177         * xml/XMLHttpRequest.cpp:
178         (WebCore::replaceCharsetInMediaTypeIfNeeded):
179         (WebCore::XMLHttpRequest::send):
180         (WebCore::replaceCharsetInMediaType): Deleted.
181
182 2019-03-01  Youenn Fablet  <youenn@apple.com>
183
184         Update originsMatch to handle the case of file origins which enforce file path separation
185         https://bugs.webkit.org/show_bug.cgi?id=195216
186
187         Reviewed by Brady Eidson.
188
189         Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
190         Make sure originsMatch returns true if either compared origins are the same object
191         or they have the same file path separation behavior.
192
193         * page/SecurityOrigin.cpp:
194         (WebCore::areOriginsMatching):
195         (WebCore::originsMatch):
196
197 2019-03-01  Youenn Fablet  <youenn@apple.com>
198
199         Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
200         https://bugs.webkit.org/show_bug.cgi?id=195213
201
202         Reviewed by Alex Christensen.
203
204         Add traits to enable enum IPC encoding.
205         No change of behavior.
206
207         * Modules/indexeddb/IndexedDB.h:
208
209 2019-03-01  Don Olmstead  <don.olmstead@sony.com>
210
211         [WinCairo] Enable service worker
212         https://bugs.webkit.org/show_bug.cgi?id=188318
213
214         Reviewed by Youenn Fablet.
215
216         * WebCorePrefix.h:
217         * testing/ServiceWorkerInternals.h:
218         * workers/service/context/SWContextManager.cpp:
219         (WebCore::SWContextManager::serviceWorkerFailedToTerminate):
220         * workers/service/context/SWContextManager.h:
221
222 2019-03-01  Sihui Liu  <sihui_liu@apple.com>
223
224         Add a quirk for bostongloble.com and latimes.com
225         https://bugs.webkit.org/show_bug.cgi?id=195155
226
227         Reviewed by Geoffrey Garen.
228
229         Covered by manual testing.
230
231         * Modules/webdatabase/DOMWindowWebDatabase.idl:
232         * bindings/scripts/CodeGeneratorJS.pm:
233         (GenerateRuntimeEnableConditionalString):
234         * bindings/scripts/IDLAttributes.json:
235         * bindings/scripts/preprocess-idls.pl:
236         (GenerateConstructorAttributes):
237         * page/Quirks.cpp:
238         (WebCore::Quirks::hasWebSQLSupportQuirk const):
239         * page/Quirks.h:
240
241 2019-03-01  Zalan Bujtas  <zalan@apple.com>
242
243         [ContentChangeObserver] Rename members and move implementation to header.
244         https://bugs.webkit.org/show_bug.cgi?id=195198
245         <rdar://problem/48499967>
246
247         Reviewed by Simon Fraser.
248
249         * page/ios/ContentChangeObserver.cpp:
250         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
251         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
252         (WebCore::ContentChangeObserver::startObservingStyleRecalc):
253         (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
254         (WebCore::ContentChangeObserver::startObservingContentChanges):
255         (WebCore::ContentChangeObserver::stopObservingContentChanges):
256         (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
257         (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
258         (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
259         (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
260         (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
261         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
262         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
263         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
264         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
265         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
266         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
267         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
268         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
269         (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
270         (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
271         (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
272         * page/ios/ContentChangeObserver.h:
273         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
274         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
275         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
276         (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
277         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
278         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
279         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
280         (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
281         (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
282         (WebCore::ContentChangeObserver::isObservingContentChanges const):
283         (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
284         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
285
286 2019-03-01  Zalan Bujtas  <zalan@apple.com>
287
288         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
289         https://bugs.webkit.org/show_bug.cgi?id=195197
290         <rdar://problem/48498332>
291
292         Reviewed by Simon Fraser.
293
294         Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
295
296         * page/ios/ContentChangeObserver.cpp:
297         (WebCore::ContentChangeObserver::didContentVisibilityChange):
298         (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
299         * page/ios/ContentChangeObserver.h:
300
301 2019-03-01  Jer Noble  <jer.noble@apple.com>
302
303         [EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
304         https://bugs.webkit.org/show_bug.cgi?id=195217
305
306         Reviewed by Eric Carlson.
307
308         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
309         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
310
311 2019-03-01  Justin Fan  <justin_fan@apple.com>
312
313         [Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
314         https://bugs.webkit.org/show_bug.cgi?id=195191
315
316         Rubber-stamped by Dean Jackson.
317
318         Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
319
320         * Configurations/FeatureDefines.xcconfig:
321
322 2019-02-28  Fujii Hironori  <Hironori.Fujii@sony.com>
323
324         HTTPSUpgradeList.db database should be opened in readonly mode
325         https://bugs.webkit.org/show_bug.cgi?id=195194
326         <rdar://problem/47103889>
327
328         Unreviewed build fix for curl.
329
330         * platform/network/curl/CookieJarDB.cpp:
331         (WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
332
333 2019-02-28  Chris Dumez  <cdumez@apple.com>
334
335         Unreviewed Windows build fix after r242251.
336
337         * platform/win/SearchPopupMenuDB.cpp:
338         (WebCore::SearchPopupMenuDB::openDatabase):
339
340 2019-02-28  Zalan Bujtas  <zalan@apple.com>
341
342         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
343         https://bugs.webkit.org/show_bug.cgi?id=195143
344         <rdar://problem/48462351>
345
346         Reviewed by Simon Fraser.
347
348         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
349
350         * page/DOMTimer.cpp:
351         (WebCore::DOMTimer::removeById):
352         * page/DOMWindow.cpp:
353         (WebCore::DOMWindow::clearTimeout):
354         * page/ios/ContentChangeObserver.cpp:
355         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
356         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
357         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
358         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
359         * page/ios/ContentChangeObserver.h:
360
361 2019-02-28  Chris Dumez  <cdumez@apple.com>
362
363         HTTPSUpgradeList.db database should be opened in readonly mode
364         https://bugs.webkit.org/show_bug.cgi?id=195194
365         <rdar://problem/47103889>
366
367         Reviewed by Youenn Fablet.
368
369         Add parameter to SQLiteDatabase::open() to specific the open flags.
370
371         * Modules/webdatabase/Database.cpp:
372         (WebCore::Database::performOpenAndVerify):
373         * platform/sql/SQLiteDatabase.cpp:
374         (WebCore::SQLiteDatabase::open):
375         * platform/sql/SQLiteDatabase.h:
376         * platform/sql/SQLiteFileSystem.cpp:
377         * platform/sql/SQLiteFileSystem.h:
378
379 2019-02-28  Brady Eidson  <beidson@apple.com>
380
381         Followup to:
382         Universal links from Google search results pages don't open the app
383         https://bugs.webkit.org/show_bug.cgi?id=195126
384
385         Unreviewed.
386
387         * page/SecurityOrigin.cpp:
388         (WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
389
390 2019-02-28  Simon Fraser  <simon.fraser@apple.com>
391
392         [iOS] Dark flash when opening Google AMP pages
393         https://bugs.webkit.org/show_bug.cgi?id=195193
394         rdar://problem/48326442
395
396         Reviewed by Zalan Bujtas.
397
398         After the incremental compositing updates changes, it was possible for a change in the size
399         of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
400         a composited descendant that is not a descendant in z-order. When Google search results
401         create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
402         leaving the #222 background of an intermediate element visible.
403
404         Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
405         that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
406         this flag affects all descendants; in future, we might be able to clear it for grand-children.
407
408         Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
409                compositing/geometry/ancestor-clip-change.html
410
411         * rendering/RenderLayer.cpp:
412         (WebCore::RenderLayer::updateLayerPositions):
413         (WebCore::RenderLayer::updateLayerPosition):
414         * rendering/RenderLayer.h:
415         * rendering/RenderLayerBacking.cpp:
416         (WebCore::RenderLayerBacking::updateAfterLayout):
417         * rendering/RenderLayerBacking.h:
418
419 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
420
421         Use-after-move in RenderCombineText::combineTextIfNeeded()
422         https://bugs.webkit.org/show_bug.cgi?id=195188
423
424         Reviewed by Zalan Bujtas.
425
426         r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
427         symptom, but this patch fixes the source of the problem (and reverts r242204).
428
429         The code in RenderCombineText::combineTextIfNeeded() has a bit that’s like:
430
431         FontDescription bestFitDescription;
432         while (...) {
433             FontCascade compressedFont(WTFMove(bestFitDescription), ...);
434             ...
435         }
436
437         Clearly this is wrong.
438
439         Test: fast/text/text-combine-crash-2.html
440
441         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
442         (WebCore::FontDescription::platformResolveGenericFamily):
443         * rendering/RenderCombineText.cpp:
444         (WebCore::RenderCombineText::combineTextIfNeeded):
445
446 2019-02-28  Zalan Bujtas  <zalan@apple.com>
447
448         [ContentChangeObserver] Introduce observer subclasses to scope content change observing.
449         https://bugs.webkit.org/show_bug.cgi?id=195172
450         <rdar://problem/48479259>
451
452         Reviewed by Simon Fraser.
453
454         Let's scope start/stopObserving call pairs.
455
456         * dom/Document.cpp:
457         (WebCore::Document::updateStyleIfNeeded):
458         * page/DOMTimer.cpp:
459         (WebCore::DOMTimer::fired):
460         * page/ios/ContentChangeObserver.cpp:
461         (WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
462         (WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
463         (WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
464         (WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
465         (WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
466         (WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
467         (WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
468         (WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
469         * page/ios/ContentChangeObserver.h:
470         * rendering/updating/RenderTreeUpdater.cpp:
471         (WebCore::RenderTreeUpdater::updateElementRenderer):
472
473 2019-02-28  Antoine Quint  <graouts@apple.com>
474
475         Enable the Pointer Events runtime flag by default
476         https://bugs.webkit.org/show_bug.cgi?id=195156
477
478         Reviewed by Dean Jackson.
479
480         * page/RuntimeEnabledFeatures.h:
481
482 2019-02-28  Zalan Bujtas  <zalan@apple.com>
483
484         [ContentChangeObserver] Make observed state reset explicit.
485         https://bugs.webkit.org/show_bug.cgi?id=195185
486         <rdar://problem/48488342>
487
488         Reviewed by Simon Fraser.
489
490         Use setObservedContentChange only for setting the observed change while observing.
491
492         * page/ios/ContentChangeObserver.cpp:
493         (WebCore::ContentChangeObserver::startObservingContentChanges):
494         (WebCore::ContentChangeObserver::resetObservedContentChange):
495         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
496         * page/ios/ContentChangeObserver.h:
497
498 2019-02-28  Commit Queue  <commit-queue@webkit.org>
499
500         Unreviewed, rolling out r242210.
501         https://bugs.webkit.org/show_bug.cgi?id=195179
502
503         it broke hover menus on losaltosonline.com (Requested by zalan
504         on #webkit).
505
506         Reverted changeset:
507
508         "[ContentChangeObserver] Move timer removal code from
509         DOMWindow::clearTimeout to DOMTimer::removeById"
510         https://bugs.webkit.org/show_bug.cgi?id=195143
511         https://trac.webkit.org/changeset/242210
512
513 2019-02-28  Zalan Bujtas  <zalan@apple.com>
514
515         [ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
516         https://bugs.webkit.org/show_bug.cgi?id=195143
517         <rdar://problem/48462351>
518
519         Reviewed by Simon Fraser.
520
521         Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
522
523         * page/DOMTimer.cpp:
524         (WebCore::DOMTimer::removeById):
525         * page/DOMWindow.cpp:
526         (WebCore::DOMWindow::clearTimeout):
527         * page/ios/ContentChangeObserver.cpp:
528         (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
529         (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
530         (WebCore::ContentChangeObserver::didRemoveDOMTimer):
531         (WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
532         * page/ios/ContentChangeObserver.h:
533
534 2019-02-28  Charles Vazac  <cvazac@akamai.com>
535
536         Fix Resource Timing buffer edge cases for WPT
537         https://bugs.webkit.org/show_bug.cgi?id=193213
538
539         Reviewed by Youenn Fablet.
540
541         Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
542
543         * page/Performance.cpp:
544         (WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
545         resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
546         expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
547         the secondary buffer.
548
549 2019-02-28  Takashi Komori  <Takashi.Komori@sony.com>
550
551         [Curl] HTTP Body is missing with redirection.
552         https://bugs.webkit.org/show_bug.cgi?id=191651
553
554         Reviewed by Don Olmstead.
555
556         Implement updateFromDelegatePreservingOldProperties for curl port.
557
558         Tests: http/tests/navigation/post-301-response.html
559                http/tests/navigation/post-302-response.html
560                http/tests/navigation/post-303-response.html
561                http/tests/navigation/post-307-response.html
562                http/tests/navigation/post-308-response.html
563
564         * platform/Curl.cmake:
565         * platform/network/curl/ResourceRequest.h:
566         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
567         * platform/network/curl/ResourceRequestCurl.cpp: Added.
568         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
569
570 2019-02-28  Carlos Garcia Campos  <cgarcia@igalia.com>
571
572         [CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
573         https://bugs.webkit.org/show_bug.cgi?id=195159
574
575         Reviewed by Don Olmstead.
576
577         Use COORDINATED_GRAPHICS instead.
578
579         * platform/graphics/GraphicsContext3D.h:
580         * platform/graphics/PlatformLayer.h:
581         * platform/graphics/cairo/ImageBufferCairo.cpp:
582         (WebCore::ImageBufferData::ImageBufferData):
583         (WebCore::ImageBufferData::~ImageBufferData):
584         * platform/graphics/cairo/ImageBufferDataCairo.h:
585         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
586         * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
587         * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
588         (Nicosia::GC3DLayer::swapBuffersIfNeeded):
589         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
590         (WebCore::GraphicsContext3D::reshapeFBOs):
591         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
592         (WebCore::GraphicsContext3D::prepareTexture):
593         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
594         (WebCore::GraphicsContext3D::reshapeFBOs):
595         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
596         (WebCore::GraphicsContext3D::GraphicsContext3D):
597         (WebCore::GraphicsContext3D::~GraphicsContext3D):
598         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
599         (WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
600         (WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
601         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
602         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
603         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
604         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
605         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
606         * platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
607         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
608         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
609         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
610         (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
611         * rendering/RenderLayerBacking.cpp:
612         (WebCore::RenderLayerBacking::paintsIntoWindow const):
613         * rendering/RenderLayerCompositor.cpp:
614         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
615
616 2019-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
617
618         Locale names can be nullptr
619         https://bugs.webkit.org/show_bug.cgi?id=195171
620         <rdar://problem/48262376>
621
622         Reviewed by Dean Jackson.
623
624         Nullptr can't be used in keys to HashMaps, so take an early out in this case.
625
626         This is a partial revert of r241288.
627
628         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
629         (WebCore::FontDescription::platformResolveGenericFamily):
630
631 2019-02-28  Justin Fan  <justin_fan@apple.com>
632
633         [Web GPU] Enable Web GPU only on 64-bit
634         https://bugs.webkit.org/show_bug.cgi?id=195139
635
636         Because Metal is only supported on 64 bit apps.
637
638         Unreviewed build fix.
639
640         * Configurations/FeatureDefines.xcconfig:
641
642 2019-02-27  Zalan Bujtas  <zalan@apple.com>
643
644         [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
645         https://bugs.webkit.org/show_bug.cgi?id=195128
646         <rdar://problem/48456752>
647
648         Reviewed by Simon Fraser.
649
650         Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
651
652         * WebCore.xcodeproj/project.pbxproj:
653         * page/ios/ContentChangeObserver.mm:
654         (WebCore::ContentChangeObserver::setObservedContentChange):
655         * platform/ios/wak/WKContentObservation.cpp:
656         (WKSetObservedContentChange):
657         * platform/ios/wak/WKContentObservation.h:
658         * platform/ios/wak/WKContentObservationInternal.h: Removed.
659
660 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
661
662         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
663
664         * dom/Document.cpp:
665         (WebCore::Document::lastModified const):
666         * html/FTPDirectoryDocument.cpp:
667         (WebCore::processFileDateString):
668         * mathml/MathMLElement.cpp:
669         (WebCore::convertToPercentageIfNeeded):
670         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
671         * page/cocoa/ResourceUsageOverlayCocoa.mm:
672         (WebCore::ResourceUsageOverlay::platformDraw):
673         * page/linux/ResourceUsageOverlayLinux.cpp:
674         (WebCore::cpuUsageString):
675         (WebCore::gcTimerString):
676         * platform/DateComponents.cpp:
677         (WebCore::DateComponents::toStringForTime const):
678         (WebCore::DateComponents::toString const):
679         * platform/LocalizedStrings.cpp:
680         (WebCore::localizedString):
681         * platform/audio/HRTFElevation.cpp:
682         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
683         * platform/mock/MockRealtimeVideoSource.cpp:
684         (WebCore::MockRealtimeVideoSource::drawText):
685         * rendering/RenderLayerCompositor.cpp:
686         (WebCore::RenderLayerCompositor::logLayerInfo):
687         * rendering/RenderTheme.cpp:
688         (WebCore::RenderTheme::formatMediaControlsTime const):
689
690 2019-02-27  Zalan Bujtas  <zalan@apple.com>
691
692         [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
693         https://bugs.webkit.org/show_bug.cgi?id=195091
694         <rdar://problem/48427271>
695
696         Reviewed by Tim Horton.
697
698         * page/ios/ContentChangeObserver.h:
699         * page/ios/ContentChangeObserver.mm:
700         (WebCore::ContentChangeObserver::startObservingContentChanges):
701         (WebCore::ContentChangeObserver::stopObservingContentChanges):
702         (WebCore::ContentChangeObserver::isObservingContentChanges):
703         * platform/ios/wak/WKContentObservation.cpp:
704         (WKObservingContentChanges): Deleted.
705         (WKStartObservingContentChanges): Deleted.
706         (WKStopObservingContentChanges): Deleted.
707         * platform/ios/wak/WKContentObservation.h:
708         * platform/ios/wak/WKContentObservationInternal.h:
709
710 2019-02-27  Brady Eidson  <beidson@apple.com>
711
712         Universal links from Google search results pages don't open the app.
713         <rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
714
715         Reviewed by Geoffrey Garen.
716
717         Covered by new API tests.
718
719         * loader/DocumentLoader.cpp:
720         (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
721           an iframe if it is from the same security origin as the main frame.
722
723 2019-02-27  Zalan Bujtas  <zalan@apple.com>
724
725         [ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
726         https://bugs.webkit.org/show_bug.cgi?id=195090
727         <rdar://problem/48426771>
728
729         Reviewed by Tim Horton.
730
731         Also remove some unused functions from WKContentObservationInternal.
732
733         * page/ios/ContentChangeObserver.h:
734         * page/ios/ContentChangeObserver.mm:
735         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
736         (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
737         (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
738         * platform/ios/wak/WKContentObservation.cpp:
739         (WKStartObservingDOMTimerScheduling): Deleted.
740         (WKStopObservingDOMTimerScheduling): Deleted.
741         (WKIsObservingDOMTimerScheduling): Deleted.
742         * platform/ios/wak/WKContentObservation.h:
743         * platform/ios/wak/WKContentObservationInternal.h:
744
745 2019-02-27  Zalan Bujtas  <zalan@apple.com>
746
747         [ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
748         https://bugs.webkit.org/show_bug.cgi?id=195087
749
750         Reviewed by Simon Fraser.
751
752         Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
753
754         * page/ios/ContentChangeObserver.h:
755         * page/ios/ContentChangeObserver.mm:
756         (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
757         (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
758         (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
759         (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
760         (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
761         (WebCore::ContentChangeObserver::setObservedContentChange):
762         * platform/ios/wak/WKContentObservation.cpp:
763         (WKSetObservedContentChange):
764         (WKStartObservingStyleRecalcScheduling): Deleted.
765         (WKStopObservingStyleRecalcScheduling): Deleted.
766         (WKIsObservingStyleRecalcScheduling): Deleted.
767         (WKSetShouldObserveNextStyleRecalc): Deleted.
768         (WKShouldObserveNextStyleRecalc): Deleted.
769         * platform/ios/wak/WKContentObservation.h:
770
771 2019-02-27  Zalan Bujtas  <zalan@apple.com>
772
773         [ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
774         https://bugs.webkit.org/show_bug.cgi?id=195070
775         <rdar://problem/48417650>
776
777         Reviewed by Tim Horton.
778
779         Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
780
781         * page/ios/ContentChangeObserver.h:
782         * page/ios/ContentChangeObserver.mm:
783         (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
784         (WebCore::ContentChangeObserver::countOfObservedDOMTimers):
785         (WebCore::ContentChangeObserver::clearObservedDOMTimers):
786         (WebCore::ContentChangeObserver::setObservedContentChange):
787         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
788         (WebCore::ContentChangeObserver::addObservedDOMTimer):
789         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
790         * platform/ios/wak/WKContentObservation.cpp:
791         (WKStartObservingDOMTimerScheduling):
792         (WKSetObservedContentChange):
793         (WebThreadGetObservedDOMTimers): Deleted.
794         (WebThreadCountOfObservedDOMTimers): Deleted.
795         (WebThreadClearObservedDOMTimers): Deleted.
796         (WebThreadContainsObservedDOMTimer): Deleted.
797         (WebThreadAddObservedDOMTimer): Deleted.
798         (WebThreadRemoveObservedDOMTimer): Deleted.
799         * platform/ios/wak/WKContentObservation.h:
800
801 2019-02-27  Justin Fan  <justin_fan@apple.com>
802         Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
803
804         Unreviewed build fix.
805
806         * Modules/webgpu/WebGPUBuffer.cpp:
807         (WebCore::WebGPUBuffer::setSubData):
808         * Modules/webgpu/WebGPUBuffer.h:
809         * Modules/webgpu/WebGPUBufferBinding.h:
810         * Modules/webgpu/WebGPURenderPassEncoder.idl:
811         * platform/graphics/gpu/GPUBufferBinding.h:
812         * platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
813         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
814
815 2019-02-27  John Wilander  <wilander@apple.com>
816
817         Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
818         https://bugs.webkit.org/show_bug.cgi?id=195071
819         <rdar://problem/48417690>
820
821         Reviewed by Alex Christensen and Brent Fulgham.
822
823         No new tests. This patch maintains functionality covered by plenty of layout
824         tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
825
826         This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
827         and makes the necessary infrastructure changes to support that.
828
829         The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
830         HashSets since we never used the counts for anything. This change simplified
831         encoding and decoding for IPC and will eventually simplify encoding and
832         decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
833         model version 14 and below.
834
835         The patch also makes WebCore::RegistrableDomain's String constructor private.
836         A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
837         is introduced to better signal to users that creating a registrable domain
838         object with a string may create an object that doesn't match a registrable
839         domain in a valid HTTP-family URL. This change (private String constructor)
840         motivated a change in WebCore::AdClickAttribution where the Source and
841         Destination structs now take a URL as parameter instead of a String.
842
843         Finally, this patch harmonizes parameter and variable naming, going from
844         "origin" to "domain" and "mainFrame" to "topFrame."
845
846         * html/HTMLAnchorElement.cpp:
847         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
848         * html/HTMLMediaElement.cpp:
849         (WebCore::HTMLMediaElement::mediaSessionTitle const):
850         * loader/AdClickAttribution.h:
851         (WebCore::AdClickAttribution::Source::Source):
852         (WebCore::AdClickAttribution::Source::deletedValue):
853         (WebCore::AdClickAttribution::Destination::Destination):
854         (WebCore::AdClickAttribution::Destination::deletedValue):
855         (WebCore::AdClickAttribution::decode):
856         * loader/ResourceLoadObserver.cpp:
857         (WebCore::ResourceLoadObserver::logSubresourceLoading):
858         (WebCore::ResourceLoadObserver::logWebSocketLoading):
859         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
860         (WebCore::ResourceLoadObserver::statisticsForURL):
861         (WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
862         * loader/ResourceLoadObserver.h:
863         * loader/ResourceLoadStatistics.cpp:
864         (WebCore::encodeHashSet):
865         (WebCore::ResourceLoadStatistics::encode const):
866         (WebCore::decodeHashCountedSet):
867         (WebCore::decodeHashSet):
868         (WebCore::ResourceLoadStatistics::decode):
869         (WebCore::appendHashSet):
870         (WebCore::ResourceLoadStatistics::toString const):
871         (WebCore::ResourceLoadStatistics::merge):
872         (WebCore::encodeHashCountedSet): Deleted.
873         (WebCore::encodeOriginHashSet): Deleted.
874         (WebCore::decodeOriginHashSet): Deleted.
875         (WebCore::appendHashCountedSet): Deleted.
876         * loader/ResourceLoadStatistics.h:
877         * platform/RegistrableDomain.h:
878         (WebCore::RegistrableDomain::uncheckedCreateFromString):
879         (WebCore::RegistrableDomain::RegistrableDomain):
880         * testing/Internals.cpp:
881         (WebCore::Internals::resourceLoadStatisticsForURL):
882         (WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
883         * testing/Internals.h:
884         * testing/Internals.idl:
885
886 2019-02-27  Justin Fan  <justin_fan@apple.com>
887
888         [Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
889         https://bugs.webkit.org/show_bug.cgi?id=195077
890         <rdar://problem/47805229>
891
892         Reviewed by Dean Jackson.
893
894         Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be 
895         used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
896         update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
897
898         Tests: webgpu/buffer-command-buffer-races.html
899                webgpu/map-read-buffers.html
900
901         * Modules/webgpu/WebGPUBindGroup.h:
902         (WebCore::WebGPUBindGroup::bindGroup const):
903         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
904         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
905         * Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
906         (WebCore::WebGPUBuffer::setSubData):
907         (WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
908         (WebCore::WebGPUBuffer::destroy):
909         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
910         * Modules/webgpu/WebGPUBuffer.h:
911         (WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
912         * Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
913         * Modules/webgpu/WebGPUCommandBuffer.cpp:
914         (WebCore::WebGPUCommandBuffer::beginRenderPass):
915         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
916         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
917         * Modules/webgpu/WebGPUProgrammablePassEncoder.h:
918         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
919         (WebCore::WebGPURenderPassEncoder::setVertexBuffers):
920         * Sources.txt:
921         * WebCore.xcodeproj/project.pbxproj:
922         * platform/graphics/gpu/GPUBuffer.h:
923         (WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
924         (WebCore::GPUBuffer::isVertex const):
925         (WebCore::GPUBuffer::isUniform const):
926         (WebCore::GPUBuffer::isStorage const):
927         (WebCore::GPUBuffer::isReadOnly const):
928         (WebCore::GPUBuffer::isMappable const):
929         (WebCore::GPUBuffer::isMapWrite const):
930         (WebCore::GPUBuffer::isMapRead const):
931         (WebCore::GPUBuffer::isMapWriteable const):
932         (WebCore::GPUBuffer::isMapReadable const):
933         * platform/graphics/gpu/GPUBufferBinding.h:
934         * platform/graphics/gpu/GPUCommandBuffer.h:
935         (WebCore::GPUCommandBuffer::usedBuffers const):
936         (WebCore::GPUCommandBuffer::useBuffer):
937         * platform/graphics/gpu/GPUDevice.cpp:
938         (WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
939         (WebCore::GPUDevice::tryCreateBuffer const): Deleted.
940         * platform/graphics/gpu/GPUDevice.h:
941         * platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
942         (WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
943         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
944         (WebCore::GPUProgrammablePassEncoder::commandBuffer const):
945         * platform/graphics/gpu/GPURenderPassEncoder.h:
946         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
947         (WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
948         (WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
949         (WebCore::GPUBuffer::GPUBuffer):
950         (WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
951         (WebCore::GPUBuffer::state const):
952         (WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
953         (WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
954         (WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
955         (WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
956         (WebCore::GPUBuffer::registerMappingCallback):
957         (WebCore::GPUBuffer::runMappingCallback):
958         (WebCore::GPUBuffer::unmap):
959         (WebCore::GPUBuffer::destroy):
960         (WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
961         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
962         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
963         (WebCore::GPUProgrammablePassEncoder::setBindGroup):
964         * platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
965         (WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
966         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
967         (WebCore::GPURenderPassEncoder::tryCreate):
968         (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
969         (WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
970         (WebCore::GPURenderPassEncoder::create): Deleted.
971
972         Buffer size updates in the IDL:
973         * Modules/webgpu/GPUBufferDescriptor.idl:
974         * Modules/webgpu/WebGPUBuffer.idl:
975         * Modules/webgpu/WebGPUBufferBinding.idl:
976         * Modules/webgpu/WebGPUCommandBuffer.idl:
977         * Modules/webgpu/WebGPURenderPassEncoder.idl:
978         * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
979         * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
980
981 2019-02-27  Youenn Fablet  <youenn@apple.com>
982
983         Remove LeetCode FetchRequest quirk
984         https://bugs.webkit.org/show_bug.cgi?id=195100
985
986         Reviewed by Alex Christensen.
987
988         Covered by manual testing.
989
990         * Modules/fetch/FetchRequest.cpp:
991         (WebCore::needsSignalQuirk):
992
993 2019-02-27  Chris Dumez  <cdumez@apple.com>
994
995         Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
996         https://bugs.webkit.org/show_bug.cgi?id=195101
997         <rdar://problem/48423023>
998
999         Reviewed by Geoffrey Garen.
1000
1001         Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
1002         tries to register a "devicemotion" event listener and fails because the API is disabled. This is
1003         needed to unblock the site and proceed with the login flow.
1004
1005         Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
1006         guard the quirk behind this flag.
1007
1008         * page/DOMWindow.cpp:
1009         (WebCore::DOMWindow::addEventListener):
1010         (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
1011         * page/DOMWindow.h:
1012
1013 2019-02-27  Antoine Quint  <graouts@apple.com>
1014
1015         Support Pointer Events on macOS
1016         https://bugs.webkit.org/show_bug.cgi?id=195008
1017         <rdar://problem/47454419>
1018
1019         Reviewed by Dean Jackson.
1020
1021         We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
1022         a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
1023         exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
1024         and the same behavior also extends to "pointerup".
1025
1026         Tests: pointerevents/mouse/over-enter-out-leave.html
1027                pointerevents/mouse/pointer-capture.html
1028                pointerevents/mouse/pointer-event-basic-properties.html
1029                pointerevents/mouse/pointer-events-before-mouse-events.html
1030                pointerevents/mouse/pointerdown-prevent-default.html
1031
1032         * Configurations/FeatureDefines.xcconfig:
1033         * dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
1034         property does not have any effect on macOS.
1035         (WebCore::Document::invalidateRenderingDependentRegions):
1036         (WebCore::Document::nodeWillBeRemoved):
1037         (WebCore::Document::updateTouchActionElements):
1038         * dom/Document.h:
1039         * dom/Element.cpp:
1040         (WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
1041         If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
1042         the mouse event.
1043         * dom/PointerEvent.cpp:
1044         (WebCore::pointerEventType):
1045         (WebCore::PointerEvent::create):
1046         * dom/PointerEvent.h:
1047         * page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
1048         (WebCore::hierarchyHasCapturingEventListeners):
1049         (WebCore::EventHandler::updateMouseEventTargetNode):
1050         * page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
1051         (WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
1052         (WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
1053         pending target override needs to be considered to determine whether a given element has pointer capture enabled.
1054         (WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
1055         it is set.
1056         * page/PointerLockController.cpp: Fix a build error which only happened on macOS.
1057         * style/StyleTreeResolver.cpp:
1058         (WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
1059
1060 2019-02-27  Sihui Liu  <sihui_liu@apple.com>
1061
1062         Network Process is put to suspended when holding locked IndexedDB files
1063         https://bugs.webkit.org/show_bug.cgi?id=195024
1064         <rdar://problem/45194169>
1065
1066         Reviewed by Geoffrey Garen.
1067
1068         We found network process was suspended when IDBDatabase was being closed in the background database thread, 
1069         holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by 
1070         taking background assertion in UI process until the closes are done and locks are released.
1071
1072         * Modules/indexeddb/server/IDBServer.cpp:
1073         (WebCore::IDBServer::IDBServer::create):
1074         (WebCore::IDBServer::IDBServer::IDBServer):
1075         (WebCore::IDBServer::IDBServer::createBackingStore):
1076         (WebCore::IDBServer::IDBServer::closeDatabase):
1077         (WebCore::IDBServer::IDBServer::didCloseDatabase):
1078         * Modules/indexeddb/server/IDBServer.h:
1079         (WebCore::IDBServer::IDBServer::create):
1080         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1081         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1082         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1083         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1084         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1085         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1086         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
1087         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1088
1089 2019-02-26  Simon Fraser  <simon.fraser@apple.com>
1090
1091         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1092         https://bugs.webkit.org/show_bug.cgi?id=194973
1093
1094         Reviewed by Antti Koivisto.
1095
1096         This patch cleans up how the scrolling tree responds to scrolls.
1097
1098         First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
1099         UI process scroll position.
1100
1101         On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
1102         bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
1103         update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
1104         updates related layers on this node (counter-scrolling layers etc), and then tells the
1105         scrolling tree, which recurses through descendant nodes so they can adjust their layer
1106         positions.
1107
1108         On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
1109         which does the above other than setting scrolledContentsLayer (since we're reacting to
1110         layer state changes, not producing them).
1111
1112         updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
1113         ScrollingTree does the tree walk so classes don't have to implement
1114         updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
1115         how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
1116         need to cross frame boundaries).
1117
1118         We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
1119         since the fixed state was computed with the "layout" scroll position, so we have to account
1120         for the scroll delta since the last committed position. It's possible we could improve this
1121         in future.
1122
1123         * page/scrolling/ScrollingTree.cpp:
1124         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1125         (WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
1126         (WebCore::ScrollingTree::notifyRelatedNodesRecursive):
1127         (WebCore::ScrollingTree::mainFrameLayoutViewport):
1128         (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
1129         * page/scrolling/ScrollingTree.h:
1130         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1131         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
1132         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1133         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1134         (WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
1135         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
1136         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1137         * page/scrolling/ScrollingTreeNode.cpp:
1138         (WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
1139         (WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
1140         * page/scrolling/ScrollingTreeNode.h:
1141         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1142         (WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
1143         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
1144         (WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
1145         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1146         (WebCore::ScrollingTreeScrollingNode::scrollTo):
1147         (WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
1148         (WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
1149         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
1150         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
1151         (WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
1152         * page/scrolling/ScrollingTreeScrollingNode.h:
1153         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
1154         (WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
1155         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
1156         * page/scrolling/ThreadedScrollingTree.cpp:
1157         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1158         * page/scrolling/ThreadedScrollingTree.h:
1159         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1160         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1161         (WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
1162         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
1163         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1164         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1165         (WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
1166         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
1167         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1168         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1169         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1170         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1171         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1172         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
1173         (WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
1174         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
1175         (WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
1176         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
1177         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
1178         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
1179         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
1180         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
1181         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
1182         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1183         (): Deleted.
1184         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1185         (WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
1186         (WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
1187         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
1188         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
1189         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
1190         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
1191         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
1192         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
1193         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1194         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
1195         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
1196         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
1197         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
1198         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
1199         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
1200
1201 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
1202
1203         Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
1204         https://bugs.webkit.org/show_bug.cgi?id=194973
1205
1206         Reviewed by Antti Koivisto.
1207
1208         The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
1209         layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
1210         and require different code for each scrolling node subclass, and adds a choke point that we can use to update
1211         the layout viewport.
1212         
1213         We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
1214         an alias for the scroll position.
1215
1216         Add some isRootNode() checks for things that should only affect the main frame.
1217
1218         * page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
1219         no sense here.
1220         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1221         (WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
1222         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1223         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
1224         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
1225         (WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
1226         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1227         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
1228         (WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
1229         (WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
1230         * page/scrolling/ScrollingTreeScrollingNode.h:
1231         (WebCore::ScrollingTreeScrollingNode::scrollPosition const):
1232         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1233         (WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
1234         * page/scrolling/ios/ScrollingTreeIOS.h:
1235         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1236         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1237         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1238         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1239         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1240         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
1241         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
1242         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
1243         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1244         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1245         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
1246
1247 2019-02-27  Ulrich Pflueger  <up@nanocosmos.de>
1248
1249         [MSE] SourceBuffer sample time increment vs. last frame duration check is broken
1250         https://bugs.webkit.org/show_bug.cgi?id=194747
1251         <rdar://problem/48148469>
1252
1253         Reviewed by Jer Noble.
1254
1255         Prevent unintended frame drops by including last frame duration in discontinuity check. 
1256
1257         Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
1258
1259         * Modules/mediasource/SourceBuffer.cpp:
1260         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
1261
1262 2019-02-27  Timothy Hatcher  <timothy@apple.com>
1263
1264         REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
1265         https://bugs.webkit.org/show_bug.cgi?id=195086
1266         rdar://problem/48419124
1267
1268         Reviewed by Tim Horton.
1269
1270         * platform/mac/ScrollAnimatorMac.mm:
1271         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
1272
1273 2019-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
1274
1275         Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
1276         https://bugs.webkit.org/show_bug.cgi?id=195067
1277         <rdar://problem/44812080>
1278
1279         Reviewed by Tim Horton.
1280
1281         This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
1282         would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
1283         by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
1284         really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
1285         specific guards around this logic.
1286
1287         Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
1288         a very subtle behavior change covered by the new layout test below.
1289
1290         Test: editing/undo/redo-text-insertion-in-non-editable-node.html
1291
1292         * editing/InsertIntoTextNodeCommand.cpp:
1293         (WebCore::InsertIntoTextNodeCommand::doReapply):
1294         * editing/InsertIntoTextNodeCommand.h:
1295
1296 2019-02-26  Keith Miller  <keith_miller@apple.com>
1297
1298         Code quality cleanup in NeverDestroyed
1299         https://bugs.webkit.org/show_bug.cgi?id=194824
1300
1301         Reviewed by Mark Lam.
1302
1303         name_names.pl should not just assume the layout of LazyNeverDestroyed.
1304
1305         * dom/make_names.pl:
1306         (printNamesCppFile):
1307
1308 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1309
1310         Do not try to observe the timer when Page is nullptr
1311         https://bugs.webkit.org/show_bug.cgi?id=195076
1312
1313         Reviewed by Tim Horton.
1314
1315         Covered by fast/dom/Window/timer-null-script-execution-context.html.
1316
1317         * page/DOMTimer.cpp:
1318         (WebCore::DOMTimer::install):
1319
1320 2019-02-20  Jer Noble  <jer.noble@apple.com>
1321
1322         [Cocoa] Media elements will restart network buffering just before suspending
1323         https://bugs.webkit.org/show_bug.cgi?id=193691
1324
1325         Reviewed by Eric Carlson.
1326
1327         API Test: WebKit.ProcessSuspendMediaBuffering
1328
1329         Allow the Page to suspend all media buffering in its child Documents.
1330
1331         * dom/Document.cpp:
1332         (WebCore::Document::suspendAllMediaBuffering):
1333         (WebCore::Document::resumeAllMediaBuffering):
1334         * dom/Document.h:
1335         * html/MediaElementSession.cpp:
1336         (WebCore::MediaElementSession::dataBufferingPermitted const):
1337         (WebCore::MediaElementSession::suspendBuffering):
1338         (WebCore::MediaElementSession::resumeBuffering):
1339         (WebCore::MediaElementSession::bufferingSuspended const):
1340         * html/MediaElementSession.h:
1341         * page/Page.cpp:
1342         (WebCore::Page::suspendAllMediaBuffering):
1343         (WebCore::Page::resumeAllMediaBuffering):
1344         * page/Page.h:
1345         (WebCore::Page::mediaPlaybackIsSuspended const):
1346         (WebCore::Page::mediaBufferingIsSuspended const):
1347         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
1348         * platform/audio/PlatformMediaSession.h:
1349         (WebCore::PlatformMediaSession::suspendBuffering):
1350         (WebCore::PlatformMediaSession::resumeBuffering):
1351         * platform/audio/PlatformMediaSessionManager.cpp:
1352         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
1353         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
1354         * platform/audio/PlatformMediaSessionManager.h:
1355
1356 2019-02-26  Youenn Fablet  <youenn@apple.com>
1357
1358         Move service worker response validation from the service worker client to the service worker itself
1359         https://bugs.webkit.org/show_bug.cgi?id=194716
1360
1361         Reviewed by Geoffrey Garen.
1362
1363         Added response validation at service worker side.
1364
1365         No change of behavior except for now logging validation error messages in the console.
1366         Covered by rebased tests.
1367
1368         * workers/service/context/ServiceWorkerFetch.cpp:
1369         (WebCore::ServiceWorkerFetch::validateResponse):
1370         (WebCore::ServiceWorkerFetch::processResponse):
1371         (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
1372
1373 2019-02-26  Sihui Liu  <sihui_liu@apple.com>
1374
1375         [Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
1376         https://bugs.webkit.org/show_bug.cgi?id=195036
1377
1378         Reviewed by Geoffrey Garen.
1379
1380         When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but 
1381         also transactions in committing process.
1382
1383         Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise 
1384         there is a reference cycle of TransactionOpration.
1385
1386         Covered by existing tests storage/indexeddb/IDBObject-leak.html.
1387
1388         * Modules/indexeddb/IDBDatabase.cpp:
1389         (WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
1390         * Modules/indexeddb/IDBTransaction.cpp:
1391         (WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
1392         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1393         (WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
1394         * Modules/indexeddb/client/IDBConnectionProxy.h:
1395         * Modules/indexeddb/client/TransactionOperation.h:
1396         (WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the 
1397         operation is in completion process. 
1398
1399 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1400
1401         [ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
1402         https://bugs.webkit.org/show_bug.cgi?id=195066
1403         <rdar://problem/48411682>
1404
1405         Reviewed by Tim Horton.
1406
1407         Now all the empty clearContentChangeObservers() implementations can be removed.
1408
1409         * dom/Document.cpp:
1410         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1411         * loader/EmptyClients.h:
1412         * page/ChromeClient.h:
1413         * page/Frame.cpp:
1414         (WebCore::Frame::willDetachPage):
1415         * page/ios/ContentChangeObserver.h:
1416         * page/ios/ContentChangeObserver.mm:
1417         (WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
1418         (WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
1419         (WebCore::ContentChangeObserver::willDetachPage):
1420
1421 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1422
1423         [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
1424         https://bugs.webkit.org/show_bug.cgi?id=195062
1425         <rdar://problem/48409258>
1426
1427         Reviewed by Tim Horton.
1428
1429         Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
1430
1431         * dom/Document.cpp:
1432         (WebCore::Document::scheduleStyleRecalc):
1433         * page/DOMTimer.cpp:
1434         (WebCore::DOMTimer::install):
1435         * page/ios/ContentChangeObserver.h:
1436         * page/ios/ContentChangeObserver.mm:
1437         (WebCore::ContentChangeObserver::didInstallDOMTimer):
1438         (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
1439         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
1440
1441 2019-02-26  Chris Dumez  <cdumez@apple.com>
1442
1443         [iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
1444         https://bugs.webkit.org/show_bug.cgi?id=195054
1445         <rdar://problem/48330549>
1446
1447         Reviewed by Geoff Garen.
1448
1449         Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
1450
1451         * page/MemoryRelease.cpp:
1452         (WebCore::releaseNoncriticalMemory):
1453         (WebCore::releaseCriticalMemory):
1454         (WebCore::releaseMemory):
1455         * page/MemoryRelease.h:
1456
1457 2019-02-26  Commit Queue  <commit-queue@webkit.org>
1458
1459         Unreviewed, rolling out r241970.
1460         https://bugs.webkit.org/show_bug.cgi?id=195057
1461
1462         made the QuickLook.LegacyQuickLookContent API test flakey
1463         (Requested by estes on #webkit).
1464
1465         Reverted changeset:
1466
1467         "[iOS] Break a reference cycle between PreviewLoader and
1468         ResourceLoader"
1469         https://bugs.webkit.org/show_bug.cgi?id=194964
1470         https://trac.webkit.org/changeset/241970
1471
1472 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1473
1474         [ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
1475         https://bugs.webkit.org/show_bug.cgi?id=195023
1476         <rdar://problem/48381885>
1477
1478         Reviewed by Tim Horton.
1479
1480         In the future we might decide that certain activities don't require DOMTimer observation, but that should
1481         be internal to ContentChangeObserver.
1482
1483         * page/ios/ContentChangeObserver.h:
1484         * page/ios/ContentChangeObserver.mm:
1485         (WebCore::ContentChangeObserver::startObservingContentChanges):
1486         (WebCore::ContentChangeObserver::stopObservingContentChanges):
1487         * page/ios/EventHandlerIOS.mm:
1488         (WebCore::EventHandler::mouseMoved):
1489
1490 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1491
1492         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
1493         https://bugs.webkit.org/show_bug.cgi?id=195032
1494         <rdar://problem/48388063>
1495
1496         Reviewed by Tim Horton.
1497
1498         This might eventually turn into a regular start/stop content observing call.
1499
1500         * dom/Document.cpp:
1501         (WebCore::Document::updateStyleIfNeeded):
1502         * page/ios/ContentChangeObserver.h:
1503         * page/ios/ContentChangeObserver.mm:
1504         (WebCore::ContentChangeObserver::startObservingStyleResolve):
1505         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
1506
1507 2019-02-26  Zalan Bujtas  <zalan@apple.com>
1508
1509         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
1510         https://bugs.webkit.org/show_bug.cgi?id=195035
1511         <rdar://problem/48389123>
1512
1513         Reviewed by Tim Horton.
1514
1515         Visibility checking logic belongs to ContentChangeObserver.
1516
1517         * page/ios/ContentChangeObserver.h:
1518         * page/ios/ContentChangeObserver.mm:
1519         (WebCore::elementImplicitVisibility):
1520         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
1521         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
1522         * rendering/updating/RenderTreeUpdater.cpp:
1523         (WebCore::RenderTreeUpdater::updateElementRenderer):
1524         (WebCore::elementImplicitVisibility): Deleted.
1525         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
1526         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
1527
1528 2019-02-26  Philippe Normand  <pnormand@igalia.com>
1529
1530         [EGL] Runtime support for RGB565 pixel layout
1531         https://bugs.webkit.org/show_bug.cgi?id=194817
1532
1533         Reviewed by Carlos Garcia Campos.
1534
1535         Currently our graphics pipeline always relies on a ARGB8888 (32
1536         bpp) pixel configuration. On some low-end (old) embedded platforms
1537         the graphics driver is sometimes optimized for 16 bpp
1538         configurations, such as RGB565. On those platforms the application
1539         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
1540         "RGB565" to adjust to the best pixel configuration supported by
1541         the screen and graphics driver.
1542
1543         * platform/graphics/egl/GLContextEGL.cpp:
1544         (WebCore::GLContextEGL::getEGLConfig):
1545
1546 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
1547
1548         [WPE] Add API for webview background color configuration
1549         https://bugs.webkit.org/show_bug.cgi?id=192305
1550
1551         Reviewed by Michael Catanzaro.
1552
1553         Adapt the FrameView API to allow a default non-white background color.
1554
1555         * page/Frame.cpp:
1556         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
1557         * page/Frame.h:
1558         * page/FrameView.cpp:
1559         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
1560         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
1561         used only in non-dark-mode-css build configurations.
1562         * page/FrameView.h:
1563         * testing/Internals.cpp:
1564         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
1565
1566 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
1567
1568         scalableNativeWebpageParameters() is not preserved on new page navigation.
1569         https://bugs.webkit.org/show_bug.cgi?id=194892
1570         <rdar://problem/47538280>
1571
1572         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
1573         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
1574         configuration until we derive the right values from viewport meta-tag.
1575
1576         Reviewed by Wenson Hsieh.
1577
1578         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
1579
1580         * page/ViewportConfiguration.cpp:
1581         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
1582         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
1583         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
1584             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
1585         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
1586         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
1587         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
1588             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
1589
1590 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1591
1592         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
1593         https://bugs.webkit.org/show_bug.cgi?id=194988
1594         <rdar://problem/48343040>
1595
1596         Reviewed by Tim Horton.
1597
1598         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
1599
1600         * page/DOMWindow.cpp:
1601         (WebCore::DOMWindow::clearTimeout):
1602         * page/ios/ContentChangeObserver.h:
1603         * page/ios/ContentChangeObserver.mm:
1604         (WebCore::ContentChangeObserver::startObservingDOMTimer):
1605         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
1606         (WebCore::ContentChangeObserver::removeDOMTimer):
1607
1608 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1609
1610         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
1611         https://bugs.webkit.org/show_bug.cgi?id=194987
1612         <rdar://problem/48342910>
1613
1614         Reviewed by Tim Horton.
1615
1616         Content obvservation logic should all move to the ContentChangeObserver class.
1617
1618         * page/DOMTimer.cpp:
1619         (WebCore::DOMTimer::install):
1620         (WebCore::DOMTimer::fired):
1621         * page/Page.cpp:
1622         (WebCore::Page::Page):
1623         * page/Page.h:
1624         (WebCore::Page::contentChangeObserver):
1625         * page/ios/ContentChangeObserver.h:
1626         * page/ios/ContentChangeObserver.mm:
1627         (WebCore::ContentChangeObserver::ContentChangeObserver):
1628         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
1629         (WebCore::ContentChangeObserver::startObservingDOMTimer):
1630         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
1631         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
1632         (WebCore::ContentChangeObserver::addObservedDOMTimer):
1633         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
1634
1635 2019-02-25  John Wilander  <wilander@apple.com>
1636
1637         Introduce and adopt new class RegistrableDomain for eTLD+1
1638         https://bugs.webkit.org/show_bug.cgi?id=194791
1639         <rdar://problem/48179240>
1640
1641         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
1642
1643         A new API test was added. Plenty of existing layout tests under
1644         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
1645
1646         This patch introduces and adopts a new class called WebCore::RegistrableDomain
1647         which represents a domain's eTLD+1 (effective top level domain plus one) and is
1648         the basis for the term "site," as in same-site. Other popular names include
1649         high-level domain, primary domain, and top privately controlled/owned domain.
1650         Effective top level domains are enumerated on the Public Suffix List
1651         (https://publicsuffix.org).
1652
1653         This class just uses the full domain for when the Public Suffix List cannot help
1654         finding the registrable domain and for WebKit ports that haven't enabled
1655         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
1656         for the null or unique origin (this matches how these origins were handled
1657         before).
1658
1659         The implementation is a wrapper around a String and the functions and class
1660         members that now make use of this new class used to handle regular String
1661         objects which didn't help much in terms of type safety or guarantees that the
1662         string had already been converted to an eTLD+1.
1663
1664         We've at least two bad bugs in the Storage Access API because of confusion
1665         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
1666         will prohibit such bugs in the future.
1667
1668         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
1669         WebCore::RegistrableDomain for partitioning in a later patch.
1670
1671         This patch also enhances parameter naming by:
1672         - Removing parts that refer to "primary" as in primaryDomain.
1673         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
1674         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
1675         - Using the term "domain" consistently instead of e.g. "host."
1676
1677         * WebCore.xcodeproj/project.pbxproj:
1678         * dom/Document.cpp:
1679         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
1680         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
1681         * dom/Document.h:
1682         * html/HTMLAnchorElement.cpp:
1683         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1684         * html/HTMLMediaElement.cpp:
1685         (WebCore::HTMLMediaElement::mediaSessionTitle const):
1686         * loader/AdClickAttribution.cpp:
1687         (WebCore::AdClickAttribution::url const):
1688         (WebCore::AdClickAttribution::referrer const):
1689         (WebCore::AdClickAttribution::toString const):
1690         * loader/AdClickAttribution.h:
1691         (WebCore::AdClickAttribution::Source::Source):
1692         (WebCore::AdClickAttribution::Source::matches const):
1693         (WebCore::AdClickAttribution::Source::deleteValue):
1694         (WebCore::AdClickAttribution::Destination::Destination):
1695         (WebCore::AdClickAttribution::Destination::matches const):
1696         (WebCore::AdClickAttribution::Destination::deleteValue):
1697         * loader/ResourceLoadObserver.cpp:
1698         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
1699         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
1700         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
1701         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
1702         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
1703         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1704         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1705         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1706         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
1707         (WebCore::ResourceLoadObserver::logFontLoad):
1708         (WebCore::ResourceLoadObserver::logCanvasRead):
1709         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1710         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1711         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1712         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
1713         (WebCore::ResourceLoadObserver::statisticsForOrigin):
1714         (WebCore::primaryDomain): Deleted.
1715         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
1716         * loader/ResourceLoadObserver.h:
1717         * loader/ResourceLoadStatistics.cpp:
1718         (WebCore::ResourceLoadStatistics::encode const):
1719         (WebCore::ResourceLoadStatistics::decode):
1720         (WebCore::ResourceLoadStatistics::toString const):
1721         (WebCore::ResourceLoadStatistics::merge):
1722         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
1723         * loader/ResourceLoadStatistics.h:
1724         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
1725         * page/Page.cpp:
1726         (WebCore::Page::logNavigation):
1727         (WebCore::Page::mainFrameLoadStarted):
1728         * page/Page.h:
1729         * page/PerformanceMonitor.cpp:
1730         (WebCore::reportPageOverPostLoadResourceThreshold):
1731         * platform/RegistrableDomain.h: Added.
1732         (WebCore::RegistrableDomain::RegistrableDomain):
1733         (WebCore::RegistrableDomain::isEmpty const):
1734         (WebCore::RegistrableDomain::string const):
1735         (WebCore::RegistrableDomain::operator!= const):
1736         (WebCore::RegistrableDomain::operator== const):
1737         (WebCore::RegistrableDomain::matches const):
1738         (WebCore::RegistrableDomain::isolatedCopy const):
1739         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
1740         (WebCore::RegistrableDomain::hash const):
1741         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
1742         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
1743         (WebCore::RegistrableDomain::encode const):
1744         (WebCore::RegistrableDomain::decode):
1745         * platform/network/NetworkStorageSession.cpp:
1746         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
1747         (WebCore::NetworkStorageSession::shouldBlockCookies const):
1748         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
1749         (WebCore::NetworkStorageSession::removePrevalentDomains):
1750         (WebCore::NetworkStorageSession::hasStorageAccess const):
1751         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
1752         (WebCore::NetworkStorageSession::grantStorageAccess):
1753         (WebCore::getPartitioningDomain): Deleted.
1754         * platform/network/NetworkStorageSession.h:
1755
1756 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
1757
1758         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
1759         https://bugs.webkit.org/show_bug.cgi?id=190138
1760         <rdar://problem/44907695>
1761
1762         Reviewed by Joanmarie Diggs.
1763
1764         Make sure that footer elements use the right role depending on their context.
1765         If scoped to body, they become contentinfo. Otherwise they are just delineated by
1766         a footer subrole.
1767
1768         * accessibility/AccessibilityObject.cpp:
1769         (WebCore::AccessibilityObject::isLandmark const):
1770         * accessibility/AccessibilityRenderObject.cpp:
1771         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
1772         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
1773         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1774         * accessibility/AccessibilityRenderObject.h:
1775         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1776         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
1777         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1778         (-[WebAccessibilityObjectWrapper subrole]):
1779
1780 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
1781
1782         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
1783         https://bugs.webkit.org/show_bug.cgi?id=194709
1784
1785         Reviewed by Geoffrey Garen.
1786
1787         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
1788         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
1789  
1790         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
1791         between IDBOpenDBRequest and IDBTransaction.
1792
1793         Test: storage/indexeddb/IDBObject-leak.html
1794
1795         * Modules/indexeddb/IDBDatabase.cpp:
1796         (WebCore::IDBDatabase::connectionToServerLost):
1797         * Modules/indexeddb/IDBTransaction.cpp:
1798         (WebCore::IDBTransaction::IDBTransaction):
1799         (WebCore::IDBTransaction::~IDBTransaction):
1800         (WebCore::IDBTransaction::connectionClosedFromServer):
1801         * Modules/indexeddb/IDBTransaction.h:
1802         * testing/Internals.cpp:
1803         (WebCore::Internals::numberOfIDBTransactions const):
1804         * testing/Internals.h:
1805         * testing/Internals.idl:
1806
1807 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1808
1809         Add missing stream parameter. Unreviewed.
1810
1811         * page/DOMTimer.cpp:
1812         (WebCore::DOMTimer::fired):
1813
1814 2019-02-25  Zalan Bujtas  <zalan@apple.com>
1815
1816         Unreviewed build fix after r242032.
1817
1818         * page/DOMTimer.cpp:
1819         (WebCore::DOMTimer::install):
1820
1821 2019-02-20  Darin Adler  <darin@apple.com>
1822
1823         Incorrect use of String::foldCase for font family names
1824         https://bugs.webkit.org/show_bug.cgi?id=194895
1825
1826         Reviewed by Myles C. Maxfield.
1827
1828         * platform/graphics/FontCascadeDescription.cpp:
1829         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
1830         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
1831         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
1832         operator== when we want case sensitive family name comparisons. This is a special
1833         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
1834         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
1835         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
1836         when we want case sensitive family name hashing.
1837         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
1838         AtomicString so we can use this at an additional call site. Converting from an
1839         AtomicString to a String if free and automatic at the existing call sites. Use
1840         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
1841         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
1842         must be consistent. 2) this is considerably faster, and 3) font family names don't
1843         need arbitrary Unicode case folding, it's only A-Z that should be folded.
1844         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
1845         in the foldedFamilyName function.
1846
1847         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1848         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
1849         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
1850
1851 2019-02-25  Charlie Turner  <cturner@igalia.com>
1852
1853         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
1854         https://bugs.webkit.org/show_bug.cgi?id=194992
1855
1856         Reviewed by Xabier Rodriguez-Calvar.
1857
1858         Refactoring, no new tests.
1859
1860         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1861         (transformCaps): Simplify the code a little. The idea to use this
1862         utility function came from a review upstream here:
1863         https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
1864
1865 2019-02-25  Alicia Boya García  <aboya@igalia.com>
1866
1867         [MSE][GStreamer] Batch player duration updates
1868         https://bugs.webkit.org/show_bug.cgi?id=194220
1869
1870         Reviewed by Xabier Rodriguez-Calvar.
1871
1872         This saves up a ton of CPU cycles doing layout unnecessarily when all
1873         the appended frames extend the duration of the movie, like in
1874         YTTV 2018 59.DASHLatencyVP9.
1875
1876         This patch is an optimization that introduces no new behavior.
1877
1878         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1879         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
1880         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1881         (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
1882         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
1883         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
1884         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1885
1886 2019-02-25  Miguel Gomez  <magomez@igalia.com>
1887
1888         [WPE] Add support for holepunch using an external video player
1889         https://bugs.webkit.org/show_bug.cgi?id=194899
1890
1891         Reviewed by Xabier Rodriguez-Calvar.
1892
1893         Implement the holepunch feature to allow playback using an external player. This creates
1894         a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
1895         whose goal is to just draw a transparent rectangle in the position where the video should be.
1896         This can be used to allow a player placed on a lower plane than the browser to become visible.
1897
1898         Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
1899
1900         * PlatformWPE.cmake:
1901         * platform/HolePunch.cmake: Added.
1902         * platform/graphics/MediaPlayer.cpp:
1903         (WebCore::buildMediaEnginesVector):
1904         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
1905         (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
1906         (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
1907         (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
1908         (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
1909         (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
1910         (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
1911         (WebCore::MediaPlayerPrivateHolePunch::proxy const):
1912         (WebCore::mimeTypeCache):
1913         (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
1914         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
1915         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
1916         (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
1917         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
1918         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
1919         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
1920
1921 2019-02-24  Zalan Bujtas  <zalan@apple.com>
1922
1923         Introduce ContentChangeObserver class
1924         https://bugs.webkit.org/show_bug.cgi?id=194977
1925         <rdar://problem/48338115>
1926
1927         Reviewed by Simon Fraser.
1928
1929         This patch is about piping through all the related WK* calls. 
1930
1931         * SourcesCocoa.txt:
1932         * WebCore.xcodeproj/project.pbxproj:
1933         * dom/Document.cpp:
1934         (WebCore::Document::scheduleStyleRecalc):
1935         (WebCore::Document::updateStyleIfNeeded):
1936         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
1937         * loader/FrameLoader.cpp:
1938         * page/DOMTimer.cpp:
1939         (WebCore::DOMTimer::install):
1940         (WebCore::DOMTimer::fired):
1941         * page/DOMWindow.cpp:
1942         (WebCore::DOMWindow::clearTimeout):
1943         * page/Frame.cpp:
1944         (WebCore::Frame::willDetachPage):
1945         * page/Page.h:
1946         (WebCore::Page::contentChangeObserver):
1947         * page/ios/EventHandlerIOS.mm:
1948         (WebCore::EventHandler::mouseMoved):
1949         * rendering/updating/RenderTreeUpdater.cpp:
1950         (WebCore::RenderTreeUpdater::updateElementRenderer):
1951         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
1952         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
1953
1954 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
1955
1956         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
1957         https://bugs.webkit.org/show_bug.cgi?id=194984
1958
1959         Reviewed by Sam Weinig.
1960
1961         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
1962
1963         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
1964         current layout viewport rect. Instead, set the layout viewport on the root
1965         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
1966
1967         * page/scrolling/ScrollingTree.cpp:
1968         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
1969         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
1970         * page/scrolling/ScrollingTree.h:
1971         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
1972         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
1973         * page/scrolling/ScrollingTreeFrameHostingNode.h:
1974         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1975         * page/scrolling/ScrollingTreeNode.h:
1976         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1977         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
1978         * page/scrolling/ScrollingTreeScrollingNode.h:
1979         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
1980         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
1981         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1982         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
1983         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
1984         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
1985         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1986         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1987         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1988         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
1989         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1990
1991 2019-02-24  Devin Rousso  <drousso@apple.com>
1992
1993         Web Inspector: Change the InspectorOverlay to use native rather than canvas
1994         https://bugs.webkit.org/show_bug.cgi?id=105023
1995         <rdar://problem/13443692>
1996
1997         Reviewed by Brian Burg.
1998
1999         Should be no change in observed functionality.
2000
2001         * inspector/InspectorOverlay.h:
2002         * inspector/InspectorOverlay.cpp:
2003         (WebCore::truncateWithEllipsis): Added.
2004         (WebCore::localPointToRootPoint): Added.
2005         (WebCore::contentsQuadToCoordinateSystem):
2006         (WebCore::effectiveElementForNode): Added.
2007         (WebCore::quadToPath): Added.
2008         (WebCore::drawOutlinedQuadWithClip): Added.
2009         (WebCore::drawOutlinedQuad): Added.
2010         (WebCore::drawFragmentHighlight): Added.
2011         (WebCore::drawShapeHighlight): Added.
2012         (WebCore::InspectorOverlay::paint):
2013         (WebCore::InspectorOverlay::setIndicating):
2014         (WebCore::InspectorOverlay::shouldShowOverlay const):
2015         (WebCore::InspectorOverlay::update):
2016         (WebCore::InspectorOverlay::setShowPaintRects): Added.
2017         (WebCore::InspectorOverlay::showPaintRect):
2018         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
2019         (WebCore::InspectorOverlay::drawNodeHighlight):
2020         (WebCore::InspectorOverlay::drawQuadHighlight):
2021         (WebCore::InspectorOverlay::drawPaintRects):
2022         (WebCore::InspectorOverlay::drawBounds): Added.
2023         (WebCore::InspectorOverlay::drawRulers):
2024         (WebCore::InspectorOverlay::drawElementTitle): Added.
2025         (WebCore::contentsQuadToPage): Deleted.
2026         (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
2027         (WebCore::buildObjectForPoint): Deleted.
2028         (WebCore::buildObjectForRect): Deleted.
2029         (WebCore::buildArrayForQuad): Deleted.
2030         (WebCore::buildObjectForHighlight): Deleted.
2031         (WebCore::buildObjectForSize): Deleted.
2032         (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
2033         (WebCore::buildArrayForRendererFragments): Deleted.
2034         (WebCore::localPointToRoot): Deleted.
2035         (WebCore::appendPathCommandAndPoints): Deleted.
2036         (WebCore::appendPathSegment): Deleted.
2037         (WebCore::buildObjectForShapeOutside): Deleted.
2038         (WebCore::buildObjectForElementData): Deleted.
2039         (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
2040         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
2041         (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
2042         (WebCore::InspectorOverlay::overlayPage): Deleted.
2043         (WebCore::InspectorOverlay::forcePaint): Deleted.
2044         (WebCore::InspectorOverlay::reset): Deleted.
2045         (WebCore::evaluateCommandInOverlay): Deleted.
2046         (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
2047         (WebCore::InspectorOverlay::freePage): Deleted.
2048
2049         * inspector/agents/InspectorPageAgent.cpp:
2050         (WebCore::InspectorPageAgent::disable):
2051         (WebCore::InspectorPageAgent::setShowPaintRects):
2052         Drive-by: rename `setShowingPaintRects` to better match the protocol.
2053
2054         * inspector/agents/page/PageDebuggerAgent.h:
2055         * inspector/agents/page/PageDebuggerAgent.cpp:
2056         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
2057         (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
2058         Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
2059
2060         * inspector/InspectorController.h:
2061         * inspector/InspectorController.cpp:
2062         (WebCore::InspectorController::createLazyAgents):
2063         (WebCore::InspectorController::disconnectFrontend):
2064         (WebCore::InspectorController::disconnectAllFrontends):
2065         (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
2066
2067         * testing/Internals.h:
2068         * testing/Internals.idl:
2069         * testing/Internals.cpp:
2070         (WebCore::Internals::inspectorHighlightObject): Deleted.
2071
2072         * inspector/InspectorOverlayPage.css: Removed.
2073         * inspector/InspectorOverlayPage.html: Removed.
2074         * inspector/InspectorOverlayPage.js: Removed.
2075
2076         * CMakeLists.txt:
2077         * DerivedSources-input.xcfilelist:
2078         * DerivedSources-output.xcfilelist:
2079         * DerivedSources.make:
2080         * WebCore.xcodeproj/project.pbxproj:
2081
2082 2019-02-20  Darin Adler  <darin@apple.com>
2083
2084         Finish removing String::format
2085         https://bugs.webkit.org/show_bug.cgi?id=194893
2086
2087         Reviewed by Daniel Bates.
2088
2089         * dom/Document.cpp:
2090         (WebCore::Document::lastModified const): Use makeString and pad.
2091         * html/FTPDirectoryDocument.cpp:
2092         (WebCore::processFileDateString): Ditto.
2093
2094         * mathml/MathMLElement.cpp:
2095         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
2096
2097         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2098         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
2099
2100         * page/linux/ResourceUsageOverlayLinux.cpp:
2101         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
2102         (WebCore::gcTimerString): Use String::number.
2103
2104         * platform/DateComponents.cpp:
2105         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
2106         (WebCore::DateComponents::toString const): Ditto.
2107
2108         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
2109         and that was also inaccurate.
2110
2111         * platform/audio/HRTFElevation.cpp:
2112         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2113         Use makeString and pad.
2114         * platform/mock/MockRealtimeVideoSource.cpp:
2115         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
2116         * rendering/RenderLayerCompositor.cpp:
2117         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
2118         * rendering/RenderTheme.cpp:
2119         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2120
2121 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2122
2123         [WPE][GTK] Remove user agent quirk for washingtonpost.com
2124         https://bugs.webkit.org/show_bug.cgi?id=194981
2125
2126         Reviewed by Žan Doberšek.
2127
2128         Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
2129
2130         * platform/UserAgentQuirks.cpp:
2131         (WebCore::urlRequiresChromeBrowser):
2132
2133 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
2134
2135         Remove remnants of iOS WK1 scrolling tree code
2136         https://bugs.webkit.org/show_bug.cgi?id=194980
2137
2138         Reviewed by Sam Weinig.
2139
2140         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
2141         to reduce maintenance costs and simplify.
2142
2143         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
2144         since that was the only concrete subclass, removing code which never applies to iOS WK2
2145         (e.g. the synchronous scrolling code path).
2146
2147         * SourcesCocoa.txt:
2148         * WebCore.xcodeproj/project.pbxproj:
2149         * page/FrameView.h:
2150         * page/scrolling/ScrollingCoordinator.cpp:
2151         * page/scrolling/ScrollingTree.h:
2152         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2153         * page/scrolling/ScrollingTreeNode.h:
2154         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2155         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
2156         * page/scrolling/ScrollingTreeScrollingNode.h:
2157         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
2158         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
2159         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
2160         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
2161         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
2162         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
2163         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
2164         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
2165         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
2166         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
2167         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
2168         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
2169         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
2170         (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
2171         (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
2172         (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
2173         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
2174         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
2175         (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
2176         (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
2177         (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
2178         (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
2179         (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
2180         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
2181         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
2182         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
2183         * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
2184         * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
2185         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
2186         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
2187         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
2188         * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
2189         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2190         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2191
2192 2019-02-23  Justin Fan  <justin_fan@apple.com>
2193
2194         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
2195         https://bugs.webkit.org/show_bug.cgi?id=194665
2196
2197         Reviewed by Dean Jackson.
2198
2199         Test: map-write-buffers.html. Other tests updated to match new API.
2200
2201         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
2202         (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
2203         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
2204         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
2205         * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
2206         (WebCore::WebGPUBuffer::create):
2207         (WebCore::WebGPUBuffer::WebGPUBuffer):
2208         (WebCore::WebGPUBuffer::mapReadAsync):
2209         (WebCore::WebGPUBuffer::mapWriteAsync):
2210         (WebCore::WebGPUBuffer::unmap):
2211         (WebCore::WebGPUBuffer::destroy):
2212         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
2213         * Modules/webgpu/WebGPUBuffer.h:
2214         (WebCore::WebGPUBuffer::buffer const):
2215         (WebCore::WebGPUBuffer::mapping const): Deleted.
2216         * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
2217         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2218         (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
2219         * Modules/webgpu/WebGPUDevice.cpp:
2220         (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
2221         (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
2222         * Modules/webgpu/WebGPUDevice.h:
2223         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
2224         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
2225         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2226         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
2227         * platform/graphics/gpu/GPUBuffer.cpp: Added.
2228         (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
2229         * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
2230         (WebCore::GPUBuffer::isVertex const):
2231         (WebCore::GPUBuffer::isUniform const):
2232         (WebCore::GPUBuffer::isStorage const):
2233         (WebCore::GPUBuffer::isReadOnly const):
2234         (WebCore::GPUBuffer::PendingMapPromise::create):
2235         (WebCore::GPUBuffer::isMappable const):
2236         (WebCore::GPUBuffer::isMapWriteable const):
2237         (WebCore::GPUBuffer::isMapReadable const):
2238         (WebCore::GPUBuffer::mapping const): Deleted.
2239         * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
2240         * platform/graphics/gpu/GPUDevice.cpp:
2241         (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer. 
2242         (WebCore::GPUDevice::createBuffer const): Deleted.
2243         * platform/graphics/gpu/GPUDevice.h:
2244         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2245         (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
2246         (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
2247         (WebCore::GPUBuffer::GPUBuffer):
2248         (WebCore::GPUBuffer::~GPUBuffer):
2249         (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
2250         (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
2251         (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
2252         (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
2253         (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
2254         (WebCore::GPUBuffer::create): Deleted.
2255         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
2256         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
2257
2258         Add symbols for new files:
2259         * Sources.txt:
2260         * WebCore.xcodeproj/project.pbxproj:
2261
2262 2019-02-23  Keith Miller  <keith_miller@apple.com>
2263
2264         Add new mac target numbers
2265         https://bugs.webkit.org/show_bug.cgi?id=194955
2266
2267         Reviewed by Tim Horton.
2268
2269         * Configurations/Base.xcconfig:
2270         * Configurations/DebugRelease.xcconfig:
2271
2272 2019-02-23  chris fleizach  <cfleizach@apple.com>
2273
2274         AX: WebKit is incorrectly mapping the <meter> element to progressbar
2275         https://bugs.webkit.org/show_bug.cgi?id=164051
2276         <rdar://problem/29055615>
2277
2278         Reviewed by Joanmarie Diggs.
2279
2280         Add a specific role for meter and map that to the appropriate mac role. 
2281
2282         * accessibility/AccessibilityNodeObject.cpp:
2283         (WebCore::AccessibilityNodeObject::canHaveChildren const):
2284         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
2285         * accessibility/AccessibilityObject.cpp:
2286         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
2287         (WebCore::AccessibilityObject::isRangeControl const):
2288         (WebCore::AccessibilityObject::computedRoleString const):
2289         * accessibility/AccessibilityObjectInterface.h:
2290         * accessibility/AccessibilityProgressIndicator.cpp:
2291         (WebCore::AccessibilityProgressIndicator::roleValue const):
2292         * accessibility/AccessibilityProgressIndicator.h:
2293         * accessibility/AccessibilityRenderObject.cpp:
2294         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
2295         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2296         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2297         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2298         (createAccessibilityRoleMap):
2299
2300 2019-02-22  Ryosuke Niwa  <rniwa@webkit.org>
2301
2302         Crash in SWServerJobQueue::runNextJobSynchronously
2303         https://bugs.webkit.org/show_bug.cgi?id=194974
2304
2305         Reviewed by Geoffrey Garen.
2306
2307         We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
2308         or there is a timer heap corruption again :(
2309
2310         Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
2311         but convert an existing release assert to a debug assert since this appears to be hitting
2312         too frequently in wild.
2313
2314         * workers/service/server/SWServerJobQueue.cpp:
2315         (WebCore::SWServerJobQueue::runNextJobSynchronously):
2316
2317 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
2318
2319         Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
2320         https://bugs.webkit.org/show_bug.cgi?id=194968
2321
2322         Reviewed by Antti Koivisto.
2323
2324         Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
2325         you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
2326
2327         ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
2328         reduce that.
2329
2330         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2331         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
2332         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2333         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2334         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
2335         (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
2336         (WebCore::ScrollingTreeScrollingNode::scrollBy):
2337         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
2338         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
2339         * page/scrolling/ScrollingTreeScrollingNode.h:
2340         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2341         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2342         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
2343         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
2344         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2345         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2346         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2347         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2348         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2349         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
2350         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2351         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
2352         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
2353         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
2354         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2355         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
2356         * platform/PlatformWheelEvent.h:
2357         (WebCore::PlatformWheelEvent::delta const):
2358         * platform/ScrollTypes.h:
2359
2360 2019-02-22  Eric Liang  <ericliang@apple.com>
2361
2362         AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
2363         https://bugs.webkit.org/show_bug.cgi?id=194923
2364
2365         Reviewed by Chris Fleizach.
2366
2367         Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
2368
2369         Test: accessibility/mac/children-in-navigation-order-returns-children.html
2370
2371         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2372         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2373
2374 2019-02-22  Tim Horton  <timothy_horton@apple.com>
2375
2376         ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
2377         https://bugs.webkit.org/show_bug.cgi?id=194963
2378
2379         Reviewed by Dean Jackson.
2380
2381         Tested by existing failing API test.
2382
2383         * page/Page.cpp:
2384         (WebCore::Page::installedPageOverlaysChanged): Deleted.
2385         * page/Page.h:
2386         (WebCore::Page::pageOverlayController):
2387         * page/PageOverlayController.cpp:
2388         (WebCore::PageOverlayController::installedPageOverlaysChanged):
2389         (WebCore::PageOverlayController::detachViewOverlayLayers):
2390         (WebCore::PageOverlayController::installPageOverlay):
2391         (WebCore::PageOverlayController::uninstallPageOverlay):
2392         (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
2393         * page/PageOverlayController.h:
2394         As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
2395         Also, make it ignore isInWindow state; otherwise, if you install a overlay
2396         and then come into window, nothing installs the root layer. There is no
2397         need for this code to follow in-window state manually anymore since
2398         the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
2399
2400         Make some methods private, and make detachViewOverlayLayers only touch
2401         *view* overlays, so that we don't detach the document-relative root
2402         layer when you drop to having no view overlays. This maintains
2403         existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
2404
2405         Now there are no callers of willDetachRootLayer, so remove it.
2406
2407 2019-02-22  Andy Estes  <aestes@apple.com>
2408
2409         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
2410         https://bugs.webkit.org/show_bug.cgi?id=194964
2411         <rdar://problem/48279441>
2412
2413         Reviewed by Alex Christensen.
2414
2415         When a document's QuickLook preview is loaded, a reference cycle is created between
2416         PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
2417         ResourceLoader::releaseResources().
2418
2419         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
2420
2421         * loader/ResourceLoader.cpp:
2422         (WebCore::ResourceLoader::releaseResources):
2423
2424 2019-02-22  Sihui Liu  <sihui_liu@apple.com>
2425
2426         Crash under IDBServer::IDBConnectionToClient::identifier() const
2427         https://bugs.webkit.org/show_bug.cgi?id=194843
2428         <rdar://problem/48203102>
2429
2430         Reviewed by Geoffrey Garen.
2431
2432         UniqueIDBDatabase should ignore requests from connections that are already closed.
2433
2434         Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. 
2435         One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
2436         disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
2437         may start a version change transaction and ask for identifier from the connection that is already gone.
2438
2439         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2440         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
2441         * Modules/indexeddb/server/IDBConnectionToClient.h:
2442         (WebCore::IDBServer::IDBConnectionToClient::isClosed):
2443         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2444         (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
2445         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
2446         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2447         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2448
2449 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2450
2451         Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
2452         https://bugs.webkit.org/show_bug.cgi?id=194703
2453         <rdar://problem/48111775>
2454
2455         Reviewed by Ryosuke Niwa.
2456
2457         Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
2458         even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
2459         scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
2460         "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
2461
2462         To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
2463         EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
2464
2465         Tests: fast/events/before-input-events-prevent-block-text-direction.html
2466                fast/events/before-input-events-prevent-inline-text-direction.html
2467
2468         * editing/CompositeEditCommand.cpp:
2469         (WebCore::CompositeEditCommand::apply):
2470         * editing/EditAction.cpp:
2471         (WebCore::undoRedoLabel):
2472         * editing/EditAction.h:
2473         * editing/EditCommand.cpp:
2474         (WebCore::inputTypeNameForEditingAction):
2475         * editing/Editor.cpp:
2476         (WebCore::inputEventDataForEditingStyleAndAction):
2477         (WebCore::Editor::setBaseWritingDirection):
2478         * editing/EditorCommand.cpp:
2479         (WebCore::executeMakeTextWritingDirectionLeftToRight):
2480         (WebCore::executeMakeTextWritingDirectionNatural):
2481         (WebCore::executeMakeTextWritingDirectionRightToLeft):
2482
2483 2019-02-22  Rob Buis  <rbuis@igalia.com>
2484
2485         Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
2486         https://bugs.webkit.org/show_bug.cgi?id=160172
2487
2488         Reviewed by Frédéric Wang.
2489
2490         Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
2491         from HTTPParsers instead.
2492
2493         No new tests, already covered by MathML tests.
2494
2495         * mathml/MathMLElement.cpp:
2496         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
2497         * mathml/MathMLElement.h:
2498         * mathml/MathMLPresentationElement.cpp:
2499         (WebCore::MathMLPresentationElement::parseMathMLLength):
2500         * mathml/MathMLTokenElement.cpp:
2501         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
2502
2503 2019-02-22  Eric Carlson  <eric.carlson@apple.com>
2504
2505         Update some media logging
2506         https://bugs.webkit.org/show_bug.cgi?id=194915
2507
2508         Reviewed by Jer Noble.
2509
2510         No new tests, no functional change.
2511
2512         * Modules/mediasource/SourceBuffer.cpp:
2513         (WebCore::SourceBuffer::evictCodedFrames):
2514         (WebCore::SourceBuffer::provideMediaData):
2515         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
2516
2517         * html/HTMLMediaElement.cpp:
2518         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
2519         (WebCore::HTMLMediaElement::loadResource):
2520         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2521         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
2522         (WebCore::HTMLMediaElement::seekTask):
2523         (WebCore::HTMLMediaElement::playInternal):
2524         (WebCore::HTMLMediaElement::pauseInternal):
2525         (WebCore::HTMLMediaElement::setLoop):
2526         (WebCore::HTMLMediaElement::setControls):
2527         (WebCore::HTMLMediaElement::sourceWasRemoved):
2528
2529         * html/MediaElementSession.cpp:
2530         (WebCore::convertEnumerationToString):
2531
2532         * html/MediaElementSession.h:
2533         (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
2534
2535         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2536         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2537
2538 2019-02-22  Rob Buis  <rbuis@igalia.com>
2539
2540         Fix unitless usage of mathsize
2541         https://bugs.webkit.org/show_bug.cgi?id=194940
2542
2543         Reviewed by Frédéric Wang.
2544
2545         Convert unitless lengths to percentage values to correct the computed
2546         font size.
2547
2548         * mathml/MathMLElement.cpp:
2549         (WebCore::convertToPercentageIfNeeded):
2550         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
2551
2552 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
2553
2554         Hardcode Visual Viewports on everywhere except iOS WK1
2555         https://bugs.webkit.org/show_bug.cgi?id=194928
2556
2557         Reviewed by Zalan Bujtas.
2558
2559         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
2560         change the default value of the Setting to 'true', and hardcode WebView on iOS to
2561         set it to false. The setting has shipped for several years and there's no need to turn
2562         it off now.
2563
2564         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
2565         Visual Viewports are not enabled.
2566         
2567         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
2568         that only runs in WK2
2569
2570         * page/Settings.yaml:
2571         * page/scrolling/AsyncScrollingCoordinator.cpp:
2572         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2573         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2574         (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
2575         * page/scrolling/AsyncScrollingCoordinator.h:
2576         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2577         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2578         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2579         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2580         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
2581         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2582         * page/scrolling/ScrollingTree.cpp:
2583         (WebCore::ScrollingTree::commitTreeState):
2584         * page/scrolling/ScrollingTree.h:
2585         (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
2586         (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
2587         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2588         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
2589         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2590         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
2591         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2592
2593 2019-02-21  Darin Adler  <darin@apple.com>
2594
2595         Some refinements for Node and Document
2596         https://bugs.webkit.org/show_bug.cgi?id=194764
2597
2598         Reviewed by Ryosuke Niwa.
2599
2600         * accessibility/AccessibilityObject.cpp:
2601         (WebCore::AccessibilityObject::press): Use shadowHost instead of
2602         deprecatedShadowAncestorNode.
2603         (WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
2604         (WebCore::AccessibilityObject::focusedUIElement const): Use existing page
2605         function to streamline.
2606
2607         * accessibility/AccessibilityRenderObject.cpp:
2608         (WebCore::AccessibilityRenderObject::accessKey const): Use
2609         attributeWithoutSynchronization for efficiency and consistency with other
2610         code working with the accesskey attribute.
2611
2612         * dom/ContainerNode.cpp:
2613         (WebCore::ContainerNode::childrenChanged): Added call to
2614         invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
2615
2616         * dom/DecodedDataDocumentParser.cpp:
2617         (WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
2618         type change of createDecoderIfNeeded to decoder.
2619         (WebCore::DecodedDataDocumentParser::flush): Ditto.
2620
2621         * dom/Document.cpp:
2622         (WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
2623         to match WebKit coding style. Changed to use unique_ptr instead of separate
2624         boolean to keep track of map validity status.
2625         (WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
2626         clarify that this is a cache. Changed to use composedTreeDescendants rather
2627         than explicit calls to shadowRoot. Use add instead of set so that first element
2628         in document order wins, instead of last element in document order. Updated
2629         to make a new map in a new unique_ptr instead of populating a map.
2630         (WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
2631         invalidateAccessKeyMap, and left an inline part in the header so the fast case
2632         of quickly checking for a null pointer can be inlined.
2633         (WebCore::Document::doctype const): Use downcast instead of static_cast.
2634         (WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
2635         from here to childrenChanged and accesskey attribute change handling.
2636         (WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
2637         directly since this is the only place that does it and we don't need to factor
2638         that one line of code into a function.
2639         (WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
2640         that always returns nullptr and can be inlined.
2641         (WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
2642         (WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
2643         the create function, since Document::create now always involves no frame.
2644         (WebCore::Document::didAssociateFormControl): Changed argument type to a reference
2645         and simplified the logic with a local variable.
2646         (WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
2647         checks and rearranged things so that m_associatedFormControls will always
2648         get cleared even if the document is no longer associated with a page.
2649
2650         * dom/Document.h: Removed unnnecessary explicit values for enumerations (first
2651         value is always zero, etc.) and formatted simple enumerations in a single line
2652         for easier reading. Moved Document::create fucntion bodies out of line, removed
2653         the frame argument from the simple "create with URL" overload and made the frame
2654         argument for createNonRenderedPlaceholder be a reference rather than a pointer.
2655         Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
2656         invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
2657         m_elementsByAccessKey to m_accessKeyCache and changed its type.
2658         Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
2659         setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
2660
2661         * dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
2662         placeholder returning null.
2663
2664         * dom/Element.cpp:
2665         (WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
2666         value of the accesskey attribute is changed. Also moved the class attribute code
2667         so the attributes here are in alphabetical order (only class and id were out of
2668         alphabetical order).
2669
2670         * dom/Node.cpp:
2671         (WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
2672         use deprecatedShadowAncestorNode and used boolean operators to make it a
2673         single line and easier to understand. Also added a FIXME since the
2674         containsIncludingShadowDOM function is so similar, yet differently written.
2675         (WebCore::Node::contains const): Rewrote as a single line to make this easier
2676         to read and to *slightly* improve the speed in the "this == node" case.
2677         (WebCore::Node::containsIncludingHostElements const): Use downcast.
2678         (WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
2679
2680         * dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
2681
2682         * editing/ReplaceSelectionCommand.cpp:
2683         (WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
2684         instead of deprecatedShadowAncestorNode.
2685
2686         * html/FormAssociatedElement.cpp:
2687         (WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
2688         didAssociateFormControl.
2689         (WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
2690
2691         * html/HTMLAreaElement.cpp:
2692         (WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
2693         attribute, because we want to call the base class parseAttribute in that case.
2694
2695         * html/HTMLFormElement.cpp:
2696         (WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
2697         didAssociateFormControl.
2698
2699         * html/HTMLSelectElement.cpp:
2700         (WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
2701         attribute with mysterious FIXME, because we want to call the base class
2702         parseAttribute in that case. The old code had no effect before; the access key
2703         logic would still find the attribute; if the goal is to ignore the attribute
2704         for these elements we will need a different solution.
2705         * html/HTMLTextAreaElement.cpp:
2706         (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
2707
2708         * loader/DocumentLoader.cpp:
2709         (WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
2710         nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
2711         m_frame was always null.
2712         (WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.
2713
2714         * loader/DocumentWriter.cpp:
2715         (WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
2716         the passed in frame, which was always nullptr, and initialized some booleans and an
2717         enumeration, which are now initialized in the class definition.
2718         (WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
2719         (WebCore::DocumentWriter::begin): Updated now that State is an enum class.
2720         (WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
2721         to return a reference.
2722         (WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
2723         updated now that State is an enum class.
2724         (WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
2725         enum class.
2726         (WebCore::DocumentWriter::end): Ditto.
2727
2728         * loader/DocumentWriter.h: Removed unneeded include and forward declaration.
2729         Removed the frame pointer argument to the constructor, caller was always passing a
2730         nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
2731         to decoder and changed it to return a reference. Initialized m_frame,
2732         m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
2733         to initialize them in a constructor. Renamed the enum from WriterState to State since
2734         it's a member of DocumentWriter already, and made it an enum class rather than ending
2735         each enumeration value with WritingState.
2736
2737         * page/DragController.cpp:
2738         (WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
2739         one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
2740         function instead.
2741         (WebCore::hasEnabledColorInputAsShadowHost): Added.
2742         (WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
2743         Also added FIXME since it seems this should instead be using parentElementInComposedTree.
2744         (WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
2745         (WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
2746         and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
2747         into a local variable to simplify code.
2748         (WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.
2749
2750         * page/EventHandler.cpp:
2751         (WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.
2752
2753         * page/FocusController.cpp:
2754         (WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.
2755
2756         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2757         (WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
2758         Document::createNonRenderedPlaceholder.
2759
2760 2019-02-21  Daniel Bates  <dabates@apple.com>
2761
2762         Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
2763         https://bugs.webkit.org/show_bug.cgi?id=194906
2764         <rdar://problem/44305947>
2765
2766         Reviewed by Brent Fulgham.
2767
2768         Ensure that a request for a top-level navigation is annotated as such regardless of whether
2769         the request has a computed Same Site policy.
2770
2771         "New loads" initiated by a the client (Safari) either by API or a human either explicitly
2772         typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
2773         are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
2774         from an existing page. (Command + click should be thought of as a convenience to the user from
2775         having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
2776         Currently the frame loader marks a request as a top-level navigation if and only if the request
2777         does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
2778         policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
2779         Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
2780         tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
2781         Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
2782         WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.
2783
2784         [1] See Note for (1) in  <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
2785         [2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>
2786
2787         Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php
2788
2789         * loader/FrameLoader.cpp:
2790         (WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
2791         level navigation bit.
2792         * platform/network/ResourceRequestBase.cpp:
2793         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
2794         level navigation bit.
2795
2796 2019-02-21  Per Arne Vollan  <pvollan@apple.com>
2797
2798         Layout Test fast/text/international/khmer-selection.html is crashing
2799         https://bugs.webkit.org/show_bug.cgi?id=191368
2800
2801         Reviewed by Brent Fulgham.
2802
2803         GlyphBuffer's offset array wasn't getting filled by UniscribeController.
2804         Our underlining code requires this array.
2805
2806         Uniscribe gives us a character -> glyph mapping, so we just have to compute
2807         the inverse and give it to the GlyphBuffer.
2808
2809         This patch is written by Myles C. Maxfield.
2810
2811         Test: fast/text/international/khmer-selection.html.
2812
2813         * platform/graphics/GlyphBuffer.h:
2814         (WebCore::GlyphBuffer::add):
2815         * platform/graphics/displaylists/DisplayListItems.cpp:
2816         (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
2817         * platform/graphics/win/UniscribeController.cpp:
2818         (WebCore::UniscribeController::advance):
2819         (WebCore::UniscribeController::itemizeShapeAndPlace):
2820         (WebCore::UniscribeController::shapeAndPlaceItem):
2821         * platform/graphics/win/UniscribeController.h:
2822
2823 2019-02-21  Sihui Liu  <sihui_liu@apple.com>
2824
2825         IndexedDB: leak UniqueIDBDatabase in layout tests
2826         https://bugs.webkit.org/show_bug.cgi?id=194870
2827         <rdar://problem/48163812>
2828
2829         Reviewed by Geoffrey Garen.
2830
2831         UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it 
2832         receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
2833         pointer should be released when a database task finishes, but it didn't perform a check when a confirm message 
2834         is received. 
2835
2836         No new test as the order of task completion and confirmation arrival is uncertain.
2837
2838         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2839         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2840
2841 2019-02-21  Andy Estes  <aestes@apple.com>
2842
2843         contentfiltering tests leak documents
2844         https://bugs.webkit.org/show_bug.cgi?id=189434
2845         <rdar://44239943>
2846
2847         Reviewed by Simon Fraser.
2848
2849         Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
2850
2851         This fixes world leaks in several tests in LayoutTests/contentfiltering/.
2852
2853         * bindings/js/ScriptController.h:
2854         * loader/ContentFilter.cpp:
2855         (WebCore::ContentFilter::didDecide):
2856
2857 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
2858
2859         [CMake][Win] Fix !USE(CF) build of WebCore
2860         https://bugs.webkit.org/show_bug.cgi?id=194879
2861
2862         Reviewed by Konstantin Tokarev.
2863
2864         * PlatformAppleWin.cmake:
2865         * PlatformWin.cmake:
2866         * PlatformWinCairo.cmake:
2867
2868 2019-02-21  Zalan Bujtas  <zalan@apple.com>
2869
2870         [LFC][Floats] Add support for placing formatting roots in-between floats.
2871         https://bugs.webkit.org/show_bug.cgi?id=194902
2872
2873         Reviewed by Antti Koivisto.
2874
2875         This patch add support for placing a formatting root box in-between existing floats.
2876         The initial vertical position of a formatting root is its static position which can make the box
2877         placed above exsiting floats (whereas we can never place a regular float above existing floats.)
2878
2879         Test: fast/block/block-only/floats-and-block-formatting-roots.html
2880
2881         * layout/blockformatting/BlockFormattingContext.cpp:
2882         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2883         * layout/floats/FloatingContext.cpp:
2884         (WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
2885         (WebCore::Layout::FloatPair::isEmpty const):
2886         (WebCore::Layout::FloatPair::operator* const):
2887         (WebCore::Layout::Iterator::operator* const):
2888         (WebCore::Layout::begin):
2889         (WebCore::Layout::end):
2890         (WebCore::Layout::FloatingContext::positionForFloat const):
2891         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
2892         (WebCore::Layout::findAvailablePosition):
2893         (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
2894         (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
2895         (WebCore::Layout::FloatPair::FloatPair):
2896         (WebCore::Layout::FloatPair::left const):
2897         (WebCore::Layout::FloatPair::right const):
2898         (WebCore::Layout::FloatPair::intersects const):
2899         (WebCore::Layout::FloatPair::operator == const):
2900         (WebCore::Layout::FloatPair::horizontalConstraints const):
2901         (WebCore::Layout::FloatPair::bottom const):
2902         (WebCore::Layout::Iterator::operator++):
2903         (WebCore::Layout::Iterator::set):
2904         (WebCore::Layout::FloatingPair::isEmpty const): Deleted.
2905         (WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
2906         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
2907         (WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
2908         (WebCore::Layout::FloatingPair::FloatingPair): Deleted.
2909         (WebCore::Layout::FloatingPair::left const): Deleted.
2910         (WebCore::Layout::FloatingPair::right const): Deleted.
2911         (WebCore::Layout::FloatingPair::intersects const): Deleted.
2912         (WebCore::Layout::FloatingPair::operator == const): Deleted.
2913         (WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
2914         (WebCore::Layout::FloatingPair::bottom const): Deleted.
2915         * layout/floats/FloatingContext.h:
2916
2917 2019-02-21  Rob Buis  <rbuis@igalia.com>
2918
2919         Update MIME type parser
2920         https://bugs.webkit.org/show_bug.cgi?id=180526
2921
2922         Reviewed by Darin Adler.
2923
2924         Further testing showed the MIME parser needs these fixes:
2925         - stripWhitespace is wrong for removing HTTP whitespace, use
2926           stripLeadingAndTrailingHTTPSpaces instead.
2927         - HTTP Token code points checking for Rfc2045 and Mimesniff were
2928           mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
2929         - Quoted Strings were not unescaped/escaped, this seems ok for
2930           serializing but is wrong when gettings individual parameter values.
2931           Implement [1] and [2] Step 2.4 to properly unescape and escape.
2932
2933         This change also tries to avoid hard to read uses of find.
2934
2935         Test: ParsedContentType.Serialize
2936
2937         [1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
2938         [2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
2939
2940         * platform/network/ParsedContentType.cpp:
2941         (WebCore::skipSpaces):
2942         (WebCore::parseToken):
2943         (WebCore::isNotQuoteOrBackslash):
2944         (WebCore::collectHTTPQuotedString):
2945         (WebCore::containsNonTokenCharacters):
2946         (WebCore::parseQuotedString):
2947         (WebCore::ParsedContentType::parseContentType):
2948         (WebCore::ParsedContentType::create):
2949         (WebCore::ParsedContentType::setContentType):
2950         (WebCore::containsNonQuoteStringTokenCharacters):
2951         (WebCore::ParsedContentType::setContentTypeParameter):
2952         (WebCore::ParsedContentType::serialize const):
2953         (WebCore::substringForRange): Deleted.
2954         (WebCore::isNonTokenCharacter): Deleted.
2955         (WebCore::isNonQuotedStringTokenCharacter): Deleted.
2956         * platform/network/ParsedContentType.h:
2957
2958 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
2959
2960         REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
2961         https://bugs.webkit.org/show_bug.cgi?id=194889
2962         rdar://problem/47755552
2963
2964         Reviewed by Tim Horton.
2965         
2966         After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
2967         position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
2968         with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
2969         update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
2970         
2971         Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
2972         layer.
2973
2974         Not currently testable.
2975
2976         * rendering/RenderLayerCompositor.cpp:
2977         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2978
2979 2019-02-20  Dean Jackson  <dino@apple.com>
2980
2981         Rotation animations sometimes use the wrong origin (affects apple.com)
2982         https://bugs.webkit.org/show_bug.cgi?id=194878
2983         <rdar://problem/43908047>
2984
2985         Reviewed by Simon Fraser.
2986
2987         Some versions of CoreAnimation apply additive animations in reverse
2988         order. Detect this and reverse the list of animations we provide.
2989
2990         Update the existing animations/additive-transform-animations.html test to
2991         be a ref-test that would identify this failure. Previously it relied on
2992         a pixel test.
2993
2994         * platform/graphics/ca/GraphicsLayerCA.cpp: Use 
2995             HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
2996             not to flip the list of animations (and mark the correct ones as
2997             additive).
2998         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2999         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
3000
3001 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
3002
3003         [Win] Guard CF usage in RenderThemeWin
3004         https://bugs.webkit.org/show_bug.cgi?id=194875
3005
3006         Reviewed by Alex Christensen.
3007
3008         No new tests. No change in behavior.
3009
3010         Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
3011
3012         * rendering/RenderThemeWin.cpp:
3013         (WebCore::RenderThemeWin::stringWithContentsOfFile):
3014         (WebCore::RenderThemeWin::mediaControlsStyleSheet):
3015         (WebCore::RenderThemeWin::mediaControlsScript):
3016         * rendering/RenderThemeWin.h:
3017
3018 2019-02-20  Ryosuke Niwa  <rniwa@webkit.org>
3019
3020         Crash in DOMWindowExtension::suspendForPageCache
3021         https://bugs.webkit.org/show_bug.cgi?id=194871
3022
3023         Reviewed by Chris Dumez.
3024
3025         This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
3026
3027         We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
3028         dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
3029         Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
3030         to avoid the crash.
3031
3032         * page/DOMWindow.cpp:
3033         (WebCore::DOMWindow::willDestroyCachedFrame):
3034         (WebCore::DOMWindow::willDestroyDocumentInFrame):
3035         (WebCore::DOMWindow::willDetachDocumentFromFrame):
3036         (WebCore::DOMWindow::suspendForPageCache):
3037         (WebCore::DOMWindow::resumeFromPageCache):
3038         * page/DOMWindowExtension.cpp:
3039         (WebCore::DOMWindowExtension::suspendForPageCache):
3040
3041 2019-02-20  Alex Christensen  <achristensen@webkit.org>
3042
3043         Always call CompletionHandlers after r240909
3044         https://bugs.webkit.org/show_bug.cgi?id=194823
3045
3046         Reviewed by Ryosuke Niwa.
3047
3048         * loader/PolicyChecker.cpp:
3049         (WebCore::PolicyChecker::checkNavigationPolicy):
3050         (WebCore::PolicyChecker::checkNewWindowPolicy):
3051
3052 2019-02-20  Andy Estes  <aestes@apple.com>
3053
3054         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
3055         https://bugs.webkit.org/show_bug.cgi?id=194869
3056
3057         Rubber-stamped by Jer Noble.
3058
3059         * WebCore.xcodeproj/project.pbxproj:
3060
3061 2019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3062
3063         drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
3064         https://bugs.webkit.org/show_bug.cgi?id=194746
3065
3066         Reviewed by Dean Jackson.
3067
3068         Test: fast/canvas/canvas-drawImage-composite-copy.html
3069
3070         If the source canvas of drawImage() is the same as the destination and
3071         globalCompositeOperation is set to "copy", copy the srcRect from the 
3072         canvas to a temporary buffer before calling clearCanvas() then drawImage
3073         from this temporary buffer.
3074
3075         * html/canvas/CanvasRenderingContext2DBase.cpp:
3076         (WebCore::CanvasRenderingContext2DBase::drawImage):
3077         * platform/graphics/ImageBuffer.cpp:
3078         (WebCore::ImageBuffer::copyRectToBuffer):
3079         * platform/graphics/ImageBuffer.h:
3080
3081 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
3082
3083         REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
3084         https://bugs.webkit.org/show_bug.cgi?id=194866
3085
3086         Reviewed by Antti Koivisto.
3087
3088         r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
3089         a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
3090         the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
3091
3092         * rendering/RenderLayerCompositor.cpp:
3093         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
3094
3095 2019-02-20  Daniel Bates  <dabates@apple.com>
3096
3097         [iOS] Tweak UI for focus rings
3098         https://bugs.webkit.org/show_bug.cgi?id=194864
3099         <rdar://problem/47831886>
3100
3101         Reviewed by Brent Fulgham.
3102
3103         Make use of UIKit constants to make focus rings pretty.
3104
3105         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
3106         (WebCore::drawFocusRingAtTime):
3107
3108 2019-02-20  Timothy Hatcher  <timothy@apple.com>
3109
3110         RenderThemeIOS should use RenderTheme's color cache instead of its own.
3111         https://bugs.webkit.org/show_bug.cgi?id=194822
3112         rdar://problem/48208296
3113
3114         Reviewed by Tim Horton.
3115
3116         Tested by fast/css/apple-system-colors.html.
3117
3118         * css/CSSValueKeywords.in:
3119         * css/parser/CSSPropertyParser.cpp:
3120         (WebCore::isAppleLegacyCssValueKeyword):
3121         * platform/graphics/Color.h:
3122         * platform/graphics/cg/ColorCG.cpp:
3123         (WebCore::makeRGBAFromCGColor):
3124         (WebCore::Color::Color):
3125         * rendering/RenderThemeIOS.h:
3126         * rendering/RenderThemeIOS.mm:
3127         (WebCore::RenderThemeIOS::systemColor const):
3128         * rendering/RenderThemeMac.mm:
3129         (WebCore::RenderThemeMac::systemColor const):
3130
3131 2019-02-20  Loïc Yhuel  <loic.yhuel@softathome.com>
3132
3133         Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
3134         https://bugs.webkit.org/show_bug.cgi?id=194819
3135
3136         Reviewed by Joseph Pecoraro.
3137
3138         Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
3139
3140         * Modules/websockets/WebSocketChannel.h:
3141         (WebCore::WebSocketChannel::hasCreatedHandshake):
3142         * inspector/agents/page/PageNetworkAgent.cpp:
3143         Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
3144
3145 2019-02-20  Zalan Bujtas  <zalan@apple.com>
3146
3147         [LFC][Floats] Make FloatAvoider::resetPosition implicit
3148         https://bugs.webkit.org/show_bug.cgi?id=194855
3149
3150         Reviewed by Antti Koivisto.
3151
3152         Let's compute the initial top/left position during c'tor time.
3153         This is in preparation for fixing formatting root box placement in a float context.
3154
3155         * layout/floats/FloatAvoider.cpp:
3156         (WebCore::Layout::FloatAvoider::resetPosition): Deleted.
3157         * layout/floats/FloatAvoider.h:
3158         (WebCore::Layout::FloatAvoider::displayBox):
3159         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
3160         * layout/floats/FloatBox.cpp:
3161         (WebCore::Layout::FloatBox::FloatBox):
3162         (WebCore::Layout::FloatBox::initialVerticalPosition const):
3163         * layout/floats/FloatBox.h:
3164         * layout/floats/FloatingContext.cpp:
3165         (WebCore::Layout::FloatingContext::floatingPosition const):
3166
3167 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
3168
3169         [MSVC] Fix compilation errors with lambdas in Service Workers
3170         https://bugs.webkit.org/show_bug.cgi?id=194841
3171
3172         Reviewed by Alex Christensen.
3173
3174         No new tests. No change in behavior.
3175
3176         MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
3177         referring to the enclosing lambda according to MSVC. This patch works around this behavior
3178         through by using the `protectedThis` pattern in WebKit code.
3179
3180         * workers/service/server/RegistrationDatabase.cpp:
3181         (WebCore::RegistrationDatabase::openSQLiteDatabase):
3182
3183 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
3184
3185         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
3186         https://bugs.webkit.org/show_bug.cgi?id=167941
3187
3188         Reviewed by Carlos Garcia Campos.
3189
3190         * platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
3191         to the list of files with translatable strings.
3192
3193 2019-02-19  Simon Fraser  <simon.fraser@apple.com>
3194
3195         REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
3196         https://bugs.webkit.org/show_bug.cgi?id=194827
3197         rdar://problem/47620594
3198
3199         Reviewed by Antti Koivisto.
3200
3201         Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
3202         layer configurations, since a repaint implies that a layer gains painted content. This is done
3203         via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
3204         The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
3205         for the root. The configuration state that matters here is whether the layer contains painted content,
3206         and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
3207         and feeds into GraphicsLayer::drawsContent().
3208
3209         However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
3210         then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
3211         causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
3212
3213         Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
3214         the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
3215         to always return false for the RenderView's layer (the root).
3216         
3217         Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
3218         properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
3219         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
3220         respect it.
3221
3222         Test: compositing/visibility/root-visibility-toggle.html
3223
3224         * page/Frame.h:
3225         * platform/graphics/GraphicsLayer.cpp:
3226         (WebCore::GraphicsLayer::dumpProperties const):
3227         * platform/graphics/GraphicsLayerClient.h:
3228         (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
3229         * rendering/RenderLayerBacking.cpp:
3230         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
3231         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
3232         * rendering/RenderLayerBacking.h:
3233         * rendering/RenderLayerCompositor.cpp:
3234         (WebCore::RenderLayerCompositor::layerTreeAsText):
3235         * testing/Internals.cpp:
3236         (WebCore::toLayerTreeFlags):
3237         * testing/Internals.h:
3238         * testing/Internals.idl:
3239
3240 2019-02-19  Ryosuke Niwa  <rniwa@webkit.org>
3241
3242         REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
3243         https://bugs.webkit.org/show_bug.cgi?id=194820
3244
3245         Reviewed by Geoffrey Garen.
3246
3247         This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
3248         doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
3249         continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
3250         and we don't rely on PolicyChecker's load type until then.
3251
3252         Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
3253
3254         This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
3255         invoking checkNewWindowPolicy which is not the right assumption.
3256
3257         Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
3258
3259         * loader/FrameLoader.cpp:
3260         (WebCore::FrameLoader::loadURL):
3261         (WebCore::FrameLoader::load):
3262         (WebCore::FrameLoader::loadPostRequest):
3263
3264 2019-02-19  Zalan Bujtas  <zalan@apple.com>
3265
3266         Fix post-commit feedback.
3267
3268         Unreviewed. 
3269
3270         * layout/floats/FloatingContext.cpp:
3271         (WebCore::Layout::FloatingPair::intersects const):
3272
3273 2019-02-19  Zalan Bujtas  <zalan@apple.com>
3274
3275         [LFC][Floats] Remove redundant intersecting logic
3276         https://bugs.webkit.org/show_bug.cgi?id=194804
3277
3278         Reviewed by Antti Koivisto.
3279
3280         floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
3281
3282         * layout/floats/FloatingContext.cpp:
3283         (WebCore::Layout::FloatingContext::floatingPosition const):
3284         (WebCore::Layout::FloatingPair::intersects const):
3285
3286 2019-02-19  Commit Queue  <commit-queue@webkit.org>
3287
3288         Unreviewed, rolling out r241722.
3289         https://bugs.webkit.org/show_bug.cgi?id=194801
3290
3291         Causing time outs and EWS failures after expectation file was
3292         added. (Requested by ShawnRoberts on #webkit).
3293
3294         Reverted changeset:
3295
3296         "IndexedDB: leak IDBDatabase and IDBTransacstion in layout
3297         tests"
3298         https://bugs.webkit.org/show_bug.cgi?id=194709
3299         https://trac.webkit.org/changeset/241722
3300
3301 2019-02-16  Darin Adler  <darin@apple.com>
3302
3303         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
3304         https://bugs.webkit.org/show_bug.cgi?id=194752
3305
3306         Reviewed by Daniel Bates.
3307
3308         * Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
3309         got included because of Logger.h, but that no longer pulls in HexNumber.h.
3310
3311         * css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
3312         * css/CSSPrimitiveValue.cpp: Ditto.
3313
3314         * css/CSSUnicodeRangeValue.cpp:
3315         (WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
3316         of String::format and "%x".
3317
3318         * html/HTMLMediaElement.h:
3319         (WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
3320         TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
3321
3322         * html/canvas/WebGLRenderingContextBase.cpp:
3323         (GetErrorString): Use makeString and hex instead of String::format and "%04x".
3324
3325         * html/track/TextTrackCue.cpp:
3326         (WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
3327         from HTMLMediaElement.h and use makeString instead of String::format. Also use
3328         the word "debug" to make it clear that it's not OK to use this string, with a
3329         pointer value serialized into it, outside of debugging.
3330         * html/track/TextTrackCue.h: Added TextTrackCue::debugString.
3331
3332         * page/linux/ResourceUsageOverlayLinux.cpp:
3333         (WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
3334         instead of String::format and "%.1f" etc.
3335
3336         * platform/cocoa/KeyEventCocoa.mm:
3337         (WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
3338         the old code that did each of the four characters explicitly.
3339
3340         * platform/gamepad/mac/HIDGamepad.cpp:
3341         (WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
3342
3343         * platform/graphics/Color.cpp:
3344         (WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
3345         digit separately.
3346
3347         * platform/graphics/FloatPolygon.cpp:
3348         (WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
3349         from the header and use makeString instead of String::format. Also use
3350         the word "debug" to make it clear that it's not OK to use this string, with a
3351         pointer value serialized into it, outside of debugging.
3352         * platform/graphics/FloatPolygon.h: Updated for the above.
3353
3354         * platform/graphics/ca/GraphicsLayerCA.cpp:
3355         (WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
3356         (WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
3357         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3358         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
3359         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
3360         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3361         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
3362         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
3363         (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
3364         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3365         (WebCore::GStreamerVideoEncoder::makeElement): Ditto.
3366         (WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
3367
3368         * platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
3369         and "using namespace WTF".
3370
3371         * platform/win/GDIObjectCounter.cpp:
3372         (WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
3373         * platform/win/KeyEventWin.cpp:
3374         (WebCore::keyIdentifierForWindowsKeyCode): Ditto.
3375
3376         * rendering/FloatingObjects.cpp:
3377         (WebCore::FloatingObject::debugString const): Added. Moved string conversion here
3378         from the header and use makeString instead of String::format. Also use
3379         the word "debug" to make it clear that it's not OK to use this string, with a
3380         pointer value serialized into it, outside of debugging.
3381         * rendering/FloatingObjects.h: Updated for the above.
3382
3383         * rendering/RenderFragmentContainer.cpp:
3384         (WebCore::RenderFragmentContainer::debugString const): Added. Moved string
3385         conversion here from the header and use makeString instead of String::format.
3386         Also use the word "debug" to make it clear that it's not OK to use this string,
3387         with a pointer value serialized into it, outside of debugging.
3388         * rendering/RenderFragmentContainer.h: Updated for the above.
3389         * rendering/RenderFragmentedFlow.h: Ditto.
3390
3391         * testing/Internals.cpp:
3392         (WebCore::Internals::address): Use makeString instead of String::format.
3393
3394 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3395
3396         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
3397         https://bugs.webkit.org/show_bug.cgi?id=194670
3398         <rdar://problem/39066529>
3399
3400         Reviewed by Tim Horton.
3401
3402         Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
3403         switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
3404         special codepath in WebContentReader::readImage.
3405
3406         This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
3407         attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
3408         contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
3409         attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
3410         conforms to "public.content", we take this codepath instead of first attempting the web content reading types
3411         supported by default in WebKit.
3412
3413         See below for more detail.
3414
3415         Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
3416
3417         * editing/Editor.cpp:
3418         (WebCore::Editor::clientReplacementURLForResource): Deleted.
3419         * editing/Editor.h:
3420         * editing/WebContentReader.h:
3421         * editing/cocoa/WebContentReaderCocoa.mm:
3422         (WebCore::mimeTypeFromContentType):
3423         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
3424         (WebCore::createFragmentAndAddResources):
3425         (WebCore::sanitizeMarkupWithArchive):
3426
3427         Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
3428
3429         (WebCore::WebContentReader::readImage):
3430         (WebCore::attachmentForFilePath):
3431         (WebCore::attachmentForData):
3432
3433         Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
3434         quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
3435         of their similarities into helper functions.
3436
3437         (WebCore::WebContentReader::readDataBuffer):
3438         (WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
3439
3440         Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
3441
3442         * loader/EmptyClients.cpp:
3443         * page/EditorClient.h:
3444         * platform/Pasteboard.h:
3445         * platform/PasteboardItemInfo.h:
3446         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
3447         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
3448         (WebCore::PasteboardItemInfo::encode const):
3449         (WebCore::PasteboardItemInfo::decode):
3450
3451         Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
3452         message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
3453         fidelity order instead.
3454
3455         * platform/PasteboardStrategy.h:
3456         * platform/PlatformPasteboard.h:
3457         * platform/ios/AbstractPasteboard.h:
3458         * platform/ios/PasteboardIOS.mm:
3459         (WebCore::Pasteboard::read):
3460
3461         Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
3462         informationForItemAtIndex out of the inner loop when reading web content.
3463
3464         (WebCore::Pasteboard::readRespectingUTIFidelities):
3465
3466         Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
3467         PasteboardItemInfo, instead of being sent in a separate message.
3468
3469         * platform/ios/PlatformPasteboardIOS.mm:
3470         (WebCore::PlatformPasteboard::informationForItemAtIndex):
3471
3472         Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
3473
3474         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
3475         * platform/ios/WebItemProviderPasteboard.h:
3476         * platform/ios/WebItemProviderPasteboard.mm:
3477         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
3478
3479 2019-02-18  Daniel Bates  <dabates@apple.com>
3480
3481         Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
3482         https://bugs.webkit.org/show_bug.cgi?id=194785
3483
3484         Reviewed by Simon Fraser.
3485
3486         Change from early return to else-clause to make the states clearer and make it more straightforward
3487         to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
3488         switch to uniform initializer syntax.
3489
3490         * rendering/RenderThemeIOS.mm:
3491         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
3492
3493 2019-02-18  Daniel Bates  <dabates@apple.com>
3494
3495         [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
3496         https://bugs.webkit.org/show_bug.cgi?id=193599
3497         <rdar://problem/47399602>
3498
3499         Reviewed by Simon Fraser.
3500
3501         For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
3502         for text fields, textareas, keygens, and selects so as to match the visual appearance of all
3503         the other controls.
3504
3505         Tests: fast/forms/ios/focus-button.html
3506                fast/forms/ios/focus-checkbox.html
3507                fast/forms/ios/focus-checked-checkbox.html
3508                fast/forms/ios/focus-checked-radio.html
3509                fast/forms/ios/focus-radio.html
3510                fast/forms/ios/focus-reset-button.html
3511                fast/forms/ios/focus-search-field.html
3512                fast/forms/ios/focus-submit-button.html
3513                fast/forms/ios/focus-text-field.html
3514                fast/forms/ios/focus-textarea.html
3515
3516         * css/html.css:
3517         (:focus): Use 3px outline width.
3518         (input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
3519         * rendering/RenderBox.cpp:
3520         (WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
3521         * rendering/RenderElement.cpp:
3522         (WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
3523         Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
3524
3525 2019-02-18  Oriol Brufau  <obrufau@igalia.com>
3526
3527         [css-grid] Handle indefinite percentages in fit-content()
3528         https://bugs.webkit.org/show_bug.cgi?id=194509
3529
3530         Reviewed by Javier Fernandez.
3531
3532         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html
3533
3534         If the size of the grid container depends on the size of its tracks,
3535         a percentage in fit-content() is indefinite. Without this patch, some
3536         places treated this case as fit-content(0), which prevented the grid
3537         container from growing enough to contain the max-content contribution
3538         of its grid items.
3539
3540         This patch treats such fit-content() as minmax(auto, max-content),
3541         but once the size of the grid container is known and it is laid out
3542         "for real", then the percentage is definite and it's used.
3543
3544         * rendering/GridTrackSizingAlgorithm.cpp:
3545         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
3546         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
3547
3548 2019-02-18  John Wilander  <wilander@apple.com>
3549
3550         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
3551         https://bugs.webkit.org/show_bug.cgi?id=194777
3552         <rdar://problem/47731945>
3553
3554         Reviewed by Geoffrey Garen and Chris Dumez.
3555
3556         Test: http/tests/storageAccess/remove-requesting-iframe.html
3557
3558         * dom/Document.cpp:
3559         (WebCore::Document::hasFrameSpecificStorageAccess const):
3560             Now checks for the existence of the frame.
3561         (WebCore::Document::setHasFrameSpecificStorageAccess):
3562             Now checks for the existence of the frame.
3563         * loader/ResourceLoadObserver.cpp:
3564         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3565             Now checks that the session ID is valid.
3566
3567 2019-02-18  Jer Noble  <jer.noble@apple.com>
3568
3569         -[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
3570         https://bugs.webkit.org/show_bug.cgi?id=194790
3571         <rdar://problem/33866742>
3572
3573         Reviewed by Jon Lee.
3574
3575         Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
3576         an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
3577
3578         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3579         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
3580
3581 2019-02-18  Joseph Pecoraro  <pecoraro@apple.com>
3582
3583         Web Inspector: Better categorize CPU usage per-thread / worker
3584         https://bugs.webkit.org/show_bug.cgi?id=194564
3585
3586         Reviewed by Devin Rousso.
3587
3588         Test: inspector/cpu-profiler/threads.html
3589
3590         * workers/WorkerThread.cpp:
3591         (WebCore::WorkerThread::workerThreadsMutex):
3592         (WebCore::WorkerThread::workerThreadCount):
3593         (WebCore::WorkerThread::WorkerThread):
3594         (WebCore::WorkerThread::~WorkerThread):
3595         (WebCore::WorkerThread::workerThread):
3596         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
3597         * workers/WorkerThread.h:
3598         (WebCore::WorkerThread::identifier const):
3599         Expose the set of all WorkerThreads.
3600
3601         * inspector/agents/InspectorCPUProfilerAgent.cpp:
3602         (WebCore::InspectorCPUProfilerAgent::collectSample):
3603         Send inspector additional per-thread data.
3604
3605         * page/ResourceUsageData.h:
3606         (WebCore::WorkerCPUInfo::WorkerCPUInfo):
3607         * page/cocoa/ResourceUsageThreadCocoa.mm:
3608         (WebCore::ThreadInfo::ThreadInfo):
3609         (WebCore::threadInfos):
3610         (WebCore::ResourceUsageThread::platformCollectCPUData):
3611         (WebCore::threadSendRights): Deleted.
3612         (WebCore::cpuUsage): Deleted.
3613         Compute per-thread values on cocoa ports.
3614
3615         * page/linux/ResourceUsageThreadLinux.cpp:
3616         (WebCore::ResourceUsageThread::platformCollectCPUData):
3617         Stub per-thread values on linux ports.
3618
3619 2019-02-18  Jer Noble  <jer.noble@apple.com>
3620
3621         Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
3622         https://bugs.webkit.org/show_bug.cgi?id=194786
3623
3624         Reviewed by Eric Carlson.
3625
3626         Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
3627         in an exception handler.
3628
3629         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3630         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
3631
3632 2019-02-18  Daniel Bates  <dabates@apple.com>
3633
3634         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
3635         https://bugs.webkit.org/show_bug.cgi?id=192824
3636         <rdar://problem/47100332>
3637
3638         Reviewed by Wenson Hsieh.
3639
3640         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
3641         now that hardware key events to non-editable elements use the same code path as for editable elements. 
3642
3643         * platform/ios/KeyEventIOS.mm:
3644         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
3645         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
3646         (WebCore::isFunctionKey): Ditto.
3647         * platform/ios/WebEvent.mm:
3648         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
3649         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
3650
3651 2019-02-18  Eric Carlson  <eric.carlson@apple.com>
3652
3653         Add MSE logging configuration
3654         https://bugs.webkit.org/show_bug.cgi?id=194719
3655         <rdar://problem/48122151>
3656
3657         Reviewed by Joseph Pecoraro.
3658
3659         No new tests, updated inspector/console/webcore-logging.html.
3660
3661         * dom/Document.cpp:
3662         (WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
3663
3664         * inspector/agents/WebConsoleAgent.cpp:
3665         (WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
3666
3667 2019-02-18  Antoine Quint  <graouts@apple.com>
3668
3669         [iOS] Dispatch additional events along with pointerdown and pointerup
3670         https://bugs.webkit.org/show_bug.cgi?id=194776
3671         <rdar://problem/48164284>
3672
3673         Reviewed by Brent Fulgham.
3674
3675         The Pointer Events specification mandates that "pointerover" and "pointerenter" events precede a "pointerdown" event and that "pointerout"
3676         and "pointerleave" events follow a "pointerup" event. We remove the EventHandler::dispatchPointerEventForTouchAtIndex() method and replace
3677         it with a PointerCaptureController::dispatchEventForTouchAtIndex() that can handle the dispatch of such additional events correctly, also
3678         allowing for two PointerCaptureController methods (pointerEventWillBeDispatched and pointerEventWasDispatched) to become private.
3679
3680         Test: pointerevents/ios/over-enter-out-leave.html
3681
3682         * dom/EventNames.h: Add the new "pointerover", "pointerenter", "pointerout" and "pointerleave" event types.
3683         * dom/PointerEvent.h:
3684         * dom/ios/PointerEventIOS.cpp:
3685         (WebCore::PointerEvent::create):
3686         * page/EventHandler.cpp:
3687         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex): Deleted.
3688         * page/EventHandler.h:
3689         * page/PointerCaptureController.cpp:
3690         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Take the existing code from EventHandler::dispatchPointerEventForTouchAtIndex()
3691         and extend it to dispatch additional events as mandated. Since several events may be dispatched we check whether the dispatch of any of those events
3692         had defaultPrevented() or defaultHanded() return true and return those values as a pair.
3693         (WebCore::PointerCaptureController::pointerEventWasDispatched):
3694         * page/PointerCaptureController.h:
3695
3696 2019-02-18  Sihui Liu  <sihui_liu@apple.com>
3697
3698         IndexedDB: leak IDBDatabase and IDBTransacstion in layout tests
3699         https://bugs.webkit.org/show_bug.cgi?id=194709
3700
3701         Reviewed by Geoffrey Garen.
3702
3703         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
3704         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
3705
3706         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
3707         between IDBOpenDBRequest and IDBTransaction.
3708
3709         Test: storage/indexeddb/IDBObject-leak.html
3710
3711         * Modules/indexeddb/IDBDatabase.cpp:
3712         (WebCore::IDBDatabase::connectionToServerLost):
3713         * Modules/indexeddb/IDBTransaction.cpp:
3714         (WebCore::IDBTransaction::IDBTransaction):
3715         (WebCore::IDBTransaction::~IDBTransaction):
3716         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
3717         (WebCore::IDBTransaction::connectionClosedFromServer):
3718         * Modules/indexeddb/IDBTransaction.h:
3719         * testing/Internals.cpp:
3720         (WebCore::Internals::numberOfIDBTransactions const):
3721         * testing/Internals.h:
3722         * testing/Internals.idl:
3723
3724 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
3725
3726         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
3727         https://bugs.webkit.org/show_bug.cgi?id=194742
3728
3729         Reviewed by Chris Dumez.
3730
3731         With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
3732         had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
3733
3734         This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
3735         receive notifications.
3736
3737         It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
3738         page load.
3739
3740         * accessibility/mac/AXObjectCacheMac.mm:
3741         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
3742
3743 2019-02-18  Megan Gardner  <megan_gardner@apple.com>
3744
3745         Turn On Smart Delete
3746         https://bugs.webkit.org/show_bug.cgi?id=194320
3747
3748         Reviewed by Ryosuke Niwa.
3749
3750         Updated the following tests to work with iOS:
3751         * editing/deleting/smart-delete-001.html:
3752         * editing/deleting/smart-delete-002.html:
3753         * editing/deleting/smart-delete-003.html:
3754         * editing/deleting/smart-delete-004.html:
3755         * editing/deleting/smart-delete-across-editable-boundaries-2.html:
3756         * editing/selection/delete-word-granularity-text-control.html:
3757
3758         Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other 
3759         platforms to turn on smart delete when desired.
3760
3761         * editing/Editor.cpp:
3762         (WebCore::Editor::shouldSmartDelete):
3763         Allow platfroms to determine if smart delete should be on.
3764         On mac, this is via word granularity, on iOS this is just on all the time.
3765         (WebCore::Editor::canSmartCopyOrDelete):
3766         (WebCore::Editor::performCutOrCopy):
3767         * editing/Editor.h:
3768         * editing/EditorCommand.cpp:
3769         (WebCore::executeDelete):
3770         * editing/ios/EditorIOS.mm:
3771         (WebCore::Editor::shouldSmartDelete):
3772         * editing/mac/EditorMac.mm:
3773         (WebCore::Editor::shouldSmartDelete):
3774
3775 2019-02-17  David Kilzer  <ddkilzer@apple.com>
3776
3777         Unreviewed, rolling out r241620.
3778
3779         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
3780         (Requested by ddkilzer on #webkit.)
3781
3782         Reverted changeset:
3783
3784         "[WTF] Add environment variable helpers"
3785         https://bugs.webkit.org/show_bug.cgi?id=192405
3786         https://trac.webkit.org/changeset/241620
3787
3788 2019-02-16  Zalan Bujtas  <zalan@apple.com>
3789
3790         [LFC] RenderImage's default intrinsic size is 0.
3791         https://bugs.webkit.org/show_bug.cgi?id=194745
3792
3793         Reviewed by Antti Koivisto.
3794
3795         While the images are being loaded, their intrinsic size is set to 0 (RenderImage c'tor). Note that this code is temporary.
3796         * layout/layouttree/LayoutTreeBuilder.cpp:
3797         (WebCore::Layout::TreeBuilder::createSubTree):
3798
3799 2019-02-16  Zalan Bujtas  <zalan@apple.com>
3800
3801         [LFC][BFC] Add support for block replaced intrinsic width.
3802         https://bugs.webkit.org/show_bug.cgi?id=194705
3803
3804         Reviewed by Simon Fraser.
3805
3806         Replaced boxes should report their intrinsic width as preferred widths.
3807
3808         Test: fast/block/block-only/replaced-intrinsic-width-simple.html
3809
3810         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3811         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
3812
3813 2019-02-16  Zalan Bujtas  <zalan@apple.com>
3814
3815         [LFC] Apply min/max width constraints to preferred width computation
3816         https://bugs.webkit.org/show_bug.cgi?id=194739
3817
3818         Reviewed by Simon Fraser.
3819
3820         Ensure that both min-height and max-height are taken into account while computing the preferred width.
3821
3822         Test: fast/block/block-only/min-max-and-preferred-width-simple.html
3823
3824         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3825         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
3826
3827 2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
3828
3829         [JSC] Make builtin objects more lazily initialized under non-JIT mode
3830         https://bugs.webkit.org/show_bug.cgi?id=194727
3831
3832         Reviewed by Saam Barati.
3833
3834         * Modules/streams/ReadableByteStreamInternals.js:
3835         (privateInitializeReadableByteStreamController):
3836         (readableByteStreamControllerRespond):
3837
3838 2019-02-15  Dean Jackson  <dino@apple.com>
3839
3840         Allow emulation of user gestures from Web Inspector console
3841         https://bugs.webkit.org/show_bug.cgi?id=194725
3842         <rdar://problem/48126604>
3843
3844         Reviewed by Joseph Pecoraro and Devin Rousso.
3845
3846         Test: inspector/runtime/evaluate-userGestureEmulation.html
3847
3848         * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
3849         a UserGestureIndicator based on the emulateUserGesture option.
3850         (WebCore::PageRuntimeAgent::evaluate):
3851         * inspector/agents/page/PageRuntimeAgent.h:
3852
3853 2019-02-15  Chris Dumez  <cdumez@apple.com>
3854
3855         Sample domainsVisited diagnostic logging
3856         https://bugs.webkit.org/show_bug.cgi?id=194657
3857
3858         Reviewed by Ryosuke Niwa.
3859
3860         Sample domainsVisited diagnostic logging, we are getting a lot of data from
3861         this key and this is hurting our other keys.
3862
3863         * page/Page.cpp:
3864         (WebCore::Page::logNavigation):
3865
3866 2019-02-15  Ryosuke Niwa  <rniwa@webkit.org>
3867
3868         Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
3869         https://bugs.webkit.org/show_bug.cgi?id=194691
3870
3871         Reviewed by Simon Fraser.
3872
3873         The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
3874         without updating the layout of ancestor documents (i.e. documents in which frame owner
3875         elements appear) even though it hit-tests against the top-level document's RenderView.
3876
3877         Fixed the bug by updating the layout of the top-level document as needed.
3878
3879         Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html
3880
3881         * html/HTMLPlugInElement.cpp:
3882         (WebCore::HTMLPlugInElement::isReplacementObscured):
3883
3884 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
3885
3886         [WTF] Add environment variable helpers
3887         https://bugs.webkit.org/show_bug.cgi?id=192405
3888
3889         Reviewed by Michael Catanzaro.
3890
3891         * platform/NotImplemented.h:
3892         * platform/cocoa/SystemVersion.mm:
3893         (WebCore::createSystemMarketingVersion):
3894         * platform/graphics/gstreamer/GStreamerCommon.cpp:
3895         (WebCore::initializeGStreamer):
3896         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3897         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3898         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
3899         (Nicosia::PaintingEngine::create):
3900         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
3901         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
3902         * platform/graphics/x11/PlatformDisplayX11.cpp:
3903         (WebCore::PlatformDisplayX11::create):
3904         * platform/gtk/RenderThemeWidget.cpp:
3905         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
3906         * platform/gtk/ScrollbarThemeGtk.cpp:
3907         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
3908         * platform/network/curl/CurlContext.cpp:
3909         (WebCore::CurlContext::CurlContext):
3910         (WebCore::EnvironmentVariableReader::read): Deleted.
3911         (WebCore::EnvironmentVariableReader::defined): Deleted.
3912         (WebCore::EnvironmentVariableReader::readAs): Deleted.
3913         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
3914         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
3915         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
3916         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3917         (WebCore::defaultCookieJarPath):
3918         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
3919         (WebCore::getCACertPathEnv):
3920         * platform/network/win/CurlSSLHandleWin.cpp:
3921         (WebCore::getCACertPathEnv):
3922         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3923         (WebCore::topLevelPath):
3924         (WebCore::webkitBuildDirectory):
3925         * platform/unix/LoggingUnix.cpp:
3926         (WebCore::logLevelString):
3927         * platform/win/LoggingWin.cpp:
3928         (WebCore::logLevelString):
3929         Utilize WTF::Environment where possible.
3930
3931 2019-02-15  Antoine Quint  <graouts@apple.com>
3932
3933         Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
3934         https://bugs.webkit.org/show_bug.cgi?id=194702
3935         <rdar://problem/48109355>
3936
3937         Reviewed by Dean Jackson.
3938
3939         * page/EventHandler.cpp:
3940         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
3941         * page/EventHandler.h:
3942
3943 2019-02-15  Per Arne Vollan  <pvollan@apple.com>
3944
3945         [WebVTT] Inline WebVTT styles should start with '::cue'
3946         https://bugs.webkit.org/show_bug.cgi?id=194227
3947
3948         Reviewed by Eric Carlson.
3949
3950         The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
3951         with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
3952