[GTK][WPE] Media controls numeric position value is not automatically updated during...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-03-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK][WPE] Media controls numeric position value is not automatically updated during playback
4         https://bugs.webkit.org/show_bug.cgi?id=209051
5
6         Reviewed by Philippe Normand.
7
8         The time label is not updated because updateTime() thinks the media controls are hidden when not hovered, but
9         for audio elements the controls are always visible.
10
11         * Modules/mediacontrols/mediaControlsAdwaita.js:
12         (Controller.prototype.controlsAreAlwaysVisible): Return true for audio elements.
13
14 2020-03-19  Enrique Ocaña González  <eocanha@igalia.com>
15
16         [GTK] media/track/track-automatic-subtitles.html is timing out
17         https://bugs.webkit.org/show_bug.cgi?id=116957
18
19         Reviewed by Adrian Perez de Castro.
20
21         Moved CaptionUserPreferencesMediaAF::textTrackSelectionScore() implementation
22         to the CaptionUserPreferencesMedia superclass.
23
24         Tested by existing test.
25
26         * page/CaptionUserPreferences.cpp:
27         (WebCore::CaptionUserPreferences::textTrackSelectionScore const):
28         * page/CaptionUserPreferencesMediaAF.cpp:
29         * page/CaptionUserPreferencesMediaAF.h:
30
31 2020-03-19  Philippe Normand  <pnormand@igalia.com>
32
33         [GTK][WPE] Unreviewed, build fixes after r258547 when disabling release logging support
34
35         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
36         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
37         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
38         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
39
40 2020-03-19  youenn fablet  <youenn@apple.com>
41
42         Make URL::path() return a StringView
43         https://bugs.webkit.org/show_bug.cgi?id=209173
44
45         Reviewed by Alex Christensen.
46
47         Update code according new path return type.
48
49         * Modules/plugins/YouTubePluginReplacement.cpp:
50         (WebCore::processAndCreateYouTubeURL):
51         (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
52         * html/Autofill.cpp:
53         (WebCore::AutofillData::createFromHTMLFormControlElement):
54         * html/URLUtils.h:
55         (WebCore::URLUtils<T>::pathname const):
56         * loader/FormSubmission.cpp:
57         (WebCore::appendMailtoPostFormDataToURL):
58         * loader/appcache/ManifestParser.cpp:
59         (WebCore::manifestPath):
60         * page/Location.cpp:
61         (WebCore::Location::pathname const):
62         * page/UserContentURLPattern.cpp:
63         (WebCore::MatchTester::MatchTester):
64         (WebCore::UserContentURLPattern::matchesPath const):
65         * page/csp/ContentSecurityPolicySource.cpp:
66         (WebCore::ContentSecurityPolicySource::pathMatches const):
67         * platform/network/curl/CookieJarDB.cpp:
68         (WebCore::CookieJarDB::searchCookies):
69         (WebCore::CookieJarDB::deleteCookie):
70         * platform/network/curl/CookieUtil.cpp:
71         (WebCore::CookieUtil::defaultPathForURL):
72         * platform/network/curl/CurlRequest.cpp:
73         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
74         * platform/text/TextEncoding.cpp:
75         (WebCore::decodeURLEscapeSequences):
76         * platform/text/TextEncoding.h:
77         * workers/WorkerLocation.cpp:
78         (WebCore::WorkerLocation::pathname const):
79         * workers/service/ServiceWorkerContainer.cpp:
80         (WebCore::ServiceWorkerContainer::addRegistration):
81         * workers/service/ServiceWorkerJob.cpp:
82         (WebCore::ServiceWorkerJob::validateServiceWorkerResponse):
83         * workers/service/server/RegistrationDatabase.cpp:
84         (WebCore::RegistrationDatabase::doPushChanges):
85
86 2020-03-18  Peng Liu  <peng.liu6@apple.com>
87
88         The value of [AVPlayerViewController isPictureInPicturePossible] is NO in the first attempt to enter PiP
89         https://bugs.webkit.org/show_bug.cgi?id=204979
90
91         Reviewed by Jer Noble.
92
93         A follow-up patch to fix build failures.
94         This patch also removes a meaningless line in the dealloc of WebAVPlayerViewController.
95
96         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
97         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
98         (-[WebAVPlayerViewController dealloc]):
99         (VideoFullscreenInterfaceAVKit::doEnterFullscreen):
100
101 2020-03-18  Andres Gonzalez  <andresg_22@apple.com>
102
103         Use helper function retainPtr(T*) instead of creating one.
104         https://bugs.webkit.org/show_bug.cgi?id=209269
105
106         Reviewed by Chris Fleizach.
107
108         This is acorrection to patch in bug: https://bugs.webkit.org/show_bug.cgi?id=209247.
109         Use the existing retainPtr helper funtion instead of creating a new helper.
110
111         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
112         (-[WebAccessibilityObjectWrapper attachmentView]):
113         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
114         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
115         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
116         (-[WebAccessibilityObjectWrapper windowElement:]):
117         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
118         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
119         (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]):
120         (-[WebAccessibilityObjectWrapper lineTextMarkerRangeForTextMarker:forUnit:]):
121         (-[WebAccessibilityObjectWrapper textMarkerForTextMarker:atUnit:]):
122         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
123         (retainWrapper): Deleted.
124
125 2020-03-18  Zalan Bujtas  <zalan@apple.com>
126
127         [Multicolumn] RenderListItem::positionListMarker should not fail when the list marker is inside a spanner.
128         https://bugs.webkit.org/show_bug.cgi?id=209262
129         <rdar://problem/58447665>
130
131         Reviewed by Simon Fraser.
132
133         When the list marker is in a column spanner and as a result it gets moved under the column flow, the
134         normal "let's find the list item by walking up on the ancestor chain" does not work anymore.
135         We need to check if this list marker is inside a spanner and climb up on the ancestor chain by
136         using the spanner placeholder position (see RenderListMarker::parentBox).
137         This patch also moves the marker's overflow computation from the list item to the marker.
138
139         Test: fast/multicol/list-item-marker-inside-column-spanner.html
140
141         * rendering/RenderListItem.cpp:
142         (WebCore::RenderListItem::addOverflowFromChildren):
143         (WebCore::RenderListItem::positionListMarker): Deleted.
144         * rendering/RenderListMarker.cpp:
145         (WebCore::RenderListMarker::parentBox):
146         (WebCore::RenderListMarker::addOverflowFromListMarker):
147         (WebCore::RenderListMarker::layout):
148         * rendering/RenderListMarker.h:
149
150 2020-03-18  Simon Fraser  <simon.fraser@apple.com>
151
152         eventSender.monitorWheelEvents() is very fragile
153         https://bugs.webkit.org/show_bug.cgi?id=197819
154         <rdar://problem/51319456>
155
156         Reviewed by Tim Horton.
157
158         Deflake tests using eventSender.monitorWheelEvents() by fixing several causes of flakiness,
159         adding back changes from r257844 that were reverted in r258558.
160         
161         First, have EventSendingController keep track of whether it's seen then "end" event
162         for the scrolling and momentum phases, and pass this down to WheelEventTestMonitor, which
163         now waits until it sees these, which prevents premature triggering which was a common cause of
164         failure before.
165         
166         Second, remove WheelEventTestMonitor's 1/60s timer and instead have WheelEventTestMonitor test
167         for completion in a callout from the end of Page::updateRendering(), which makes it test
168         and fire at a more consistent time.
169         
170         Third, push WheelEventTestMonitor to the ScrollingTree, so that reasons for deferral
171         can be added on the scrolling thread. This fixes an issue where the RunLoop::main().dispatch()
172         used to send the "ScrollingThreadSyncNeeded" reason to the main thread would get delayed,
173         also resulting in a premature trigger.
174
175         * Modules/applepay/ApplePaySession.cpp: Unified sources!
176         * dom/WindowEventLoop.cpp: Unified sources!
177         * page/EventHandler.cpp:
178         (WebCore::EventHandler::handleWheelEvent):
179         * page/FrameView.cpp:
180         (WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
181         * page/Page.cpp:
182         (WebCore::Page::doAfterUpdateRendering):
183         (WebCore::Page::wheelEventTestMonitor const):
184         (WebCore::Page::clearWheelEventTestMonitor):
185         (WebCore::Page::isMonitoringWheelEvents const):
186         (WebCore::Page::ensureWheelEventTestMonitor):
187         * page/Page.h:
188         (WebCore::Page::wheelEventTestMonitor const): Deleted.
189         (WebCore::Page::clearWheelEventTestMonitor): Deleted.
190         (WebCore::Page::isMonitoringWheelEvents const): Deleted.
191         * page/WheelEventTestMonitor.cpp:
192         (WebCore::WheelEventTestMonitor::WheelEventTestMonitor):
193         (WebCore::WheelEventTestMonitor::clearAllTestDeferrals):
194         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartMonitoring):
195         (WebCore::WheelEventTestMonitor::deferForReason):
196         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
197         (WebCore::WheelEventTestMonitor::receivedWheelEvent):
198         (WebCore::WheelEventTestMonitor::scheduleCallbackCheck):
199         (WebCore::WheelEventTestMonitor::checkShouldFireCallbacks):
200         (WebCore::operator<<):
201         (WebCore::WheelEventTestMonitor::setTestCallbackAndStartNotificationTimer): Deleted.
202         (WebCore::WheelEventTestMonitor::triggerTestTimerFired): Deleted.
203         * page/WheelEventTestMonitor.h:
204         (WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
205         (WebCore::WheelEventTestMonitorCompletionDeferrer::~WheelEventTestMonitorCompletionDeferrer):
206         * page/scrolling/AsyncScrollingCoordinator.cpp:
207         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
208         (WebCore::AsyncScrollingCoordinator::deferWheelEventTestCompletionForReason const): Deleted.
209         (WebCore::AsyncScrollingCoordinator::removeWheelEventTestCompletionDeferralForReason const): Deleted.
210         * page/scrolling/AsyncScrollingCoordinator.h:
211         * page/scrolling/ScrollingCoordinator.h:
212         (WebCore::ScrollingCoordinator::startMonitoringWheelEvents):
213         (WebCore::ScrollingCoordinator::stopMonitoringWheelEvents):
214         * page/scrolling/ScrollingTree.cpp:
215         (WebCore::ScrollingTree::handleWheelEvent):
216         * page/scrolling/ScrollingTree.h:
217         (WebCore::ScrollingTree::setWheelEventTestMonitor):
218         (WebCore::ScrollingTree::receivedWheelEvent):
219         * page/scrolling/ThreadedScrollingTree.cpp:
220         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
221         (WebCore::ThreadedScrollingTree::deferWheelEventTestCompletionForReason): Deleted.
222         (WebCore::ThreadedScrollingTree::removeWheelEventTestCompletionDeferralForReason): Deleted.
223         * page/scrolling/ThreadedScrollingTree.h:
224         * page/scrolling/mac/ScrollingCoordinatorMac.h:
225         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
226         (WebCore::ScrollingCoordinatorMac::startMonitoringWheelEvents):
227         (WebCore::ScrollingCoordinatorMac::stopMonitoringWheelEvents):
228         * page/scrolling/mac/ScrollingTreeMac.h:
229         * page/scrolling/mac/ScrollingTreeMac.mm:
230         (ScrollingTreeMac::setWheelEventTestMonitor):
231         (ScrollingTreeMac::receivedWheelEvent):
232         (ScrollingTreeMac::deferWheelEventTestCompletionForReason):
233         (ScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):
234         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
235         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferWheelEventTestCompletionForReason const):
236         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeWheelEventTestCompletionDeferralForReason const):
237         * testing/js/WebCoreTestSupport.cpp:
238         (WebCoreTestSupport::setWheelEventMonitorTestCallbackAndStartMonitoring):
239         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Deleted.
240         * testing/js/WebCoreTestSupport.h:
241
242 2020-03-18  Fujii Hironori  <Hironori.Fujii@sony.com>
243
244         AuthenticatorResponseData::decode should check bufferIsLargeEnoughToContain before allocating buffers
245         https://bugs.webkit.org/show_bug.cgi?id=209133
246
247         Reviewed by Darin Adler.
248
249         Check bufferIsLargeEnoughToContain with the decoded size before
250         allocating buffers.
251
252         Replaced ArrayBuffer::create with ArrayBuffer::tryCreate, and
253         added a null check.
254
255         * Modules/webauthn/AuthenticatorResponseData.h:
256         (WebCore::encodeArrayBuffer): Added.
257         (WebCore::decodeArrayBuffer): Added.
258         (WebCore::AuthenticatorResponseData::encode const):
259         (WebCore::AuthenticatorResponseData::decode):
260
261 2020-03-18  Andres Gonzalez  <andresg_22@apple.com>
262
263         Several TextMarker attributes need to run on the main thread.
264         https://bugs.webkit.org/show_bug.cgi?id=209247
265
266         Reviewed by Chris Fleizach.
267
268         - Dispatch several TextMarker parameterized attributes to the main
269         thread.
270         - Added helper methods to return TextMarkers and TextMarkerRanges for
271         diffferent units of text such as word or sentence.
272         - Added a helper function, retainWrapper to make code a bit more
273         readable in lambda definitions.
274
275         * accessibility/mac/AXObjectCacheMac.mm:
276         (WebCore::textMarkerForVisiblePosition):
277         (WebCore::textMarkerRangeFromVisiblePositions):
278         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
279         (retainWrapper):
280         (-[WebAccessibilityObjectWrapper attachmentView]):
281         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
282         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
283         (-[WebAccessibilityObjectWrapper associatedPluginParent]):
284         (-[WebAccessibilityObjectWrapper windowElement:]):
285         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
286         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
287         (-[WebAccessibilityObjectWrapper textMarkerRangeAtTextMarker:forUnit:]):
288         (-[WebAccessibilityObjectWrapper lineTextMarkerRangeForTextMarker:forUnit:]):
289         (-[WebAccessibilityObjectWrapper textMarkerForTextMarker:atUnit:]):
290         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
291
292 2020-03-18  Zalan Bujtas  <zalan@apple.com>
293
294         [MultiColumn] Ignore spanner boxes inside <legend>
295         https://bugs.webkit.org/show_bug.cgi?id=209248
296         <rdar://problem/51857865>
297
298         Reviewed by Simon Fraser.
299
300         <legend> boxes don't participate in the multicolumn flow, they are simply ignored.
301         This patch ensures that we don't include their descendants in the spanner construction.
302         <column>some<legend><div spanner></div></legend>content</column> <- the "spanner" div won't span the column content. 
303
304         Test: fast/multicol/spanner-inside-legend-crash.html
305
306         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
307         (WebCore::isValidColumnSpanner):
308
309 2020-03-18  Yusuke Suzuki  <ysuzuki@apple.com>
310
311         Add a way to mark a rejected promise as handled
312         https://bugs.webkit.org/show_bug.cgi?id=209241
313
314         Reviewed by Michael Saboff.
315
316         This adds an interface using JSPromise::rejectAsHandled to DOMPromise classes.
317
318         * bindings/js/DOMPromiseProxy.h:
319         (WebCore::DOMPromiseProxy<IDLType>::reject):
320         (WebCore::DOMPromiseProxy<IDLVoid>::reject):
321         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::reject):
322         * bindings/js/JSDOMPromiseDeferred.cpp:
323         (WebCore::DeferredPromise::callFunction):
324         (WebCore::DeferredPromise::reject):
325         * bindings/js/JSDOMPromiseDeferred.h:
326         (WebCore::DeferredPromise::reject):
327         (WebCore::DeferredPromise::rejectWithCallback):
328         (WebCore::DOMPromiseDeferredBase::reject):
329         (WebCore::DOMPromiseDeferredBase::rejectType):
330
331 2020-03-18  youenn fablet  <youenn@apple.com>
332
333         WebPage should own a Ref<WebFrame>
334         https://bugs.webkit.org/show_bug.cgi?id=209235
335
336         Reviewed by Geoffrey Garen.
337
338         * loader/FrameLoaderStateMachine.h:
339         Export committedFirstRealDocumentLoad/
340
341 2020-03-18  Eugene But  <eugenebut@chromium.org>
342
343         Fix ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren crash
344         https://bugs.webkit.org/show_bug.cgi?id=208312
345         
346         Reviewed by Ryosuke Niwa
347
348         ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren
349         was crashing on dereferencing m_firstNodeInserted pointer. Before the crash
350         ReplaceSelectionCommand::InsertedNodes object received the following calls:
351
352         respondToNodeInsertion() with node A, which set m_firstNodeInserted and m_lastNodeInserted to A
353         willRemoveNode() with node B, which left m_firstNodeInserted and m_lastNodeInserted unchanged (A)
354         (node A was destroyed setting m_firstNodeInserted and m_lastNodeInserted to null)
355         respondToNodeInsertion() with node C, which set m_firstNodeInserted and m_lastNodeInserted to C
356         willRemoveNodePreservingChildren() with node C, which set m_firstNodeInserted to null and crashed
357
358         This patch checks m_firstNodeInserted before dereferencing and sets m_lastNodeInserted to null if
359         m_firstNodeInserted became null. It seems like having non-null value for m_lastNodeInserted would
360         be an invalid state.
361
362         Test: editing/pasteboard/insert-apple-style-span-after-timeout.html
363
364         * editing/ReplaceSelectionCommand.cpp:
365         (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
366
367 2020-03-18  Youenn Fablet  <youenn@apple.com>
368
369         CrossOriginPreflightResultCacheItem::allows methods should not use out parameters
370         https://bugs.webkit.org/show_bug.cgi?id=209224
371
372         Reviewed by Alex Christensen.
373
374         Instead of having an out parameter for the error description, either return whether there is an error or not.
375         Covered by existing tests.
376
377         * loader/CrossOriginPreflightResultCache.cpp:
378         (WebCore::CrossOriginPreflightResultCacheItem::validateMethodAndHeaders const):
379         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
380         (WebCore::CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders const):
381         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
382         (WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginHeaders const): Deleted.
383         * loader/CrossOriginPreflightResultCache.h:
384
385 2020-03-18  Peng Liu  <peng.liu6@apple.com>
386
387         The value of [AVPlayerViewController isPictureInPicturePossible] is NO in the first attempt to enter PiP
388         https://bugs.webkit.org/show_bug.cgi?id=204979
389
390         Reviewed by Jer Noble.
391
392         Since [AVPlayerViewControl isPictureInPicturePossible] can be NO initially, we may fail to enter
393         the Picture-in-Picture mode.
394
395         This patch implements the mechanism to observe [AVPlayerViewControl isPictureInPicturePossible] after
396         a user requests to enter the Picture-in-Picture mode, and call [AVPlayerViewController startPictureInPicture]
397         when [AVPlayerViewController isPictureInPicturePossible] changes to YES.
398         A timer is added to monitor the status. If [AVPlayerViewController isPictureInPicturePossible] does not
399         change to YES in 0.5 second, we will give up the attempt.
400
401         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
402         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
403         (-[WebAVPlayerViewController dealloc]):
404         (-[WebAVPlayerViewController MY_NO_RETURN]):
405         (VideoFullscreenInterfaceAVKit::doEnterFullscreen):
406
407 2020-03-18  Frederic Wang  <fwang@igalia.com>
408
409         frame/iframe scrolling attribute does to recognize value "noscroll" or "off"
410         https://bugs.webkit.org/show_bug.cgi?id=208570
411
412         Reviewed by Rob Buis.
413
414         Tests: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute.html
415                imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html
416
417         * html/HTMLFrameElementBase.cpp:
418         (WebCore::HTMLFrameElementBase::scrollingMode const): Treat "noscroll" and "off" the same as "no".
419
420 2020-03-18  Chris Dumez  <cdumez@apple.com>
421
422         [ Mac wk2 ] http/wpt/beacon/beacon-quota.html is flaky failing
423         https://bugs.webkit.org/show_bug.cgi?id=207894
424         <rdar://problem/59551688>
425
426         Reviewed by Geoffrey Garen.
427
428         Add internals API exposing the number of inflight beacon loads for a given navigator object
429         so that the test can rely on it.
430
431         * Modules/beacon/NavigatorBeacon.h:
432         * testing/Internals.cpp:
433         (WebCore::Internals::inflightBeaconsCount const):
434         * testing/Internals.h:
435         * testing/Internals.idl:
436
437 2020-03-18  Frederic Wang  <fwang@igalia.com>
438
439         [intersection-observer] Accept a Document as an explicit root
440         https://bugs.webkit.org/show_bug.cgi?id=208047
441
442         Reviewed by Rob Buis.
443
444         No new tests, no behavior change.
445
446         * page/IntersectionObserver.cpp:
447         (WebCore::IntersectionObserver::create):
448         (WebCore::IntersectionObserver::IntersectionObserver):
449         * page/IntersectionObserver.h:
450         (WebCore::IntersectionObserver::root const):
451
452 2020-03-18  Joonghun Park  <jh718.park@samsung.com>
453
454         Unreviewed. Remove the build warnings below since r256756
455         warning: unused parameter ‘foo’ [-Wunused-parameter]
456
457         no new tests, no new behaviours.
458
459         * testing/Internals.cpp:
460         (WebCore::Internals::readPreferenceInteger):
461         (WebCore::Internals::encodedPreferenceValue):
462         (WebCore::Internals::getUTIFromMIMEType):
463         (WebCore::Internals::getUTIFromTag):
464
465 2020-03-18  Joonghun Park  <jh718.park@samsung.com>
466
467         Unreviewed. Remove the build warning below since r256196
468         warning: variable ‘highlightEnd’ set but not used [-Wunused-but-set-variable]
469
470         no new tests, no new behaviours.
471
472         * rendering/HighlightData.cpp:
473         (WebCore::HighlightData::highlightStateForRenderer):
474
475 2020-03-18  youenn fablet  <youenn@apple.com>
476
477         Make sure a preflight fails if response headers are invalid
478         https://bugs.webkit.org/show_bug.cgi?id=208924
479
480         Reviewed by Alex Christensen.
481
482         Implement https://fetch.spec.whatwg.org/#cors-preflight-fetch-0 step 7.3.
483         In case header parsing is wrong, fail the preflight with a meaningful message.
484         Update parsing of headers to return an Optional so that parsing error is handled as a nullopt.
485         Minor refactoring to return Expected/Optional for error handlng instead of passing an out parameter.
486         Also, adding preflight cache entry if it is valid, no matter whether preflight succeeds or not.
487
488         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-response-validation.any.html
489                imported/w3c/web-platform-tests/fetch/api/cors/cors-preflight-response-validation.any.worker.html
490
491         * loader/CrossOriginAccessControl.cpp:
492         (WebCore::validatePreflightResponse):
493         * loader/CrossOriginPreflightResultCache.cpp:
494         (WebCore::CrossOriginPreflightResultCacheItem::create):
495         (WebCore::CrossOriginPreflightResultCacheItem::validateMethodAndHeaders const):
496         * loader/CrossOriginPreflightResultCache.h:
497         (WebCore::CrossOriginPreflightResultCacheItem::CrossOriginPreflightResultCacheItem):
498         * platform/network/HTTPParsers.h:
499         (WebCore::parseAccessControlAllowList):
500         * platform/network/ResourceResponseBase.cpp:
501         (WebCore::ResourceResponseBase::filter):
502         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
503
504 2020-03-18  Joonghun Park  <jh718.park@samsung.com>
505
506         Unreviewed. Remove the build warning below since r258458
507         warning: unused variable ‘frame’ [-Wunused-variable]
508
509         No new tests, no new behaviors.
510
511         * loader/ResourceLoader.cpp:
512         (WebCore::ResourceLoader::didReceiveResponse):
513
514 2020-03-18  youenn fablet  <youenn@apple.com>
515
516         FrameLoader should own its FrameLoaderClient
517         https://bugs.webkit.org/show_bug.cgi?id=208918
518
519         Reviewed by Geoff Garen.
520
521         Update Frame/FrameLoader constructors to get a UniqueRef<FrameLoaderClient>.
522         This makes the lifetime management much clearer and allows some WebKit1/WebKit2 clean-up.
523
524         Covered by existing tests.
525
526         * loader/EmptyClients.cpp:
527         (WebCore::pageConfigurationWithEmptyClients):
528         * loader/EmptyFrameLoaderClient.h:
529         * loader/FrameLoader.cpp:
530         (WebCore::FrameLoader::FrameLoader):
531         (WebCore::FrameLoader::~FrameLoader):
532         (WebCore::FrameLoader::init):
533         (WebCore::FrameLoader::initForSynthesizedDocument):
534         (WebCore::FrameLoader::didExplicitOpen):
535         (WebCore::FrameLoader::receivedFirstData):
536         (WebCore::FrameLoader::finishedParsing):
537         (WebCore::FrameLoader::loadArchive):
538         (WebCore::FrameLoader::setOpener):
539         (WebCore::FrameLoader::provisionalLoadStarted):
540         (WebCore::FrameLoader::loadInSameDocument):
541         (WebCore::FrameLoader::prepareForLoadStart):
542         (WebCore::FrameLoader::setupForReplace):
543         (WebCore::FrameLoader::load):
544         (WebCore::FrameLoader::loadWithNavigationAction):
545         (WebCore::FrameLoader::loadWithDocumentLoader):
546         (WebCore::FrameLoader::willLoadMediaElementURL):
547         (WebCore::FrameLoader::reloadWithOverrideEncoding):
548         (WebCore::FrameLoader::reload):
549         (WebCore::FrameLoader::setDocumentLoader):
550         (WebCore::FrameLoader::commitProvisionalLoad):
551         (WebCore::FrameLoader::transitionToCommitted):
552         (WebCore::FrameLoader::clientRedirectCancelledOrFinished):
553         (WebCore::FrameLoader::clientRedirected):
554         (WebCore::FrameLoader::closeOldDataSources):
555         (WebCore::FrameLoader::willChangeTitle):
556         (WebCore::FrameLoader::dispatchDidFailProvisionalLoad):
557         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
558         (WebCore::FrameLoader::didReachLayoutMilestone):
559         (WebCore::FrameLoader::didReachVisuallyNonEmptyState):
560         (WebCore::FrameLoader::frameLoadCompleted):
561         (WebCore::FrameLoader::checkLoadComplete):
562         (WebCore::FrameLoader::userAgent const):
563         (WebCore::FrameLoader::dispatchOnloadEvents):
564         (WebCore::FrameLoader::detachViewsAndDocumentLoader):
565         (WebCore::FrameLoader::receivedMainResourceError):
566         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
567         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
568         (WebCore::FrameLoader::loadedResourceFromMemoryCache):
569         (WebCore::FrameLoader::loadDifferentDocumentItem):
570         (WebCore::FrameLoader::cancelledError const):
571         (WebCore::FrameLoader::blockedByContentBlockerError const):
572         (WebCore::FrameLoader::blockedError const):
573         (WebCore::FrameLoader::blockedByContentFilterError const):
574         (WebCore::FrameLoader::connectionProperties):
575         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
576         (WebCore::FrameLoader::dispatchGlobalObjectAvailableInAllWorlds):
577         (WebCore::FrameLoader::didChangeTitle):
578         (WebCore::FrameLoader::dispatchDidCommitLoad):
579         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
580         (WebCore::FrameLoader::completePageTransitionIfNeeded):
581         * loader/FrameLoader.h:
582         * loader/FrameLoaderClient.h:
583         * page/Frame.cpp:
584         (WebCore::Frame::Frame):
585         (WebCore::Frame::create):
586         * page/Frame.h:
587         * page/Page.cpp:
588         (WebCore::Page::Page):
589         * page/PageConfiguration.cpp:
590         (WebCore::PageConfiguration::PageConfiguration):
591         * page/PageConfiguration.h:
592         * workers/service/context/SWContextManager.cpp:
593         * workers/service/context/SWContextManager.h:
594
595 2020-03-18  Philippe Normand  <pnormand@igalia.com>
596
597         [GTK][WPE] Migrate to Flatpak-based dev SDK
598         https://bugs.webkit.org/show_bug.cgi?id=205658
599
600         Reviewed by Carlos Alberto Lopez Perez.
601
602         * platform/text/hyphen/HyphenationLibHyphen.cpp:
603         (WebCore::scanTestDictionariesDirectoryIfNecessary): Check for flatpak-installed dictionaries.
604
605 2020-03-17  Pinki Gyanchandani  <pgyanchandani@apple.com>
606
607         Crash in CSSPrimitiveValue::cleanup
608         https://bugs.webkit.org/show_bug.cgi?id=208316
609
610         Reviewed by Ryosuke Niwa.
611
612         Added a NULL check before calling deref() for CSSUnitType :: CSS_CALC.
613
614         During initialization of CSSCalcValue, createCSS returns nullptr when processing min() operator
615         and there is a category mismatch between length and percent for min() operator
616         as seen in this newly added test case.
617
618         Test: editing/execCommand/primitive-value-cleanup-minimal.html
619
620         * css/CSSPrimitiveValue.cpp:
621         (WebCore::CSSPrimitiveValue::cleanup):
622
623 2020-03-17  Fujii Hironori  <Hironori.Fujii@sony.com>
624
625         SerializedScriptValue::decode should check bufferIsLargeEnoughToContain before allocating a buffer
626         https://bugs.webkit.org/show_bug.cgi?id=209132
627
628         Reviewed by Darin Adler.
629
630         * bindings/js/SerializedScriptValue.h:
631         (WebCore::SerializedScriptValue::decode): Added bufferIsLargeEnoughToContain check.
632         Added a null check for Gigacage::tryMalloc.
633
634 2020-03-17  Chris Fleizach  <cfleizach@apple.com>
635
636         AX: WebKit crashes with VO and keyboard support fails on encapsulated radio button components.
637         https://bugs.webkit.org/show_bug.cgi?id=208844
638         <rdar://problem/60252659>
639
640         Reviewed by Darin Adler.
641
642         Test: accessibility/mac/crash-bounds-for-range.html
643
644         Don't access renderer if nil in getInlineBoxAndOffset.
645
646         * dom/Position.cpp:
647         (WebCore::Position::getInlineBoxAndOffset const):
648
649 2020-03-17  Eric Carlson  <eric.carlson@apple.com>
650
651         TextTrackBase should validate language before setting m_validBCP47Language
652         https://bugs.webkit.org/show_bug.cgi?id=209094
653         <rdar://problem/60439603>
654
655         Unreviewed, address post-commit review comments.
656
657         * html/track/TrackBase.cpp:
658         (WebCore::TrackBase::setLanguage): Use makeString instead of StringBuilder.
659
660 2020-03-17  Eric Carlson  <eric.carlson@apple.com>
661
662         TextTrackBase should validate language before setting m_validBCP47Language
663         https://bugs.webkit.org/show_bug.cgi?id=209094
664         <rdar://problem/60439603>
665
666         Reviewed by Jer Noble.
667         
668         Test: media/track/track-bcp-language.html
669
670         * html/track/TextTrack.idl:
671         * html/track/TrackBase.cpp:
672         (WebCore::TrackBase::TrackBase): Don't set m_validBCP47Language unless the language is valid.
673         (WebCore::TrackBase::setLanguage): Clear m_validBCP47Language if the language is invalid. 
674         Restructure the code to use early returns.
675         (WebCore::TrackBase::validBCP47Language const): Deleted.
676         * html/track/TrackBase.h:
677         (WebCore::TrackBase::validBCP47Language const):
678         * testing/Internals.cpp:
679         (WebCore::Internals::textTrackBCP47Language):
680         * testing/Internals.h:
681         * testing/Internals.idl:
682
683 2020-03-17  Alex Christensen  <achristensen@webkit.org>
684
685         REGRESSION(r254856) Add exception for window.openDatabase to not masquerade as undefined in currently shipping Jesus Calling Devotional app
686         https://bugs.webkit.org/show_bug.cgi?id=209160
687         <rdar://problem/60297073>
688
689         Reviewed by Geoff Garen.
690
691         Manually verified this fixes the app, which compares typeof openDatabase with 'undefined'
692         Going forward, we intend to completely remove WebSQL, so this is a temporary exception to our removal strategy.
693
694         * bindings/js/JSDOMWindowCustom.cpp:
695         (WebCore::JSDOMWindow::openDatabase const):
696         * platform/RuntimeApplicationChecks.h:
697         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
698         (WebCore::IOSApplication::isJesusCalling):
699
700 2020-03-17  Andres Gonzalez  <andresg_22@apple.com>
701
702         AXIsolatedTree removal should set all nodes to be removed on AX secondary thread.
703         https://bugs.webkit.org/show_bug.cgi?id=209169
704
705         Reviewed by Chris Fleizach.
706
707         - AXIsolatedTree::removeTreeForPageID is called on the main thread but
708         it should not remove the nodes in the main thread, but instead add them
709         to the pending changes to be removed on the secondary thread. This was
710         causing the problem of empty new trees when the old tree would go away
711         but the client was holding a reference to an object that has been
712         disconnected and thus had no children.
713         - In addition, this change fixes an isolated tree mode crash in AccessibilityMenuList.
714
715         * accessibility/AXObjectCache.cpp:
716         (WebCore::AXObjectCache::~AXObjectCache):
717         * accessibility/AccessibilityMenuList.cpp:
718         (WebCore::AccessibilityMenuList::isCollapsed const):
719         * accessibility/isolatedtree/AXIsolatedTree.cpp:
720         (WebCore::AXIsolatedTree::removeTreeForPageID):
721
722 2020-03-17  Jacob Uphoff  <jacob_uphoff@apple.com>
723
724         Unreviewed, reverting r257844.
725
726         this revision caused a test to start timing out
727
728         Reverted changeset:
729
730         "(r256513) [ Mac ] fast/scrolling/programmatic-scroll-to-zero-
731         zero.html is a flaky failure"
732         https://bugs.webkit.org/show_bug.cgi?id=207948
733         https://trac.webkit.org/changeset/257844
734
735 2020-03-17  Commit Queue  <commit-queue@webkit.org>
736
737         Unreviewed, reverting r258339.
738         https://bugs.webkit.org/show_bug.cgi?id=209179
739
740         "Is it sometimes breaking rendering" (Requested by youenn on
741         #webkit).
742
743         Reverted changeset:
744
745         "FrameLoader should own its FrameLoaderClient"
746         https://bugs.webkit.org/show_bug.cgi?id=208918
747         https://trac.webkit.org/changeset/258339
748
749 2020-03-17  Philippe Normand  <pnormand@igalia.com>
750
751         RELEASE_LOG should not be Cocoa specific
752         https://bugs.webkit.org/show_bug.cgi?id=195182
753
754         Reviewed by Konstantin Tokarev.
755
756         WPE/GTK build fixes related with Release logging support.
757
758         * bridge/npruntime_internal.h:
759         * dom/ScriptedAnimationController.cpp:
760         (WebCore::throttlingReasonToString):
761         * page/PerformanceLogging.cpp:
762         (WebCore::toString):
763         * page/PerformanceMonitor.cpp:
764         (WebCore::stringForCPUSamplingActivityState):
765         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
766         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
767         (WebCore::MediaPlayerPrivateGStreamer::logChannel const):
768         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
769         (WebCore::MediaPlayerPrivateGStreamer::mediaPlayerLogIdentifier):
770         (WebCore::MediaPlayerPrivateGStreamer::mediaPlayerLogger):
771         * platform/graphics/gstreamer/eme/CDMProxyClearKey.cpp:
772         (WebCore::CDMProxyClearKey::cencDecryptSubsampled):
773         (WebCore::CDMProxyClearKey::initializeGcrypt):
774         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
775         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
776         (WebCore::MediaSourceGStreamer::MediaSourceGStreamer):
777         (WebCore::MediaSourceGStreamer::~MediaSourceGStreamer):
778         (WebCore::MediaSourceGStreamer::addSourceBuffer):
779         (WebCore::MediaSourceGStreamer::logChannel const):
780         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.h:
781         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
782         (WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
783         (WebCore::SourceBufferPrivateGStreamer::logChannel const):
784         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
785         * platform/mediastream/AudioMediaStreamTrackRenderer.cpp:
786         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
787         (WebCore::computeLogLevel):
788         * platform/network/soup/NetworkStorageSessionSoup.cpp:
789         (WebCore::NetworkStorageSession::getRawCookies const):
790
791 2020-03-17  youenn fablet  <youenn@apple.com>
792
793         Safari doesn't insert mDNS candidates to SDP
794         https://bugs.webkit.org/show_bug.cgi?id=209050
795         <rdar://problem/60419936>
796
797         Reviewed by Eric Carlson.
798
799         Instead of removing host candidate lines in SDP, replace the host IP address by the corresponding mDNS name.
800         Covered by updated test.
801
802         * Modules/mediastream/PeerConnectionBackend.cpp:
803         (WebCore::extractIPAddress):
804         (WebCore::PeerConnectionBackend::filterSDP const):
805         (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
806         * Modules/mediastream/PeerConnectionBackend.h:
807
808 2020-03-17  Philippe Normand  <pnormand@igalia.com>
809
810         [GStreamer][MSE] Playback rate update support
811         https://bugs.webkit.org/show_bug.cgi?id=208454
812
813         Reviewed by Xabier Rodriguez-Calvar.
814
815         Implement playback rate update support for the MSE player. Also
816         includes drive-by logging cleanups.
817
818         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
819         (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
820         (WebCore::MediaPlayerPrivateGStreamer::setRate):
821         (WebCore::MediaPlayerPrivateGStreamer::setPreservesPitch):
822         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
823         (WebCore::MediaPlayerPrivateGStreamer::pipeline const):
824         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
825         (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
826         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
827         (WebCore::MediaPlayerPrivateGStreamerMSE::maybeFinishSeek):
828         (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
829         (WebCore::MediaPlayerPrivateGStreamerMSE::updatePlaybackRate): Deleted.
830         (WebCore::MediaPlayerPrivateGStreamerMSE::setRate): Deleted.
831         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
832
833 2020-03-16  Simon Fraser  <simon.fraser@apple.com>
834
835         Remove the zero-delay ScrollingCoordinatorMac commit timer
836         https://bugs.webkit.org/show_bug.cgi?id=209164
837
838         Reviewed by Zalan Bujtas.
839
840         The scrolling tree on macOS should just commit at rendering update time. There's no need
841         for a separate zero-delay timer.
842
843         Tested by existing tests.
844
845         * page/scrolling/mac/ScrollingCoordinatorMac.h:
846         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
847         (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
848         (WebCore::ScrollingCoordinatorMac::pageDestroyed):
849         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
850         (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
851         (WebCore::ScrollingCoordinatorMac::commitTreeState): Deleted.
852
853 2020-03-16  Simon Fraser  <simon.fraser@apple.com>
854
855         Add a bit more UIHitTesting logging, and make it possible to dump EventRegions from WebKit
856         https://bugs.webkit.org/show_bug.cgi?id=209058
857
858         Reviewed by Antti Koivisto.
859
860         Export operator<<(TextStream&, const EventRegion&) so it can be used from Webkit.
861
862         * rendering/EventRegion.h:
863
864 2020-03-16  Tim Horton  <timothy_horton@apple.com>
865
866         Remove a 'using namespace WebCore' in MediaSessionManagerCocoa
867         https://bugs.webkit.org/show_bug.cgi?id=209162
868
869         Reviewed by Simon Fraser.
870
871         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
872         Unified source cleanliness. Not currently causing any trouble, but
873         it did when I changed something locally!
874
875 2020-03-16  ChangSeok Oh  <changseok@webkit.org>
876
877         A change event gets dispatched when textarea gets changed without focus
878         https://bugs.webkit.org/show_bug.cgi?id=202144
879
880         Reviewed by Ryosuke Niwa.
881
882         A crash happens in WebCore::ValidationMessage::buildBubbleTree. An immediate reason
883         is that DOM tree is modified in buildBubbleTree triggered by a timer.
884         The function calls document.updateLayout() that causes a change event
885         for textarea to fire when something changed in the textarea.
886         This bug is not reproduced on Mac because buildBubbleTree is not called.
887         See ValidationMessage::setMessage.
888         On the other hand, the root cause of this issue is triggering the change event
889         for textarea even if it is not focused when a change is made. This behavior
890         is different to what Gecko and Chromium do. When loading the test, they do not
891         trigger the change event although the textarea is filled by the script
892         since the textarea is not focused. Only when we manually make a change (meaning
893         the textarea is focused by user input), the event gets dispatched. To fix it,
894         setChangedSinceLastFormControlChangeEvent(true) is moved below the focus check
895         in HTMLTextAreaElement::subtreeHasChanged();
896
897         Test: fast/forms/textfield-onchange-without-focus.html
898
899         * html/HTMLTextAreaElement.cpp:
900         (WebCore::HTMLTextAreaElement::subtreeHasChanged):
901
902 2020-03-16  Simon Fraser  <simon.fraser@apple.com>
903
904         Update touch event regions once per frame
905         https://bugs.webkit.org/show_bug.cgi?id=209153
906
907         Reviewed by Zalan Bujtas.
908
909         Call document->updateTouchEventRegions() once at the end of Page::updateRendering() instead
910         of relying on a timer.
911
912         Also rename the functions called from Internal to make it clear they are testing-only.
913
914         Page::scrollingStateTreeAsText() needs to eagerly update event regions because they are input
915         to the scrolling tree.
916
917         * dom/Document.cpp:
918         (WebCore::Document::Document):
919         * page/Page.cpp:
920         (WebCore::Page::scrollingStateTreeAsText):
921         (WebCore::Page::touchEventRectsForEventForTesting):
922         (WebCore::Page::passiveTouchEventListenerRectsForTesting):
923         (WebCore::Page::doAfterUpdateRendering):
924         (WebCore::Page::touchEventRectsForEvent): Deleted.
925         (WebCore::Page::passiveTouchEventListenerRects): Deleted.
926         * page/Page.h:
927         * page/scrolling/ScrollingCoordinator.cpp:
928         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
929         * testing/Internals.cpp:
930         (WebCore::Internals::touchEventRectsForEvent):
931         (WebCore::Internals::passiveTouchEventListenerRects):
932
933 2020-03-15  Darin Adler  <darin@apple.com>
934
935         Move most of TextIterator off of live ranges
936         https://bugs.webkit.org/show_bug.cgi?id=209129
937
938         Reviewed by Antti Koivisto.
939
940         - Change almost all arguments and return values of functions in TextIterator.h
941           to use SimpleRange instead of live ranges. Exceptions are an overload of plainText
942           TextIterator::rangeLength, TextIterator::rangeFromLocationAndLength,
943           TextIterator::getLocationAndLengthFromRange, and TextIterator::subrange. Those
944           five are a little trickier to convert, so I will do them each in separate patches.
945
946         - Go with the flow in adding an include of Node.h to BoundaryPoint.h. I had avoided
947           this in the initial version, but now it seems practical to just leave it that way.
948           This led to removing BoundaryPoint.cpp and moving all functions to the header.
949
950         - Converted many member functions of the Position class from using int to unsigned
951           for offsets. The DOM specifies unsigned for offsets, but for some reason we used
952           int for them a lot historically, even though negative numbers don't make sense.
953           New classes like StaticRange, SimpleRange, and BoundaryPoint are already using
954           unsigned exclusively and we'll eventually convert everything.
955
956         - Remove includes of SimpleRange.h from files that also include TextIterator.h,
957           now that TextIterator.h pulls it in.
958
959         * Sources.txt: Removed BoundaryPoint.cpp.
960         * WebCore.xcodeproj/project.pbxproj: Ditto.
961
962         * accessibility/AXObjectCache.cpp:
963         (WebCore::AXObjectCache::traverseToOffsetInRange): Updated to pass a reference
964         to a range rather than a pointer, after null-checking it.
965         (WebCore::AXObjectCache::lengthForRange): Ditto.
966         (WebCore::AXObjectCache::nextBoundary): Ditto.
967         (WebCore::AXObjectCache::previousBoundary): Ditto.
968         * accessibility/AccessibilityObject.cpp:
969         (WebCore::AccessibilityObject::stringForRange const): Ditto.
970         (WebCore::AccessibilityObject::stringForVisiblePositionRange): Ditto.
971         (WebCore::AccessibilityObject::lengthForVisiblePositionRange const): Ditto.
972
973         * accessibility/AccessibilityObjectInterface.h: Removed an extra include.
974
975         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
976         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
977         Updated to pass a reference to a range rather than a pointer, after null-checking it.
978         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
979         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]): Ditto.
980
981         * dom/BoundaryPoint.cpp: Removed.
982
983         * dom/BoundaryPoint.h: Removed redundant includes and forward declarations
984         since we're now committing to including "Node.h" here. Moved functions
985         all out of the .cpp file and made them inlines.
986
987         * dom/DocumentMarkerController.cpp:
988         (WebCore::DocumentMarkerController::collectTextRanges): Pass a reference to
989         a range instead of a pointer.
990
991         * dom/Position.cpp:
992         (WebCore::Position::Position): Take unsigned.
993         (WebCore::Position::moveToPosition): Ditto.
994         (WebCore::Position::moveToOffset): Ditto.
995         (WebCore::Position::parentAnchoredEquivalent const): Cast to unsigned.
996         (WebCore::Position::anchorTypeForLegacyEditingPosition): Take unsigned.
997         (WebCore::Position::previous const): Use unsigned.
998         (WebCore::Position::next const): Ditto.
999         (WebCore::Position::uncheckedPreviousOffset): Take unsigned.
1000         (WebCore::Position::uncheckedPreviousOffsetForBackwardDeletion): Ditto.
1001         (WebCore::Position::uncheckedNextOffset): Ditto.
1002         (WebCore::Position::atLastEditingPositionForNode const): Cast to unsigned.
1003         (WebCore::Position::atEndOfTree const): Ditto.
1004         (WebCore::Position::rendersInDifferentPosition const): Added casts to
1005         unsigned and also removed unneeded redundant checks. In a place where
1006         we had already checked that both nodes were the same and both offsets
1007         were different, we were checking the types of both nodes (but they are
1008         the same so only need to check one) and we were checking that both
1009         offsets were different (but we already knew they were different).
1010         (WebCore::searchAheadForBetterMatch): Use unsigned.
1011         (WebCore::Position::getInlineBoxAndOffset const): Ditto.
1012         (WebCore::Position::equals const): Removed a cast to int.
1013         (WebCore::makeBoundaryPoint): Moved this function here so now it can be
1014         used in more places.
1015
1016         * dom/Position.h: Changed many argument types to unsigned. Moved declarations
1017         of all the functions up above all the inline implementations of the functions
1018         to separate interface from implementation a bit better. Wrote a FIXME about
1019         the name createLegacyEditingPosition. Moved makeBoundaryPoint here and exported
1020         it from WebCore so we can use it from more places.
1021
1022         * dom/Range.cpp:
1023         (WebCore::createLiveRange): Moved these functions here from SimpleRange.cpp
1024         because a live range is more advanced concept, so makes more sense for live
1025         range to know about simple range rather than vice versa.
1026
1027         * dom/Range.h: Removed some unneeded includes and forward declarations.
1028         Added a FIXME about renaming to LiveRange. Moved the createLiveRange
1029         functions here. Moved declarations of functions above inline function bodies.
1030
1031         * dom/SimpleRange.cpp:
1032         (WebCore::createLiveRange): Moved to Range.cpp.
1033
1034         * dom/SimpleRange.h: Exported the constructor. Removed unneeded overload
1035         that takes a Range*.
1036
1037         * editing/ApplyStyleCommand.cpp:
1038         (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
1039         Refactored code a bit and use unsigned.
1040         (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): Use unsigned.
1041
1042         * editing/Editing.cpp:
1043         (WebCore::visibleImageElementsInRangeWithNonLoadedImages): Use a reference
1044         to a range rather than a pointer.
1045
1046         * editing/Editing.h: Added a forward declaration of Range that now seems to
1047         be needed to compile.
1048
1049         * editing/Editor.cpp:
1050         (WebCore::Editor::selectedText const): Call makeBoundaryPoint twice here to
1051         convert two Position objects into a SimpleRange.
1052
1053         * editing/HTMLInterchange.cpp: Removed some extra includes.
1054         (WebCore::convertHTMLTextToInterchangeFormat): Use variadic
1055         StringBuilder::append.
1056
1057         * editing/TextIterator.cpp:
1058         (WebCore::firstNode): Added. We use this instead of Range::firstNode.
1059         If we find we need it outside TextIterator we can find a header for it.
1060         Not sure it would be great to add it to in BoundaryPoint.h, nor is it
1061         obviously better as a BoundaryPoint member function.
1062         (WebCore::TextIterator::TextIterator): Cut down on the extra constructors
1063         and have the single remaining one take a SimpleRange.
1064         (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
1065         Ditto. Also change some int to unsigned.
1066         (WebCore::CharacterIterator::CharacterIterator): Ditto.
1067         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): Ditto.
1068         (WebCore::WordAwareIterator::WordAwareIterator): Ditto.
1069         (WebCore::TextIterator::rangeLength): Since this is one of the functions
1070         that still takes a live range pointer, updated it to check for null and
1071         pass a reference rather than a pointer.
1072         (WebCore::TextIterator::rangeFromLocationAndLength): Ditto.
1073         (WebCore::hasAnyPlainText): Removed now-unneeded call to createLiveRange.
1074         (WebCore::plainText): Updated the main implementation to take a SimpleRange,
1075         eliminating the version that takes two Position objects, but keeping the
1076         one that takes a live range pointer for now.
1077         (WebCore::plainTextReplacingNoBreakSpace): Removed all but the one, and
1078         have that one take a SimpleRange.
1079
1080         * editing/TextIterator.h: Removed the include of SimpleRange.h. Also
1081         Updated for the changes above, eliminating five different constructors
1082         that take a live range and also overloads that take two Position objects.
1083
1084         * editing/TextManipulationController.cpp:
1085         (WebCore::ParagraphContentIterator::ParagraphContentIterator):
1086         Call makeBoundaryPoint twice here to convert two Position objects into
1087         a SimpleRange.
1088
1089         * editing/VisibleSelection.cpp: Removed an include.
1090
1091         * editing/VisibleUnits.cpp:
1092         (WebCore::suffixLengthForRange): Pass a reference to a range known to
1093         not be null.
1094         (WebCore::previousBoundary): Ditto.
1095         (WebCore::nextBoundary): Ditto.
1096
1097         * editing/cocoa/DataDetection.mm:
1098         (WebCore::buildQuery): Take a SimpleRange.
1099         (WebCore::DataDetection::detectContentInRange): Added a null check on
1100         a live range and pass a reference to it.
1101         * editing/cocoa/DictionaryLookup.mm:
1102         (WebCOre::DictionaryLookup::rangeAtHitTestResult): Ditto.
1103
1104         * editing/cocoa/HTMLConverter.mm:
1105         (WebCore::editingAttributedStringFromRange): Pass a reference to a range
1106         known to not be null.
1107         * page/TextIndicator.cpp:
1108         (WebCore::estimatedTextColorsForRange): Ditto.
1109         (WebCore::containsOnlyWhiteSpaceText): Ditto.
1110         * page/ios/FrameIOS.mm:
1111         (WebCore::Frame::interpretationsForCurrentRoot const): Ditto.
1112
1113         * rendering/HitTestResult.cpp:
1114         (WebCore::HitTestResult::selectedText const): Added a null check on
1115         a live range and pass a reference to it.
1116
1117 2020-03-16  Pinki Gyanchandani  <pgyanchandani@apple.com>
1118
1119         Crash in CSSValue::isPrimitiveValue
1120         https://bugs.webkit.org/show_bug.cgi?id=208309
1121
1122         Reviewed by Ryosuke Niwa.
1123
1124         Added a NULL check before dereferencing value in ApplyStyleCommand::computedFontSize
1125
1126         Test: editing/execCommand/primitive-value.html
1127
1128         * editing/ApplyStyleCommand.cpp:
1129         (WebCore::ApplyStyleCommand::computedFontSize):
1130
1131 2020-03-16  Megan Gardner  <megan_gardner@apple.com>
1132
1133         Color Picker crashes on touch
1134         https://bugs.webkit.org/show_bug.cgi?id=209086
1135
1136         Reviewed by Darin Adler.
1137
1138         Vector sizing lost in refactor. Not perfomance sensitive code, so just expanding vector as needed.
1139
1140         Test: fast/forms/color/color-input-activate-crash.html
1141
1142         * html/ColorInputType.cpp:
1143         (WebCore::ColorInputType::suggestedColors const):
1144
1145 2020-03-16  Simon Fraser  <simon.fraser@apple.com>
1146
1147         Remove FrameView::scheduleRenderingUpdate()
1148         https://bugs.webkit.org/show_bug.cgi?id=209109
1149
1150         Reviewed by Antti Koivisto.
1151
1152         FrameView::scheduleRenderingUpdate() called through to compositor(), but that just
1153         turned around to call scheduleRenderingUpdate() via Page. So Remove it and change
1154         callers to call Page::scheduleRenderingUpdate() directly.
1155
1156         * page/FrameView.cpp:
1157         (WebCore::FrameView::setViewExposedRect):
1158         (WebCore::FrameView::scheduleRenderingUpdate): Deleted.
1159         * page/FrameView.h:
1160         * page/Page.cpp:
1161         (WebCore::Page::scheduleRenderingUpdate):
1162         * page/Page.h:
1163         * rendering/RenderLayerCompositor.cpp:
1164         (WebCore::RenderLayerCompositor::scheduleRenderingUpdate):
1165
1166 2020-03-16  Simon Fraser  <simon.fraser@apple.com>
1167
1168         Commit Xcode-modified xcfilelist.
1169
1170         New WebXR idl files.
1171
1172         * DerivedSources-input.xcfilelist:
1173         * DerivedSources-output.xcfilelist:
1174
1175 2020-03-14  Simon Fraser  <simon.fraser@apple.com>
1176
1177         Factor some post-updateRendering code into its own function
1178         https://bugs.webkit.org/show_bug.cgi?id=209108
1179
1180         Reviewed by Antti Koivisto.
1181
1182         Make a new function to hold code that needs to do post update-rendering work.
1183         It asserts that the layout is clean at the end.
1184
1185         * page/Page.cpp:
1186         (WebCore::Page::updateRendering):
1187         (WebCore::Page::doAfterUpdateRendering):
1188         * page/Page.h:
1189
1190 2020-03-16  Daniel Bates  <dabates@apple.com>
1191
1192         ASSERTION FAILURE: !result.innerNode() || (request.resultIsElementList() && result.listBasedTestResult().size()) in RenderLayer::hitTestContents()
1193         https://bugs.webkit.org/show_bug.cgi?id=209112
1194
1195         Reviewed by Darin Adler.
1196
1197         Fix rect-based hit testing (e.g. used in the impl of document.elementsFromPoint()) of ::before
1198         and ::after pseudo elements. Same issue as in r133330, updateHitTestResult() and addNodeToRectBasedTestResult()
1199         are using different "hit" nodes. In particular, RenderObject::updateHitTestResult() knows how to
1200         reason about ::before and ::after pseudo elements, but addNodeToRectBasedTestResult() cannot.
1201         Standardize the concept of the node used for hit testing from something-specifically added to RenderBlock
1202         in r133330 to all renderers. Have both updateHitTestResult() and addNodeToRectBasedTestResult()
1203         make use of this concept so that they consider the same hit node.
1204
1205         Test: fast/dom/nodesFromRect/pseudo-empty-svg-image-crash.html
1206
1207         * layout/integration/LayoutIntegrationLineLayout.cpp:
1208         (WebCore::LayoutIntegration::LineLayout::hitTest):
1209         * rendering/EllipsisBox.cpp:
1210         (WebCore::EllipsisBox::nodeAtPoint):
1211         * rendering/InlineFlowBox.cpp:
1212         (WebCore::InlineFlowBox::nodeAtPoint):
1213         * rendering/InlineTextBox.cpp:
1214         (WebCore::InlineTextBox::nodeAtPoint):
1215         Update code to call nodeForHitTest() to keep the code behavior we have today. Note that RenderElement::element()
1216         and RenderText::textNode() just cast the return value of RenderObject::node().
1217         * rendering/RenderBlock.cpp:
1218         (WebCore::RenderBlock::nodeForHitTest const): Remove special case for RenderView now that I added RenderView::nodeForHitTest().
1219         Moreover, this special case was returning the document even though RenderView::updateHitTestResult() hit
1220         test the document element. See remarks for RenderView::nodeForHitTest() for more details.
1221         * rendering/RenderBlock.h:
1222         * rendering/RenderBox.cpp:
1223         (WebCore::RenderBox::nodeAtPoint): Use nodeForHitTest(). This fixes the bug. Currently, updateHitTestResult()
1224         knows that when RenderObject::node() is nullptr and the parent renderer is for generated content that it can
1225         walk up the hierarchy to find the hit PseudoElement. But in the call to addNodeToListBasedTestResult(), RenderObject::element()
1226         was passed, which is nullptr for an anonymous node, and addNodeToListBasedTestResult() doesn't have enough info
1227         to know that this means generated content was hit and hence it is not able to find the PseudoElement. This
1228         disagreement caused the assertion failure because updateHitTestResult() would update the inner node, but
1229         addNodeToListBasedTestResult() would not add a node to the set.
1230         * rendering/RenderInline.cpp:
1231         (WebCore::RenderInline::hitTestCulledInline): Use nodeForHitTest().
1232         (WebCore::RenderInline::updateHitTestResult): Update code as needed to use nodeForHitTest(). Also while I
1233         am here fix up code style of comment and rename the local from element to node to match the return value
1234         of nodeForHitTest().
1235         * rendering/RenderMultiColumnSet.cpp:
1236         (WebCore::RenderMultiColumnSet::nodeForHitTest const): Added.
1237         (WebCore::RenderMultiColumnSet::updateHitTestResult): Update code as needed to use nodeForHitTest().
1238         * rendering/RenderMultiColumnSet.h:
1239         * rendering/RenderObject.cpp:
1240         (WebCore::RenderObject::nodeForHitTest const): Added.
1241         (WebCore::RenderObject::updateHitTestResult): Update code as needed to use nodeForHitTest().
1242         * rendering/RenderObject.h:
1243         * rendering/RenderTable.cpp:
1244         (WebCore::RenderTable::nodeAtPoint): Ditto.
1245         * rendering/RenderView.cpp:
1246         (WebCore::RenderView::nodeForHitTest const): Added. This overrides RenderBlock::nodeForHitTest(), which
1247         following r155370 was returning the document as the hit test node even though RenderView::updateHitTestResult()
1248         considered the document element as the hit node for a RenderView. As a result of this change, the rect-based
1249         hit testing no longer returns the document (seen in test results as #document) in the list of nodes.
1250         (WebCore::RenderView::updateHitTestResult): Update code as needed to use nodeForHitTest().
1251         * rendering/RenderView.h:
1252         * rendering/SimpleLineLayoutFunctions.cpp:
1253         (WebCore::SimpleLineLayout::hitTestFlow): Ditto.
1254         * rendering/svg/RenderSVGContainer.cpp:
1255         (WebCore::RenderSVGContainer::nodeAtFloatPoint): Ditto.
1256         * rendering/svg/RenderSVGImage.cpp:
1257         (WebCore::RenderSVGImage::nodeAtFloatPoint): Ditto.
1258         * rendering/svg/RenderSVGRoot.cpp:
1259         (WebCore::RenderSVGRoot::nodeAtPoint): Ditto.
1260         * rendering/svg/RenderSVGShape.cpp:
1261         (WebCore::RenderSVGShape::nodeAtFloatPoint): Ditto.
1262         * rendering/svg/SVGInlineTextBox.cpp:
1263         (WebCore::SVGInlineTextBox::nodeAtPoint): Ditto.
1264
1265 2020-03-16  Youenn Fablet  <youenn@apple.com>
1266
1267         Make CoreAudioCaptureSourceFactoryIOS an AudioSession::InterruptionObserver
1268         https://bugs.webkit.org/show_bug.cgi?id=209138
1269
1270         Reviewed by Eric Carlson.
1271
1272         Instead of listening to Audiosession interruptions, CoreAudioCaptureSourceFactoryIOS is now relying on AudioSession directly.
1273         This allows removing some duplicate code.
1274         No change of behavior.
1275
1276         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
1277         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
1278         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
1279         (WebCore::CoreAudioCaptureSourceFactoryIOS::CoreAudioCaptureSourceFactoryIOS):
1280         (WebCore::CoreAudioCaptureSourceFactoryIOS::~CoreAudioCaptureSourceFactoryIOS):
1281         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]): Deleted.
1282
1283 2020-03-16  Youenn Fablet  <youenn@apple.com>
1284
1285         Apply rotation at source level if WebRTC sink ask so
1286         https://bugs.webkit.org/show_bug.cgi?id=205645
1287
1288         Reviewed by Eric Carlson.
1289
1290         Add a virtual method to RealtimeMediaSource to pass the information that the sink prefers the frames to be rotated before sending them.
1291 r       By default, the method does nothing and RealtimeOutgoingVideoSource will continue to do the rotation itself.
1292         Update ImageRotationSessionVT to be more easily usable by users having MediaSample instead of CVPixelBuffer.
1293         Update RealtimeOutgoingVideoSource to use that routine: whenever applying rotation is needed,
1294         it will ask its track source to apply rotation. If the track source cannot do it, it will do it on its own.
1295
1296         Test: webrtc/video-rotation-no-cvo.html
1297
1298         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1299         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
1300         * WebCore.xcodeproj/project.pbxproj:
1301         * platform/graphics/cv/ImageRotationSessionVT.h:
1302         (WebCore::operator==):
1303         (WebCore::operator!=):
1304         * platform/graphics/cv/ImageRotationSessionVT.mm:
1305         (WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
1306         (WebCore::ImageRotationSessionVT::initialize):
1307         (WebCore::ImageRotationSessionVT::rotate):
1308         * platform/mediastream/RealtimeMediaSource.h:
1309         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
1310         (WebCore::RealtimeOutgoingVideoSource::setSource):
1311         (WebCore::RealtimeOutgoingVideoSource::applyRotation):
1312         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
1313         * platform/mediastream/RealtimeOutgoingVideoSource.h:
1314
1315 2020-03-16  youenn fablet  <youenn@apple.com>
1316
1317         Audio is not played from an audio element when the srcObject object has unstarted video tracks
1318         https://bugs.webkit.org/show_bug.cgi?id=207041
1319         <rdar://problem/59084745>
1320
1321         Reviewed by Eric Carlson.
1322
1323         In case MediaPlayer is an audio element, we should just make it as if there is no video track in the stream.
1324
1325         Test: imported/w3c/web-platform-tests/webrtc/audio-video-element-playing.html
1326
1327         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1328         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1329         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
1330         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
1331         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::activeVideoTrack const):
1332         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didPassCORSAccessCheck const):
1333         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
1334         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
1335         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
1336         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
1337
1338 2020-03-16  youenn fablet  <youenn@apple.com>
1339
1340         RTCRtpSender of kind video should have a null dtmf attribute
1341         https://bugs.webkit.org/show_bug.cgi?id=209135
1342
1343         Reviewed by Eric Carlson.
1344
1345         Test: imported/w3c/web-platform-tests/webrtc/RTCRtpSender.https.html
1346
1347         * Modules/mediastream/RTCRtpSender.cpp:
1348         (WebCore::RTCRtpSender::dtmf):
1349
1350         * rendering/line/LineLayoutTraversal.h: Removed some unneeded includes.
1351         * testing/Internals.cpp: Ditto.
1352
1353 2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
1354
1355         [WebXR] IDLs, stubs and build configuration for WPE
1356         https://bugs.webkit.org/show_bug.cgi?id=208702
1357
1358         Reviewed by Dean Jackson.
1359
1360         Added the IDLs defined by the spec with very basic empty implementations to get them
1361         built. Apart from that a very basic implementation of the required platform code using
1362         OpenXR API was also added.
1363
1364         No new tests as no new functionality was really added (empty implementations). However
1365         follow up patches will import the already available WPT tests for WebXR.
1366
1367         Largely based on previous work by Žan Doberšek.
1368
1369         * CMakeLists.txt:
1370         * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
1371         * DerivedSources.make:
1372         * Modules/webxr/NavigatorWebXR.cpp: Added.
1373         (WebCore::NavigatorWebXR::xr):
1374         (WebCore::NavigatorWebXR::from):
1375         * Modules/webxr/NavigatorWebXR.h: Added.
1376         * Modules/webxr/NavigatorWebXR.idl: Added.
1377         * Modules/webxr/WebXRBoundedReferenceSpace.cpp: Added.
1378         (WebCore::WebXRBoundedReferenceSpace::boundsGeometry const):
1379         * Modules/webxr/WebXRBoundedReferenceSpace.h: Added.
1380         * Modules/webxr/WebXRBoundedReferenceSpace.idl: Added.
1381         * Modules/webxr/WebXRFrame.cpp: Added.
1382         (WebCore::WebXRFrame::create):
1383         (WebCore::WebXRFrame::WebXRFrame):
1384         (WebCore::WebXRFrame::session const):
1385         (WebCore::WebXRFrame::getViewerPose):
1386         (WebCore::WebXRFrame::getPose):
1387         * Modules/webxr/WebXRFrame.h: Added.
1388         * Modules/webxr/WebXRFrame.idl: Added.
1389         * Modules/webxr/WebXRInputSource.cpp: Added.
1390         (WebCore::WebXRInputSource::create):
1391         (WebCore::WebXRInputSource::WebXRInputSource):
1392         (WebCore::WebXRInputSource::handedness const):
1393         (WebCore::WebXRInputSource::targetRayMode const):
1394         (WebCore::WebXRInputSource::targetRaySpace const):
1395         (WebCore::WebXRInputSource::gripSpace const):
1396         (WebCore::WebXRInputSource::profiles const):
1397         * Modules/webxr/WebXRInputSource.h: Added.
1398         * Modules/webxr/WebXRInputSource.idl: Added.
1399         * Modules/webxr/WebXRInputSourceArray.cpp: Added.
1400         (WebCore::WebXRInputSourceArray::length const):
1401         (WebCore::WebXRInputSourceArray::item const):
1402         * Modules/webxr/WebXRInputSourceArray.h: Added.
1403         * Modules/webxr/WebXRInputSourceArray.idl: Added.
1404         * Modules/webxr/WebXRPose.cpp: Added.
1405         (WebCore::WebXRPose::create):
1406         (WebCore::WebXRPose::WebXRPose):
1407         (WebCore::WebXRPose::transform const):
1408         (WebCore::WebXRPose::emulatedPosition const):
1409         * Modules/webxr/WebXRPose.h: Added.
1410         * Modules/webxr/WebXRPose.idl: Added.
1411         * Modules/webxr/WebXRReferenceSpace.cpp: Added.
1412         (WebCore::WebXRReferenceSpace::WebXRReferenceSpace):
1413         (WebCore::WebXRReferenceSpace::getOffsetReferenceSpace):
1414         * Modules/webxr/WebXRReferenceSpace.h: Added.
1415         * Modules/webxr/WebXRReferenceSpace.idl: Added.
1416         * Modules/webxr/WebXRRenderState.cpp: Added.
1417         (WebCore::WebXRRenderState::create):
1418         (WebCore::WebXRRenderState::WebXRRenderState):
1419         (WebCore::WebXRRenderState::depthNear const):
1420         (WebCore::WebXRRenderState::depthFar const):
1421         (WebCore::WebXRRenderState::inlineVerticalFieldOfView const):
1422         (WebCore::WebXRRenderState::baseLayer const):
1423         * Modules/webxr/WebXRRenderState.h: Added.
1424         * Modules/webxr/WebXRRenderState.idl: Added.
1425         * Modules/webxr/WebXRRigidTransform.cpp: Added.
1426         (WebCore::WebXRRigidTransform::create):
1427         (WebCore::WebXRRigidTransform::WebXRRigidTransform):
1428         (WebCore::WebXRRigidTransform::position const):
1429         (WebCore::WebXRRigidTransform::orientation const):
1430         (WebCore::WebXRRigidTransform::matrix const):
1431         (WebCore::WebXRRigidTransform::inverse const):
1432         * Modules/webxr/WebXRRigidTransform.h: Added.
1433         * Modules/webxr/WebXRRigidTransform.idl: Added.
1434         * Modules/webxr/WebXRSession.cpp: Added.
1435         (WebCore::WebXRSession::environmentBlendMode const):
1436         (WebCore::WebXRSession::visibilityState const):
1437         (WebCore::WebXRSession::renderState const):
1438         (WebCore::WebXRSession::inputSources const):
1439         (WebCore::WebXRSession::updateRenderState):
1440         (WebCore::WebXRSession::requestReferenceSpace):
1441         (WebCore::WebXRSession::requestAnimationFrame):
1442         (WebCore::WebXRSession::cancelAnimationFrame):
1443         (WebCore::WebXRSession::end):
1444         (WebCore::WebXRSession::activeDOMObjectName const):
1445         (WebCore::WebXRSession::stop):
1446         * Modules/webxr/WebXRSession.h: Added.
1447         * Modules/webxr/WebXRSession.idl: Added.
1448         * Modules/webxr/WebXRSpace.cpp: Added.
1449         (WebCore::WebXRSpace::WebXRSpace):
1450         * Modules/webxr/WebXRSpace.h: Added.
1451         * Modules/webxr/WebXRSpace.idl: Added.
1452         * Modules/webxr/WebXRSystem.cpp: Added.
1453         (WebCore::WebXRSystem::create):
1454         (WebCore::WebXRSystem::WebXRSystem):
1455         (WebCore::WebXRSystem::isSessionSupported):
1456         (WebCore::WebXRSystem::requestSession):
1457         (WebCore::WebXRSystem::activeDOMObjectName const):
1458         (WebCore::WebXRSystem::stop):
1459         * Modules/webxr/WebXRSystem.h: Added.
1460         * Modules/webxr/WebXRSystem.idl: Added.
1461         * Modules/webxr/WebXRView.cpp: Added.
1462         (WebCore::WebXRView::create):
1463         (WebCore::WebXRView::WebXRView):
1464         (WebCore::WebXRView::eye const):
1465         (WebCore::WebXRView::projectionMatrix const):
1466         (WebCore::WebXRView::transform const):
1467         * Modules/webxr/WebXRView.h: Added.
1468         * Modules/webxr/WebXRView.idl: Added.
1469         * Modules/webxr/WebXRViewerPose.cpp: Added.
1470         (WebCore::WebXRViewerPose::create):
1471         (WebCore::WebXRViewerPose::views const):
1472         * Modules/webxr/WebXRViewerPose.h: Added.
1473         * Modules/webxr/WebXRViewerPose.idl: Added.
1474         * Modules/webxr/WebXRViewport.cpp: Added.
1475         (WebCore::WebXRViewport::create):
1476         (WebCore::WebXRViewport::x const):
1477         (WebCore::WebXRViewport::y const):
1478         (WebCore::WebXRViewport::width const):
1479         (WebCore::WebXRViewport::height const):
1480         * Modules/webxr/WebXRViewport.h: Added.
1481         * Modules/webxr/WebXRViewport.idl: Added.
1482         * Modules/webxr/WebXRWebGLLayer.cpp: Added.
1483         (WebCore::WebXRWebGLLayer::create):
1484         (WebCore::WebXRWebGLLayer::WebXRWebGLLayer):
1485         (WebCore::WebXRWebGLLayer::antialias const):
1486         (WebCore::WebXRWebGLLayer::ignoreDepthValues const):
1487         (WebCore::WebXRWebGLLayer::framebuffer const):
1488         (WebCore::WebXRWebGLLayer::framebufferWidth const):
1489         (WebCore::WebXRWebGLLayer::framebufferHeight const):
1490         (WebCore::WebXRWebGLLayer::getViewport):
1491         (WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor):
1492         * Modules/webxr/WebXRWebGLLayer.h: Added.
1493         * Modules/webxr/WebXRWebGLLayer.idl: Added.
1494         * Modules/webxr/XREnvironmentBlendMode.h: Added.
1495         * Modules/webxr/XREnvironmentBlendMode.idl: Added.
1496         * Modules/webxr/XREye.h: Added.
1497         * Modules/webxr/XREye.idl: Added.
1498         * Modules/webxr/XRFrameRequestCallback.h: Added.
1499         * Modules/webxr/XRFrameRequestCallback.idl: Added.
1500         * Modules/webxr/XRHandedness.h: Added.
1501         * Modules/webxr/XRHandedness.idl: Added.
1502         * Modules/webxr/XRInputSourceEvent.cpp: Added.
1503         (WebCore::XRInputSourceEvent::create):
1504         (WebCore::XRInputSourceEvent::XRInputSourceEvent):
1505         (WebCore::XRInputSourceEvent::frame const):
1506         (WebCore::XRInputSourceEvent::inputSource const):
1507         (WebCore::XRInputSourceEvent::buttonIndex const):
1508         * Modules/webxr/XRInputSourceEvent.h: Added.
1509         * Modules/webxr/XRInputSourceEvent.idl: Added.
1510         * Modules/webxr/XRInputSourcesChangeEvent.cpp: Added.
1511         (WebCore::XRInputSourcesChangeEvent::create):
1512         (WebCore::XRInputSourcesChangeEvent::XRInputSourcesChangeEvent):
1513         (WebCore::XRInputSourcesChangeEvent::session const):
1514         (WebCore::XRInputSourcesChangeEvent::added const):
1515         (WebCore::XRInputSourcesChangeEvent::removed const):
1516         * Modules/webxr/XRInputSourcesChangeEvent.h: Added.
1517         * Modules/webxr/XRInputSourcesChangeEvent.idl: Added.
1518         * Modules/webxr/XRReferenceSpaceEvent.cpp: Added.
1519         (WebCore::XRReferenceSpaceEvent::create):
1520         (WebCore::XRReferenceSpaceEvent::XRReferenceSpaceEvent):
1521         (WebCore::XRReferenceSpaceEvent::referenceSpace const):
1522         (WebCore::XRReferenceSpaceEvent::transform const):
1523         * Modules/webxr/XRReferenceSpaceEvent.h: Added.
1524         * Modules/webxr/XRReferenceSpaceEvent.idl: Added.
1525         * Modules/webxr/XRReferenceSpaceType.h: Added.
1526         * Modules/webxr/XRReferenceSpaceType.idl: Added.
1527         * Modules/webxr/XRRenderStateInit.h: Added.
1528         * Modules/webxr/XRRenderStateInit.idl: Added.
1529         * Modules/webxr/XRSessionEvent.cpp: Added.
1530         (WebCore::XRSessionEvent::create):
1531         (WebCore::XRSessionEvent::XRSessionEvent):
1532         (WebCore::XRSessionEvent::session const):
1533         * Modules/webxr/XRSessionEvent.h: Added.
1534         * Modules/webxr/XRSessionEvent.idl: Added.
1535         * Modules/webxr/XRSessionInit.h: Added.
1536         * Modules/webxr/XRSessionInit.idl: Added.
1537         * Modules/webxr/XRSessionMode.h: Added.
1538         * Modules/webxr/XRSessionMode.idl: Added.
1539         * Modules/webxr/XRTargetRayMode.h: Added.
1540         * Modules/webxr/XRTargetRayMode.idl: Added.
1541         * Modules/webxr/XRVisibilityState.h: Added.
1542         * Modules/webxr/XRVisibilityState.idl: Added.
1543         * Modules/webxr/XRWebGLLayerInit.h: Added.
1544         * Modules/webxr/XRWebGLLayerInit.idl: Added.
1545         * PlatformWPE.cmake: Added OpenXR libraries and include paths.
1546         * Sources.txt: Added new cpp files.
1547         * WebCore.xcodeproj/project.pbxproj: Added new files.
1548         * bindings/IDLTypes.h: Added SequenceStorageType.
1549         * bindings/js/JSDOMConvertSequences.h:
1550         * bindings/js/WebCoreBuiltinNames.h:
1551         * dom/EventNames.h:
1552         * dom/EventNames.in: Added WebXR events.
1553         * dom/EventTargetFactory.in: Added WebXR event targets.
1554         * page/RuntimeEnabledFeatures.h: Added new runtime feature for WebXR.
1555         (WebCore::RuntimeEnabledFeatures::setWebXREnabled):
1556         (WebCore::RuntimeEnabledFeatures::webXREnabled const):
1557         * platform/xr/PlatformXR.cpp: Added.
1558         * platform/xr/PlatformXR.h: Added.
1559         * platform/xr/openxr/PlatformXR.cpp: Added.
1560         (PlatformXR::createStructure): Utility function to create OpenXR structs.
1561         (PlatformXR::resultToString): Translates OpenXR error codes to strings.
1562         (PlatformXR::Instance::Impl::Impl):
1563         (PlatformXR::Instance::Impl::~Impl):
1564         (PlatformXR::Instance::singleton):
1565
1566 2020-03-16  Zan Dobersek  <zdobersek@igalia.com>
1567
1568         [Cairo] Path copy constructor and operator must also copy over CTM
1569         https://bugs.webkit.org/show_bug.cgi?id=183327
1570
1571         Reviewed by Carlos Garcia Campos.
1572
1573         Cairo implementations of Path copy constructor and assignment operator
1574         must also copy over the current transformation matrix that's maintained
1575         on the source path's cairo_t context.
1576
1577         cairo_copy_path() copies the current path off of a Cairo context, but
1578         during that also transforms every point on the path through inverse of
1579         the CTM, back into user coordinates. For copying to be done correctly,
1580         the copied path must be transformed through the CTM when it's appended
1581         to the target Cairo context. For that reason the CTM has to be copied
1582         over from source to target context before the path is copied and
1583         appended.
1584
1585         * platform/graphics/cairo/PathCairo.cpp:
1586         (WebCore::Path::Path):
1587         (WebCore::Path::operator=):
1588
1589 2020-03-16  youenn fablet  <youenn@apple.com>
1590
1591         Unique origins should not be Potentially Trustworthy
1592         https://bugs.webkit.org/show_bug.cgi?id=209049
1593
1594         Reviewed by Darin Adler.
1595
1596         Unique origins should not be considered trustworthy as per https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy.
1597
1598         Test: http/tests/security/iframe-unique-origin.https.html
1599
1600         * dom/Document.cpp:
1601         (WebCore::Document::isSecureContext const):
1602         Removed check for top level origins as we make all unique origins not trusted.
1603         * page/SecurityOrigin.cpp:
1604
1605 2020-03-16  youenn fablet  <youenn@apple.com>
1606
1607         Remove the use of empty WebRTC sources for receiver tracks
1608         https://bugs.webkit.org/show_bug.cgi?id=209061
1609
1610         Reviewed by Eric Carlson.
1611
1612         We no longer need to create receivers with empty sources since we now always have a libwebrtc receiver from which we can get the track.
1613         We remove that code path.
1614         This sldo allows using the right track parameters from the start, like track id.
1615
1616         Covered by existing and rebased tests.
1617
1618         * Modules/mediastream/RTCPeerConnection.h:
1619         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1620         (WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
1621         (WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
1622         (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
1623         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1624         (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
1625         (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
1626         (WebCore::LibWebRTCPeerConnectionBackend::addTransceiverFromTrackOrKind):
1627         (WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver):
1628         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1629         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
1630         (WebCore::LibWebRTCRtpReceiverBackend::createSource):
1631         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
1632         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
1633         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
1634         * platform/mediastream/RealtimeIncomingAudioSource.h:
1635         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
1636         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
1637         * platform/mediastream/RealtimeIncomingVideoSource.h:
1638         * testing/MockLibWebRTCPeerConnection.h:
1639         (WebCore::MockMediaStreamTrack::state const):
1640         (WebCore::MockRtpReceiver::SetObserver):
1641
1642 2020-03-16  Hurnjoo Lee  <hurnjoo.lee@samsung.com>, Fujii Hironori  <Hironori.Fujii@sony.com>, Carlos Garcia Campos  <cgarcia@igalia.com>
1643
1644         [Cairo][SVG] marker-mid isn't shown on a joint of rectilinearly connected line-to path segments
1645         https://bugs.webkit.org/show_bug.cgi?id=113849
1646
1647         Reviewed by Adrian Perez de Castro.
1648
1649         Marker-mid of svg is not displayed because path elements that added to
1650         cairo backend are optimized. If the new line_to has same slope with
1651         the previous path element, then the path element is joined to previous
1652         path element.
1653
1654         Example:
1655
1656         added path elements : moveto(-5,-2), lineto(0,-2), lineto(5,-2)
1657         cairo_path_data : moveto(-5,-2), lineto(5, -2)
1658
1659         This patch stores all of path informations separately in order to avoid
1660         this problem. When generating positions of markers, we use stored path
1661         informations instead of cairo_path_data.
1662
1663         When a new operation can't be directly stored in an ElementPath, we fallback to use cairo_path_data() in
1664         Path::apply().
1665
1666         * platform/graphics/Path.h: Add new constructor that receives a cairo context, make ensureCairoPath() private
1667         and add m_elements member.
1668         * platform/graphics/cairo/FontCairo.cpp:
1669         (WebCore::Font::platformPathForGlyph const): Create a cairo context for the path and use the new constructor
1670         that receives a RefPtr<cairo_t>&&.
1671         * platform/graphics/cairo/PathCairo.cpp:
1672         (WebCore::Path::Path): Initialize m_elements to an empty vector when created without a cairo context.
1673         (WebCore::Path::operator=): Also copy m_elements.
1674         (WebCore::Path::clear): Initialize m_elements to an empty vector.
1675         (WebCore::Path::translate): Apply the translate to elements in m_elements.
1676         (WebCore::Path::appendElement): Helper to add an operation to m_elements.
1677         (WebCore::Path::moveToSlowCase): Call appendElement() if m_elements is not nullopt.
1678         (WebCore::Path::addLineToSlowCase): Ditto.
1679         (WebCore::Path::addRect): Ditto.
1680         (WebCore::Path::addQuadCurveToSlowCase): Ditto.
1681         (WebCore::Path::addBezierCurveToSlowCase): Ditto.
1682         (WebCore::Path::addArcSlowCase): Set m_elements to nullopt.
1683         (WebCore::Path::addArcTo): Ditto.
1684         (WebCore::Path::addEllipse): Ditto.
1685         (WebCore::Path::addPath): Ditto.
1686         (WebCore::Path::closeSubpath): Call appendElement() if m_elements is not nullopt.
1687         (WebCore::Path::applySlowCase const): Use elements from m_elements if it's not nullopt, otherwise fallback to
1688         use cairo_path_data.
1689         (WebCore::Path::transform): Apply the transform to elements in m_elements.
1690
1691 2020-03-16  Rob Buis  <rbuis@igalia.com>
1692
1693         Remove addHTTPOriginIfNeeded calls
1694         https://bugs.webkit.org/show_bug.cgi?id=209127
1695
1696         Reviewed by Darin Adler.
1697
1698         Remove addHTTPOriginIfNeeded calls since they are get requests and navigations and the spec [1]
1699         indicates that the Origin header should not be written out, making these calls no-ops.
1700
1701        [1] https://fetch.spec.whatwg.org/#append-a-request-origin-header
1702
1703         * loader/FrameLoader.cpp:
1704         (WebCore::FrameLoader::changeLocation):
1705         (WebCore::FrameLoader::loadURL):
1706
1707 2020-03-16  Rob Buis  <rbuis@igalia.com>
1708
1709         Simplify ChromeClient.createWindow
1710         https://bugs.webkit.org/show_bug.cgi?id=209123
1711
1712         Reviewed by Darin Adler.
1713
1714         Simplify ChromeClient.createWindow by removing the FrameLoadRequest parameter.
1715         It was only passed for its ResourceRequest member, which can also be obtained
1716         from the NavigationAction parameter.
1717
1718         * loader/EmptyClients.h:
1719         * loader/FrameLoader.cpp:
1720         (WebCore::createWindow):
1721         * page/Chrome.cpp:
1722         (WebCore::Chrome::createWindow const):
1723         * page/Chrome.h:
1724         * page/ChromeClient.h:
1725         * page/ContextMenuController.cpp:
1726         (WebCore::openNewWindow):
1727
1728 2020-03-15  Fujii Hironori  <Hironori.Fujii@sony.com>
1729
1730         KeyedDecoderGeneric fails to allocate Vector while decoding broken data
1731         https://bugs.webkit.org/show_bug.cgi?id=207324
1732
1733         Reviewed by Darin Adler.
1734
1735         There were three crash bugs in it.
1736
1737         KeyedDecoderGeneric was trying to allocate a buffer without
1738         ensuring the size wouldn't exceed the decoding data size by using
1739         bufferIsLargeEnoughToContain.
1740
1741         It was trying to push an itme into the top dictionary of emtpy
1742         m_dictionaryStack when EndObject tag would appear without the
1743         preceding BeginObject tag.
1744
1745         It was trying to push an item into the top array of empty
1746         m_arrayStack when EndArray tag would appear without the preceding
1747         BeginArray tag.
1748
1749         Tests: TestWebKitAPI: KeyedCoding.DecodeRandomData
1750
1751         * platform/generic/KeyedDecoderGeneric.cpp:
1752         (WebCore::readString):
1753         (WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric):
1754         Check bufferIsLargeEnoughToContain(size) before allocating a Vector with size.
1755         Check if m_dictionaryStack and m_arrayStack are empty.
1756
1757 2020-03-15  Chris Dumez  <cdumez@apple.com>
1758
1759         [DRT] InternalSettingsGenerated::resetToConsistentState() may override TestOptions::enableBackForwardCache
1760         https://bugs.webkit.org/show_bug.cgi?id=207481
1761         <rdar://problem/59331661>
1762
1763         Reviewed by Darin Adler.
1764
1765         Add a support for a new excludeFromInternalSetting option in Settings.yaml and use it for
1766         'usesBackForwardCache' setting. This means that script will no longer be able to toggle
1767         this particular setting via internals.settings JS API. Tests wanting to turn on the
1768         back / forward cache are supposed to use the following:
1769         <!-- webkit-test-runner [ enableBackForwardCache=true ] -->
1770
1771         Using internals.settings JS API to turn on the back/forward cache would not work well
1772         with WebKit2 because of process-swap-on-navigation. Support for it in WK1 / DRT was
1773         causing flakiness because of a conflict between the 2 ways of enabling the setting.
1774
1775         * Scripts/GenerateSettings.rb:
1776         * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb:
1777         * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb:
1778         * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb:
1779         * page/Settings.yaml:
1780
1781 2020-03-15  Zalan Bujtas  <zalan@apple.com>
1782
1783         [LFC][TFC] Add basic column span support for content box width
1784         https://bugs.webkit.org/show_bug.cgi?id=209120
1785         <rdar://problem/60463424>
1786
1787         Reviewed by Antti Koivisto.
1788
1789         Take the column spanning into account when computing the content width for the table cell.
1790         [content box width = column width(1) + column width(2) + .. + column width(spanning value) + ((spanning value - 1) * horizontal spacing)]
1791
1792         Test: fast/layoutformattingcontext/table-colspan-simple.html
1793
1794         * layout/tableformatting/TableFormattingContext.cpp:
1795         (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
1796         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
1797         (WebCore::Layout::TableFormattingContext::positionTableCells):
1798         * layout/tableformatting/TableFormattingContext.h:
1799         * layout/tableformatting/TableGrid.cpp:
1800         (WebCore::Layout::TableGrid::appendCell):
1801         * layout/tableformatting/TableGrid.h:
1802         (WebCore::Layout::TableGrid::CellInfo::startColumn const):
1803         (WebCore::Layout::TableGrid::CellInfo::endColumn const):
1804         (WebCore::Layout::TableGrid::CellInfo::startRow const):
1805         (WebCore::Layout::TableGrid::CellInfo::endRow const):
1806         (WebCore::Layout::TableGrid::CellInfo::columnSpan const):
1807         (WebCore::Layout::TableGrid::CellInfo::rowSpan const):
1808
1809 2020-03-15  Yusuke Suzuki  <ysuzuki@apple.com>
1810
1811         Should not use variable-length-array (VLA)
1812         https://bugs.webkit.org/show_bug.cgi?id=209043
1813
1814         Reviewed by Mark Lam.
1815
1816         * Configurations/Base.xcconfig:
1817         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1818         (WebCore::wrapSerializedCryptoKey):
1819         (WebCore::unwrapSerializedCryptoKey):
1820         * html/canvas/WebGL2RenderingContext.cpp:
1821         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
1822         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1823         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
1824         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
1825         (WebCore::updateDisplayID):
1826         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
1827
1828 2020-03-14  Brent Fulgham  <bfulgham@apple.com>
1829
1830         Add missing checks needed for AppBound Quirk
1831         https://bugs.webkit.org/show_bug.cgi?id=209117
1832         <rdar://problem/60460097>
1833
1834         Reviewed by John Wilander.
1835
1836         The checks for the 'NeedsInAppBrowserPrivacyQuirks' flag added in r258101 was incomplete.
1837         Two additional call sites need to check the state of the flag.
1838
1839         * bindings/js/ScriptController.cpp:
1840         (WebCore::ScriptController::executeScriptInWorld): Add missing check for the quirk.
1841         * loader/FrameLoaderClient.h: Add new API for the 'NeedsInAppBrowserPrivacyQuirks'
1842         debug flag.
1843         * page/Frame.cpp:
1844         (WebCore::Frame::injectUserScriptImmediately): Ditto.
1845
1846 2020-03-10  Darin Adler  <darin@apple.com>
1847
1848         Change all return values in TextIterator header from live ranges to SimpleRange
1849         https://bugs.webkit.org/show_bug.cgi?id=208906
1850
1851         Reviewed by Antti Koivisto.
1852
1853         This is another step in moving off of live ranges for WebKit internals.
1854
1855         - Change return values of remaining functions that were returning live ranges in
1856           the TextIterator header to return SimpleRange.
1857         - Change some arguments from live ranges to SimpleRange.
1858         - At some call sites, use createLiveRange to convert the SimpleRange into a live
1859           range (for now), but at others update the code to use SimpleRange.
1860         - Renamed a version of findPlainText that returns a boolean to containsPlainText.
1861         - Convert call sites that were using createLiveRange just to use the
1862           Range::startPosition and Range::endPosition functions to instead use a new
1863           overload of the createLegacyEditingPosition function that can be used with
1864           SimpleRange::start and SimpleRange::end because it takes a BoundaryPoint.
1865
1866         * accessibility/AXObjectCache.cpp:
1867         (WebCore::AXObjectCache::rangeMatchesTextNearRange): Return Optional<SimpleRange>
1868         and take SimpleRange argument.
1869         (WebCore::AXObjectCache::previousBoundary): Updated since
1870         SimplifiedBackwardsTextIterator::range now returns SimpleRange.
1871         * accessibility/AXObjectCache.h: Updated for the above.
1872
1873         * accessibility/AccessibilityObjectInterface.h:
1874         (WebCore::AXCoreObject::containsText const): Updated for name change.
1875         Now containsPlainText instead of findPlainText.
1876
1877         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1878         (-[WebAccessibilityObjectWrapper arrayOfTextForTextMarkers:attributed:]):
1879         Use createLegacyEditingPosition instead of createLiveRange.
1880         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]): Use createLiveRange.
1881
1882         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1883         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
1884         Use createLegacyEditingPosition instead of createLiveRange.
1885
1886         * dom/Position.cpp:
1887         (WebCore::createLegacyEditingPosition): Added an overload that takes a BoundaryPoint.
1888         * dom/Position.h: Updated for the above, also removed unneeded includes and forward
1889         declarations.
1890
1891         * editing/Editing.cpp:
1892         (WebCore::visiblePositionForIndexUsingCharacterIterator): Updated since
1893         CharacterIterator::range is now a SimpleRange, use createLegacyEditingPosition.
1894
1895         * editing/Editor.cpp:
1896         (WebCore::Editor::advanceToNextMisspelling): Updated since CharacterIterator::range
1897         is now a SimpleRange.
1898         (WebCore::Editor::rangeOfString): Updated since findPlainText now returns a
1899         SimpleRange; use createLiveRange.
1900         (WebCore::Editor::countMatchesForText): Ditto.
1901
1902         * editing/TextIterator.cpp:
1903         (WebCore::SimplifiedBackwardsTextIterator::range const): Return a SimpleRange.
1904         (WebCore::CharacterIterator::range const): Ditto.
1905         (WebCore::characterSubrange): Updated since CharacterIterator::range returns
1906         a SimpleRange. Use createLiveRange.
1907         (WebCore::BackwardsCharacterIterator::BackwardsCharacterIterator): Cut down
1908         code here by initializing data members in the class definition.
1909         (WebCore::BackwardsCharacterIterator::range const): Return a SimpleRange.
1910         (WebCore::WordAwareIterator::WordAwareIterator): Cut down code here by
1911         initializing data members in the class definition.
1912         (WebCore::hasAnyPlainText): Take a SimpleRange, use createLiveRange.
1913         (WebCore::plainTextUsingBackwardsTextIteratorForTesting): Take a SimpleRange,
1914         use createLiveRange.
1915         (WebCore::collapsedToBoundary): Take and return a SimpleRange.
1916         (WebCore::findPlainTextMatches): Take a SimpleRange, use createLiveRange.
1917         (WebCore::rangeForMatch): Take and return a SimpleRange.
1918         (WebCore::findClosestPlainText): Ditto.
1919         (WebCore::findPlainText): Ditto.
1920         (WebCore::containsPlainText): Renamed from findPlainText since this returns
1921         a boolean, not a found location of some text.
1922         * editing/TextIterator.h: Updated for the above. Also changed some data
1923         members to use unsigned for offsets rather than int.
1924
1925         * editing/TextManipulationController.cpp:
1926         (WebCore::ParagraphContentIterator::startPosition): Use
1927         createLegacyEditingPosition instead of createLiveRange.
1928         (WebCore::ParagraphContentIterator::endPosition): Ditto.
1929
1930         * editing/VisiblePosition.h: Added a forward declaration here since Position.h
1931         no longer forward declares it.
1932
1933         * editing/VisibleSelection.cpp:
1934         (WebCore::VisibleSelection::appendTrailingWhitespace): Updated since
1935         CharacterIterator::range is now a SimpleRange, use createLegacyEditingPosition.
1936         * editing/VisibleUnits.cpp:
1937         (WebCore::previousBoundary): Ditto.
1938         (WebCore::nextBoundary): Ditto.
1939
1940         * testing/Internals.cpp:
1941         (WebCore::Internals::rangeOfStringNearLocation): Updated since
1942         findClosestPlainText now returns a SimpleRange, use createLiveRange.
1943
1944 2020-03-14  Zalan Bujtas  <zalan@apple.com>
1945
1946         [LFC][TFC] Fill in the gaps with anonymous table cell boxes
1947         https://bugs.webkit.org/show_bug.cgi?id=209114
1948         <rdar://problem/60458806>
1949
1950         Reviewed by Antti Koivisto.
1951
1952         17.5 Visual layout of table contents
1953         A "missing cell" is a cell in the row/column grid that is not
1954         occupied by an element or pseudo-element. Missing cells are rendered
1955         as if an anonymous table-cell box occupied their position in the grid.
1956         (https://www.w3.org/TR/CSS22/tables.html)
1957
1958         This helps to keep TableGrid an actual grid.
1959
1960         Test: fast/layoutformattingcontext/table-missing-cells-simple.html
1961
1962         * layout/layouttree/LayoutTreeBuilder.cpp:
1963         (WebCore::Layout::TreeBuilder::buildTableStructure):
1964
1965 2020-03-14  Peng Liu  <peng.liu6@apple.com>
1966
1967         Cleanup RenderMediaControls.cpp and RenderMediaControlElements.cpp
1968         https://bugs.webkit.org/show_bug.cgi?id=209008
1969
1970         Reviewed by Daniel Bates.
1971
1972         Merge RenderMediaControls.[h|cpp] and RenderMediaControlElements.[h|cpp].
1973         Remove class RenderMediaVolumeSliderContainer because we can use RenderBlockFlow
1974         to render MediaControlTextTrackContainerElement.
1975
1976         No new tests, no functional change.
1977
1978         * Sources.txt:
1979         * WebCore.xcodeproj/project.pbxproj:
1980         * html/shadow/MediaControlElementTypes.cpp:
1981         * html/shadow/MediaControlElements.cpp:
1982         (WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
1983         * rendering/RenderMediaControlElements.cpp: Removed.
1984         * rendering/RenderMediaControlElements.h: Removed.
1985         * rendering/RenderMediaControls.cpp:
1986         (WebCore::RenderMediaVolumeSliderContainer::RenderMediaVolumeSliderContainer):
1987         (WebCore::RenderMediaVolumeSliderContainer::layout):
1988         (WebCore::RenderMediaControlTimelineContainer::RenderMediaControlTimelineContainer):
1989         (WebCore::RenderMediaControlTimelineContainer::layout):
1990         * rendering/RenderMediaControls.h:
1991         * rendering/RenderThemeMac.mm:
1992
1993 2020-03-14  Daniel Bates  <dabates@apple.com>
1994
1995         Share HitTestResult::addNodeToListBasedTestResult() impl for LayoutRect and FloatRect overloads
1996         https://bugs.webkit.org/show_bug.cgi?id=209107
1997
1998         Reviewed by Brady Eidson.
1999
2000         Remove code duplication for adding a node to the result set.
2001
2002         * rendering/HitTestResult.cpp:
2003         (WebCore::HitTestResult::addNodeToListBasedTestResultCommon): Added.
2004         (WebCore::HitTestResult::addNodeToListBasedTestResult): Write in terms of addNodeToListBasedTestResultCommon().
2005         * rendering/HitTestResult.h:
2006
2007 2020-03-14  Zalan Bujtas  <zalan@apple.com>
2008
2009         [Tree building] Reset the fragmented flow status before calling child.willBeRemovedFromTree.
2010         https://bugs.webkit.org/show_bug.cgi?id=209100
2011         <rdar://problem/60434672>
2012
2013         Reviewed by Simon Fraser.
2014
2015         ::willBeRemovedFromTree() assumes all the cleanup has happened and it's the final step before calling d'tor.
2016         It clears m_fragmentList that resetFragmentedFlowStateOnRemoval() later checks for consistency (m_fragmentList.contains(fragment)).
2017
2018         Test: fast/multicol/reparent-fragment-flow-content.html
2019
2020         * rendering/updating/RenderTreeBuilder.cpp:
2021         (WebCore::RenderTreeBuilder::detachFromRenderElement):
2022
2023 2020-03-14  Rob Buis  <rbuis@igalia.com>
2024
2025         Set Origin header value to null rather than omitting it
2026         https://bugs.webkit.org/show_bug.cgi?id=186030
2027
2028         Reviewed by Youenn Fablet.
2029
2030         For every redirect, addHTTPOriginIfNeeded should be called to
2031         make sure that the tainted origin logic is applied [1, Step 10] and
2032         thus the request after redirect has the correct Origin header.
2033
2034         Make AppleWin treat 308 redirects like 307 and so keeping http
2035         methods across redirects. This is similar to
2036         https://bugs.webkit.org/show_bug.cgi?id=154348.
2037
2038         [1] https://fetch.spec.whatwg.org/#concept-http-network-or-cache-fetch
2039
2040         * loader/FrameLoader.cpp:
2041         (WebCore::FrameLoader::addHTTPOriginIfNeeded):
2042         * loader/SubresourceLoader.cpp:
2043         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2044         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
2045         (WebCore::ResourceHandleCFURLConnectionDelegate::createResourceRequest):
2046
2047 2020-03-14  Ryosuke Niwa  <rniwa@webkit.org>
2048
2049         Call SVGTRefElement::buildPendingResource in SVGElement::didFinishInsertingNode
2050         https://bugs.webkit.org/show_bug.cgi?id=208981
2051
2052         Reviewed by Antti Koivisto.
2053
2054         This patch moves the call to SVGTRefElement::buildPendingResource from SVGElement::insertedIntoAncestor
2055         to SVGElement::didFinishInsertingNode.
2056
2057         * svg/SVGElement.cpp:
2058         (WebCore::SVGElement::insertedIntoAncestor): Return true when the element has a pending resource ID.
2059         (WebCore::SVGElement::didFinishInsertingNode): Added. Calls buildPendingResourcesIfNeeded.
2060         * svg/SVGElement.h:
2061
2062 2020-03-13  Said Abou-Hallawa  <said@apple.com>
2063
2064         SVGMatrix should have the access right of its owner SVGTransform always
2065         https://bugs.webkit.org/show_bug.cgi?id=207462
2066
2067         Reviewed by Simon Fraser.
2068
2069         The SVGMatrix needs to be reattached to its owner SVGTransform when the
2070         access right of this owner changes. The access right of the owner changes
2071         when it gets attached to or detached from a higher level owner.
2072
2073         Test: svg/dom/SVGTransformList-anim-read-only.html
2074
2075         * svg/SVGTransform.h:
2076         * svg/properties/SVGProperty.h:
2077         (WebCore::SVGProperty::attach):
2078         (WebCore::SVGProperty::detach):
2079         (WebCore::SVGProperty::reattach):
2080
2081 2020-03-13  Alex Christensen  <achristensen@webkit.org>
2082
2083         WKWebView._negotiatedLegacyTLS should be correct after back/forward navigations
2084         https://bugs.webkit.org/show_bug.cgi?id=209011
2085         <rdar://problem/59370588>
2086
2087         Reviewed by Youenn Fablet.
2088
2089         This is basically r258343 but for legacy TLS negotiation instead of plaintext HTTP use.
2090
2091         * dom/SecurityContext.h:
2092         (WebCore::SecurityContext::usedLegacyTLS const):
2093         (WebCore::SecurityContext::setUsedLegacyTLS):
2094         * history/CachedFrame.cpp:
2095         (WebCore::CachedFrame::usedLegacyTLS const):
2096         (WebCore::CachedFrame::setUsedLegacyTLS): Deleted.
2097         * history/CachedFrame.h:
2098         (WebCore::CachedFrame::usedLegacyTLS const): Deleted.
2099         * loader/FrameLoader.cpp:
2100         (WebCore::FrameLoader::commitProvisionalLoad):
2101         * platform/network/ResourceResponseBase.cpp:
2102         (WebCore::ResourceResponseBase::includeCertificateInfo const):
2103         * platform/network/ResourceResponseBase.h:
2104         (WebCore::ResourceResponseBase::setUsedLegacyTLS):
2105
2106 2020-03-13  Zalan Bujtas  <zalan@apple.com>
2107
2108         [Tree building] Block::attachIgnoringContinuation should allow inline tables as before child container
2109         https://bugs.webkit.org/show_bug.cgi?id=209095
2110         <rdar://problem/59837588>
2111
2112         Reviewed by Simon Fraser.
2113
2114         It's perfectly valid to have an inline table as the anonymous container for the before child.
2115         It'll get wrapped inside an anonymous block right before we insert the block box candidate, so
2116         the final result will be something like:
2117
2118         new block level child (this is the child we are inserting)
2119         anonymous block wrapper
2120           inline table (this is the before child's inline container)
2121             before child 
2122
2123         Test: fast/table/before-child-is-inline-table.html
2124
2125         * rendering/updating/RenderTreeBuilderBlock.cpp:
2126         (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
2127
2128 2020-03-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2129
2130         [GPU Process] GraphicsContextStateChange::apply() should process ShadowsIgnoreTransformsChange before processing ShadowChange
2131         https://bugs.webkit.org/show_bug.cgi?id=209071
2132
2133         Reviewed by Darin Adler.
2134
2135         Ensure GraphicsContextStateChange::apply() calls shadowsIgnoreTransforms()
2136         before calling setLegacyShadow() or setShadow().
2137
2138         Test: This patch fixes the following tests when running:
2139         "run-webkit-tests --internal-feature RenderCanvasInGPUProcessEnabled"
2140             fast/canvas/canvas-image-shadow.html
2141             fast/canvas/canvas-scale-drawImage-shadow.html
2142             fast/canvas/canvas-scale-fillPath-shadow.html
2143             fast/canvas/canvas-scale-fillRect-shadow.html
2144             fast/canvas/canvas-scale-shadowBlur.html
2145             fast/canvas/canvas-transforms-fillRect-shadow.html
2146             fast/canvas/fillText-shadow.html
2147
2148         * platform/graphics/GraphicsContext.cpp:
2149         (WebCore::GraphicsContextStateChange::apply const):
2150
2151 2020-03-13  John Wilander  <wilander@apple.com>
2152
2153         Remove unused code related to removePrevalentDomains()
2154         https://bugs.webkit.org/show_bug.cgi?id=209078
2155         <rdar://problem/59681984>
2156
2157         Reviewed by Brent Fulgham.
2158
2159         The various removePrevalentDomains() functions and its IPC endpoint are unused and should be removed.
2160
2161         No new tests. Just dead code removal.
2162
2163         * platform/network/NetworkStorageSession.cpp:
2164         (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
2165         * platform/network/NetworkStorageSession.h:
2166
2167 2020-03-13  Myles C. Maxfield  <mmaxfield@apple.com>
2168
2169         [Cocoa] Push applicationSDKVersion() down from WebCore into WTF
2170         https://bugs.webkit.org/show_bug.cgi?id=209030
2171
2172         Reviewed by Simon Fraser.
2173
2174         * html/HTMLObjectElement.cpp:
2175         * html/MediaElementSession.cpp:
2176         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
2177         * loader/DocumentThreadableLoader.cpp:
2178         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2179         * platform/RuntimeApplicationChecks.h:
2180         * platform/Timer.cpp:
2181         (WebCore::shouldSuppressThreadSafetyCheck):
2182         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2183         (WebCore::applicationSDKVersionOverride): Deleted.
2184         (WebCore::setApplicationSDKVersion): Deleted.
2185         (WebCore::applicationSDKVersion): Deleted.
2186
2187 2020-03-13  Jiewen Tan  <jiewen_tan@apple.com>
2188
2189         [WebAuthn] Customize a bit more on the macOS LocalAuthentication prompt
2190         https://bugs.webkit.org/show_bug.cgi?id=208703
2191         <rdar://problem/60136974>
2192
2193         Reviewed by Darin Adler.
2194
2195         * en.lproj/Localizable.strings:
2196         * platform/LocalizedStrings.cpp:
2197         (WebCore::touchIDPromptTitle):
2198         * platform/LocalizedStrings.h:
2199         Adds a new formatted UI string to help with RP ID.
2200
2201 2020-03-13  Peng Liu  <peng.liu6@apple.com>
2202
2203         Safari sometimes crashes when switch video into PiP mode
2204         https://bugs.webkit.org/show_bug.cgi?id=208904
2205
2206         Reviewed by Simon Fraser.
2207
2208         With this patch, MediaControlTextTrackContainerElement won't paint its subtree
2209         to an image buffer (for the captions in video fullscreen or picture-in-picture mode)
2210         when the cues are updated. Instead, it only sets the flag m_needsGenerateTextTrackRepresentation
2211         to true after running layout based on the new cues. After that, it paints its subtree
2212         to an image buffer if needed at the end of Page::updateRendering() when the layout is clean.
2213         TextTrackRepresentationCocoa will use the image buffer to set the content of the layer
2214         for captions in video fullscreen or picture-in-picture mode.
2215
2216         MediaControlTextTrackContainerElement class is responsible for rendering the captions in both:
2217         1) a video player in the inline mode.
2218         2) a video player in "video fullscreen" or picture-in-picture mode.
2219         This patch refactors some functions to make their responsibilities clear.
2220
2221         * Modules/mediacontrols/MediaControlsHost.cpp:
2222         (WebCore::MediaControlsHost::updateTextTrackRepresentationImageIfNeeded):
2223         * Modules/mediacontrols/MediaControlsHost.h:
2224         * dom/Document.cpp:
2225         (WebCore::Document::setMediaElementShowingTextTrack):
2226         (WebCore::Document::clearMediaElementShowingTextTrack):
2227         (WebCore::Document::updateTextTrackRepresentationImageIfNeeded):
2228         * dom/Document.h:
2229
2230         Functions textTracksAreReady(), textTrackReadyStateChanged() and configureTextTrackDisplay()
2231         should be wrapped with "#if ENABLE(VIDEO_TRACK)".
2232         * html/HTMLMediaElement.cpp:
2233         (WebCore::HTMLMediaElement::setTextTrackRepresentation):
2234         (WebCore::HTMLMediaElement::textTracksAreReady const):
2235         (WebCore::HTMLMediaElement::textTrackReadyStateChanged):
2236         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
2237         (WebCore::HTMLMediaElement::updateTextTrackRepresentationImageIfNeeded):
2238         * html/HTMLMediaElement.h:
2239
2240         * html/shadow/MediaControlElements.cpp:
2241         (WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
2242         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2243         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationImageIfNeeded):
2244         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationIfNeeded):
2245         (WebCore::MediaControlTextTrackContainerElement::clearTextTrackRepresentation):
2246         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackStyle):
2247         (WebCore::MediaControlTextTrackContainerElement::enteredFullscreen):
2248         (WebCore::MediaControlTextTrackContainerElement::updateVideoDisplaySize):
2249         (WebCore::MediaControlTextTrackContainerElement::updateSizes):
2250         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
2251         (WebCore::MediaControlTextTrackContainerElement::textTrackRepresentationBoundsChanged):
2252         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Deleted.
2253         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentationStyle): Deleted.
2254         (WebCore::MediaControlTextTrackContainerElement::layoutIfNecessary): Deleted.
2255         (WebCore::MediaControlTextTrackContainerElement::updateCueStyles): Deleted.
2256         * html/shadow/MediaControlElements.h:
2257         * html/shadow/MediaControls.cpp:
2258         (WebCore::MediaControls::updateTextTrackRepresentationImageIfNeeded):
2259         * html/shadow/MediaControls.h:
2260         * page/Page.cpp:
2261         (WebCore::Page::updateRendering):
2262         * rendering/RenderMediaControlElements.cpp:
2263         (WebCore::RenderMediaControlTextTrackContainer::RenderMediaControlTextTrackContainer):
2264         (WebCore::RenderMediaControlTextTrackContainer::layout):
2265         (WebCore::RenderTextTrackContainerElement::RenderTextTrackContainerElement): Deleted.
2266         (WebCore::RenderTextTrackContainerElement::layout): Deleted.
2267         * rendering/RenderMediaControlElements.h:
2268
2269 2020-03-13  Ryan Haddad  <ryanhaddad@apple.com>
2270
2271         Unreviewed, reverting r258391.
2272
2273         Breaks internal builds.
2274
2275         Reverted changeset:
2276
2277         "Apply rotation at source level if WebRTC sink ask so"
2278         https://bugs.webkit.org/show_bug.cgi?id=205645
2279         https://trac.webkit.org/changeset/258391
2280
2281 2020-03-13  Kate Cheney  <katherine_cheney@apple.com>
2282
2283         Report all third party loads on a per-page basis
2284         https://bugs.webkit.org/show_bug.cgi?id=209032
2285         <rdar://problem/60397323>
2286
2287         Reviewed by Chris Dumez.
2288
2289         Test: http/tests/resourceLoadStatistics/loaded-registrable-domains-get-reported.html
2290
2291         Rename this function to more accurately reflect its purpose of sending
2292         loaded registrable domains to the WebPage.
2293
2294         * Modules/websockets/WebSocket.cpp:
2295         (WebCore::WebSocket::connect):
2296         * loader/FrameLoaderClient.h:
2297         * loader/ResourceLoader.cpp:
2298         (WebCore::ResourceLoader::willSendRequestInternal):
2299         * loader/cache/CachedResourceLoader.cpp:
2300         (WebCore::CachedResourceLoader::requestResource):
2301
2302 2020-03-13  Antti Koivisto  <antti@apple.com>
2303
2304         Remove AffectedByDrag style flag
2305         https://bugs.webkit.org/show_bug.cgi?id=209054
2306
2307         Reviewed by Simon Fraser.
2308
2309         As a followup to r258321, remove the last remaining user action related AffectedBy flag.
2310
2311         This also cleans out a bunch of scetchy, risky code from render tree (style invalidation!).
2312
2313         * css/SelectorChecker.cpp:
2314         (WebCore::SelectorChecker::checkOne const):
2315         * dom/DataTransfer.cpp:
2316         (WebCore::DataTransfer::createDragImage const):
2317         * dom/Element.cpp:
2318         (WebCore::Element::isUserActionElementDragged const):
2319         (WebCore::Element::setBeingDragged):
2320
2321         Move dragged state for render tree to Element where it belongs.
2322
2323         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
2324         * dom/Element.h:
2325         (WebCore::Element::isBeingDragged const):
2326         (WebCore::Element::descendantsAffectedByPreviousSibling const):
2327         (WebCore::Element::setDescendantsAffectedByPreviousSibling):
2328         (WebCore::Element::childrenAffectedByDrag const): Deleted.
2329         (WebCore::Element::setChildrenAffectedByDrag): Deleted.
2330         * dom/Node.h:
2331         * dom/UserActionElementSet.h:
2332         (WebCore::UserActionElementSet::isBeingDragged):
2333         (WebCore::UserActionElementSet::setBeingDragged):
2334
2335         Invalidate using PseudoClassChangeInvalidation that doesn't require any flags.
2336
2337         * platform/DragImage.cpp:
2338         (WebCore::ScopedNodeDragEnabler::ScopedNodeDragEnabler):
2339         (WebCore::ScopedNodeDragEnabler::~ScopedNodeDragEnabler):
2340         * rendering/RenderBlock.cpp:
2341         (WebCore::RenderBlock::updateDragState): Deleted.
2342         * rendering/RenderBlock.h:
2343         * rendering/RenderInline.cpp:
2344         (WebCore::RenderInline::updateDragState): Deleted.
2345         * rendering/RenderInline.h:
2346         * rendering/RenderObject.cpp:
2347         (WebCore::RenderObject::updateDragState): Deleted.
2348         (WebCore::RenderObject::setIsDragging): Deleted.
2349         * rendering/RenderObject.h:
2350         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
2351         (WebCore::RenderObject::isDragging const): Deleted.
2352         * rendering/style/RenderStyle.cpp:
2353         (WebCore::RenderStyle::RenderStyle):
2354         * rendering/style/RenderStyle.h:
2355         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2356         (WebCore::RenderStyle::affectedByDrag const): Deleted.
2357         (WebCore::RenderStyle::setAffectedByDrag): Deleted.
2358         * style/StyleRelations.cpp:
2359         (WebCore::Style::commitRelationsToRenderStyle):
2360         (WebCore::Style::commitRelations):
2361         * style/StyleRelations.h:
2362
2363 2020-03-13  Andres Gonzalez  <andresg_22@apple.com>
2364
2365         [WebAccessibilityObjectWrapper renderWidgetChildren] does not need to run on main thread.
2366         https://bugs.webkit.org/show_bug.cgi?id=209053
2367         <rdar://problem/60349440>
2368
2369         Reviewed by Chris Fleizach.
2370
2371         Since we are caching the platform widget in IsolatedMode (NSView),
2372         there is no need to dispatch renderWidgetChildren to the main thread.
2373
2374         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2375         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
2376
2377 2020-03-13  Ryosuke Niwa  <rniwa@webkit.org>
2378
2379         Crash in TextIterator::node via TextManipulationController::replace
2380         https://bugs.webkit.org/show_bug.cgi?id=209048
2381
2382         Reviewed by Wenson Hsieh.
2383
2384         The crash was caused by item.start being null in TextManipulationController::replace for a paragraph
2385         consisting of just an image because TextManipulationController::observeParagraphs never may never set
2386         startOfCurrentParagraph in such a case (content.isTextContent can be false for an image!).
2387
2388         Fixed the bug by setting startOfCurrentParagraph to a position before the current content's node
2389         when inserting a token for a RenderReplaced if it's null.
2390
2391         Test: TextManipulation.CompleteTextManipulationShouldReplaceContentsAroundParagraphWithJustImage
2392
2393         * editing/TextManipulationController.cpp:
2394         (WebCore::TextManipulationController::observeParagraphs):
2395
2396 2020-03-13  Michael Catanzaro  <mcatanzaro@gnome.org>
2397
2398         -Wredundant-move in CSSPropertyParserHelpers.cpp
2399         https://bugs.webkit.org/show_bug.cgi?id=209019
2400
2401         Reviewed by Youenn Fablet.
2402
2403         Silence compiler warning by removing improper WTFMove().
2404
2405         * css/parser/CSSPropertyParserHelpers.cpp:
2406         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
2407
2408 2020-03-13  Youenn Fablet  <youenn@apple.com>
2409
2410         Apply rotation at source level if WebRTC sink ask so
2411         https://bugs.webkit.org/show_bug.cgi?id=205645
2412
2413         Reviewed by Eric Carlson.
2414
2415         Add a virtual method to RealtimeMediaSource to pass the information that the sink prefers the frames to be rotated before sending them.
2416 r       By default, the method does nothing and RealtimeOutgoingVideoSource will continue to do the rotation itself.
2417         Update ImageRotationSessionVT to be more easily usable by users having MediaSample instead of CVPixelBuffer.
2418         Update RealtimeOutgoingVideoSource to use that routine: whenever applying rotation is needed,
2419         it will ask its track source to apply rotation. If the track source cannot do it, it will do it on its own.
2420
2421         Test: webrtc/video-rotation-no-cvo.html
2422
2423         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2424         (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
2425         * WebCore.xcodeproj/project.pbxproj:
2426         * platform/graphics/cv/ImageRotationSessionVT.h:
2427         (WebCore::operator==):
2428         (WebCore::operator!=):
2429         * platform/graphics/cv/ImageRotationSessionVT.mm:
2430         (WebCore::ImageRotationSessionVT::ImageRotationSessionVT):
2431         (WebCore::ImageRotationSessionVT::initialize):
2432         (WebCore::ImageRotationSessionVT::rotate):
2433         * platform/mediastream/RealtimeMediaSource.h:
2434         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2435         (WebCore::RealtimeOutgoingVideoSource::setSource):
2436         (WebCore::RealtimeOutgoingVideoSource::applyRotation):
2437         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
2438         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2439
2440 2020-03-13  youenn fablet  <youenn@apple.com>
2441
2442         Remove use of PlatformMediaSession types in AudioSession
2443         https://bugs.webkit.org/show_bug.cgi?id=208995
2444
2445         Reviewed by Eric Carlson.
2446
2447         Remove type for beginInterruption since AudioSession always trigger system interruptions.
2448         Have a dedicated type for endInterruption.
2449         No change of behavior.
2450
2451         * platform/audio/AudioSession.cpp:
2452         (WebCore::AudioSession::beginInterruption):
2453         (WebCore::AudioSession::endInterruption):
2454         * platform/audio/AudioSession.h:
2455         * platform/audio/ios/AudioSessionIOS.mm:
2456         (-[WebInterruptionObserverHelper interruption:]):
2457         (WebCore::AudioSession::beginInterruption):
2458         (WebCore::AudioSession::endInterruption):
2459         * platform/audio/ios/MediaSessionManagerIOS.h:
2460
2461 2020-03-13  Antti Koivisto  <antti@apple.com>
2462
2463         Remove unused affectedBy style flags
2464         https://bugs.webkit.org/show_bug.cgi?id=209009
2465
2466         Reviewed by Antoine Quint.
2467
2468         These flags are unused after r258321. Remove the flags and the code that generates them.
2469
2470         * css/SelectorChecker.cpp:
2471         (WebCore::SelectorChecker::checkOne const):
2472         * cssjit/SelectorCompiler.cpp:
2473         (WebCore::SelectorCompiler::addStyleRelationFunction):
2474         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
2475         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
2476         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasFocusWithin):
2477         * dom/Element.cpp:
2478         (WebCore::Element::hasFlagsSetDuringStylingOfChildren const):
2479         (WebCore::Element::resetStyleRelations):
2480         * dom/Element.h:
2481         (WebCore::Element::styleAffectedByEmpty const):
2482         (WebCore::Element::descendantsAffectedByPreviousSibling const):
2483         (WebCore::Element::setStyleAffectedByEmpty):
2484         (WebCore::Element::setDescendantsAffectedByPreviousSibling):
2485         (WebCore::Element::styleAffectedByActive const): Deleted.
2486         (WebCore::Element::styleAffectedByFocusWithin const): Deleted.
2487         (WebCore::Element::childrenAffectedByHover const): Deleted.
2488         (WebCore::Element::setStyleAffectedByFocusWithin): Deleted.
2489         (WebCore::Element::setChildrenAffectedByHover): Deleted.
2490         (WebCore::Element::setStyleAffectedByActive): Deleted.
2491         * dom/Node.h:
2492         * rendering/style/RenderStyle.cpp:
2493         (WebCore::RenderStyle::RenderStyle):
2494         * rendering/style/RenderStyle.h:
2495         (WebCore::RenderStyle::affectedByDrag const):
2496         (WebCore::RenderStyle::NonInheritedFlags::operator== const):
2497         (WebCore::RenderStyle::affectedByHover const): Deleted.
2498         (WebCore::RenderStyle::affectedByActive const): Deleted.
2499         (WebCore::RenderStyle::setAffectedByHover): Deleted.
2500         (WebCore::RenderStyle::setAffectedByActive): Deleted.
2501         * style/StyleRelations.cpp:
2502         (WebCore::Style::commitRelationsToRenderStyle):
2503         (WebCore::Style::commitRelations):
2504         * style/StyleRelations.h:
2505         * style/StyleSharingResolver.cpp:
2506         (WebCore::Style::SharingResolver::canShareStyleWithElement const):
2507
2508         Compare the hasFocusWithin bit instead.
2509
2510 2020-03-12  Yusuke Suzuki  <ysuzuki@apple.com>
2511
2512         Report crashed cell in jsCast in debug builds
2513         https://bugs.webkit.org/show_bug.cgi?id=209041
2514         <rdar://problem/59705631>
2515
2516         Reviewed by Mark Lam.
2517
2518         We should take JSLock when touching JSC::VM.
2519
2520         * page/MemoryRelease.cpp:
2521         (WebCore::logMemoryStatisticsAtTimeOfDeath):
2522         * page/PerformanceLogging.cpp:
2523         (WebCore::PerformanceLogging::memoryUsageStatistics):
2524
2525 2020-03-12  Cathie Chen  <cathiechen@igalia.com>
2526
2527         REGRESSION(r255957): Element with scroll-behavior:smooth isn't draggable after r255957
2528         https://bugs.webkit.org/show_bug.cgi?id=208566
2529
2530         Reviewed by Simon Fraser and Frédéric Wang.
2531
2532         To perform smooth scroll, RenderLayer::scrollRectToVisible checks the value of scroll-behavior.
2533         It starts an animated scrolling if scroll-behavior is smooth.
2534         On the other hand, the drag action would start an autoscroll if the element is scrollable.
2535         The autoscroll uses m_autoscrollTimer which is a repeating timer, when the timer fired it calls
2536         scrollRectToVisible with different positions.
2537         So if performing autoscroll on scroll-bahavior: smooth element, there are two nested animations.
2538         When timer fired, scrollRectToVisible is called, because of scroll-behavior:smooth, it starts
2539         animated scrolling not instant scrolling. Then there's the next timer fired, the previous
2540         animated scrolling would be canceled. Eventually, the element becomes un-draggable.
2541         To fix this, while performing autoscroll, scrollRectToVisible shouldn't trigger animated scrolling
2542         no matter what the value of scroll-behavior is.
2543
2544         Test: fast/events/drag-smooth-scroll-element.html
2545
2546         * rendering/RenderLayer.cpp:
2547         (WebCore::RenderLayer::scrollRectToVisible):
2548         (WebCore::RenderLayer::autoscroll):
2549         * rendering/RenderLayer.h:
2550
2551 2020-03-12  Zalan Bujtas  <zalan@apple.com>
2552
2553         RenderTreeNeedsLayoutChecker asserts with imported/w3c/web-platform-tests/css/css-position/position-absolute-crash-chrome-005.html
2554         https://bugs.webkit.org/show_bug.cgi?id=209022
2555         <rdar://problem/60390647>
2556
2557         Reviewed by Simon Fraser.
2558
2559         Fix the case when
2560         1. the block level box is no longer the containing block for its out-of-flow descendants and
2561         2. the new containing block does not get marked dirty because there's a re-layout boundary (overflow: hidden)
2562         between the old and the new containing block.
2563
2564         Test: fast/block/containing-block-for-out-of-flow-becomes-static.html
2565
2566         * rendering/RenderBlock.cpp:
2567         (WebCore::RenderBlock::removePositionedObjectsIfNeeded):
2568         (WebCore::RenderBlock::removePositionedObjects):
2569
2570 2020-03-12  Ryosuke Niwa  <rniwa@webkit.org>
2571
2572         Crash in TextManipulationController::replace
2573         https://bugs.webkit.org/show_bug.cgi?id=209021
2574
2575         Reviewed by Wenson Hsieh.
2576
2577         This patch addresses two issues that can lead to a crash in TextManipulationController::replace.
2578
2579         The biggest issue here is that commonAncestor can be a descendent of insertionPoint's containerNode.
2580         Addressed this issue by computing the first node to remove in the same traveral where commonAncestor
2581         is computed by way of remembering the very first content node (firstContentNode). This also lets us
2582         eliminate the secondary, redundant traversal to discover all the nodes to remove.
2583
2584         In addition, the set of nodes to remove could sometimes contain commonAncestor and its ancestors.
2585         This patch addresses this issue by removing all inclusive ancestors of commonAncestor from nodesToRemove.
2586
2587         * editing/TextManipulationController.cpp:
2588         (WebCore::TextManipulationController::replace):
2589
2590 2020-03-12  Per Arne Vollan  <pvollan@apple.com>
2591
2592         [macOS] _AXSApplicationAccessibilityEnabled should not be called
2593         https://bugs.webkit.org/show_bug.cgi?id=208953
2594
2595         Reviewed by Brent Fulgham.
2596
2597         The function _AXSApplicationAccessibilityEnabled and the notification kAXSApplicationAccessibilityEnabledNotification
2598         exist on macOS, but they do not have the same behavior as on iOS, and should not be used in the same way. Using this
2599         function and notification on macOS was introduced in <https://bugs.webkit.org/show_bug.cgi?id=208690>, and this patch
2600         partially reverts this behavior.
2601
2602         API test: WebKit.IsRemoteUIAppForAccessibility
2603
2604         * testing/Internals.cpp:
2605         (WebCore::Internals::isRemoteUIAppForAccessibility):
2606         * testing/Internals.h:
2607         * testing/Internals.idl:
2608         * testing/Internals.mm:
2609         (WebCore::Internals::isRemoteUIAppForAccessibility):
2610
2611 2020-03-12  Andres Gonzalez  <andresg_22@apple.com>
2612
2613         Cache the ScrollView platformWidget to avoid [WebAccessibilityObjectWrapper scrollViewParent] hitting the main thread too often.
2614         https://bugs.webkit.org/show_bug.cgi?id=209010
2615
2616         Reviewed by Chris Fleizach.
2617
2618         - [WebAccessibilityObjectWrapper scrollViewParent] is called very often
2619         and blocks the AXThread to retrieve a value from the main thread. This
2620         change caches the PlatformWidget for the corresponding ScrollView (an
2621         NSView) to avoid hitting the main thread that often.
2622         - In Addition, made the ScrollView member of AccessibilityScrollView a
2623         WeakPtr instead of a naked pointer.
2624         - Removed an unused lock from AXIsolatedObject and the const qualifier
2625         from the return value of stringAttributeValue which is unnecessary.
2626
2627         * accessibility/AccessibilityObject.h:
2628         * accessibility/AccessibilityObjectInterface.h:
2629         * accessibility/AccessibilityScrollView.cpp:
2630         (WebCore::AccessibilityScrollView::AccessibilityScrollView):
2631         (WebCore::AccessibilityScrollView::platformWidget const):
2632         (WebCore::AccessibilityScrollView::widgetForAttachmentView const):
2633         (WebCore::AccessibilityScrollView::webAreaObject const):
2634         (WebCore::AccessibilityScrollView::documentFrameView const):
2635         (WebCore::AccessibilityScrollView::parentObject const):
2636         (WebCore::AccessibilityScrollView::parentObjectIfExists const):
2637         (WebCore::AccessibilityScrollView::getScrollableAreaIfScrollable const):
2638         * accessibility/AccessibilityScrollView.h:
2639         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2640         (WebCore::AXIsolatedObject::initializeAttributeData):
2641         (WebCore::AXIsolatedObject::stringAttributeValue const):
2642         (WebCore::AXIsolatedObject::platformWidget const):
2643         * accessibility/isolatedtree/AXIsolatedObject.h:
2644         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2645         (-[WebAccessibilityObjectWrapper scrollViewParent]):
2646
2647 2020-03-12  Andres Gonzalez  <andresg_22@apple.com>
2648
2649         Attributes SelectionTextMarkerRange and Start/EndTextMarker need to run on the main thread.
2650         https://bugs.webkit.org/show_bug.cgi?id=208996
2651
2652         Reviewed by Chris Fleizach.
2653
2654         Covered by existing tests.
2655
2656         Dispatch to the main thread the computation of these accessibility attributes.
2657
2658         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2659         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2660
2661 2020-03-12  Andres Gonzalez  <andresg_22@apple.com>
2662
2663         AX: Isolated tree: Crash in URL retrieval
2664         https://bugs.webkit.org/show_bug.cgi?id=208942
2665         <rdar://problem/60337588>
2666
2667         Reviewed by Chris Fleizach.
2668
2669         Test: accessibility/url-test.html
2670
2671         * accessibility/AccessibilityRenderObject.cpp:
2672         (WebCore::AccessibilityRenderObject::url const): Check for m_renderer
2673         before dereferencing and re-use the associated Node. Also fixes the last
2674         type check and downcast that were using different types.
2675
2676 2020-03-12  Alex Christensen  <achristensen@webkit.org>
2677
2678         WKWebView.hasOnlySecureContent should be correct after back/forward navigations
2679         https://bugs.webkit.org/show_bug.cgi?id=207609
2680         <rdar://problem/59371252>
2681
2682         Reviewed by Ryosuke Niwa.
2683
2684         The web process informs the UI process of insecure content loads when http resources are requested from https pages.
2685         The web process also remembers that this happened.
2686         Rather than ask the UI process during a navigation, which can sometimes get information about the wrong navigation,
2687         just use the remembered values.  We will need to do something for legacy TLS loads too, but I left that code as it is
2688         for this patch.  Another is coming soon.
2689
2690         Covered by API tests.
2691
2692         * history/CachedFrame.cpp:
2693         (WebCore::CachedFrame::setUsedLegacyTLS):
2694         (WebCore::CachedFrame::hasInsecureContent const):
2695         (WebCore::CachedFrame::setHasInsecureContent): Deleted.
2696         * history/CachedFrame.h:
2697         (WebCore::CachedFrame::hasInsecureContent const): Deleted.
2698         * loader/FrameLoader.cpp:
2699         (WebCore::FrameLoader::commitProvisionalLoad):
2700
2701 2020-03-12  Simon Fraser  <simon.fraser@apple.com>
2702
2703         REGRESSION (r257938): Some pointerevents/ios/touch-action-region tests started to fail
2704         https://bugs.webkit.org/show_bug.cgi?id=209005
2705         <rdar://problem/60337239>
2706
2707         Reviewed by Tim Horton, Wenson Hsieh.
2708
2709         We need to continue to paint event regions if there are touch-action elements.
2710
2711         Tested by existing tests.
2712
2713         * rendering/RenderLayerBacking.cpp:
2714         (WebCore::RenderLayerBacking::updateEventRegion):
2715
2716 2020-03-12  youenn fablet  <youenn@apple.com>
2717
2718         FrameLoader should own its FrameLoaderClient
2719         https://bugs.webkit.org/show_bug.cgi?id=208918
2720
2721         Reviewed by Geoffrey Garen.
2722
2723         Update Frame/FrameLoader constructors to get a UniqueRef<FrameLoaderClient>.
2724         This makes the lifetime management much clearer and allows some WebKit1/WebKit2 clean-up.
2725
2726         Covered by existing tests.
2727
2728         * loader/EmptyClients.cpp:
2729         (WebCore::pageConfigurationWithEmptyClients):
2730         * loader/EmptyFrameLoaderClient.h:
2731         * loader/FrameLoader.cpp:
2732         (WebCore::FrameLoader::FrameLoader):
2733         (WebCore::FrameLoader::~FrameLoader):
2734         (WebCore::FrameLoader::init):
2735         (WebCore::FrameLoader::initForSynthesizedDocument):
2736         (WebCore::FrameLoader::didExplicitOpen):
2737         (WebCore::FrameLoader::receivedFirstData):
2738         (WebCore::FrameLoader::finishedParsing):
2739         (WebCore::FrameLoader::loadArchive):
2740         (WebCore::FrameLoader::setOpener):
2741         (WebCore::FrameLoader::provisionalLoadStarted):
2742         (WebCore::FrameLoader::loadInSameDocument):
2743         (WebCore::FrameLoader::prepareForLoadStart):
2744         (WebCore::FrameLoader::setupForReplace):
2745         (WebCore::FrameLoader::load):
2746         (WebCore::FrameLoader::loadWithNavigationAction):
2747         (WebCore::FrameLoader::loadWithDocumentLoader):
2748         (WebCore::FrameLoader::willLoadMediaElementURL):
2749         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2750         (WebCore::FrameLoader::reload):
2751         (WebCore::FrameLoader::setDocumentLoader):
2752         (WebCore::FrameLoader::commitProvisionalLoad):
2753         (WebCore::FrameLoader::transitionToCommitted):
2754         (WebCore::FrameLoader::clientRedirectCancelledOrFinished):
2755         (WebCore::FrameLoader::clientRedirected):
2756         (WebCore::FrameLoader::closeOldDataSources):
2757         (WebCore::FrameLoader::willChangeTitle):
2758         (WebCore::FrameLoader::dispatchDidFailProvisionalLoad):
2759         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2760         (WebCore::FrameLoader::didReachLayoutMilestone):
2761         (WebCore::FrameLoader::didReachVisuallyNonEmptyState):
2762         (WebCore::FrameLoader::frameLoadCompleted):
2763         (WebCore::FrameLoader::checkLoadComplete):
2764         (WebCore::FrameLoader::userAgent const):
2765         (WebCore::FrameLoader::dispatchOnloadEvents):
2766         (WebCore::FrameLoader::detachViewsAndDocumentLoader):
2767         (WebCore::FrameLoader::receivedMainResourceError):
2768         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2769         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2770         (WebCore::FrameLoader::loadedResourceFromMemoryCache):
2771         (WebCore::FrameLoader::loadDifferentDocumentItem):
2772         (WebCore::FrameLoader::cancelledError const):
2773         (WebCore::FrameLoader::blockedByContentBlockerError const):
2774         (WebCore::FrameLoader::blockedError const):
2775         (WebCore::FrameLoader::blockedByContentFilterError const):
2776         (WebCore::FrameLoader::connectionProperties):
2777         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
2778         (WebCore::FrameLoader::dispatchGlobalObjectAvailableInAllWorlds):
2779         (WebCore::FrameLoader::didChangeTitle):
2780         (WebCore::FrameLoader::dispatchDidCommitLoad):
2781         (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
2782         (WebCore::FrameLoader::completePageTransitionIfNeeded):
2783         * loader/FrameLoader.h:
2784         * loader/FrameLoaderClient.h:
2785         * page/Frame.cpp:
2786         (WebCore::Frame::Frame):
2787         (WebCore::Frame::create):
2788         * page/Frame.h:
2789         * page/Page.cpp:
2790         (WebCore::Page::Page):
2791         * page/PageConfiguration.cpp:
2792         (WebCore::PageConfiguration::PageConfiguration):
2793         * page/PageConfiguration.h:
2794         * workers/service/context/SWContextManager.cpp:
2795         * workers/service/context/SWContextManager.h:
2796
2797 2020-03-11  Simon Fraser  <simon.fraser@apple.com>
2798
2799         REGRESSION (r254054): finance.google.com watch list renders initially then disappears for 5+ seconds before reappearing
2800         https://bugs.webkit.org/show_bug.cgi?id=208972
2801         <rdar://problem/59727171>
2802
2803         Reviewed by Zalan Bujtas.
2804         
2805         After r254054 we could get a style change in which opacity was unchanged, but
2806         hasAutoUsedZIndex() in the style changed (because Adjuster::adjustAnimatedStyle() can set it).
2807
2808         In this case we failed to trigger layout, which means that we failed to recompute visual
2809         overflow when a layer changed from being self-painting to non-self-painting (which affects
2810         visual overflow computation and has hasAutoUsedZIndex() as input). We'd thus fail to paint some
2811         renderers because their visual overflow didn't intersect the paint dirty rect.
2812
2813         Fix by having RenderStyle::changeRequiresLayout() return true if hasAutoUsedZIndex() differs
2814         between the styles. This has minimal performance impact; rareNonInheritedDataChangeRequiresLayout()
2815         already returns true if opacity, filters and other stacking-context-affecting properties change.
2816
2817         Test: fast/overflow/animation-recompute-overflow.html
2818
2819         * rendering/RenderBox.cpp:
2820         (WebCore::RenderBox::addOverflowFromChild):
2821         (WebCore::RenderBox::addLayoutOverflow):
2822         * rendering/style/RenderStyle.cpp:
2823         (WebCore::RenderStyle::changeRequiresLayout const):
2824
2825 2020-03-12  Daniel Bates  <dabates@apple.com>
2826
2827         FocusController::setFocusedElement() should tell client of refocused element
2828         https://bugs.webkit.org/show_bug.cgi?id=208880
2829
2830         Reviewed by Wenson Hsieh.
2831
2832         If the specified new focus element is non-nullptr and is already focused then tell the client
2833         that the element was re-focused so that it may update its input state, if needed. On iOS, this
2834         lets the UI process evaluate again whether to start an input session (i.e. bring up the keyboard),
2835         which may have been disallowed when the element was originally focused (say, it was programmatically
2836         focused and there was no hardware keyboard attached).
2837
2838         * page/FocusController.cpp:
2839         (WebCore::FocusController::setFocusedElement):
2840
2841 2020-03-12  Rob Buis  <rbuis@igalia.com>
2842
2843         Implement wildcard behavior for Cross-Origin-Expose-Headers
2844         https://bugs.webkit.org/show_bug.cgi?id=208800
2845
2846         Reviewed by Youenn Fablet.
2847
2848         Implement wildcard behavior for Cross-Origin-Expose-Headers [1] while also
2849         checking for credentials mode.
2850
2851         Test: imported/w3c/web-platform-tests/xhr/cors-expose-star.sub.any.html
2852
2853         [1] https://fetch.spec.whatwg.org/#ref-for-concept-response-cors-exposed-header-name-list%E2%91%A2
2854
2855         * Modules/fetch/FetchResponse.cpp:
2856         (WebCore::FetchResponse::create):
2857         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2858         (WebCore::FetchResponse::BodyLoader::start):
2859         * Modules/fetch/FetchResponse.h:
2860         * loader/DocumentThreadableLoader.cpp:
2861         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2862         (WebCore::DocumentThreadableLoader::didFinishLoading):
2863         * platform/network/ResourceResponseBase.cpp:
2864         (WebCore::ResourceResponseBase::filter):
2865         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2866         * platform/network/ResourceResponseBase.h:
2867
2868 2020-03-12  youenn fablet  <youenn@apple.com>
2869
2870         Remove no longer used code in LibWebRTCMediaEndpoint to handle remote streams
2871         https://bugs.webkit.org/show_bug.cgi?id=208919
2872
2873         Reviewed by Eric Carlson.
2874
2875         These stream APIs are legacy now and not useful anymore.
2876         Stop implementing the corresponding callbacks and remove related code.
2877         Coverd by existing tests.
2878
2879         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2880         (WebCore::LibWebRTCMediaEndpoint::addRemoteStream): Deleted.
2881         (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack): Deleted.
2882         (WebCore::LibWebRTCMediaEndpoint::OnAddStream): Deleted.
2883         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2884
2885 2020-03-12  Pavel Feldman  <pavel.feldman@gmail.com>
2886
2887         [Curl] sort out MS vs Seconds confusion in Cookies
2888         https://bugs.webkit.org/show_bug.cgi?id=208964
2889
2890         Reviewed by Don Olmstead.
2891
2892         Making sure curl parser is storing expires using millis in the code. Using consistent time
2893         functions around the changed code.
2894  
2895         * platform/network/curl/CookieJarDB.cpp:
2896         (WebCore::CookieJarDB::searchCookies):
2897         (WebCore::CookieJarDB::getAllCookies):
2898         (WebCore::CookieJarDB::setCookie):
2899         * platform/network/curl/CookieUtil.cpp:
2900         (WebCore::CookieUtil::parseExpiresMS):
2901         (WebCore::CookieUtil::parseCookieAttributes):
2902
2903 2020-03-12  youenn fablet  <youenn@apple.com>
2904
2905         Move AudioSession interruption listener code to AudioSession
2906         https://bugs.webkit.org/show_bug.cgi?id=208714
2907
2908         Reviewed by Jer Noble.
2909
2910         Move AudioSession interruption detection code from MediaSessionManagerIOS helper to AudioSessionIOS.
2911         Add interruption observer capabilities to AudioSession and make MediaSessionManagerIOS an observer of it.
2912         Manually tested.
2913
2914         * platform/audio/AudioSession.cpp:
2915         (WebCore::AudioSession::addInterruptionObserver):
2916         (WebCore::AudioSession::removeInterruptionObserver):
2917         (WebCore::AudioSession::beginInterruption):
2918         (WebCore::AudioSession::endInterruption):
2919         * platform/audio/AudioSession.h:
2920         * platform/audio/ios/AudioSessionIOS.mm:
2921         (-[WebInterruptionObserverHelper initWithCallback:]):
2922         (-[WebInterruptionObserverHelper dealloc]):
2923         (-[WebInterruptionObserverHelper clearCallback]):
2924         (-[WebInterruptionObserverHelper interruption:]):
2925         (WebCore::AudioSessionPrivate::AudioSessionPrivate):
2926         (WebCore::AudioSessionPrivate::~AudioSessionPrivate):
2927         (WebCore::AudioSession::addInterruptionObserver):
2928         (WebCore::AudioSession::removeInterruptionObserver):
2929         (WebCore::AudioSession::beginInterruption):
2930         (WebCore::AudioSession::endInterruption):
2931         * platform/audio/ios/MediaSessionHelperIOS.h:
2932         * platform/audio/ios/MediaSessionHelperIOS.mm:
2933         (-[WebMediaSessionHelper initWithCallback:]):
2934         * platform/audio/ios/MediaSessionManagerIOS.h:
2935         * platform/audio/ios/MediaSessionManagerIOS.mm:
2936         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
2937         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
2938         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
2939
2940 2020-03-12  Antti Koivisto  <antti@apple.com>
2941
2942         Accurate style invalidation for user action pseudo classes
2943         https://bugs.webkit.org/show_bug.cgi?id=208859
2944         <rdar://problem/55196888>
2945
2946         Reviewed by Zalan Bujtas.
2947
2948         Currently :hover, :focus, :focus-within and :active lack fine grained invalidation using
2949         rule sets like we do with class and attribute selectors.
2950
2951         This can be added easily following the same pattern.
2952
2953         Tests: fast/selectors/style-invalidation-hover-change-descendants.html
2954                fast/selectors/style-invalidation-hover-change-siblings.html
2955                fast/selectors/style-invalidation-focus-change-descendants.html
2956                fast/selectors/style-invalidation-focus-change-siblings.html
2957                fast/selectors/style-invalidation-focus-within-change-descendants.html
2958                fast/selectors/style-invalidation-focus-within-change-siblings.html
2959
2960         * Sources.txt:
2961         * WebCore.xcodeproj/project.pbxproj:
2962         * dom/Element.cpp:
2963         (WebCore::Element::setActive):
2964         (WebCore::Element::setFocus):
2965         (WebCore::Element::setHasFocusWithin):
2966         (WebCore::Element::setHovered):
2967
2968         Use PseudoClassChangeInvalidation.
2969
2970         * dom/Element.h:
2971         (WebCore::Element::setHasFocusWithin): Deleted.
2972         * page/FrameViewLayoutContext.cpp:
2973         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
2974         * style/PseudoClassChangeInvalidation.cpp: Added.
2975         (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation):
2976
2977         Compute invalidation rule set for a pseudo class change.
2978
2979         (WebCore::Style::PseudoClassChangeInvalidation::invalidateStyleWithRuleSets):
2980         * style/PseudoClassChangeInvalidation.h: Added.
2981         (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation):
2982         (WebCore::Style::PseudoClassChangeInvalidation::~PseudoClassChangeInvalidation):
2983         * style/RuleFeature.cpp:
2984         (WebCore::Style::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
2985         (WebCore::Style::RuleFeatureSet::collectFeatures):
2986
2987         Collect pseudo class features, similar to classes/attributes.
2988
2989         (WebCore::Style::RuleFeatureSet::add):
2990         (WebCore::Style::RuleFeatureSet::clear):
2991         (WebCore::Style::RuleFeatureSet::shrinkToFit):
2992         * style/RuleFeature.h:
2993         * style/StyleScopeRuleSets.cpp:
2994         (WebCore::Style::ScopeRuleSets::collectFeatures const):
2995         (WebCore::Style::ensureInvalidationRuleSets):
2996
2997         Make more generic to allow enum key.
2998
2999         (WebCore::Style::ScopeRuleSets::pseudoClassInvalidationRuleSets const):
3000
3001         Create pseudo class invalidation ruleset.
3002
3003         * style/StyleScopeRuleSets.h:
3004
3005 2020-03-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
3006
3007         [GPU Process] GraphicsContextStateChange must accumulate fill and stroke fields as single properties
3008         https://bugs.webkit.org/show_bug.cgi?id=208971
3009
3010         Reviewed by Simon Fraser.
3011
3012         Setting the fill or the stroke should set one field: color, gradient or
3013         pattern. When detecting a change any of them, accumulate() should copy
3014         all of the fields from the source state to the destination state.
3015
3016         * platform/graphics/GraphicsContext.cpp:
3017         (WebCore::GraphicsContextStateChange::accumulate):
3018         * platform/graphics/GraphicsContext.h:
3019
3020 2020-03-11  Antoine Quint  <graouts@webkit.org>
3021
3022         AnimationTimeline should not have multiple HashMaps with raw Element* keys
3023         https://bugs.webkit.org/show_bug.cgi?id=208079
3024         <rdar://problem/59687906>
3025
3026         Reviewed by Ryosuke Niwa.
3027
3028         We introduce a new ElementAnimationRareData class that holds the KeyframeEffectStack previously owned by ElementRareData as well as a few maps and lists
3029         owned by AnimationTimeline which would use raw Element pointers as keys. Specifically, this is what changed:
3030
3031         - AnimationTimeline::m_elementToRunningCSSTransitionByCSSPropertyID → ElementAnimationRareData::runningTransitionByProperty()
3032         - AnimationTimeline::m_elementToCompletedCSSTransitionByCSSPropertyID → ElementAnimationRareData::completedTransitionByProperty()
3033         - AnimationTimeline::m_elementToCSSAnimationsCreatedByMarkupMap → ElementAnimationRareData::animationsCreatedByMarkup()
3034         - AnimationTimeline::m_elementToCSSTransitionsMap → ElementAnimationRareData::transitions()
3035         - AnimationTimeline::m_elementToCSSAnimationsMap → ElementAnimationRareData::cssAnimations()
3036         - AnimationTimeline::m_elementToAnimationsMap → ElementAnimationRareData::webAnimations()
3037
3038         For convenience, these new members are exposed via Element directly.
3039
3040         No change in behavior, so no new tests.
3041
3042         * Headers.cmake:
3043         * Sources.txt:
3044         * WebCore.xcodeproj/project.pbxproj:
3045         * animation/AnimationPlaybackEventInit.h:
3046         * animation/AnimationTimeline.cpp:
3047         (WebCore::AnimationTimeline::animationWasAddedToElement):
3048         (WebCore::removeCSSTransitionFromMap):
3049         (WebCore::AnimationTimeline::animationWasRemovedFromElement):
3050         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement):
3051         (WebCore::AnimationTimeline::animationsForElement const):
3052         (WebCore::AnimationTimeline::removeCSSAnimationCreatedByMarkup):
3053         (WebCore::AnimationTimeline::willDestroyRendererForElement):
3054         (WebCore::AnimationTimeline::elementWasRemoved):
3055         (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
3056         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
3057         (WebCore::propertyInStyleMatchesValueForTransitionInMap):
3058         (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty):
3059         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
3060         (WebCore::removeAnimationFromMapForElement): Deleted.
3061         (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Deleted.
3062         * animation/AnimationTimeline.h:
3063         * animation/ComputedEffectTiming.h:
3064         * animation/DocumentTimeline.cpp:
3065         (WebCore::DocumentTimeline::transitionDidComplete):
3066         * animation/ElementAnimationRareData.cpp: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
3067         (WebCore::ElementAnimationRareData::ElementAnimationRareData):
3068         (WebCore::ElementAnimationRareData::~ElementAnimationRareData):
3069         (WebCore::ElementAnimationRareData::ensureKeyframeEffectStack):
3070         * animation/ElementAnimationRareData.h: Added.
3071         (WebCore::ElementAnimationRareData::keyframeEffectStack):
3072         (WebCore::ElementAnimationRareData::webAnimations):
3073         (WebCore::ElementAnimationRareData::cssAnimations):
3074         (WebCore::ElementAnimationRareData::transitions):
3075         (WebCore::ElementAnimationRareData::animationsCreatedByMarkup):
3076         (WebCore::ElementAnimationRareData::setAnimationsCreatedByMarkup):
3077         (WebCore::ElementAnimationRareData::completedTransitionByProperty):
3078         (WebCore::ElementAnimationRareData::runningTransitionsByProperty):
3079         * animation/KeyframeEffect.h:
3080         * animation/OptionalEffectTiming.h:
3081         * animation/WebAnimation.h:
3082         * animation/WebAnimationTypes.h: Copied from Source/WebCore/animation/WebAnimationUtilities.h.
3083         (WebCore::WebAnimationsMarkableDoubleTraits::isEmptyValue):
3084         (WebCore::WebAnimationsMarkableDoubleTraits::emptyValue):
3085         * animation/WebAnimationUtilities.h:
3086         (WebCore::WebAnimationsMarkableDoubleTraits::isEmptyValue): Deleted.
3087         (WebCore::WebAnimationsMarkableDoubleTraits::emptyValue): Deleted.
3088         * dom/Element.cpp:
3089         (WebCore::Element::animationRareData const):
3090         (WebCore::Element::ensureAnimationRareData):
3091         (WebCore::Element::keyframeEffectStack const):
3092         (WebCore::Element::ensureKeyframeEffectStack):
3093         (WebCore::Element::hasKeyframeEffects const):
3094         (WebCore::Element::webAnimations):
3095         (WebCore::Element::cssAnimations):
3096         (WebCore::Element::transitions):
3097         (WebCore::Element::animationsCreatedByMarkup):
3098         (WebCore::Element::setAnimationsCreatedByMarkup):
3099         (WebCore::Element::completedTransitionByProperty):
3100         (WebCore::Element::runningTransitionsByProperty):
3101         * dom/Element.h:
3102         * dom/ElementRareData.h:
3103         (WebCore::ElementRareData::elementAnimationRareData):
3104         (WebCore::ElementRareData::useTypes const):
3105         (WebCore::ElementRareData::ensureAnimationRareData):
3106         (WebCore::ElementRareData::keyframeEffectStack): Deleted.
3107         (WebCore::ElementRareData::setKeyframeEffectStack): Deleted.
3108         * dom/Node.cpp:
3109         (WebCore::stringForRareDataUseType):
3110         * dom/NodeRareData.h:
3111
3112 2020-03-11  Jer Noble  <jer.noble@apple.com>
3113
3114         Adopt AVSampleBufferVideoOutput
3115         https://bugs.webkit.org/show_bug.cgi?id=208951
3116
3117         Reviewed by Eric Carlson.
3118
3119         Adopt AVSampleBufferVideoOutput, used for extracting decoded samples from an AVSampleBufferDisplayLayer.
3120
3121         Rather than use a separate decompression session when we need to, e.g., paint samples into WebGL, we will
3122         add a AVSBVO to the AVSBDL and use it to extract CVPixelBuffers when asked.
3123
3124         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3125         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3126         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastPixelBuffer):
3127         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::acceleratedRenderingStateChanged):
3128         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
3129         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isVideoOutputAvailable const):
3130
3131 2020-03-11  Andres Gonzalez  <andresg_22@apple.com>
3132
3133         Removed unused textElements member from AccessibilityText structure.
3134         https://bugs.webkit.org/show_bug.cgi?id=208967
3135
3136         Reviewed by Chris Fleizach.
3137
3138         The textElements member of AccessibilityText is not used by any client
3139         and its computation is causing crashes in IsolatedTree mode. So this
3140         change removes it.
3141
3142         * accessibility/AccessibilityNodeObject.cpp:
3143         (WebCore::AccessibilityNodeObject::titleElementText const):
3144         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
3145         * accessibility/AccessibilityObject.h:
3146         (WebCore::AccessibilityText::AccessibilityText):
3147         * accessibility/isolatedtree/AXIsolatedObject.cpp:
3148         (WebCore::AXIsolatedObject::initializeAttributeData):
3149         (WebCore::AXIsolatedObject::accessibilityText const):
3150         * accessibility/isolatedtree/AXIsolatedObject.h:
3151
3152 2020-03-11  Don Olmstead  <don.olmstead@sony.com>
3153
3154         Non-unified build fixes early March 2020 edition Take 2
3155         https://bugs.webkit.org/show_bug.cgi?id=208968
3156
3157         Unreviewed build fix.
3158
3159         * editing/TextIterator.cpp:
3160         * editing/TextIterator.h:
3161         * editing/TextManipulationController.cpp:
3162         * editing/VisibleSelection.cpp:
3163         * editing/VisibleUnits.cpp:
3164
3165 2020-03-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3166
3167         Large single select elements are incorrectly sized
3168         https://bugs.webkit.org/show_bug.cgi?id=208966
3169
3170         Reviewed by Tim Horton.
3171
3172         Adjusts several size and margin values for menu lists (i.e. the default appearance of non-multiple select
3173         elements) to reflect recent changes in macOS. Additionally, adds a workaround for <rdar://problem/60350699>,
3174         which causes text inside many form controls (including select buttons) to be incorrectly sized.
3175
3176         * platform/mac/ThemeMac.h:
3177         * platform/mac/ThemeMac.mm:
3178         (WebCore::ThemeMac::systemFontSizeFor):
3179         (WebCore::ThemeMac::controlFont const):
3180         * rendering/RenderThemeMac.mm:
3181
3182         Replace calls to +[NSFont systemFontSizeForControlSize:] with `ThemeMac::systemFontSizeFor(NSControlSize size)`
3183         in order to work around <rdar://problem/60350699>.
3184
3185         (WebCore::RenderThemeMac::updateCachedSystemFontDescription const):
3186         (WebCore::RenderThemeMac::setFontFromControlSize const):
3187         (WebCore::RenderThemeMac::controlSizeForSystemFont const):
3188         (WebCore::RenderThemeMac::popupButtonMargins const):
3189         (WebCore::menuListButtonSizes):
3190
3191 2020-03-11  Canhai Chen  <canhai_chen@apple.com>
3192
3193         AX: accessibilityReplaceRange:withText: doesn't post an AXValueChanged notification like when typing with kb
3194         https://bugs.webkit.org/show_bug.cgi?id=208332
3195         <rdar://problem/58489685>
3196
3197         Reviewed by Chris Fleizach.
3198
3199         When accessibilityReplaceRange:withText: is called to insert or replace text, there should be a
3200         AXValueChanged notification posted with the correct user info to notify the AX client that the text value
3201         has been changed with detailed info about the change.
3202
3203         Post a notification in Editor::replaceSelectionWithFragment for EditAction::Insert edit type 
3204         with replaced text and selection.
3205
3206         Add a new test for text replacement value change notification in editable div, text input, and textarea,
3207         including direct text insertion and replace-and-insert.
3208
3209         Test: accessibility/mac/replace-text-with-range-value-change-notification.html
3210
3211         * editing/Editor.cpp:
3212         (WebCore::Editor::replaceSelectionWithFragment):
3213         * editing/ReplaceSelectionCommand.h:
3214         (WebCore::ReplaceSelectionCommand::documentFragmentPlainText const):
3215
3216 2020-03-11  Andres Gonzalez  <andresg_22@apple.com>
3217
3218         AX: Isolated tree: enabling secondary thread for the wrong clients
3219         https://bugs.webkit.org/show_bug.cgi?id=208950
3220
3221         Reviewed by Chris Fleizach.
3222
3223         Removed incorrect call to _AXUIElementUseSecondaryAXThread and wrap it
3224         in initializeSecondaryAXThread with the appropriate checks.
3225
3226         * accessibility/AXObjectCache.cpp:
3227         (WebCore::AXObjectCache::isolatedTreeFocusedObject):
3228         (WebCore::AXObjectCache::initializeSecondaryAXThread):
3229         (WebCore::AXObjectCache::isolatedTreeRootObject):
3230         * accessibility/AXObjectCache.h:
3231
3232 2020-03-11  Jer Noble  <jer.noble@apple.com>
3233
3234         [EME] Issue an "encrypted" event when a new encrypted initialization segment is encountered
3235         https://bugs.webkit.org/show_bug.cgi?id=208923
3236
3237         Reviewed by Eric Carlson.
3238
3239         When AVStreamDataParser encounters an initialization segment indicating encrypted content, it
3240         will issue a -streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID: message
3241         to its delegate. If the parser is already associated with an AVContentKeySession, it will instead
3242         allow the session to handle the initialization segment and the delagete method will not be called.
3243
3244         When the latter situation occurs, we can detect that the -didProvideRequest callback did not
3245         occur due to the client calling MediaKeySession.generateRequest() and therefore must have been
3246         due to parsing an encrypted segment. In response, store the request in a list of "unexpected"
3247         requests to be checked the next time a MediaKeySession tries to generateRequest(). Then, we will
3248         pass the initalizationData and type to HTMLMediaElement through a new client interface, where it
3249         will use that initializationData to issue an "encrypted" event. If the client passes that same
3250         initializationData back into MediaKeySession, the "unexpected" request can be found, and re-used.
3251
3252         Drive-by fixes: Added a ton of debug logging messages to the CDMPrivate classes.
3253
3254         * Modules/encryptedmedia/CDM.cpp:
3255         (WebCore::CDM::CDM):
3256         * Modules/encryptedmedia/CDM.h:
3257         * Modules/encryptedmedia/CDMClient.h:
3258         * Modules/encryptedmedia/MediaKeySession.cpp:
3259         (WebCore::MediaKeySession::create):
3260         (WebCore::MediaKeySession::MediaKeySession):
3261         * Modules/encryptedmedia/MediaKeySession.h:
3262         * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
3263         (WebCore::MediaKeySystemAccess::createMediaKeys):
3264         * Modules/encryptedmedia/MediaKeySystemAccess.h:
3265         * Modules/encryptedmedia/MediaKeySystemAccess.idl:
3266         * Modules/encryptedmedia/MediaKeys.cpp:
3267         (WebCore::MediaKeys::MediaKeys):
3268         (WebCore::MediaKeys::createSession):
3269         (WebCore::MediaKeys::setServerCertificate):
3270         (WebCore::MediaKeys::attachCDMClient):
3271         (WebCore::MediaKeys::detachCDMClient):
3272         (WebCore::MediaKeys::attemptToResumePlaybackOnClients):
3273         (WebCore::MediaKeys::unrequestedInitializationDataReceived):
3274         (WebCore::MediaKeys::nextChildIdentifier const):
3275         * Modules/encryptedmedia/MediaKeys.h:
3276         (WebCore::MediaKeys::create): Deleted.
3277         (WebCore::MediaKeys::cdmInstance): Deleted.
3278         (WebCore::MediaKeys::cdmInstance const): Deleted.
3279         * Modules/encryptedmedia/MediaKeys.idl:
3280         * WebCore.xcodeproj/project.pbxproj:
3281         * html/HTMLMediaElement.cpp:
3282         (WebCore::HTMLMediaElement::cdmClientUnrequestedInitializationDataReceived):
3283         * html/HTMLMediaElement.h:
3284         * platform/encryptedmedia/CDMFactory.h:
3285         * platform/encryptedmedia/CDMInstance.h:
3286         (WebCore::CDMInstance::setClient):
3287         (WebCore::CDMInstance::clearClient):
3288         (WebCore::CDMInstance::setLogger):
3289         * platform/encryptedmedia/CDMInstanceSession.h:
3290         (WebCore::CDMInstanceSession::setLogger):
3291         (WebCore::CDMInstanceSession::setClient):
3292         * platform/encryptedmedia/CDMPrivate.h:
3293         (WebCore::CDMPrivate::setLogger):
3294         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
3295         (WebCore::logChannel):
3296         (WebCore::CDMPrivateFairPlayStreaming::setLogger):
3297         (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
3298         * platform/graphics/avfoundation/CDMFairPlayStreaming.h:
3299         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3300         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3301         (WebCore::logChannel):
3302         (WebCore::initTypeForRequest):
3303         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setLogger):
3304         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::takeUnexpectedKeyRequestForInitializationData):
3305         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setServerCertificate):
3306         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
3307         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient):
3308         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient):
3309         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
3310         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequests):
3311         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest):
3312         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest):
3313         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
3314         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
3315         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
3316         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::groupSessionIdentifierChanged):
3317         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForRequest const):
3318         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setLogger):
3319         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
3320         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
3321         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
3322         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
3323         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
3324         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setClient):
3325         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::hasRequest const):
3326
3327 2020-03-11  Jiewen Tan  <jiewen_tan@apple.com>
3328
3329         [WebAuthn] Formalize the Keychain schema
3330         https://bugs.webkit.org/show_bug.cgi?id=183533
3331         <rdar://problem/43347926>
3332
3333         Reviewed by Brent Fulgham.
3334
3335         Covered by new test contents within existing files.
3336
3337         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
3338         (WebCore::AuthenticatorAssertionResponse::create):
3339         (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
3340         * Modules/webauthn/AuthenticatorAssertionResponse.h:
3341         Modifies the constructors to accept userEntity.name.
3342
3343         * Modules/webauthn/cbor/CBORValue.h:
3344         Adds a FIXME.
3345
3346         * testing/MockWebAuthenticationConfiguration.h:
3347         (WebCore::MockWebAuthenticationConfiguration::LocalConfiguration::encode const):
3348         (WebCore::MockWebAuthenticationConfiguration::LocalConfiguration::decode):
3349         * testing/MockWebAuthenticationConfiguration.idl:
3350         Modifies the test infra to use Credential ID as the unique identifier for a credential instead of
3351         the original combination of RP ID and user handle.
3352
3353 2020-03-11  Daniel Bates  <dabates@apple.com>
3354
3355         REGRESSION (r257502): HitTestLocation::HitTestLocation(const FloatPoint&, const FloatQuad&) should set m_isRectBased to true
3356         https://bugs.webkit.org/show_bug.cgi?id=208947
3357
3358         Reviewed by Wenson Hsieh.
3359
3360         Partial revert of r257502. I accidentally removed initialization of m_isRectBased when refactoring
3361         the code in HitTestLocation::HitTestLocation(const FloatPoint&, const FloatQuad&). Revert this to
3362         be faithful to the code before my change.
3363
3364         * rendering/HitTestLocation.cpp:
3365
3366 2020-03-11  Myles C. Maxfield  <mmaxfield@apple.com>
3367
3368         icloud.com Notes text in titles and headings is distorted
3369         https://bugs.webkit.org/show_bug.cgi?id=208908
3370         <rdar://problem/58874371>
3371
3372         Reviewed by Zalan Bujtas.
3373
3374         icloud.com Notes determines if a font has finished loading by measuring it repeatedly.
3375         Depending on the state of the page, we may slice the text differently in different
3376         circumstances. These slices are all supposed to sum together equivalently, but
3377         floating point precision may cause the results to be slightly off.
3378
3379         WidthIterator::applyFontTransforms() was summing a large list of numbers, and then
3380         subtracting the same large list of numbers. A more robust design would be to sum
3381         it twice, and then subtract the two sums.
3382
3383         Test: fast/text/shaping-width-precision.html
3384
3385         * platform/graphics/WidthIterator.cpp:
3386         (WebCore::WidthIterator::applyFontTransforms):
3387
3388 2020-03-11  Zalan Bujtas  <zalan@apple.com>
3389
3390         SVG filter triggers unstable layout.
3391         https://bugs.webkit.org/show_bug.cgi?id=207444
3392         rdar://problem/59297004
3393
3394         Reviewed by Simon Fraser.
3395
3396         SVG filter code marks DOM nodes dirty and schedules style recalc outside of the SVG root
3397         while in layout. This could lead to unstable layout and cause battery drain.
3398         (See webkit.org/b/208903)
3399
3400         * rendering/RenderLayer.cpp: Remove filterNeedsRepaint(). It's a dangerously misleading name and should
3401         not be part of RenderLayer.
3402         (WebCore::RenderLayer::calculateClipRects const):
3403         * rendering/RenderLayer.h:
3404         * rendering/RenderLayerFilters.cpp:
3405         (WebCore::RenderLayerFilters::notifyFinished):
3406         * rendering/svg/RenderSVGResourceContainer.cpp:
3407         (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):