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