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