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