Pass a hint from the extension to decidePolicyForSOAuthorizationLoadWithCurrentPolicy
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-02-03  Sihui Liu  <sihui_liu@apple.com>
2
3         Crash in WebCore::IDBServer::IDBServer::createIndex
4         https://bugs.webkit.org/show_bug.cgi?id=207137
5         <rdar://problem/59096231>
6
7         Reviewed by Darin Adler.
8
9         Export IDBIndexInfo::isolatedCopy so it can be used in WebKitLegacy framework code.
10
11         * Modules/indexeddb/shared/IDBIndexInfo.h:
12
13 2020-02-03  Jer Noble  <jer.noble@apple.com>
14
15         Unreviewed iOS build fix; lambdas need an arrow operator between the paramaters and return type.
16
17         * page/Quirks.cpp:
18         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
19
20 2020-02-03  Antoine Quint  <graouts@apple.com>
21
22         [Web Animations] Accelerated animations don't run until their natural completion
23         https://bugs.webkit.org/show_bug.cgi?id=207130
24         <rdar://problem/59106047>
25
26         Reviewed by Dean Jackson.
27
28         Tests: webanimations/transform-accelerated-animation-finishes-before-removal.html
29                webanimations/transform-accelerated-animation-removed-one-frame-after-finished-promise.html
30
31         Ensure we don't tear down a composited renderer until all of its runnning accelerated animations are completed.
32         The accelerated animations will be queued for removal in the next animation frame.
33
34         * animation/KeyframeEffect.cpp:
35         (WebCore::KeyframeEffect::isRunningAcceleratedAnimationForProperty const):
36         * animation/KeyframeEffect.h:
37         * animation/KeyframeEffectStack.cpp:
38         (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const):
39
40 2020-02-03  Jer Noble  <jer.noble@apple.com>
41
42         [iPad] Videos on nhl.com can't be scrubbed when loaded with desktop UA.
43         https://bugs.webkit.org/show_bug.cgi?id=207058
44
45         Reviewed by Darin Adler.
46
47         The video controls on nhl.com listen for mousedown/mousemove/mouseup events, not
48         touchstart/touchmove/touchend events. Until nhl.com can update their site to support touch
49         events, add them to the quirks list for simplated mouse events.
50
51         Drive-by fix: There's no need to re-parse the entire URL and walk through all the cases
52         every time shouldDispatchSimulatedMouseEvents() is called. Save the results of the initial
53         pass so that subsequent checks are just a simple bool check.
54
55         * page/Quirks.cpp:
56         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
57
58 2020-02-03  Jer Noble  <jer.noble@apple.com>
59
60         Replace the custom allocator in AudioArray::allocate() with fastAlignedMalloc().
61         https://bugs.webkit.org/show_bug.cgi?id=206504
62
63         Reviewed by Filip Pizlo.
64
65         AudioArray wants to have its data aligned at 16-byte boundaries, as that's a requirement for
66         some of the accelerated math frameworks used by Web Audio. Now that we have fastAlignedMalloc(),
67         there's no need to use a custom aligned allocator.
68
69         Drive-by fixes: clean up the constructors a bit to use the modern initialization syntax.
70
71         * platform/audio/AudioArray.h:
72         (WebCore::AudioArray::AudioArray):
73         (WebCore::AudioArray::~AudioArray):
74         (WebCore::AudioArray::allocate):
75         (WebCore::AudioArray::data):
76         (WebCore::AudioArray::data const):
77         (WebCore::AudioArray::alignedAddress): Deleted.
78
79 2020-02-03  youenn fablet  <youenn@apple.com>
80
81         [ macOS wk2 ] http/tests/media/media-stream/get-display-media-prompt.html is flaky failure
82         https://bugs.webkit.org/show_bug.cgi?id=206958
83         <rdar://problem/59003765>
84
85         Reviewed by Eric Carlson.
86
87         We added a rule to only allow one getDisplayMedia call per gesture.
88         For that reason, we were storing a pointer to the gesture event and
89         resetting in case the current gesture event was equal to the stored pointer.
90         Instead, store a WeakPtr which ensures that if the previous event is destroyed,
91         the weak pointer will be null and so will not have the same value as the new gesture event.
92         Covered by existing tests no longer being flaky.
93
94         * Modules/mediastream/MediaDevices.cpp:
95         (WebCore::MediaDevices::computeUserGesturePriviledge):
96         * Modules/mediastream/MediaDevices.h:
97         * dom/UserGestureIndicator.h:
98
99 2020-02-03  Eric Carlson  <eric.carlson@apple.com>
100
101         [macOS] AirPlay sometimes stops after 60 minutes of playback
102         https://bugs.webkit.org/show_bug.cgi?id=207056
103         <rdar://problem/53649508>
104
105         Reviewed by Jer Noble.
106
107         No new tests, this only reproduces when playing to an AirPlay device.
108
109         AVPlayerItem.tracks is empty during AirPlay. If AirPlay is activated immediately
110         after the item is created, as is typically the case when switching from an MSE to
111         a url based player, MediaPlayerPrivateAVFoundationObjC doesn't know if the AVPlayerItem
112         has audio or video so the state reported to the WebMediaSessionManager is incorrect.
113         AirPlay can't actually be active if an item doesn't have audio or video, so always claim
114         to have both during AirPlay.
115
116         Converted WebMediaSessionManager logging from debug-only to runtime to make it easier
117         to diagnose problems in the future.
118
119         * Modules/mediasession/WebMediaSessionManager.cpp:
120         (WebCore::mediaProducerStateString):
121         (WebCore::WebMediaSessionLogger::create):
122         (WebCore::WebMediaSessionLogger::WebMediaSessionLogger):
123         (WebCore::WebMediaSessionLogger::log const):
124         (WebCore::WebMediaSessionManager::logger):
125         (WebCore::WebMediaSessionManager::alwaysOnLoggingAllowed const):
126         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled):
127         (WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState):
128         (WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup):
129         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
130         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
131         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
132         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
133         (WebCore::WebMediaSessionManager::clientStateDidChange):
134         (WebCore::WebMediaSessionManager::setPlaybackTarget):
135         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
136         (WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed):
137         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients):
138         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
139         (WebCore::WebMediaSessionManager::configureWatchdogTimer):
140         (WebCore::WebMediaSessionManager::watchdogTimerFired):
141         (WebCore::ClientState::logAlways const): Deleted.
142         * Modules/mediasession/WebMediaSessionManager.h:
143         * Modules/mediasession/WebMediaSessionManagerClient.h:
144         (WebCore::WebMediaSessionManagerClient::alwaysOnLoggingAllowed):
145         * html/HTMLMediaElement.cpp:
146         (WebCore::HTMLMediaElement::mediaState const):
147         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
148         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
149         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasVideo const):
150         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAudio const):
151
152 2020-02-03  youenn fablet  <youenn@apple.com>
153
154         Do not copy feature policy in isFeaturePolicyAllowedByDocumentAndAllOwners
155         https://bugs.webkit.org/show_bug.cgi?id=207110
156
157         Reviewed by Eric Carlson.
158
159         Use auto& instead of auto to not copy the feature policy object.
160         Add some auto* to improve code readability.
161         No change of behavior.
162
163         * html/FeaturePolicy.cpp:
164         (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):
165
166 2020-02-03  Zan Dobersek  <zdobersek@igalia.com>
167
168         Use std::hypot() where possible
169         https://bugs.webkit.org/show_bug.cgi?id=198483
170
171         Reviewed by Carlos Garcia Campos.
172
173         Use std::hypot() where possible, allowing for a possibly more precise
174         calculation of square roots of sums of two or three square values.
175
176         * css/CSSGradientValue.cpp:
177         (WebCore::horizontalEllipseRadius):
178         * platform/audio/FFTFrame.cpp:
179         (WebCore::FFTFrame::print):
180         * platform/graphics/FloatPoint.cpp:
181         (WebCore::FloatPoint::length const): Deleted.
182         * platform/graphics/FloatPoint.h:
183         (WebCore::FloatPoint::length const):
184         * platform/graphics/FloatPoint3D.h:
185         (WebCore::FloatPoint3D::length const):
186         * platform/graphics/FloatSize.cpp:
187         (WebCore::FloatSize::diagonalLength const): Deleted.
188         * platform/graphics/FloatSize.h:
189         (WebCore::FloatSize::diagonalLength const):
190         * platform/graphics/GeometryUtilities.cpp:
191         (WebCore::euclidianDistance):
192         * platform/graphics/GraphicsContext.cpp:
193         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
194         * platform/graphics/PathTraversalState.cpp:
195         (WebCore::distanceLine):
196         * platform/graphics/cairo/CairoOperations.cpp:
197         (WebCore::Cairo::computeLineBoundsAndAntialiasingModeForText):
198         * platform/graphics/cairo/PathCairo.cpp:
199         (WebCore::Path::addArcTo):
200         * platform/graphics/cg/GraphicsContextCG.cpp:
201         (WebCore::GraphicsContext::roundToDevicePixels):
202         * platform/graphics/filters/FETurbulence.cpp:
203         (WebCore::FETurbulence::initPaint):
204         * platform/graphics/transforms/AffineTransform.cpp:
205         (WebCore::AffineTransform::xScale const):
206         (WebCore::AffineTransform::yScale const):
207         * platform/graphics/transforms/RotateTransformOperation.cpp:
208         (WebCore::RotateTransformOperation::blend):
209         * platform/graphics/transforms/TransformationMatrix.cpp:
210         (WebCore::v3Length):
211         (WebCore::decompose2):
212         (WebCore::TransformationMatrix::rotate3d):
213         * rendering/RenderThemeIOS.mm:
214         (WebCore::shortened):
215         * rendering/style/BasicShapes.cpp:
216         (WebCore::BasicShapeCircle::floatValueForRadiusInBox const):
217         * rendering/svg/SVGRenderingContext.cpp:
218         (WebCore::SVGRenderingContext::calculateScreenFontSizeScalingFactor):
219         * svg/SVGAnimateMotionElement.cpp:
220         (WebCore::SVGAnimateMotionElement::calculateDistance):
221         * svg/SVGLengthContext.cpp:
222         (WebCore::SVGLengthContext::valueForLength):
223         (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
224         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
225         * svg/SVGTransformDistance.cpp:
226         (WebCore::SVGTransformDistance::distance const):
227         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
228
229 2020-02-03  Jonathan Kingston  <jonathan@jooped.co.uk>
230
231         Crash in WebKitAccessible
232         https://bugs.webkit.org/show_bug.cgi?id=207093
233         <rdar://problem/59088456>
234
235         Reviewed by Carlos Garcia Campos.
236
237         Fixed a debug crash in WebKitAccessible caused by detatching an accessibility wrapper multiple times.
238
239         * accessibility/atk/AccessibilityObjectAtk.cpp:
240         (WebCore::AccessibilityObject::detachPlatformWrapper):
241
242 2020-02-03  Pablo Saavedra  <psaavedra@igalia.com>
243
244         Build error with -DENABLE_VIDEO_TRACK=OFF after r255151
245         https://bugs.webkit.org/show_bug.cgi?id=207097
246
247         Reviewed by Antti Koivisto.
248
249         No new tests, only build error fix up
250
251         * css/CSSSelector.cpp:
252         (WebCore::CSSSelector::selectorText const):
253
254 2020-02-02  Antoine Quint  <graouts@apple.com>
255
256         ASSERTION FAILED: !HashTranslator::equal(KeyTraits::emptyValue(), key) on animations/keyframe-autoclose-brace.html
257         https://bugs.webkit.org/show_bug.cgi?id=207071
258         <rdar://problem/59076249>
259
260         Reviewed by Dean Jackson.
261
262         We cannot add CSSPropertyInvalid to a HashSet<CSSPropertyID>, because it triggers an ASSERT, and also we shouldn't
263         because we wouldn't know how to animate that CSS property.
264
265         * animation/AnimationTimeline.cpp:
266         (WebCore::compileTransitionPropertiesInStyle):
267
268 2020-02-01  Michael Catanzaro  <mcatanzaro@gnome.org>
269
270         Silence compiler warnings
271         https://bugs.webkit.org/show_bug.cgi?id=207015
272
273         Reviewed by Darin Adler.
274
275         * accessibility/AXObjectCache.cpp:
276         (WebCore::characterForCharacterOffset): Use IGNORE_CLANG_WARNINGS macros to avoid
277         warnings when using GCC. GCC freaks out when it doesn't recognize a warning passed to
278         IGNORE_WARNINGS_BEGIN().
279         * inspector/InspectorCanvas.cpp:
280         (WebCore::InspectorCanvas::buildObjectForCanvas): Fix -Wredundant-move
281         * platform/PasteboardItemInfo.h: Fix -Wredundant-move
282         (WebCore::PresentationSize::decode):
283         (WebCore::PasteboardItemInfo::decode):
284
285 2020-02-01  Devin Rousso  <drousso@apple.com>
286
287         Web Inspector: move the items in the toolbar into the tab bar to save vertical space
288         https://bugs.webkit.org/show_bug.cgi?id=204627
289
290         Reviewed by Timothy Hatcher.
291
292         Now that there is no toolbar area, there is nothing obstructing the ability for the window
293         to be moved around when dragging via the title bar area. As such, we can remove the unused
294         `InspectorFrontendHost` APIs.
295
296         * inspector/InspectorFrontendHost.idl:
297         * inspector/InspectorFrontendHost.h:
298         * inspector/InspectorFrontendHost.cpp:
299         (WebCore::InspectorFrontendHost::startWindowDrag): Deleted.
300         (WebCore::InspectorFrontendHost::moveWindowBy const): Deleted.
301
302         * inspector/InspectorFrontendClient.h:
303         * inspector/InspectorFrontendClientLocal.h:
304         * inspector/InspectorFrontendClientLocal.cpp:
305         (WebCore::InspectorFrontendClientLocal::moveWindowBy): Deleted.
306
307 2020-01-31  Wenson Hsieh  <wenson_hsieh@apple.com>
308
309         Add support for specifying background colors when setting marked text
310         https://bugs.webkit.org/show_bug.cgi?id=207065
311         <rdar://problem/57876140>
312
313         Reviewed by Tim Horton.
314
315         Add support for rendering custom highlights (background colors) behind marked text in WebCore. To do this, we
316         plumb a Vector of CompositionHighlights alongside the Vector of CompositionUnderlines to Editor. At paint time,
317         we then consult this highlight data to determine which ranges of text in the composition should paint using
318         custom background colors.
319
320         Note that in the future, we should consider refactoring both composition underlines and highlights to use the
321         MarkedText mechanism for decorating ranges of text instead.
322
323         Test: editing/input/composition-highlights.html
324
325         * Headers.cmake:
326         * WebCore.xcodeproj/project.pbxproj:
327         * editing/CompositionHighlight.h: Added.
328         (WebCore::CompositionHighlight::CompositionHighlight):
329         (WebCore::CompositionHighlight::encode const):
330         (WebCore::CompositionHighlight::decode):
331
332         Add CompositionHighlight, which represents a range in the composition that should be highlighted with a given
333         background color.
334
335         * editing/Editor.cpp:
336         (WebCore::Editor::clear):
337         (WebCore::Editor::setComposition):
338
339         Add logic for clearing and updating m_customCompositionHighlights.
340
341         * editing/Editor.h:
342         (WebCore::Editor::compositionUsesCustomHighlights const):
343         (WebCore::Editor::customCompositionHighlights const):
344         * rendering/InlineTextBox.cpp:
345         (WebCore::InlineTextBox::paintCompositionBackground):
346
347         If custom composition highlights are given, use those when painting the composition background; otherwise,
348         default to painting the entire composition range using `Color::compositionFill`.
349
350 2020-01-31  Justin Fan  <justin_fan@apple.com>
351
352         [WebGL] Revert logging added to investigate 205757
353         https://bugs.webkit.org/show_bug.cgi?id=207076
354
355         Unreviewed.
356         
357         Revert https://trac.webkit.org/changeset/255468.
358
359         * html/canvas/WebGLRenderingContextBase.cpp:
360         (WebCore::WebGLRenderingContextBase::bindTexture):
361         (WebCore::WebGLRenderingContextBase::createTexture):
362         (WebCore::WebGLRenderingContextBase::getError):
363         (WebCore::WebGLRenderingContextBase::texSubImage2D):
364         (WebCore::WebGLRenderingContextBase::texImage2D):
365         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
366         (WebCore::GraphicsContextGLOpenGL::texImage2D):
367         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
368         (WebCore::GraphicsContextGLOpenGL::bindTexture):
369         (WebCore::GraphicsContextGLOpenGL::getError):
370         (WebCore::GraphicsContextGLOpenGL::texSubImage2D):
371         (WebCore::GraphicsContextGLOpenGL::createTexture):
372
373 2020-01-31  Antoine Quint  <graouts@apple.com>
374
375         [Web Animations] [WK1] REGRESSION: opacity doesn't animate
376         https://bugs.webkit.org/show_bug.cgi?id=207044
377         <rdar://problem/59061225>
378
379         Reviewed by Simon Fraser.
380
381         Test: webanimations/opacity-animation.html
382
383         We failed to animate opacity in WK1 because we made the assumption that just because an animation targets only accelerated properties it would be accelerated
384         and wouldn't need to be updated as it runs in WebAnimation::timeToNextTick(). This is incorrect, an animation may fail to start or may fail to get a composited
385         layer, the latter being the case on WK1 because usesCompositing() is false in RenderLayerCompositor::requiresCompositingForAnimation().
386
387         We now check that an animation is both only animating accelerated properties and running accelerated to determine that an animation won't need to be updated
388         until it completes.
389
390         * animation/WebAnimation.cpp:
391         (WebCore::WebAnimation::timeToNextTick const):
392
393 2020-01-31  Cathie Chen  <cathiechen@igalia.com>
394
395         Asynchronous scrolling of overflow element can enter a recursive loop
396         https://bugs.webkit.org/show_bug.cgi?id=206884
397
398         Reviewed by Frédéric Wang.
399
400         After implementing RenderLayer::requestScrollPositionUpdate, there's a recursive loop
401         while performing asynchronous programmatic scrolling for overflow elements. In order to break
402         the loop call notifyScrollPositionChanged in updateScrollPositionAfterAsyncScroll instead.
403
404         Test: fast/scrolling/ios/programmatic-scroll-element-crash.html
405
406         * page/scrolling/AsyncScrollingCoordinator.cpp:
407         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
408         * rendering/RenderLayer.cpp:
409         (WebCore::RenderLayer::requestScrollPositionUpdate):
410         (WebCore::RenderLayer::scrollToOffset):
411         * rendering/RenderLayer.h:
412
413 2020-01-31  Antti Koivisto  <antti@apple.com>
414
415         REGRESSION (r240250): Pages using smoothscroll.js can't be scrolled with trackpad
416         https://bugs.webkit.org/show_bug.cgi?id=207040
417         <rdar://problem/52712513>
418
419         Reviewed by Simon Fraser.
420
421         Add a quirk that makes the wheel event listener used by smoothscroll.js passive so it can't prevent scrolling.
422
423         This uses the same logic as the Chromium intervention in
424         https://chromium.googlesource.com/chromium/src/+/b6b13c9cfe64d52a4168d9d8d1ad9bb8f0b46a2a%5E%21/
425
426         * bindings/js/JSEventListener.cpp:
427         (WebCore::JSEventListener::functionName const):
428         * bindings/js/JSEventListener.h:
429         * dom/EventTarget.cpp:
430         (WebCore::EventTarget::addEventListener):
431         * page/Quirks.cpp:
432         (WebCore::Quirks::shouldMakeEventListenerPassive const):
433
434         Also factor the existing code for making some touch event listeners passive here.
435
436         * page/Quirks.h:
437
438 2020-01-31  Peng Liu  <peng.liu6@apple.com>
439
440         Media controls of the video player on nfl.com are not visible in fullscreen mode (iPad only)
441         https://bugs.webkit.org/show_bug.cgi?id=207020
442
443         Reviewed by Eric Carlson.
444
445         Add a quirk to disable the element fullscreen API support for nfl.com on iPads.
446
447         * dom/DocumentFullscreen.idl:
448         * dom/Element.idl:
449         * page/Quirks.cpp:
450         (WebCore::Quirks::shouldDisableElementFullscreenQuirk const):
451         * page/Quirks.h:
452
453 2020-01-31  Antti Koivisto  <antti@apple.com>
454
455         Regression(r255359): imported/mozilla/svg/svg-integration/clipPath-html-06.xhtml is failing consistently on windows
456         https://bugs.webkit.org/show_bug.cgi?id=206991
457         <rdar://problem/59030252>
458
459         Reviewed by Antoine Quint.
460
461         The previous approach may have still allowed RenderStyles computed with non-current FontCascade in
462         matched properties caches (because some non-font properties were resolved based on obsolete font information).
463
464         This patch takes a more robust approach by simply preventing caching of styles with non-current font.
465
466         * dom/Document.h:
467         (WebCore::Document::fontSelector const):
468         * platform/graphics/FontCascade.cpp:
469         (WebCore::FontCascade::isCurrent const):
470         * platform/graphics/FontCascade.h:
471         * style/MatchedDeclarationsCache.cpp:
472         (WebCore::Style::MatchedDeclarationsCache::isCacheable):
473         * style/StyleBuilderState.cpp:
474         (WebCore::Style::BuilderState::updateFont):
475
476 2020-01-30  Antoine Quint  <graouts@apple.com>
477
478         [Web Animations] DocumentTimeline shouldn't suspend itself if hiddenPageCSSAnimationSuspensionEnabled is disabled
479         https://bugs.webkit.org/show_bug.cgi?id=207014
480         <rdar://problem/58815952>
481
482         Reviewed by Antti Koivisto.
483
484         We suspend a timeline upon consutrction if we know that the page is not visible because, unlike CSSAnimationController, the DocumentTimeline is not guaranteed
485         to be created by the time the Page sets the initial visibility state. This is because DocumentTimeline is created as needed when there are CSS Animations or CSS
486         Transitions created for the page, or if the content uses any of the Web Animations APIs.
487
488         However, the Page::setIsVisibleInternal() function that would call DocumentTimeline::resumeAnimations() at a later time checks whether the hiddenPageCSSAnimationSuspensionEnabled
489         setting is enabled. So we must respect that setting also when suspending animations in the first place or we risk ending up in a state where we suspend animations
490         because the page is not visible upon timeline creation, but never resuming animations later due to the hiddenPageCSSAnimationSuspensionEnabled setting being false.
491
492         * animation/DocumentTimeline.cpp:
493         (WebCore::DocumentTimeline::DocumentTimeline):
494
495 2020-01-31  Jiewen Tan  <jiewen_tan@apple.com>
496
497         REGRESSION: [iOS release] http/tests/security/window-named-proto.html is a flaky timing out
498         https://bugs.webkit.org/show_bug.cgi?id=206672
499         <rdar://problem/58838583>
500
501         Reviewed by Chris Dumez.
502
503         This is a speculative fix to increase the priority of the DataURLDecoder's WorkQueue such that
504         it is less likely to be preempted.
505
506         Covered by existing tests.
507
508         * platform/network/DataURLDecoder.cpp:
509         (WebCore::DataURLDecoder::decodeQueue):
510
511 2020-01-30  Said Abou-Hallawa  <said@apple.com>
512
513         [iOS] Page throttling reasons are not initialized with the device low power mode
514         https://bugs.webkit.org/show_bug.cgi?id=206860
515
516         Reviewed by Simon Fraser.
517
518         Initialize m_throttlingReasons with the device current low power mode in
519         the constructor of Page.
520
521         Add m_throttlingReasonsOverridenForTesting to Page and use it to control
522         overriding the ThrottlingReasons of m_throttlingReasons.
523
524         * page/Page.cpp:
525         (WebCore::m_deviceOrientationUpdateProvider):
526         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
527         (WebCore::Page::handleLowModePowerChange):
528         (WebCore::Page::isLowPowerModeEnabled const): Deleted.
529         * page/Page.h:
530         (WebCore::Page::isLowPowerModeEnabled const):
531         (WebCore::Page::canUpdateThrottlingReason const):
532
533 2020-01-30  Doug Kelly  <dougk@apple.com>
534
535         Ensure non-initial values for CSS Font properties
536         https://bugs.webkit.org/show_bug.cgi?id=206312
537
538         Reviewed by Antti Koivisto.
539
540         If CSS font properties are currently initial values, set them to a normal value.
541
542         * css/CSSFontFaceSet.cpp:
543         (WebCore::computeFontSelectionRequest):
544
545 2020-01-30  Doug Kelly  <dougk@apple.com>
546
547         Crash in GraphicsLayerCA::fetchCloneLayers() when setting contents to solid color
548         https://bugs.webkit.org/show_bug.cgi?id=205530
549
550         Reviewed by Ryosuke Niwa.
551
552         Change the assertion in fetchCloneLayers() to check for null explicitly to ensure contentsLayer is valid.
553
554         * platform/graphics/ca/GraphicsLayerCA.cpp:
555         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
556
557 2020-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
558
559         [Cairo] Use CAIRO_FILTER_BILINEAR for image tile painting with InterpolationQuality::Default
560         https://bugs.webkit.org/show_bug.cgi?id=201326
561
562         Reviewed by Carlos Garcia Campos.
563
564         Mac port is using a better image interpolation method for painting
565         a single image than painting tiled images.
566
567         In Cairo port, CAIRO_FILTER_GOOD was used for both cases as
568         default. CAIRO_FILTER_GOOD is using separable convolution filter
569         for down-scaling (≤ 0.75 and ≠ 0.5), and bi-linear filter
570         otherwise. The separable convolution filter is better quality but
571         quite slower than bi-linear filter.
572
573         drawSurface of CairoOperations.cpp has the code to choose a filter
574         based on InterpolationQuality.
575         <https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp?rev=254506#L966>
576
577         This change copied the code to drawPatternToCairoContext, and
578         changed it to use CAIRO_FILTER_BILINEAR for
579         InterpolationQuality::Default.
580
581         * platform/graphics/cairo/CairoOperations.cpp:
582         (WebCore::Cairo::drawPattern):
583         * platform/graphics/cairo/CairoUtilities.cpp:
584         (WebCore::drawPatternToCairoContext): Set a filter by calling
585         cairo_pattern_set_filter based on InterpolationQuality.
586         * platform/graphics/cairo/CairoUtilities.h: Added a InterpolationQuality argument.
587
588 2020-01-30  Ross Kirsling  <ross.kirsling@sony.com>
589
590         [CMake] Add SQLite::SQLite3 target
591         https://bugs.webkit.org/show_bug.cgi?id=207005
592
593         Reviewed by Don Olmstead.
594
595         * CMakeLists.txt: Use SQLite3 target.
596         * PlatformPlayStation.cmake: Remove redundant entries.
597
598 2020-01-30  Tim Horton  <timothy_horton@apple.com>
599
600         Add a quirk to opt Twitter out of the non-overlaid minimized input view
601         https://bugs.webkit.org/show_bug.cgi?id=207021
602         <rdar://problem/59016252>
603
604         Reviewed by Wenson Hsieh.
605
606         * page/Quirks.cpp:
607         (WebCore::Quirks::shouldAvoidResizingWhenInputViewBoundsChange const):
608         Twitter has a content breakpoint that sits immediately between the size
609         of the Safari content area on a 11" iPad in landscape with the App Banner
610         visible and the same minus the height of the minimized input view that
611         we display when using a hardware keyboard. This breakpoint removes the
612         login field, causing the keyboard to dismiss, the input view to disappear,
613         and the page to resize to the larger size. This results in a loop,
614         so we must opt Twitter out of the content-avoiding input view mechanism.
615
616 2020-01-30  Justin Fan  <justin_fan@apple.com>
617
618         [WebGL] Add logging statements to attempt to catch texture-upload-size.html timeout
619         https://bugs.webkit.org/show_bug.cgi?id=207006
620
621         Unreviewed temporary logging additions for flaky timeout investigation.
622
623         * html/canvas/WebGLRenderingContextBase.cpp:
624         (WebCore::WebGLRenderingContextBase::bindTexture):
625         (WebCore::WebGLRenderingContextBase::createTexture):
626         (WebCore::WebGLRenderingContextBase::getError):
627         (WebCore::WebGLRenderingContextBase::texSubImage2D):
628         (WebCore::WebGLRenderingContextBase::texImage2D):
629         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
630         (WebCore::GraphicsContextGLOpenGL::texImage2D):
631         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
632         (WebCore::GraphicsContextGLOpenGL::bindTexture):
633         (WebCore::GraphicsContextGLOpenGL::getError):
634         (WebCore::GraphicsContextGLOpenGL::texSubImage2D):
635         (WebCore::GraphicsContextGLOpenGL::createTexture):
636
637 2020-01-30  Per Arne Vollan  <pvollan@apple.com>
638
639         [iOS] Issue mach sandbox extension to the frontboard and icon service when the attachment element is enabled
640         https://bugs.webkit.org/show_bug.cgi?id=205443
641
642         Reviewed by Brent Fulgham.
643
644         Get focus ring color in the UI process since getting this color will communicate with the frontboard daemon.
645
646         Test: fast/sandbox/ios/focus-ring-color.html
647
648         * rendering/RenderTheme.h:
649         * rendering/RenderThemeIOS.h:
650         * rendering/RenderThemeIOS.mm:
651         (WebCore::cachedFocusRingColor):
652         (WebCore::RenderThemeIOS::platformFocusRingColor const):
653         (WebCore::RenderThemeIOS::setFocusRingColor):
654         * testing/Internals.cpp:
655         (WebCore::Internals::focusRingColor):
656         * testing/Internals.h:
657         * testing/Internals.idl:
658
659 2020-01-30  Jonathan Bedard  <jbedard@apple.com>
660
661         PAL: Remove old iOS version macros
662         https://bugs.webkit.org/show_bug.cgi?id=206905
663
664         Reviewed by Darin Adler.
665
666         No functional changes, covered by existing tests.
667
668         * loader/archive/cf/LegacyWebArchiveMac.mm: Remove USE(SECURE_ARCHIVER_API).
669         * testing/cocoa/WebArchiveDumpSupport.mm: Ditto.
670
671 2020-01-30  Doug Kelly  <dougk@apple.com>
672
673         Crash in RenderElement::selectionPseudoStyle with detail element set to display: contents
674         https://bugs.webkit.org/show_bug.cgi?id=206705
675
676         Reviewed by Zalan Bujtas.
677
678         Check the element for a valid renderer before calling getUncachedPseudoStyle(), and if the
679         element is set to "display: contents", walk up to the parent element until we're at the root
680         or the element is not set to "display: contents".
681
682         Test: fast/css/display-contents-detail-selection.html
683
684         * rendering/RenderElement.cpp:
685         (WebCore::RenderElement::selectionPseudoStyle const):
686
687 2020-01-30  Ryan Haddad  <ryanhaddad@apple.com>
688
689         Unreviewed, rolling out r255424.
690
691         Breaks internal builds.
692
693         Reverted changeset:
694
695         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
696         https://bugs.webkit.org/show_bug.cgi?id=206582
697         https://trac.webkit.org/changeset/255424
698
699 2020-01-30  Doug Kelly  <dougk@apple.com>
700
701         Crash in RenderBlockFlow::adjustLinePositionForPagination() with complex line without root box
702         https://bugs.webkit.org/show_bug.cgi?id=206610
703
704         Reviewed by Zalan Bujtas.
705
706         Add a check for a null pointer when getting firstRootBox() -- if it is null, return early after calling setPaginationStrut().
707
708         Test: fast/text/complex-without-root-box.html
709
710         * rendering/RenderBlockFlow.cpp:
711         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
712
713 2020-01-30  Chris Dumez  <cdumez@apple.com>
714
715         REGRESSION (r252064): [ Mac iOS ] storage/websql/statement-error-callback.html is timing out flakily
716         https://bugs.webkit.org/show_bug.cgi?id=206291
717         <rdar://problem/58606666>
718
719         Unreviewed, partial rollout of r252064 which seems to have introduced the regression.
720
721         No new tests, covered by existing test
722
723         * Modules/webdatabase/SQLTransaction.cpp:
724         (WebCore::SQLTransaction::notifyDatabaseThreadIsShuttingDown):
725
726 2020-01-30  Joonghun Park  <jh718.park@samsung.com>
727
728         Unreviewed. Remove the build warning since r254991 as below.
729         warning: base class ‘class WTF::RefCounted<WebCore::AnimationList>’
730         should be explicitly initialized in the copy constructor [-Wextra]
731
732         No new tests, no behavioral changes.
733
734         * platform/animation/AnimationList.cpp:
735         (WebCore::AnimationList::AnimationList):
736
737 2020-01-30  youenn fablet  <youenn@apple.com>
738
739         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
740         https://bugs.webkit.org/show_bug.cgi?id=206582
741
742         Reviewed by Eric Carlson.
743
744         AVAssetWriterDelegate allows to grab recorded data whenever wanted.
745         This delegate requires passing compressed samples to AVAssetWriter.
746         Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
747         Since AVAssetWriterDelegate is Apple SDK only, keep the existing file based implementation as a fallback.
748
749         Covered by existing tests.
750
751         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h:
752         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:
753         (WebCore::AudioSampleBufferCompressor::create):
754         (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
755         (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
756         (WebCore::AudioSampleBufferCompressor::initialize):
757         (WebCore::AudioSampleBufferCompressor::finish):
758         (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
759         (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
760         (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
761         (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
762         (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
763         (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
764         (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
765         (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
766         (WebCore::AudioSampleBufferCompressor::processSampleBuffer):
767         (WebCore::AudioSampleBufferCompressor::addSampleBuffer):
768         (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
769         (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
770         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
771         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
772         (WebCore::MediaRecorderPrivateWriter::create):
773         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
774         (WebCore::MediaRecorderPrivateWriter::initialize):
775         (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
776         (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
777         (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
778         (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
779         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
780         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
781         (WebCore::MediaRecorderPrivateWriter::stopRecording):
782         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h:
783         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm:
784         (WebCore::VideoSampleBufferCompressor::create):
785         (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
786         (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
787         (WebCore::VideoSampleBufferCompressor::initialize):
788         (WebCore::VideoSampleBufferCompressor::finish):
789         (WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
790         (WebCore::VideoSampleBufferCompressor::initCompressionSession):
791         (WebCore::VideoSampleBufferCompressor::processSampleBuffer):
792         (WebCore::VideoSampleBufferCompressor::addSampleBuffer):
793         (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
794         (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):
795
796 2020-01-29  Sergio Villar Senin  <svillar@igalia.com>
797
798         [GStreamer] Fix build with ACCELERATED_2D_CANVAS enabled
799         https://bugs.webkit.org/show_bug.cgi?id=206976
800
801         Reviewed by Philippe Normand.
802
803         When ACCELERATED_2D_CANVAS is enabled the MediaPlayerPrivate uses both PlatformDisplay and
804         GLContext that were undefined. Apart from that all the MediaPlayer::PreLoad::None enums fail
805         because cairo-gl.h ends up including X.h which already defines None.
806
807         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
808
809 2020-01-30  Antoine Quint  <graouts@apple.com>
810
811         [Web Animations] Changing the delay of an accelerated animation doesn't seek the animation
812         https://bugs.webkit.org/show_bug.cgi?id=206990
813         <rdar://problem/58675608>
814
815         Reviewed by Antti Koivisto.
816
817         Test: webanimations/seeking-by-changing-delay-accelerated.html
818
819         In order to seek an accelerated animation, we need to update the animation on the target element's backing GraphicsLayer. We do this by enqueuing an
820         AcceleratedAction:Seek command which is done by calling KeyframeEffect::animationDidSeek(), which we would only call from WebAnimation::setCurrentTime().
821         However, seeking can be performed by modifying the animation's effect's timing.
822
823         We now call WebAnimation::effectTimingDidChange() with an optional ComputedEffectTiming for call sites that want to provide timing data prior to
824         modifying timing properties. This allows WebAnimation::effectTimingDidChange() to compare the previous progress with the new progress to determine if the
825         animation was seeked, so KeyframeEffect::animationDidSeek() may be called.
826
827         There are two places where we now call WebAnimation::effectTimingDidChange() with the previous timing data. First, when updateTiming() is called
828         through the JavaScript API (AnimationEffect::updateTiming) and when a CSS Animation's timing has been modified by changing some of the animation CSS
829         properties (CSSAnimation::syncPropertiesWithBackingAnimation).
830
831         * animation/AnimationEffect.cpp:
832         (WebCore::AnimationEffect::updateTiming): Compute the previous timing data and provide it to WebAnimation::effectTimingDidChange().
833         * animation/CSSAnimation.cpp:
834         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Compute the previous timing data and provide it to WebAnimation::effectTimingDidChange().
835         * animation/KeyframeEffect.cpp:
836         (WebCore::KeyframeEffect::computeAcceleratedPropertiesState): Drive-by fix for faulty logic introduced in a recent patch (r255383).
837         (WebCore::KeyframeEffect::applyPendingAcceleratedActions): We need to reset the m_isRunningAccelerated flag when an animation was supposed to be stopped but
838         couldn't be because the target's layer backing was removed prior to the accelerated action being committed.
839         * animation/WebAnimation.cpp:
840         (WebCore::WebAnimation::effectTimingDidChange): If previous timing data was provided, check whether its progress differs from the current timing data and
841         call KeyframeEffect::animationDidSeek().
842         * animation/WebAnimation.h:
843
844 2020-01-30  Noam Rosenthal  <noam@webkit.org>
845
846         REGRESSION (r254406): Gmail.com star/favorite icons are not rendering
847         https://bugs.webkit.org/show_bug.cgi?id=206909
848
849         Reviewed by Simon Fraser.
850
851         Make image-set parsing more conservative, for backwards compatibility:
852         - Differentiate between image-set and -webkit-image-set when parsing, -webkit-image-set maintains old behavior.
853         - Don't allow empty urls when using raw strings, e.g. image-set('' 1x) is invalid.
854
855         Tests updated: fast/css/image-set-parsing.html.
856
857         * css/parser/CSSPropertyParserHelpers.cpp:
858         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
859         (WebCore::CSSPropertyParserHelpers::consumeImage):
860
861 2020-01-29  Fujii Hironori  <Hironori.Fujii@sony.com>
862
863         [MSVC] Add /experimental:newLambdaProcessor switch for better C++ conformance
864         https://bugs.webkit.org/show_bug.cgi?id=204443
865
866         Reviewed by Alex Christensen.
867
868         * dom/DocumentStorageAccess.cpp:
869         (WebCore::DocumentStorageAccess::requestStorageAccess): Reverted MSVC workaround of r252726.
870
871 2020-01-29  Eric Carlson  <eric.carlson@apple.com>
872
873         Do not notify other applications when deactivating the audio session
874         https://bugs.webkit.org/show_bug.cgi?id=206963
875
876         Reviewed by Jer Noble.
877
878         Tested manually because this change is iOS-only and only reproduces on hardware.
879
880         * platform/audio/ios/AudioSessionIOS.mm:
881         (WebCore::AudioSession::tryToSetActiveInternal): Don't pass the AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation
882         flag to -[AVAudioSession setActive:error].
883
884 2020-01-29  Tim Horton  <timothy_horton@apple.com>
885
886         REGRESSION (r255322): macCatalyst: Tapping in an input field doesn't change the selection location
887         https://bugs.webkit.org/show_bug.cgi?id=206978
888
889         Reviewed by Wenson Hsieh.
890
891         * page/ChromeClient.h:
892         (WebCore::ChromeClient::shouldUseMouseEventForSelection):
893         (WebCore::ChromeClient::shouldUseMouseEventsForSelection): Deleted.
894         * page/EventHandler.cpp:
895         (WebCore::EventHandler::canMouseDownStartSelect):
896         (WebCore::EventHandler::handleMousePressEvent):
897         * page/EventHandler.h:
898         Plumb the event through to the ChromeClient so it can use it to make decisions.
899
900 2020-01-29  Ryosuke Niwa  <rniwa@webkit.org>
901
902         REGRESSION: [Mac wk1] imported/w3c/web-platform-tests/mathml/presentation-markup/scripts/underover-parameters-3.html is a flakey failure
903         https://bugs.webkit.org/show_bug.cgi?id=205168
904
905         Reviewed by Simon Fraser.
906
907         The flakiness of the test was caused by document.fonts.ready resolving without waiting for the document
908         to be loaded if FontFaceSet::FontFaceSet is created after the initial layout had been done.
909
910         r249295 introduced this racy code to address the previous behavior of WebKit, which didn't wait for
911         either document to finish loading or the initial layout to happen at all, and the WebKit workaround in
912         the offending WPT test was subsequentially removed, resulting in the flaky failure after the test was
913         synced up in r249760.
914
915         This patch address the underlying bug by making ready promise wait until Document::implicitClose is called.
916
917         Unfortunately, the specification is extremely vague in terms of when this promise is resolved but new
918         behavior of WebKit is more or less with Firefox (Chrome seems to have a similar race condition as WebKit).
919
920         See also: https://github.com/w3c/csswg-drafts/issues/4248.
921
922         Test: fast/css/font-face-set-ready-after-document-load.html
923
924         * css/CSSFontSelector.cpp:
925         (WebCore::CSSFontSelector::fontFaceSetIfExists): Renamed from optionalFontFaceSet for consistency.
926         * css/CSSFontSelector.h:
927         * css/FontFaceSet.cpp:
928         (WebCore::FontFaceSet::FontFaceSet): Fixed the bug.
929         (WebCore::FontFaceSet::documentDidFinishLoading): Renamed from didFirstLayout to reflect the new semantics.
930         (WebCore::FontFaceSet::completedLoading):
931         * css/FontFaceSet.h:
932         * dom/Document.cpp:
933         (WebCore::Document::implicitClose): Deployed makeRefPtr to be safe.
934
935 2020-01-29  Sunny He  <sunny_he@apple.com>
936
937         Clamp paddingBoxWidth/Height to a minimum of zero
938         https://bugs.webkit.org/show_bug.cgi?id=206317
939         rdar://57102010
940
941         Reviewed by Zalan Bujtas.
942
943         Test: fast/multicol/crash-negative-paddingBoxWidth.html
944
945         * rendering/RenderBox.h:
946         (WebCore::RenderBox::paddingBoxWidth const):
947         (WebCore::RenderBox::paddingBoxHeight const):
948
949 2020-01-29  Robin Morisset  <rmorisset@apple.com>
950
951         Remove Options::enableSpectreMitigations
952         https://bugs.webkit.org/show_bug.cgi?id=193885
953
954         Reviewed by Saam Barati.
955
956         From what I remember we decided to remove the spectre-specific mitigations we had tried (in favor of things like process-per-origin).
957         I don't think anyone is using the SpectreGadget we had added for experiments either.
958         So this patch removes the following three options, and all the code that depended on them:
959         - enableSpectreMitigations (was true, only used in one place)
960         - enableSpectreGadgets (was false)
961         - zeroStackFrame (was false, and was an experiment about Spectre variant 4 if I remember correctly)
962
963         No new tests as there is no new behaviour added.
964
965         * CMakeLists.txt:
966         * DerivedSources-input.xcfilelist:
967         * DerivedSources-output.xcfilelist:
968         * DerivedSources.make:
969         * Sources.txt:
970         * WebCore.xcodeproj/project.pbxproj:
971         * bindings/js/WebCoreBuiltinNames.h:
972         * dom/SpectreGadget.cpp: Removed.
973         * dom/SpectreGadget.h: Removed.
974         * dom/SpectreGadget.idl: Removed.
975         * page/RuntimeEnabledFeatures.cpp:
976         * page/RuntimeEnabledFeatures.h:
977
978 2020-01-29  Sihui Liu  <sihui_liu@apple.com>
979
980         Set QoS of blobUtilityQueue to be Utility
981         https://bugs.webkit.org/show_bug.cgi?id=206971
982
983         Reviewed by Chris Dumez.
984
985         * platform/network/BlobRegistryImpl.cpp:
986         (WebCore::blobUtilityQueue):
987
988 2020-01-29  Devin Rousso  <drousso@apple.com>
989
990         Web Inspector: add instrumentation for showing existing Web Animations
991         https://bugs.webkit.org/show_bug.cgi?id=205434
992         <rdar://problem/28328087>
993
994         Reviewed by Brian Burg.
995
996         Add types/commands/events for instrumenting the lifecycle of `Animation` objects, as well as
997         commands for getting the JavaScript wrapper object and the target DOM node.
998
999         Tests: inspector/animation/effectChanged.html
1000                inspector/animation/lifecycle-css-animation.html
1001                inspector/animation/lifecycle-css-transition.html
1002                inspector/animation/lifecycle-web-animation.html
1003                inspector/animation/requestEffectTarget.html
1004                inspector/animation/resolveAnimation.html
1005                inspector/animation/targetChanged.html
1006
1007         * animation/WebAnimation.h:
1008         * animation/WebAnimation.cpp:
1009         (WebCore::WebAnimation::instances): Added.
1010         (WebCore::WebAnimation::instancesMutex): Added.
1011         (WebCore::WebAnimation::create):
1012         (WebCore::WebAnimation::WebAnimation):
1013         (WebCore::WebAnimation::~WebAnimation):
1014         (WebCore::WebAnimation::effectTimingDidChange):
1015         (WebCore::WebAnimation::setEffectInternal):
1016         (WebCore::WebAnimation::effectTargetDidChange):
1017         * animation/CSSAnimation.cpp:
1018         (WebCore::CSSAnimation::create):
1019         * animation/CSSTransition.cpp:
1020         (WebCore::CSSTransition::create):
1021
1022         * animation/KeyframeEffect.h:
1023         (WebCore::KeyframeEffect::parsedKeyframes const): Added.
1024         (WebCore::KeyframeEffect::blendingKeyframes const): Added.
1025         (WebCore::KeyframeEffect::hasBlendingKeyframes const): Deleted.
1026         Provide a way to access the list of keyframes.
1027
1028         * inspector/InspectorInstrumentation.h:
1029         (WebCore::InspectorInstrumentation::didSetWebAnimationEffect): Added.
1030         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectTiming): Added.
1031         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectTarget): Added.
1032         (WebCore::InspectorInstrumentation::didCreateWebAnimation): Added.
1033         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffect): Deleted.
1034         * inspector/InspectorInstrumentation.cpp:
1035         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
1036         (WebCore::InspectorInstrumentation::didSetWebAnimationEffectImpl): Added.
1037         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectTimingImpl): Added.
1038         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectTargetImpl): Added.
1039         (WebCore::InspectorInstrumentation::didCreateWebAnimationImpl): Added.
1040         (WebCore::InspectorInstrumentation::willDestroyWebAnimationImpl):
1041         (WebCore::InspectorInstrumentation::didChangeWebAnimationEffectImpl): Deleted.
1042
1043         * inspector/InstrumentingAgents.h:
1044         (WebCore::InstrumentingAgents::enabledInspectorAnimationAgent const): Added.
1045         (WebCore::InstrumentingAgents::setEnabledInspectorAnimationAgent): Added.
1046         * inspector/InstrumentingAgents.cpp:
1047         (WebCore::InstrumentingAgents::reset):
1048
1049         * inspector/agents/InspectorAnimationAgent.h:
1050         * inspector/agents/InspectorAnimationAgent.cpp:
1051         (WebCore::protocolValueForSeconds): Added.
1052         (WebCore::protocolValueForPlaybackDirection): Added.
1053         (WebCore::protocolValueForFillMode): Added.
1054         (WebCore::buildObjectForKeyframes): Added.
1055         (WebCore::buildObjectForEffect): Added.
1056         (WebCore::InspectorAnimationAgent::InspectorAnimationAgent):
1057         (WebCore::InspectorAnimationAgent::willDestroyFrontendAndBackend):
1058         (WebCore::InspectorAnimationAgent::enable): Added.
1059         (WebCore::InspectorAnimationAgent::disable): Added.
1060         (WebCore::InspectorAnimationAgent::requestEffectTarget): Added.
1061         (WebCore::InspectorAnimationAgent::resolveAnimation): Added.
1062         (WebCore::InspectorAnimationAgent::didSetWebAnimationEffect): Added.
1063         (WebCore::InspectorAnimationAgent::didChangeWebAnimationEffectTiming): Added.
1064         (WebCore::InspectorAnimationAgent::didChangeWebAnimationEffectTarget): Added.
1065         (WebCore::InspectorAnimationAgent::didCreateWebAnimation): Added.
1066         (WebCore::InspectorAnimationAgent::willDestroyWebAnimation):
1067         (WebCore::InspectorAnimationAgent::frameNavigated):
1068         (WebCore::InspectorAnimationAgent::findAnimationId): Added.
1069         (WebCore::InspectorAnimationAgent::assertAnimation): Added.
1070         (WebCore::InspectorAnimationAgent::bindAnimation): Added.
1071         (WebCore::InspectorAnimationAgent::unbindAnimation): Added.
1072         (WebCore::InspectorAnimationAgent::animationDestroyedTimerFired): Added.
1073         (WebCore::InspectorAnimationAgent::reset): Added.
1074         (WebCore::InspectorAnimationAgent::didChangeWebAnimationEffect): Deleted.
1075
1076         * inspector/agents/InspectorDOMAgent.h:
1077         * inspector/agents/InspectorDOMAgent.cpp:
1078         (WebCore::InspectorDOMAgent::pushNodeToFrontend):
1079         (WebCore::InspectorDOMAgent::querySelector):
1080         (WebCore::InspectorDOMAgent::pushNodePathToFrontend):
1081         (WebCore::InspectorDOMAgent::setNodeName):
1082         (WebCore::InspectorDOMAgent::setOuterHTML):
1083         (WebCore::InspectorDOMAgent::moveTo):
1084         (WebCore::InspectorDOMAgent::requestNode):
1085         (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
1086         Add an overload for `pushNodePathToFrontend` that exposes an `ErrorString`.
1087
1088 2020-01-29  Ross Kirsling  <ross.kirsling@sony.com>
1089
1090         [PlayStation] Fix MIMETypeRegistry
1091         https://bugs.webkit.org/show_bug.cgi?id=206960
1092
1093         Reviewed by Don Olmstead.
1094
1095         * platform/playstation/MIMETypeRegistryPlayStation.cpp:
1096         (WebCore::platformMediaTypes):
1097         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1098         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1099         Address redeclarations, then fix key/value order of platform-specific MIME type map and make it a static local.
1100
1101 2020-01-29  Ryan Haddad  <ryanhaddad@apple.com>
1102
1103         Unreviewed, rolling out r255338.
1104
1105         Introduced flakiness in multiple throttling layout tests
1106
1107         Reverted changeset:
1108
1109         "REGRESSION (r255158): http/tests/frame-throttling/raf-
1110         throttle-in-cross-origin-subframe.html is a flaky failure"
1111         https://bugs.webkit.org/show_bug.cgi?id=206839
1112         https://trac.webkit.org/changeset/255338
1113
1114 2020-01-28  Antoine Quint  <graouts@apple.com>
1115
1116         [Web Animations] Animations should run accelerated even if other animations targeting the same element are not accelerated
1117         https://bugs.webkit.org/show_bug.cgi?id=206890
1118         <rdar://problem/58961750>
1119
1120         Reviewed by Simon Fraser.
1121
1122         Test: webanimations/width-and-opacity-separate-animation-yields-compositing.html
1123
1124         In the Web Animations implementation, when an element has some animated properties that can be accelerated and some that cannot be, we would never
1125         run accelerated animations at all. However, in the "legacy" animation engine, we would animate properties that can be acclerated if possible.
1126         We now attempt to run accelerated animations provided at least one animation is accelerated.
1127
1128         To do that, we now keep track of whether none, some or all of the animated properties of a given KeyframeEffect are accelerated using the new
1129         m_acceleratedPropertiesState instance variable. We compute this property when creating the blending keyframes for the effect. 
1130         
1131         Then, as time progresses and the effect is resolved, updateAcceleratedActions() is called and we simply use the effect's phase to determine
1132         whether we need to enqueue actions to start, pause, seek or end accelerated animations. This is an improvement over how this method used to work
1133         since we would run accelerated animations while in their delay phase, which did not match the "legacy" animation engine's behavior.
1134
1135         We've also removed the single method that provided the accelerated characteristics of a KeyframeEffect, isAccelerated(), with a few more methods:
1136
1137             - isRunningAccelerated(): the effect is currently running accelerated animations.
1138             - isAboutToRunAccelerated(): the effect has pending accelerated actions that should make it run accelerated animations when accelerated actions
1139             are updated next.
1140             - isCompletelyAccelerated(): the effect animates only accelerated properties.
1141             - isCurrentlyAffectingProperty(property, accelerated): the effect is currently animating the given property, with the option to specify whether
1142             that animation is accelerated.
1143
1144         We use this information in a few new places. If an effect returns true for either isRunningAccelerated() or isAboutToRunAccelerated() when
1145         Element::applyKeyframeEffects() is called, we set the AnimationImpact::RequiresRecomposite flag. In RenderLayerCompositor::requiresCompositingForAnimation(),
1146         if an effect returns true for isCurrentlyAffectingProperty() with the accelerated flag set to true, the method returns true, matching the logic
1147         used by the "legacy" animation engine.
1148
1149         All in all, this better aligns the behavior of the "legacy" and Web Animations engines to run accelerated animations in the same circumstances.
1150
1151         * animation/AnimationTimeline.cpp:
1152         (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): Use KeyframeEfffect::isRunningAccelerated() instead of KeyframeEffect::isAccelerated().
1153         * animation/DocumentTimeline.cpp:
1154         (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Use KeyframeEffect::isCurrentlyAffectingProperty() instead of checking both
1155         isRunningAccelerated() and manually looking at the effect's animated properties.
1156         * animation/KeyframeEffect.cpp:
1157         (WebCore::KeyframeEffect::setBlendingKeyframes): Call computeAcceleratedPropertiesState() instead of the now-defunct computeShouldRunAccelerated().
1158         (WebCore::KeyframeEffect::apply): Keep track of the newly computed phase so that we may use it in the new isCurrentlyAffectingProperty() without having
1159         to recompute it on each call.
1160         (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const): Indicates whether a given property is currently animated (active phase) with the option
1161         to specify whether that animation is accelerated.
1162         (WebCore::KeyframeEffect::computeAcceleratedPropertiesState): Compute whether none, some or all of the animated properties of the given effect can be accelerated.
1163         (WebCore::KeyframeEffect::updateAcceleratedActions): Use the phase to determine which accelerated actions to enqueue.
1164         (WebCore::KeyframeEffect::animationDidSeek): Use the new m_isRunningAccelerated state to determine whether the animation is presently running accelerated.
1165         (WebCore::KeyframeEffect::animationWasCanceled): Use the new m_isRunningAccelerated state to determine whether the animation is presently running accelerated.
1166         (WebCore::KeyframeEffect::animationSuspensionStateDidChange): Use the new m_isRunningAccelerated state to determine whether the animation is presently running accelerated.
1167         (WebCore::KeyframeEffect::applyPendingAcceleratedActions): 
1168         * animation/KeyframeEffect.h:
1169         (WebCore::KeyframeEffect::isRunningAccelerated const):
1170         (WebCore::KeyframeEffect::isAboutToRunAccelerated const):
1171         (WebCore::KeyframeEffect::isCompletelyAccelerated const):
1172         * animation/KeyframeEffectStack.cpp:
1173         (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const): Indicates whether any of the effects in the stack animates a given property, with the option
1174         to specify whether the animation should be accelerated.
1175         * animation/KeyframeEffectStack.h:
1176         * animation/WebAnimation.cpp:
1177         (WebCore::WebAnimation::effectTargetDidChange): Ensure we schedule an animation update if an effect is no longer animating a given element or newly animating an element,
1178         to ensure that replaced animations may be removed.
1179         (WebCore::WebAnimation::isCompletelyAccelerated const): Convenience function to call isCompletelyAccelerated() on the animation's effect.
1180         (WebCore::WebAnimation::computeRelevance): Check the replaced state when computing relevance.
1181         (WebCore::WebAnimation::timeToNextTick const): Schedule an immediate update if a given animation is not _completely_ accelerated.
1182         * animation/WebAnimation.h:
1183         * dom/Element.cpp:
1184         (WebCore::Element::keyframeEffectStack const):
1185         (WebCore::Element::applyKeyframeEffects): Set the AnimationImpact::RequiresRecomposite flag when the animation is either currently running accelerated or expected
1186         to be in the next accelerated animation update.
1187         * dom/Element.h:
1188         * rendering/RenderLayerCompositor.cpp:
1189         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Use the same logic as for the "legacy" animation engine to determine whether an animation
1190         requires compositing using the new KeyframeEffect::isCurrentlyAffectingProperty() method.
1191         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Refactor some code to use the new KeyframeEffect::isCurrentlyAffectingProperty() method.
1192
1193 2020-01-29  Ross Kirsling  <ross.kirsling@sony.com>
1194
1195         Unreviewed !ENABLE(ACCESSIBILITY) build fix.
1196
1197         * accessibility/AccessibilityObjectInterface.h:
1198
1199 2020-01-29  Chris Dumez  <cdumez@apple.com>
1200
1201         [iOS] Make sure unused service worker processes exit promptly on low memory warning
1202         https://bugs.webkit.org/show_bug.cgi?id=206939
1203         <rdar://problem/58972717>
1204
1205         Reviewed by Alex Christensen.
1206
1207         Make sure unused service worker processes exit promptly on low memory warning. They normally take 10 seconds to exit
1208         for performance reasons. However, in case of memory pressure, keeping those processes around that long is not the
1209         right thing to do.
1210
1211         * workers/service/server/SWServer.cpp:
1212         (WebCore::SWServer::handleLowMemoryWarning):
1213         * workers/service/server/SWServer.h:
1214
1215 2020-01-29  Antoine Quint  <graouts@apple.com>
1216
1217         [Web Animations] `DeclarativeAnimation` for CSS Animation is not always destroyed when class that applies `animation-name` is removed
1218         https://bugs.webkit.org/show_bug.cgi?id=206899
1219
1220         Reviewed by Devin Rousso.
1221
1222         In case after processing the new animation styles we don't have any CSSAnimation objects anymore, we should make sure we remove the entry
1223         for this element from m_elementToCSSAnimationsCreatedByMarkupMap so as to release ownership of any prior animation.
1224
1225         * animation/AnimationTimeline.cpp:
1226         (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
1227
1228 2020-01-28  Yusuke Suzuki  <ysuzuki@apple.com>
1229
1230         [JSC] Give up IC when unknown structure transition happens
1231         https://bugs.webkit.org/show_bug.cgi?id=206846
1232
1233         Reviewed by Mark Lam.
1234
1235         IDL Code Generator should taint PutPropertySlot or taint implemented object to avoid Put IC caching
1236         when it implements custom ::put operation which has side-effect regardless of Structure. Otherwise, IC can be setup
1237         and IC can do fast path without consulting the custom ::put operation.
1238
1239         Test: js/dom/put-override-should-not-use-ic.html
1240
1241         * bindings/scripts/CodeGeneratorJS.pm:
1242         (GenerateHeader):
1243         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
1244         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
1245         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
1246         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
1247         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
1248         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
1249         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
1250         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
1251         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
1252         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
1253         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
1254         * bindings/scripts/test/JS/JSTestPluginInterface.h:
1255
1256 2020-01-29  Andres Gonzalez  <andresg_22@apple.com>
1257
1258         Crash in AXIsolatedObject destruction.
1259         https://bugs.webkit.org/show_bug.cgi?id=206828
1260
1261         Reviewed by Carlos Alberto Lopez Perez.
1262
1263         Fix for crash on GTK introduced with this IsolatedTree change.
1264
1265         * accessibility/atk/AccessibilityObjectAtk.cpp:
1266         (WebCore::AccessibilityObject::detachPlatformWrapper):
1267
1268 2020-01-29  Peng Liu  <peng.liu6@apple.com>
1269
1270         Always enable some log messages related to audio tracks
1271         https://bugs.webkit.org/show_bug.cgi?id=206918
1272
1273         Reviewed by Eric Carlson.
1274
1275         No new tests needed. Just enable some log messages.
1276
1277         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1278         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1279         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
1280         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
1281
1282 2020-01-29  Antti Koivisto  <antti@apple.com>
1283
1284         REGRESSION: WK1 Accessibility: ASSERTION FAILED: FontCache::singleton().generation() == m_generation
1285         https://bugs.webkit.org/show_bug.cgi?id=206241
1286         <rdar://problem/58570085>
1287
1288         Reviewed by Zalan Bujtas.
1289
1290         Font cache generation bump empties all font related caches and triggers full style resolution. However it is possible
1291         for single element computed style resolution (triggeded by <title> element here) to happen before the full resolution.
1292         In this case a style computed based on parent style with old font generation may get inserted into matched declarations
1293         cache. A subsequent style resolution may then pick up this style and use it as render style.
1294
1295         * style/StyleBuilderState.cpp:
1296         (WebCore::Style::BuilderState::updateFont):
1297
1298         Fix by taking care that the font returned by style resolver is always updated to the current generation.
1299
1300 2020-01-29  Commit Queue  <commit-queue@webkit.org>
1301
1302         Unreviewed, rolling out r255345.
1303         https://bugs.webkit.org/show_bug.cgi?id=206933
1304
1305         "It breaks some internals builds" (Requested by youenn on
1306         #webkit).
1307
1308         Reverted changeset:
1309
1310         "[Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder"
1311         https://bugs.webkit.org/show_bug.cgi?id=206582
1312         https://trac.webkit.org/changeset/255345
1313
1314 2020-01-29  youenn fablet  <youenn@apple.com>
1315
1316         Blob media loading does not work with GPUProcess
1317         https://bugs.webkit.org/show_bug.cgi?id=206824
1318         <rdar://problem/58917596>
1319
1320         Reviewed by Eric Carlson.
1321
1322         GPU process is using WebCoreAVFResourceLoader for various loads, including blob loads.
1323         In GPU process, loads will fail since this loader expects a CachedResource, which only WebProcess can have.
1324         For that reason, move the CachedResource loader part of WebCoreAVFResourceLoader to a dedicated class CachedResourceMediaLoader.
1325         If load cannot happen with a CachedResource, use a new class PlatformResourceMediaLoader, which uses a loader from MediaPlayer::createResourceLoader.
1326         This allows using the loading path in GPUProcess used for HTTP loads, which works for blob loads as well.
1327
1328         Covered by existing and enabled tests.
1329
1330         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
1331         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1332         (WebCore::CachedResourceMediaLoader::~CachedResourceMediaLoader):
1333         (WebCore::CachedResourceMediaLoader::create):
1334         (WebCore::CachedResourceMediaLoader::CachedResourceMediaLoader):
1335         (WebCore::CachedResourceMediaLoader::stop):
1336         (WebCore::CachedResourceMediaLoader::responseReceived):
1337         (WebCore::CachedResourceMediaLoader::notifyFinished):
1338         (WebCore::CachedResourceMediaLoader::dataReceived):
1339         (WebCore::PlatformResourceMediaLoader::~PlatformResourceMediaLoader):
1340         (WebCore::PlatformResourceMediaLoader::create):
1341         (WebCore::PlatformResourceMediaLoader::PlatformResourceMediaLoader):
1342         (WebCore::PlatformResourceMediaLoader::stop):
1343         (WebCore::PlatformResourceMediaLoader::responseReceived):
1344         (WebCore::PlatformResourceMediaLoader::loadFailed):
1345         (WebCore::PlatformResourceMediaLoader::loadFinished):
1346         (WebCore::PlatformResourceMediaLoader::dataReceived):
1347         (WebCore::WebCoreAVFResourceLoader::startLoading):
1348         (WebCore::WebCoreAVFResourceLoader::stopLoading):
1349         (WebCore::WebCoreAVFResourceLoader::responseReceived):
1350         (WebCore::WebCoreAVFResourceLoader::loadFailed):
1351         (WebCore::WebCoreAVFResourceLoader::loadFinished):
1352         (WebCore::WebCoreAVFResourceLoader::newDataStoredInSharedBuffer):
1353
1354 2020-01-29  youenn fablet  <youenn@apple.com>
1355
1356         [Cocoa] Use AVAssetWriterDelegate to implement MediaRecorder
1357         https://bugs.webkit.org/show_bug.cgi?id=206582
1358
1359         Reviewed by Eric Carlson.
1360
1361         AVAssetWriterDelegate allows to grab recorded data whenever wanted.
1362         This delegate requires passing compressed samples to AVAssetWriter.
1363         Implement video encoding and audio encoding in dedicated classes and use these classes before adding buffers to AVAssetWriter.
1364         Since AVAssetWriterDelegate is Apple SDK only, keep the existing file based implementation as a fallback.
1365
1366         Covered by existing tests.
1367
1368         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.h:
1369         * platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:
1370         (WebCore::AudioSampleBufferCompressor::create):
1371         (WebCore::AudioSampleBufferCompressor::AudioSampleBufferCompressor):
1372         (WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
1373         (WebCore::AudioSampleBufferCompressor::initialize):
1374         (WebCore::AudioSampleBufferCompressor::finish):
1375         (WebCore::AudioSampleBufferCompressor::audioConverterComplexInputDataProc):
1376         (WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
1377         (WebCore::AudioSampleBufferCompressor::computeBufferSizeForAudioFormat):
1378         (WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
1379         (WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
1380         (WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
1381         (WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
1382         (WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
1383         (WebCore::AudioSampleBufferCompressor::processSampleBuffer):
1384         (WebCore::AudioSampleBufferCompressor::addSampleBuffer):
1385         (WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
1386         (WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):
1387         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
1388         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1389         (WebCore::MediaRecorderPrivateWriter::create):
1390         (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
1391         (WebCore::MediaRecorderPrivateWriter::initialize):
1392         (WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
1393         (WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
1394         (WebCore::MediaRecorderPrivateWriter::appendCompressedAudioSampleBuffer):
1395         (WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
1396         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1397         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1398         (WebCore::MediaRecorderPrivateWriter::stopRecording):
1399         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.h:
1400         * platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm:
1401         (WebCore::VideoSampleBufferCompressor::create):
1402         (WebCore::VideoSampleBufferCompressor::VideoSampleBufferCompressor):
1403         (WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
1404         (WebCore::VideoSampleBufferCompressor::initialize):
1405         (WebCore::VideoSampleBufferCompressor::finish):
1406         (WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
1407         (WebCore::VideoSampleBufferCompressor::initCompressionSession):
1408         (WebCore::VideoSampleBufferCompressor::processSampleBuffer):
1409         (WebCore::VideoSampleBufferCompressor::addSampleBuffer):
1410         (WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
1411         (WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):
1412
1413 2020-01-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1414
1415         [GTK] Should use light theme unless website declares support for dark themes in color-schemes property
1416         https://bugs.webkit.org/show_bug.cgi?id=197947
1417
1418         Reviewed by Michael Catanzaro.
1419
1420         * dom/Document.cpp:
1421         (WebCore::Document::useDarkAppearance const): Remove HAVE(OS_DARK_MODE_SUPPORT) because ENABLE(DARK_MODE_CSS)
1422         guards should be enough.
1423         * page/FrameView.cpp:
1424         (WebCore::FrameView::updateBackgroundRecursively): Revert changes made in r244635.
1425         * page/Page.cpp:
1426         (WebCore::Page::effectiveAppearanceDidChange): Use ENABLE(DARK_MODE_CSS) instead of HAVE(OS_DARK_MODE_SUPPORT).
1427         (WebCore::Page::useDarkAppearance const): Ditto.
1428         * rendering/RenderThemeGtk.cpp:
1429         (WebCore::RenderThemeGtk::systemColor const): Revert changes made in r244635.
1430         * rendering/RenderThemeGtk.h:
1431         * testing/InternalSettings.cpp:
1432         (WebCore::InternalSettings::setUseDarkAppearanceInternal): Revert changes made in r244635.
1433
1434 2020-01-29  Sunny He  <sunny_he@apple.com>
1435
1436         Nullptr crash when setting custom properties on detached style
1437         https://bugs.webkit.org/show_bug.cgi?id=206724
1438
1439         Reviewed by Darin Adler.
1440
1441         Test: fast/dom/StyleSheet/detached-style-set-custom-property.html
1442
1443         * css/PropertySetCSSStyleDeclaration.cpp:
1444         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1445         (WebCore::StyleRuleCSSStyleDeclaration::clearParentRule):
1446         (WebCore::InlineCSSStyleDeclaration::clearParentElement):
1447
1448 2020-01-28  Said Abou-Hallawa  <said@apple.com>
1449
1450         REGRESSION (r255158): http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html is a flaky failure
1451         https://bugs.webkit.org/show_bug.cgi?id=206839
1452
1453         Reviewed by Simon Fraser.
1454
1455         Logging on EWS has shown that in some cases ThrottlingReason::VisuallyIdle
1456         was added to the Page::m_throttlingReasons but it was never removed. If
1457         this happens renderingUpdate and requestAnimationFrame will be throttled
1458         to 10 seconds which leads to test flakiness and timeout.
1459
1460         Currently the throttling reasons of Page or ScriptedAnimationController
1461         can be changed by natural reasons (visibility, layout or device state)
1462         unless Setting::renderingUpdateThrottlingEnabled is disabled. Low power
1463         mode also can be overridden by a specific value set by the test.
1464
1465         To make things clearer, a new OptionSet<ThrottlingReason> will be added 
1466         to Page. Its name is m_throttlingReasonsOverrideForTestingMask. The
1467         purpose of adding it is to allow disabling and overriding specific
1468         ThrottlingReasons. The bits of m_throttlingReasonsOverrideForTestingMask
1469         are not actually reasons. They prevent changing the corresponding bits in
1470         Page::m_throttlingReasons by natural reasons. Here are the rules for
1471         setting the bits of m_throttlingReasonsOverrideForTestingMask and
1472         m_throttlingReasons:
1473
1474         -- Settings::renderingUpdateThrottlingEnabled is enabled: All the bits in
1475            m_throttlingReasonsOverrideForTestingMask will be turned off expect
1476            the bit of ThrottlingReason::VisuallyIdle. We need to disable it always
1477            for testing. All the bits in m_throttlingReasons will be cleared.
1478            ThrottlingReason::LowPowerMode will be added to m_throttlingReasons
1479            if the device is already in low power mode.
1480
1481         -- Settings::renderingUpdateThrottlingEnabled is disabled: All the bits 
1482            in m_throttlingReasonsOverrideForTestingMask will be turned on. All the
1483            bits in m_throttlingReasons will be cleared.
1484
1485         -- Low power mode is overridden: ThrottlingReason::LowPowerMode is added
1486            to m_throttlingReasonsOverrideForTestingMask. The new overriding value
1487            is set in m_throttlingReasons.
1488
1489         -- Low power mode is cleared: ThrottlingReason::LowPowerMode is removed
1490            from m_throttlingReasonsOverrideForTestingMask. If the device is in
1491            low power mode. ThrottlingReason::LowPowerMode will be added to
1492            m_throttlingReasons
1493
1494         * dom/ScriptedAnimationController.cpp:
1495         (WebCore::ScriptedAnimationController::addThrottlingReason):
1496         (WebCore::ScriptedAnimationController::removeThrottlingReason):
1497         Adding and removing ThrottlingReasons to ScriptedAnimationController will
1498         be controlled by Page::m_throttlingReasonsOverrideForTestingMask. If the
1499         bits of the corresponding reasons are on, no change will be allowed.
1500
1501         (WebCore::ScriptedAnimationController::clearThrottlingReasons):
1502         (WebCore::ScriptedAnimationController::isThrottled const):
1503         The bits in the m_throttlingReasons of Page and ScriptedAnimationController
1504         reflect the state of the throttling. No need to check for the Settings.
1505
1506         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): Deleted.
1507         * dom/ScriptedAnimationController.h:
1508         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
1509         (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
1510         (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
1511
1512         * page/Page.cpp:
1513         (WebCore::Page::Page):
1514         Set the initial state of the low power mode throttling.
1515
1516         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
1517         This will override the low power mode state or clear it. If it overrides
1518         it, no subsequent change will be allowed.
1519
1520         (WebCore::Page::renderingUpdateThrottlingEnabledChangedForTesting):
1521         This called through changing the Settings from the tests only.
1522
1523         (WebCore::Page::setIsVisuallyIdleInternal):
1524         (WebCore::Page::handleLowModePowerChange):
1525         Prevent changing m_throttlingReasons if the throttling reasons can't be
1526         altered.
1527
1528         (WebCore::Page::isLowPowerModeEnabled const): Deleted.
1529         (WebCore::Page::renderingUpdateThrottlingEnabled const): Deleted.
1530         (WebCore::Page::renderingUpdateThrottlingEnabledChanged): Deleted.
1531         (WebCore::Page::isRenderingUpdateThrottled const): Deleted.
1532         (WebCore::Page::preferredRenderingUpdateInterval const): Deleted.
1533         * page/Page.h:
1534         (WebCore::Page::isLowPowerModeEnabled const):
1535         (WebCore::Page::canUpdateThrottlingReason const):
1536         (WebCore::Page::isRenderingUpdateThrottled const):
1537         (WebCore::Page::preferredRenderingUpdateInterval const):
1538         * page/Settings.yaml:
1539         * page/SettingsBase.cpp:
1540         (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChangedForTesting):
1541         (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged): Deleted.
1542         * page/SettingsBase.h:
1543
1544 2020-01-28  Simon Fraser  <simon.fraser@apple.com>
1545
1546         Add logging to detect cause of rare crash at RenderLayer::calculateLayerBounds const
1547         https://bugs.webkit.org/show_bug.cgi?id=206915
1548         rdar://problem/55699292
1549
1550         Reviewed by Tim Horton.
1551         
1552         We have reports of a rare crash under RenderLayer::calculateLayerBounds() under RenderLayer::updateLayerPositions(),
1553         where a RenderLayerBacking's m_owningLayer is null (which should never happen). This appears to reproduce
1554         by clicking links to CNN or FoxNews articles from Google News on macOS.
1555         
1556         Add a bear trap in that offset in the class, and also null-check the m_owningLayer reference
1557         in release assertions to better understand what's happening.
1558
1559         * rendering/RenderLayerBacking.cpp:
1560         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1561         (WebCore::RenderLayerBacking::willBeDestroyed):
1562         (WebCore::RenderLayerBacking::updateCompositedBounds):
1563         (WebCore::RenderLayerBacking::updateAfterLayout):
1564         (WebCore::RenderLayerBacking::updateConfiguration):
1565         (WebCore::RenderLayerBacking::updateAfterDescendants):
1566         (WebCore::RenderLayerBacking::paintIntoLayer):
1567         * rendering/RenderLayerBacking.h:
1568
1569 2020-01-28  Pinki Gyanchandani  <pgyanchandani@apple.com>
1570
1571         Null deref crash in DOMWindow::scrollBy after evoking updateLayoutIgnorePendingStylesheets()
1572         https://bugs.webkit.org/show_bug.cgi?id=206099
1573
1574         Reviewed by Ryosuke Niwa
1575
1576         Added null pointer check for frame in scrollBy function before usage.
1577
1578         Test: fast/dom/Window/window-scroll-ignore-null-frame.html
1579
1580         * page/DOMWindow.cpp:
1581         (WebCore::DOMWindow::scrollBy const):
1582
1583 2020-01-28  Chris Dumez  <cdumez@apple.com>
1584
1585         REGRESSION (r252064): [ Mac iOS ] storage/websql/statement-error-callback.html is timing out flakily
1586         https://bugs.webkit.org/show_bug.cgi?id=206291
1587         <rdar://problem/58606666>
1588
1589         Reviewed by Maciej Stachowiak.
1590
1591         I found that extending the lifetime of the SQLTransaction by capturing protectedThis in the event loop
1592         task was the source of the flaky timeouts & crashes. Queueing this event loop task in
1593         notifyDatabaseThreadIsShuttingDown() is actually not necessary because calling callErrorCallbackDueToInterruption()
1594         directly would schedule the event loop task for us. Also, in callErrorCallbackDueToInterruption(),
1595         the event loop task only keeps the error callback alive, not just the SQLTransaction object.
1596
1597         No new tests, unskipped existing test.
1598
1599         * Modules/webdatabase/SQLTransaction.cpp:
1600         (WebCore::SQLTransaction::notifyDatabaseThreadIsShuttingDown):
1601
1602 2020-01-28  Tim Horton  <timothy_horton@apple.com>
1603
1604         macCatalyst: Triple clicking to select a sentence results in an empty selection
1605         https://bugs.webkit.org/show_bug.cgi?id=206863
1606         <rdar://problem/58776993>
1607
1608         Reviewed by Wenson Hsieh.
1609
1610         * editing/EditingBehavior.h:
1611         (WebCore::EditingBehavior::shouldSelectOnContextualMenuClick const):
1612         * page/ChromeClient.h:
1613         (WebCore::ChromeClient::shouldUseMouseEventsForSelection):
1614         * page/EventHandler.cpp:
1615         (WebCore::EventHandler::canMouseDownStartSelect):
1616         (WebCore::canMouseDownStartSelect): Deleted.
1617         * page/EventHandler.h:
1618         Disable WebCore's mouse-event-driven selection mechanisms on macCatalyst,
1619         where we use a UITextInteraction-driven selection instead. Otherwise,
1620         they conflict with each other in a chaotic fashion.
1621
1622 2020-01-28  Sihui Liu  <sihui_liu@apple.com>
1623
1624         IndexedDB: speed up index records deletion
1625         https://bugs.webkit.org/show_bug.cgi?id=206196
1626         <rdar://problem/53596307>
1627
1628         Reviewed by Brady Eidson.
1629
1630         This patch does a few things to accelerate deletion for index records:
1631         1. make indexID unique in database instead of objectStore
1632         2. create an index on IndexRecords table
1633         3. optimize some SQLite statements to take advantage of 1 and 2
1634
1635         Test: IndexedDB.IDBObjectStoreInfoUpgradeToV2
1636
1637         Make test PerformanceTests/IndexedDB/basic/index-cursor-delete-2.html 7.5x faster.
1638
1639         * Modules/indexeddb/IDBDatabase.h:
1640         * Modules/indexeddb/IDBObjectStore.cpp:
1641         (WebCore::IDBObjectStore::createIndex):
1642         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1643         (WebCore::IDBServer::MemoryIDBBackingStore::getOrEstablishDatabaseInfo):
1644         (WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
1645         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1646         (WebCore::IDBServer::createV1ObjectStoreInfoSchema):
1647         (WebCore::IDBServer::createV2ObjectStoreInfoSchema):
1648         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsRecordIndex):
1649         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
1650         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidObjectStoreInfoTable):
1651         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
1652         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1653         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1654         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1655         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
1656         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1657         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
1658         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1659         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
1660         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteOneIndexRecord): Deleted.
1661         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1662         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1663         (WebCore::IDBServer::buildIndexStatement):
1664         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
1665         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1666         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1667         (WebCore::IDBServer::UniqueIDBDatabase::createIndex):
1668         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
1669         (WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
1670         (WebCore::IDBDatabaseInfo::setMaxIndexID):
1671         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
1672         (WebCore::IDBDatabaseInfo::generateNextIndexID):
1673         (WebCore::IDBDatabaseInfo::encode const):
1674         (WebCore::IDBDatabaseInfo::decode):
1675         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1676         (WebCore::IDBObjectStoreInfo::createNewIndex):
1677         (WebCore::IDBObjectStoreInfo::addExistingIndex):
1678         (WebCore::IDBObjectStoreInfo::isolatedCopy const):
1679         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1680         (WebCore::IDBObjectStoreInfo::autoIncrement const):
1681         (WebCore::IDBObjectStoreInfo::encode const):
1682         (WebCore::IDBObjectStoreInfo::decode):
1683         (WebCore::IDBObjectStoreInfo::maxIndexID const): Deleted.
1684
1685 2020-01-28  Justin Fan  <justin_fan@apple.com>
1686
1687         [WebGL2] Implement sub-source texImage2D and texSubImage2D
1688         https://bugs.webkit.org/show_bug.cgi?id=206782
1689         <rdar://problem/58886527>
1690
1691         Reviewed by Dean Jackson.
1692
1693         Implement sub-source override versions of texImage2D and texSubImage2D. 
1694         Some refactoring of bufferData and bufferSubData to share code with new implementation.
1695
1696         Conformance test results updated for:
1697         webgl/2.0.0/conformance2/buffers/buffer-data-and-buffer-sub-data-sub-source.html
1698         webgl/2.0.0/conformance2/misc/views-with-offsets.html
1699         webgl/2.0.0/conformance2/textures/misc/tex-image-and-sub-image-with-array-buffer-view-sub-source.html
1700
1701         * html/canvas/WebGL2RenderingContext.cpp:
1702         (WebCore::WebGL2RenderingContext::arrayBufferViewSliceFactory): Creates sub-resource of appropriate type for ArrayBufferView resources.
1703         (WebCore::WebGL2RenderingContext::sliceArrayBufferView): Consolidates duplicate logic of buffer/SubData.
1704         (WebCore::WebGL2RenderingContext::bufferData):
1705         (WebCore::WebGL2RenderingContext::bufferSubData):
1706         (WebCore::WebGL2RenderingContext::getBufferSubData): DataView buffers are allowed, and remove unnecessary elementSize helper function.
1707         (WebCore::WebGL2RenderingContext::texImage2D): Implement sub-source version and improve log messaging for unimplemented overrides.
1708         (WebCore::WebGL2RenderingContext::sliceTypedArrayBufferView): Creates sub-resource of appropriate type for TypedArray buffer resources.
1709         (WebCore::WebGL2RenderingContext::texImage3D): Improve log messaging.
1710         (WebCore::WebGL2RenderingContext::texSubImage2D): Implement sub-source version and improve log messaging for unimplemented overrides.
1711         (WebCore::WebGL2RenderingContext::texSubImage3D): Improve log messaging.
1712         (WebCore::WebGL2RenderingContext::compressedTexImage3D): 
1713         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
1714         (WebCore::WebGL2RenderingContext::compressedTexImage2D):
1715         (WebCore::WebGL2RenderingContext::compressedTexSubImage2D):
1716         (WebCore::WebGL2RenderingContext::readPixels):
1717         (WebCore::arrayBufferViewElementSize): Deleted. Unnecessary given utilities in TypedArrayType.h.
1718         * html/canvas/WebGL2RenderingContext.h:
1719         * platform/graphics/GraphicsContextGL.h: Remove some extra overrides that aren't actually present in OpenGL ES 3.
1720         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
1721         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
1722         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
1723         (WebCore::GraphicsContextGLOpenGL::texImage2D): Deleted.
1724
1725 2020-01-28  Chris Lord  <clord@igalia.com>
1726
1727         Implement [Transferable] property of OffscreenCanvas
1728         https://bugs.webkit.org/show_bug.cgi?id=202574
1729
1730         Reviewed by Antti Koivisto.
1731
1732         Bug 202574 - Implement [Transferable] property of OffscreenCanvas
1733
1734         No new tests. Covered by existing tests.
1735
1736         * bindings/js/SerializedScriptValue.cpp:
1737         (WebCore::CloneSerializer::serialize):
1738         (WebCore::CloneSerializer::CloneSerializer):
1739         (WebCore::CloneSerializer::dumpOffscreenCanvas):
1740         (WebCore::CloneSerializer::dumpIfTerminal):
1741         (WebCore::CloneDeserializer::deserialize):
1742         (WebCore::CloneDeserializer::CloneDeserializer):
1743         (WebCore::CloneDeserializer::readOffscreenCanvas):
1744         (WebCore::CloneDeserializer::readTerminal):
1745         (WebCore::SerializedScriptValue::SerializedScriptValue):
1746         (WebCore::SerializedScriptValue::create):
1747         (WebCore::canOffscreenCanvasesDetach):
1748         (WebCore::SerializedScriptValue::deserialize):
1749         * bindings/js/SerializedScriptValue.h:
1750         (WebCore::SerializedScriptValue::SerializedScriptValue):
1751         * html/CanvasBase.h:
1752         (WebCore::CanvasBase::width const):
1753         (WebCore::CanvasBase::height const):
1754         * html/OffscreenCanvas.cpp:
1755         (WebCore::DetachedOffscreenCanvas::DetachedOffscreenCanvas):
1756         (WebCore::DetachedOffscreenCanvas::takeImageBuffer):
1757         (WebCore::OffscreenCanvas::create):
1758         (WebCore::OffscreenCanvas::width const):
1759         (WebCore::OffscreenCanvas::height const):
1760         (WebCore::OffscreenCanvas::setWidth):
1761         (WebCore::OffscreenCanvas::setHeight):
1762         (WebCore::OffscreenCanvas::getContext):
1763         (WebCore::OffscreenCanvas::transferToImageBitmap):
1764         (WebCore::OffscreenCanvas::convertToBlob):
1765         (WebCore::OffscreenCanvas::canDetach const):
1766         (WebCore::OffscreenCanvas::detach):
1767         (WebCore::OffscreenCanvas::takeImageBuffer const):
1768         * html/OffscreenCanvas.h:
1769         (WebCore::DetachedOffscreenCanvas::size const):
1770         (WebCore::DetachedOffscreenCanvas::originClean const):
1771
1772 2020-01-28  Andres Gonzalez  <andresg_22@apple.com>
1773
1774         Properly clear pending changes during AXIsolatedTree removal and applyPendingChanges.
1775         https://bugs.webkit.org/show_bug.cgi?id=206879
1776
1777         Reviewed by Chris Fleizach.
1778
1779         - After applying pending changes clear the m_pendingAppends and
1780         m_pendingRemovals, so that they are not applied again.
1781         - Also clear these variables when the IsolatedTree is being removed in
1782         the main thread, so that requests in the accessibility thread do not
1783         cause adding changes to a dead tree.
1784
1785         * accessibility/isolatedtree/AXIsolatedTree.cpp:
1786         (WebCore::AXIsolatedTree::removeTreeForPageID):
1787         (WebCore::AXIsolatedTree::applyPendingChanges):
1788         * accessibility/isolatedtree/AXIsolatedTree.h:
1789
1790 2020-01-28  Don Olmstead  <don.olmstead@sony.com>
1791
1792         [LFC][Integration] Build and enable on Windows
1793         https://bugs.webkit.org/show_bug.cgi?id=206165
1794
1795         Reviewed by Darin Adler.
1796
1797         Fix minor compilation issues in LFC when using MSVC.
1798
1799         * layout/inlineformatting/LineLayoutContext.cpp:
1800         (WebCore::Layout::LineLayoutContext::close):
1801
1802 2020-01-28  Brent Fulgham  <bfulgham@apple.com>
1803
1804         Reset the application bundle identifier between test runs
1805         https://bugs.webkit.org/show_bug.cgi?id=206858
1806         <rdar://problem/58844002>
1807
1808         Reviewed by Per Arne Vollan.
1809
1810         Clear the application bundle identifier set during testing when resetting the test system
1811         to a known state in preparation for the next run.
1812
1813         Tests: fast/sandbox/ios/sandbox-mach-lookup.html, fast/sandbox/ios/sandbox-mach-lookup-mail.html
1814
1815         * platform/RuntimeApplicationChecks.h:
1816         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1817         (WebCore::clearApplicationBundleIdentifierTestingOverride): Added.
1818
1819 2020-01-28  Andres Gonzalez  <andresg_22@apple.com>
1820
1821         Regression: 30+ layout-test crash on Windows
1822         https://bugs.webkit.org/show_bug.cgi?id=206868
1823
1824         Reviewed by Chris Fleizach.
1825
1826         Instead of getting the AXObjectCache to invoke detachWrapper, detach the wrapper directly.
1827
1828         * accessibility/win/AccessibilityObjectWin.cpp:
1829         (WebCore::AccessibilityObject::detachPlatformWrapper):
1830
1831 2020-01-28  Don Olmstead  <don.olmstead@sony.com>
1832
1833         Non-unified build fixes late January 2020 edition
1834         https://bugs.webkit.org/show_bug.cgi?id=206896
1835
1836         Unreviewed build fix.
1837
1838         * Modules/cache/DOMCacheEngine.cpp:
1839         * animation/DocumentTimeline.cpp:
1840         * layout/inlineformatting/InlineItem.h:
1841
1842 2020-01-28  Antoine Quint  <graouts@apple.com>
1843
1844         [Web Animations] Separate setting a timeline's current time from updating its animations
1845         https://bugs.webkit.org/show_bug.cgi?id=206880
1846
1847         Reviewed by Dean Jackson.
1848
1849         While we must always update the current time of all timelines if a new animation frame has been requested,
1850         regardless of the reason (rAF callback, animation servicing, etc.), we should only update timelines' animations
1851         if at least one timeline has requested an update. We used to decide this at the DocumentTimeline level, but
1852         this needs to be coordinated at the Document level to consider all timelines at once.
1853
1854         This is required for an upcoming patch where we make changes to the way we schedule animations to correctly
1855         support mixed accelerated and non-accelerated properties.
1856
1857         No new tests since this shouldn't yield any visible behavior change.
1858
1859         * animation/DocumentTimeline.cpp:
1860         (WebCore::DocumentTimeline::updateCurrentTime):
1861         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
1862         * animation/DocumentTimeline.h:
1863         * dom/Document.cpp:
1864         (WebCore::Document::updateAnimationsAndSendEvents):
1865
1866 2020-01-28  Zalan Bujtas  <zalan@apple.com>
1867
1868         [LFC][IFC] Decouple Display::LineBox and Layout::LineBoxBuilder
1869         https://bugs.webkit.org/show_bug.cgi?id=206861
1870         <rdar://problem/58945284>
1871
1872         Reviewed by Antti Koivisto.
1873
1874         We should not mix logical and physical coordinates.
1875
1876         * WebCore.xcodeproj/project.pbxproj:
1877         * layout/FormattingContextGeometry.cpp:
1878         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1879         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1880         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1881         * layout/displaytree/DisplayLineBox.h:
1882         (WebCore::Display::LineBox::Baseline::ascent const):
1883         (WebCore::Display::LineBox::Baseline::descent const):
1884         (WebCore::Display::LineBox::rect const):
1885         (WebCore::Display::LineBox::left const):
1886         (WebCore::Display::LineBox::right const):
1887         (WebCore::Display::LineBox::top const):
1888         (WebCore::Display::LineBox::bottom const):
1889         (WebCore::Display::LineBox::width const):
1890         (WebCore::Display::LineBox::height const):
1891         (WebCore::Display::LineBox::baseline const):
1892         (WebCore::Display::LineBox::baselineOffset const):
1893         (WebCore::Display::LineBox::isConsideredEmpty const):
1894         (WebCore::Display::LineBox::LineBox):
1895         (WebCore::Display::LineBox::Baseline::Baseline):
1896         (WebCore::Display::LineBox::logicalRect const): Deleted.
1897         (WebCore::Display::LineBox::logicalTopLeft const): Deleted.
1898         (WebCore::Display::LineBox::logicalLeft const): Deleted.
1899         (WebCore::Display::LineBox::logicalRight const): Deleted.
1900         (WebCore::Display::LineBox::logicalTop const): Deleted.
1901         (WebCore::Display::LineBox::logicalBottom const): Deleted.
1902         (WebCore::Display::LineBox::logicalWidth const): Deleted.
1903         (WebCore::Display::LineBox::logicalHeight const): Deleted.
1904         (WebCore::Display::LineBox::resetDescent): Deleted.
1905         (WebCore::Display::LineBox::setLogicalTopLeft): Deleted.
1906         (WebCore::Display::LineBox::setLogicalHeight): Deleted.
1907         (WebCore::Display::LineBox::setLogicalWidth): Deleted.
1908         (WebCore::Display::LineBox::setScrollableOverflow): Deleted.
1909         (WebCore::Display::LineBox::setInkOverflow): Deleted.
1910         (WebCore::Display::LineBox::moveHorizontally): Deleted.
1911         (WebCore::Display::LineBox::expandHorizontally): Deleted.
1912         (WebCore::Display::LineBox::shrinkHorizontally): Deleted.
1913         (WebCore::Display::LineBox::expandVertically): Deleted.
1914         (WebCore::Display::LineBox::shrinkVertically): Deleted.
1915         (WebCore::Display::LineBox::setIsConsideredEmpty): Deleted.
1916         (WebCore::Display::LineBox::setIsConsideredNonEmpty): Deleted.
1917         (WebCore::Display::LineBox::setLogicalHeightIfGreater): Deleted.
1918         (WebCore::Display::LineBox::setBaselineOffsetIfGreater): Deleted.
1919         (WebCore::Display::LineBox::setAscentIfGreater): Deleted.
1920         (WebCore::Display::LineBox::setDescentIfGreater): Deleted.
1921         (WebCore::Display::LineBox::resetBaseline): Deleted.
1922         (WebCore::Display::LineBox::Baseline::setAscent): Deleted.
1923         (WebCore::Display::LineBox::Baseline::setDescent): Deleted.
1924         (WebCore::Display::LineBox::Baseline::reset): Deleted.
1925         * layout/displaytree/DisplayPainter.cpp:
1926         (WebCore::Display::paintInlineContent):
1927         * layout/inlineformatting/InlineFormattingContext.cpp:
1928         (WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
1929         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1930         (WebCore::Layout::InlineFormattingContext::Quirks::lineHeightConstraints const):
1931         * layout/inlineformatting/InlineLineBox.h: Copied from Source/WebCore/layout/displaytree/DisplayLineBox.h.
1932         (WebCore::Layout::LineBox::Baseline::height const):
1933         (WebCore::Layout::LineBox::logicalRect const):
1934         (WebCore::Layout::LineBox::scrollableOverflow const):
1935         (WebCore::Layout::LineBox::logicalLeft const):
1936         (WebCore::Layout::LineBox::logicalRight const):
1937         (WebCore::Layout::LineBox::logicalTop const):
1938         (WebCore::Layout::LineBox::logicalBottom const):
1939         (WebCore::Layout::LineBox::logicalWidth const):
1940         (WebCore::Layout::LineBox::logicalHeight const):
1941         (WebCore::Layout::LineBox::resetDescent):
1942         (WebCore::Layout::LineBox::setLogicalHeight):
1943         (WebCore::Layout::LineBox::setLogicalWidth):
1944         (WebCore::Layout::LineBox::setScrollableOverflow):
1945         (WebCore::Layout::LineBox::moveHorizontally):
1946         (WebCore::Layout::LineBox::expandHorizontally):
1947         (WebCore::Layout::LineBox::shrinkHorizontally):
1948         (WebCore::Layout::LineBox::expandVertically):
1949         (WebCore::Layout::LineBox::shrinkVertically):
1950         (WebCore::Layout::LineBox::isConsideredEmpty const):
1951         (WebCore::Layout::LineBox::setIsConsideredEmpty):
1952         (WebCore::Layout::LineBox::setIsConsideredNonEmpty):
1953         (WebCore::Layout::LineBox::LineBox):
1954         (WebCore::Layout::LineBox::setLogicalHeightIfGreater):
1955         (WebCore::Layout::LineBox::baseline const):
1956         (WebCore::Layout::LineBox::setBaselineOffsetIfGreater):
1957         (WebCore::Layout::LineBox::setAscentIfGreater):
1958         (WebCore::Layout::LineBox::setDescentIfGreater):
1959         (WebCore::Layout::LineBox::baselineOffset const):
1960         (WebCore::Layout::LineBox::resetBaseline):
1961         (WebCore::Layout::LineBox::Baseline::Baseline):
1962         (WebCore::Layout::LineBox::Baseline::setAscent):
1963         (WebCore::Layout::LineBox::Baseline::setDescent):
1964         (WebCore::Layout::LineBox::Baseline::reset):
1965         (WebCore::Layout::LineBox::Baseline::ascent const):
1966         (WebCore::Layout::LineBox::Baseline::descent const):
1967         * layout/inlineformatting/InlineLineBuilder.cpp:
1968         (WebCore::Layout::LineBuilder::initialize):
1969         (WebCore::Layout::LineBuilder::close):
1970         (WebCore::Layout::LineBuilder::halfLeadingMetrics):
1971         * layout/inlineformatting/InlineLineBuilder.h:
1972         (WebCore::Layout::LineBuilder::contentLogicalRight const):
1973         (WebCore::Layout::LineBuilder::lineBox const):
1974         (WebCore::Layout::LineBuilder::contentLogicalWidth const):
1975         * layout/inlineformatting/LineLayoutContext.cpp:
1976         (WebCore::Layout::LineLayoutContext::layoutLine):
1977         * layout/inlineformatting/LineLayoutContext.h:
1978         * layout/integration/LayoutIntegrationLineLayout.cpp:
1979         (WebCore::LayoutIntegration::LineLayout::contentLogicalHeight const):
1980         (WebCore::LayoutIntegration::LineLayout::firstLineBaseline const):
1981         (WebCore::LayoutIntegration::LineLayout::lastLineBaseline const):
1982         (WebCore::LayoutIntegration::LineLayout::paint):
1983         * layout/layouttree/LayoutTreeBuilder.cpp:
1984         (WebCore::Layout::outputInlineRuns):
1985
1986 2020-01-28  Jonathan Bedard  <jbedard@apple.com>
1987
1988         WebCore: Guard uneven corners in rounded rectangles
1989         https://bugs.webkit.org/show_bug.cgi?id=206838
1990
1991         Reviewed by Darin Adler.
1992
1993         No functional changes, covered by existing tests.
1994
1995         * platform/graphics/cg/PathCG.cpp:
1996         (WebCore::Path::platformAddPathForRoundedRect):
1997
1998 2020-01-28  Commit Queue  <commit-queue@webkit.org>
1999
2000         Unreviewed, rolling out r255237.
2001         https://bugs.webkit.org/show_bug.cgi?id=206889
2002
2003         it is breaking Win build (Requested by youenn on #webkit).
2004
2005         Reverted changeset:
2006
2007         "Blob media loading does not work with GPUProcess"
2008         https://bugs.webkit.org/show_bug.cgi?id=206824
2009         https://trac.webkit.org/changeset/255237
2010
2011 2020-01-28  Jack Lee  <shihchieh_lee@apple.com>
2012
2013         Nullptr crash in WebCore::findPlaceForCounter with display: contents sibling
2014         https://bugs.webkit.org/show_bug.cgi?id=206107
2015
2016         Reviewed by Antti Koivisto.
2017
2018         Test: fast/css/counters/findPlaceForCounter-display-content-sibling-crash.html
2019
2020         * rendering/RenderCounter.cpp:
2021         (WebCore::parentOrPseudoHostElement):
2022         (WebCore::previousSiblingOrParentElement):
2023         (WebCore::previousSiblingOrParent):
2024
2025 2020-01-24  Sergio Villar Senin  <svillar@igalia.com>
2026
2027         Remove WebVR from the tree
2028         https://bugs.webkit.org/show_bug.cgi?id=206739
2029
2030         Reviewed by Darin Adler.
2031
2032         WebVR 1.1 was never completely implemented, it was just included as build option of
2033         WebKitGTK and WPE, and it was never released by any WebKit port either. There are no plans
2034         to work on it as it has been replaced by the WebXR specification.
2035
2036         * CMakeLists.txt:
2037         * DerivedSources-input.xcfilelist:
2038         * DerivedSources-output.xcfilelist:
2039         * DerivedSources.make:
2040         * Modules/webvr/DOMWindowWebVR.idl: Removed.
2041         * Modules/webvr/GamepadWebVR.cpp: Removed.
2042         * Modules/webvr/GamepadWebVR.h: Removed.
2043         * Modules/webvr/GamepadWebVR.idl: Removed.
2044         * Modules/webvr/NavigatorWebVR.cpp: Removed.
2045         * Modules/webvr/NavigatorWebVR.h: Removed.
2046         * Modules/webvr/NavigatorWebVR.idl: Removed.
2047         * Modules/webvr/VRDisplay.cpp: Removed.
2048         * Modules/webvr/VRDisplay.h: Removed.
2049         * Modules/webvr/VRDisplay.idl: Removed.
2050         * Modules/webvr/VRDisplayCapabilities.h: Removed.
2051         * Modules/webvr/VRDisplayCapabilities.idl: Removed.
2052         * Modules/webvr/VRDisplayEvent.cpp: Removed.
2053         * Modules/webvr/VRDisplayEvent.h: Removed.
2054         * Modules/webvr/VRDisplayEvent.idl: Removed.
2055         * Modules/webvr/VRDisplayEventReason.h: Removed.
2056         * Modules/webvr/VRDisplayEventReason.idl: Removed.
2057         * Modules/webvr/VREye.h: Removed.
2058         * Modules/webvr/VREye.idl: Removed.
2059         * Modules/webvr/VREyeParameters.cpp: Removed.
2060         * Modules/webvr/VREyeParameters.h: Removed.
2061         * Modules/webvr/VREyeParameters.idl: Removed.
2062         * Modules/webvr/VRFieldOfView.h: Removed.
2063         * Modules/webvr/VRFieldOfView.idl: Removed.
2064         * Modules/webvr/VRFrameData.cpp: Removed.
2065         * Modules/webvr/VRFrameData.h: Removed.
2066         * Modules/webvr/VRFrameData.idl: Removed.
2067         * Modules/webvr/VRLayerInit.h: Removed.
2068         * Modules/webvr/VRLayerInit.idl: Removed.
2069         * Modules/webvr/VRPose.cpp: Removed.
2070         * Modules/webvr/VRPose.h: Removed.
2071         * Modules/webvr/VRPose.idl: Removed.
2072         * Modules/webvr/VRStageParameters.cpp: Removed.
2073         * Modules/webvr/VRStageParameters.h: Removed.
2074         * Modules/webvr/VRStageParameters.idl: Removed.
2075         * Sources.txt:
2076         * WebCore.xcodeproj/project.pbxproj:
2077         * bindings/js/WebCoreBuiltinNames.h:
2078         * dom/EventNames.in:
2079         * dom/EventTargetFactory.in:
2080         * features.json:
2081         * page/RuntimeEnabledFeatures.h:
2082         (WebCore::RuntimeEnabledFeatures::setWebVREnabled): Deleted.
2083         (WebCore::RuntimeEnabledFeatures::webVREnabled const): Deleted.
2084         * platform/vr/VRManager.cpp: Removed.
2085         * platform/vr/VRManager.h: Removed.
2086         * platform/vr/VRPlatformDisplay.cpp: Removed.
2087         * platform/vr/VRPlatformDisplay.h: Removed.
2088         * platform/vr/VRPlatformDisplayClient.h: Removed.
2089         * platform/vr/VRPlatformManager.h: Removed.
2090         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp: Removed.
2091         * platform/vr/openvr/VRPlatformDisplayOpenVR.h: Removed.
2092         * platform/vr/openvr/VRPlatformManagerOpenVR.cpp: Removed.
2093         * platform/vr/openvr/VRPlatformManagerOpenVR.h: Removed.
2094         * testing/InternalSettings.cpp:
2095         (WebCore::InternalSettings::Backup::Backup):
2096         (WebCore::InternalSettings::Backup::restoreTo):
2097         (WebCore::InternalSettings::setWebVREnabled): Deleted.
2098         * testing/InternalSettings.h:
2099         * testing/InternalSettings.idl:
2100
2101 2020-01-28  youenn fablet  <youenn@apple.com>
2102
2103         Blob media loading does not work with GPUProcess
2104         https://bugs.webkit.org/show_bug.cgi?id=206824
2105         <rdar://problem/58917596>
2106
2107         Reviewed by Eric Carlson.
2108
2109         GPU process is using WebCoreAVFResourceLoader for various loads, including blob loads.
2110         In GPU process, loads will fail since this loader expects a CachedResource, which only WebProcess can have.
2111         For that reason, move the CachedResource loader part of WebCoreAVFResourceLoader to a dedicated class CachedResourceMediaLoader.
2112         If load cannot happen with a CachedResource, use a new class PlatformResourceMediaLoader, which uses a loader from MediaPlayer::createResourceLoader.
2113         This allows using the loading path in GPUProcess used for HTTP loads, which works for blob loads as well.
2114
2115         Covered by existing and enabled tests.
2116
2117         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2118         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2119         (WebCore::CachedResourceMediaLoader::~CachedResourceMediaLoader):
2120         (WebCore::CachedResourceMediaLoader::create):
2121         (WebCore::CachedResourceMediaLoader::CachedResourceMediaLoader):
2122         (WebCore::CachedResourceMediaLoader::stop):
2123         (WebCore::CachedResourceMediaLoader::responseReceived):
2124         (WebCore::CachedResourceMediaLoader::notifyFinished):
2125         (WebCore::CachedResourceMediaLoader::dataReceived):
2126         (WebCore::PlatformResourceMediaLoader::~PlatformResourceMediaLoader):
2127         (WebCore::PlatformResourceMediaLoader::create):
2128         (WebCore::PlatformResourceMediaLoader::PlatformResourceMediaLoader):
2129         (WebCore::PlatformResourceMediaLoader::stop):
2130         (WebCore::PlatformResourceMediaLoader::responseReceived):
2131         (WebCore::PlatformResourceMediaLoader::loadFailed):
2132         (WebCore::PlatformResourceMediaLoader::loadFinished):
2133         (WebCore::PlatformResourceMediaLoader::dataReceived):
2134         (WebCore::WebCoreAVFResourceLoader::startLoading):
2135         (WebCore::WebCoreAVFResourceLoader::stopLoading):
2136         (WebCore::WebCoreAVFResourceLoader::responseReceived):
2137         (WebCore::WebCoreAVFResourceLoader::loadFailed):
2138         (WebCore::WebCoreAVFResourceLoader::loadFinished):
2139         (WebCore::WebCoreAVFResourceLoader::newDataStoredInSharedBuffer):
2140
2141 2020-01-27  Antoine Quint  <graouts@apple.com>
2142
2143         [Web Animations] Make Animation.timeline read-write only if a runtime flag is enabled
2144         https://bugs.webkit.org/show_bug.cgi?id=206173
2145         <rdar://problem/58527432>
2146
2147         Reviewed by Dean Jackson.
2148
2149         Make the timeline property of Animation read-write only if the new WebAnimationsMutableTimelines runtime flag is enabled.
2150
2151         * animation/WebAnimation.idl: Make the "timeline" property conditionally read-write if WebAnimationsMutableTimelines is enabled.
2152         * bindings/js/WebCoreBuiltinNames.h: With the new RuntimeConditionallyReadWrite property used in WebAnimation.idl, it is necessary
2153         to declare the name of the affected property, in this case "timeline", in WebCoreBuiltinNames.
2154         * page/RuntimeEnabledFeatures.h:
2155         (WebCore::RuntimeEnabledFeatures::setWebAnimationsMutableTimelinesEnabled):
2156         (WebCore::RuntimeEnabledFeatures::webAnimationsMutableTimelinesEnabled const):
2157
2158 2020-01-27  Noam Rosenthal  <noam@webkit.org>
2159
2160         -webkit-image-set should support resolution units other than 'x'
2161         https://bugs.webkit.org/show_bug.cgi?id=100120
2162
2163         Reviewed by Darin Adler.
2164
2165         Leveraged previous work on image-resolution to enable dpi/dppx/dpcm in CSS image-set.
2166         Now the second value of every entry in the image-set is parsed like any resolution,
2167         allowing "x" as a synonim for "dppx.
2168
2169         This changes computed style behavior for image-set - "x" resolution values will be converted
2170         to "dppx". This is in line with the spirit of computed values, though it's not spec'ed particularly.
2171
2172         Tests: fast/hidpi/image-set-units.html
2173
2174         * css/CSSImageSetValue.cpp:
2175         (WebCore::CSSImageSetValue::fillImageSet):
2176         (WebCore::CSSImageSetValue::updateDeviceScaleFactor):
2177         (WebCore::CSSImageSetValue::customCSSText const):
2178                 Convert values to dppx before sorting them the image set.
2179                 Use given CSS units in computed styles instead of hardcoding "x" 
2180
2181         * css/CSSPrimitiveValue.cpp:
2182         (WebCore::isValidCSSUnitTypeForDoubleConversion):
2183         (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
2184                 Allow conversion of dpi/dppx/dpcm to canonical (dppx).
2185
2186         * css/parser/CSSPropertyParserHelpers.cpp:
2187         (WebCore::CSSPropertyParserHelpers::consumeResolution):
2188         (WebCore::CSSPropertyParserHelpers::consumeImageSet):
2189         * css/parser/CSSPropertyParserHelpers.h:
2190                 Consume any resolution when parsing image-set.
2191
2192 2020-01-27  Antti Koivisto  <antti@apple.com>
2193
2194         Correct VTT Cue Style handling to match the specification
2195         https://bugs.webkit.org/show_bug.cgi?id=201086
2196
2197         Unreviewed followup based on a review comment.
2198
2199         * html/track/WebVTTParser.cpp:
2200         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
2201
2202 2020-01-27  Simon Fraser  <simon.fraser@apple.com>
2203
2204         REGRESSION (r253634): cricbuzz.com media controls vanish depending on page scale
2205         https://bugs.webkit.org/show_bug.cgi?id=206788
2206         rdar://problem/58780584
2207
2208         Reviewed by Tim Horton.
2209         
2210         r253634 changed "delegatesPageScaling"'" to a flag on ScrollView. However, this changed behavior
2211         for subframes; Settings are propagated down, but only the main ScrollView had delegatesPageScaling
2212         set on it.
2213         
2214         "delegatesPageScaling" is a page-level thing (subframes don't independently zoom), so it
2215         should live on Page. Move it there.
2216         
2217         The bug was triggered by incorrectly taking page scale into account for rects in the compositing
2218         overlap map (see RenderLayerCompositor::addToOverlapMap()) in subframes, and those rects
2219         changing on zoom.
2220
2221         Test: compositing/backing/page-scale-overlap-in-iframe.html
2222
2223         * page/Frame.cpp:
2224         (WebCore::Frame::frameScaleFactor const):
2225         * page/FrameSnapshotting.cpp:
2226         (WebCore::snapshotFrameRectWithClip):
2227         * page/FrameView.cpp:
2228         (WebCore::FrameView::visibleContentScaleFactor const):
2229         * page/Page.cpp:
2230         (WebCore::Page::setPageScaleFactor):
2231         (WebCore::Page::setDelegatesScaling):
2232         * page/Page.h:
2233         (WebCore::Page::delegatesScaling const):
2234         * platform/ScrollView.cpp:
2235         (WebCore::ScrollView::setDelegatesPageScaling): Deleted.
2236         * platform/ScrollView.h:
2237         (WebCore::ScrollView::delegatesPageScaling const): Deleted.
2238         * rendering/RenderLayerCompositor.cpp:
2239         (WebCore::RenderLayerCompositor::addToOverlapMap const):
2240
2241 2020-01-27  Sam Weinig  <weinig@apple.com>
2242
2243         Need a way to mark a DOM attribute as runtime conditionally read-write
2244         https://bugs.webkit.org/show_bug.cgi?id=206836
2245
2246         Reviewed by Chris Dumez.
2247
2248         Adds a new IDL extended attribute, RuntimeConditionallyReadWrite, that works
2249         like EnableAtRuntime, but instead allows the associated attribute to be
2250         converted from read-only to read-write based on the value of a RuntimeEnabledFeature.
2251
2252         * bindings/scripts/CodeGeneratorJS.pm:
2253         (GeneratePropertiesHashTable): 
2254         Add check that both runtime enabling and runtime conditional read-write aren't
2255         both specified. For now, that is not supported.
2256
2257         (GenerateRuntimeEnableConditionalString):
2258         Add support for generating the conditional string for RuntimeConditionallyReadWrite.
2259
2260         (GenerateImplementation):
2261         Implement the feature by piggy-backing off the existing runtime enabling, which
2262         deletes the property if the feature is not enabled. For this, if the feature isn't
2263         enabled, we delete the property, and then add it back readonly. In the future, we
2264         should move off of this add-then-delete model, but that is tracked via http://webkit.org/b/206837.
2265         
2266         * bindings/scripts/IDLAttributes.json:
2267         Add new extended attribute.
2268
2269         * bindings/scripts/test/JS/JSTestObj.cpp:
2270         (WebCore::JSTestObjPrototype::finishCreation):
2271         (WebCore::jsTestObjRuntimeConditionallyReadWriteAttributeGetter):
2272         (WebCore::jsTestObjRuntimeConditionallyReadWriteAttribute):
2273         (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttributeSetter):
2274         (WebCore::setJSTestObjRuntimeConditionallyReadWriteAttribute):
2275         * bindings/scripts/test/TestObj.idl:
2276         Add new test with result.
2277
2278 2020-01-27  Devin Rousso  <drousso@apple.com>
2279
2280         Unreviewed, speculative win build fix after r255191
2281
2282         * bindings/js/ScriptController.h:
2283         * testing/Internals.cpp:
2284         (WebCore::Internals::evaluateInWorldIgnoringException):
2285         Don't use the `ScriptSourceCode` so we don't have to export its symbol.
2286
2287 2020-01-27  Jonathan Bedard  <jbedard@apple.com>
2288
2289         WebCore: Remove iOS 11 macros from RenderThemeIOS.mm
2290         https://bugs.webkit.org/show_bug.cgi?id=206787
2291
2292         Reviewed by Darin Adler.
2293
2294         No functional changes, covered by existing tests.
2295
2296         * rendering/RenderThemeIOS.mm:
2297         (WebCore::RenderThemeIOS::cachedSystemFontDescription const):
2298         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription const):
2299
2300 2020-01-27  Devin Rousso  <drousso@apple.com>
2301
2302         Unreviewed, speculative win build fix after r255191
2303
2304         * inspector/agents/page/PageRuntimeAgent.cpp:
2305         Add missing include.
2306
2307 2020-01-27  Chris Dumez  <cdumez@apple.com>
2308
2309         Unreviewed build fix after r255167.
2310
2311         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2312         (WebCore::AXIsolatedObject::detachRemoteParts):
2313
2314 2020-01-27  Devin Rousso  <drousso@apple.com>
2315
2316         Web Inspector: unable to evaluate in the isolated world of content scripts injected by safari app extensions
2317         https://bugs.webkit.org/show_bug.cgi?id=206110
2318         <rdar://problem/16945643>
2319
2320         Reviewed by Timothy Hatcher, Joseph Pecoraro, and Brian Burg.
2321
2322         In addition to evaluating in subframe execution contexts, add the ability for Web Inspector
2323         to evaluate in non-normal isolated worlds.
2324
2325         Test: inspector/runtime/executionContextCreated-isolated-world.html
2326
2327         * bindings/js/DOMWrapperWorld.h:
2328         (WebCore::DOMWrapperWorld::create):
2329         (WebCore::DOMWrapperWorld::type const): Added.
2330         (WebCore::DOMWrapperWorld::isNormal const):
2331         (WebCore::DOMWrapperWorld::name const): Added.
2332         * bindings/js/DOMWrapperWorld.cpp:
2333         (WebCore::DOMWrapperWorld::DOMWrapperWorld):
2334         * bindings/js/ScriptController.h:
2335         * bindings/js/ScriptController.cpp:
2336         (WebCore::ScriptController::createWorld):
2337         * bindings/js/WebCoreJSClientData.cpp:
2338         (WebCore::JSVMClientData::initNormalWorld):
2339         Require that a name is specified when creating an isolated world (except the normal world)
2340         so that Web Inspector has something to show in the execution context picker.
2341
2342         * inspector/InspectorInstrumentation.cpp:
2343         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
2344         * inspector/agents/InspectorPageAgent.h:
2345         * inspector/agents/InspectorPageAgent.cpp:
2346         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
2347         * inspector/agents/page/PageDebuggerAgent.h:
2348         * inspector/agents/page/PageDebuggerAgent.cpp:
2349         (WebCore::PageDebuggerAgent::didClearWindowObjectInWorld):
2350         * inspector/agents/page/PageRuntimeAgent.h:
2351         * inspector/agents/page/PageRuntimeAgent.cpp:
2352         (WebCore::PageRuntimeAgent::didClearWindowObjectInWorld):
2353         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
2354         (WebCore::toProtocol): Added.
2355         (WebCore::PageRuntimeAgent::notifyContextCreated):
2356         Allow this instrumentation call to pass through to the agents for non-`Normal` worlds.
2357
2358         * html/HTMLMediaElement.cpp:
2359         (WebCore::HTMLMediaElement::ensureIsolatedWorld):
2360         * html/HTMLPlugInImageElement.cpp:
2361         (WebCore::plugInImageElementIsolatedWorld):
2362         * Modules/plugins/QuickTimePluginReplacement.mm:
2363         (WebCore::QuickTimePluginReplacement::isolatedWorld):
2364         Mark these worlds as `Internal`.
2365
2366         * testing/Internals.idl:
2367         * testing/Internals.h:
2368         * testing/Internals.cpp:
2369         (WebCore::Internals::evaluateInWorldIgnoringException): Added.
2370
2371 2020-01-27  Peng Liu  <peng.liu6@apple.com>
2372
2373         Crash in WebCore::HTMLMediaElement::detachMediaSource()
2374         https://bugs.webkit.org/show_bug.cgi?id=206766
2375
2376         Reviewed by Jer Noble.
2377
2378         Use WeakPtr<HTMLMediaElement> in MediaSource instead of a raw pointer.
2379         In addition, we need to detach a MediaSource from an HTMLMediaElement before the HTMLMediaElement forgets the reference to the MediaSource.
2380
2381         * Modules/mediasource/MediaSource.cpp:
2382         (WebCore::MediaSource::attachToElement):
2383         * Modules/mediasource/MediaSource.h:
2384         * html/HTMLMediaElement.cpp:
2385         (WebCore::HTMLMediaElement::loadResource):
2386
2387 2020-01-27  Andres Gonzalez  <andresg_22@apple.com>
2388
2389         Crash in AXIsolatedObject destruction.
2390         https://bugs.webkit.org/show_bug.cgi?id=206828
2391
2392         Reviewed by Chris Fleizach.
2393
2394         - The previous AXCoreObject::detach method became detachRemoteParts,
2395         since this method detaches all references to and from other objects.
2396         - The new AXCoreObject::detach method performs three distinctive
2397         operations:
2398         1. Detaches the platform wrapper.
2399         2. Detaches all remote references to and from other objects.
2400         3. Sets the object ID to InvalidAXID.
2401         - The detachPlatformWrapper method allows for platform-specific
2402         customizations.
2403         - Added accessibility/isolatedtree/mac/AXIsolatedobject.mm.
2404
2405         * PlatformMac.cmake:
2406         * SourcesCocoa.txt:
2407         * WebCore.xcodeproj/project.pbxproj:
2408         * accessibility/AXObjectCache.cpp:
2409         (WebCore::AXObjectCache::~AXObjectCache):
2410         (WebCore::AXObjectCache::remove):
2411         * accessibility/AXObjectCache.h:
2412         * accessibility/AccessibilityNodeObject.cpp:
2413         (WebCore::AccessibilityNodeObject::detachRemoteParts):
2414         (WebCore::AccessibilityNodeObject::detach): Became detachRemoteParts.
2415         * accessibility/AccessibilityNodeObject.h:
2416         * accessibility/AccessibilityObject.cpp:
2417         (WebCore::AccessibilityObject::detachRemoteParts):
2418         (WebCore::AccessibilityObject::detach): Became detachRemoteParts.
2419         * accessibility/AccessibilityObject.h:
2420         * accessibility/AccessibilityObjectInterface.h:
2421         (WebCore::AXCoreObject::detachWrapper):
2422         (WebCore::AXCoreObject::detach):
2423         * accessibility/AccessibilityRenderObject.cpp:
2424         (WebCore::AccessibilityRenderObject::detachRemoteParts):
2425         (WebCore::AccessibilityRenderObject::detach): Became detachRemoteParts.
2426         * accessibility/AccessibilityRenderObject.h:
2427         * accessibility/AccessibilityScrollView.cpp:
2428         (WebCore::AccessibilityScrollView::detachRemoteParts):
2429         (WebCore::AccessibilityScrollView::detach): Became detachRemoteParts.
2430         * accessibility/AccessibilityScrollView.h:
2431         * accessibility/atk/AccessibilityObjectAtk.cpp:
2432         (WebCore::AccessibilityObject::detachPlatformWrapper):
2433         * accessibility/ios/AXObjectCacheIOS.mm:
2434         (WebCore::AXObjectCache::detachWrapper): Deleted, no longer used in COCOA platforms.
2435         * accessibility/ios/AccessibilityObjectIOS.mm:
2436         (WebCore::AccessibilityObject::detachPlatformWrapper):
2437         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2438         (WebCore::AXIsolatedObject::detachRemoteParts):
2439         (WebCore::AXIsolatedObject::detach): Became detachRemoteParts.
2440         (WebCore::AXIsolatedObject::disconnect): Replaced with AXCoreObject::detach.
2441         * accessibility/isolatedtree/AXIsolatedObject.h:
2442         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2443         (WebCore::AXIsolatedTree::removeTreeForPageID):
2444         (WebCore::AXIsolatedTree::applyPendingChanges):
2445         * accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
2446         (WebCore::AXIsolatedObject::detachPlatformWrapper):
2447         * accessibility/mac/AXObjectCacheMac.mm:
2448         (WebCore::AXObjectCache::detachWrapper): Deleted, no longer used in COCOA platforms.
2449         * accessibility/mac/AccessibilityObjectMac.mm:
2450         (WebCore::AccessibilityObject::detachPlatformWrapper):
2451         * accessibility/win/AccessibilityObjectWin.cpp:
2452         (WebCore::AccessibilityObject::detachPlatformWrapper):
2453
2454 2020-01-27  Ryan Haddad  <ryanhaddad@apple.com>
2455
2456         Unreviewed, rolling out r255161.
2457
2458         Broke the watchOS build.
2459
2460         Reverted changeset:
2461
2462         "Crash in WebCore::HTMLMediaElement::detachMediaSource()"
2463         https://bugs.webkit.org/show_bug.cgi?id=206766
2464         https://trac.webkit.org/changeset/255161
2465
2466 2020-01-27  Jer Noble  <jer.noble@apple.com>
2467
2468         Support 'allow="fullscreen"' feature policy
2469         https://bugs.webkit.org/show_bug.cgi?id=206806
2470         <rdar://problem/55640448>
2471
2472         Reviewed by Youenn Fablet.
2473
2474         Test: http/tests/fullscreen/fullscreen-feature-policy.html
2475
2476         The unprefixed version of the Fullscreen API has deprecated the 'allowfullscreen' iframe
2477         attribute in favor of the 'allow="fullscreen"' style attribute used by Feature Policy.
2478         Add support for such, including the specified handling for the legacy 'allowfullscreen'
2479         attribute.
2480
2481         Note: this patch will (intentionally) change the default behavior of <iframe>s. Previously
2482         any <iframe> without the "allowfullscreen" attribute would not be allowed to enter fullscreen
2483         mode. After this patch, <iframes> without the legacy attribute or an explicit fullscreen
2484         Feature Policy will be allowed to enter fullscreen so long as their origin is the same as
2485         the top document (and that all parent iframes are also allowed to enter fullscreen).
2486
2487         * dom/FullscreenManager.cpp:
2488         (WebCore::FullscreenManager::requestFullscreenForElement):
2489         (WebCore::FullscreenManager::isFullscreenEnabled const):
2490         (WebCore::isAttributeOnAllOwners): Deleted.
2491         (WebCore::FullscreenManager::fullscreenIsAllowedForElement const): Deleted.
2492         * dom/FullscreenManager.h:
2493         * html/FeaturePolicy.cpp:
2494         (WebCore::isFeaturePolicyAllowedByDocumentAndAllOwners):
2495         (WebCore::FeaturePolicy::parse):
2496         (WebCore::FeaturePolicy::allows const):
2497         * html/FeaturePolicy.h:
2498         * html/HTMLIFrameElement.cpp:
2499         (WebCore::HTMLIFrameElement::parseAttribute):
2500         (WebCore::HTMLIFrameElement::featurePolicy const):
2501         * xml/XMLHttpRequest.cpp:
2502         (WebCore::XMLHttpRequest::createRequest):
2503         (WebCore::isSyncXHRAllowedByFeaturePolicy): Deleted.
2504
2505 2020-01-27  Peng Liu  <peng.liu6@apple.com>
2506
2507         Crash in WebCore::HTMLMediaElement::detachMediaSource()
2508         https://bugs.webkit.org/show_bug.cgi?id=206766
2509
2510         Reviewed by Jer Noble.
2511
2512         Use WeakPtr<HTMLMediaElement> in MediaSource instead of a raw pointer.
2513         In addition, we need to detach a MediaSource from an HTMLMediaElement before the HTMLMediaElement forgets the reference to the MediaSource.
2514
2515         * Modules/mediasource/MediaSource.cpp:
2516         (WebCore::MediaSource::attachToElement):
2517         * Modules/mediasource/MediaSource.h:
2518         * html/HTMLMediaElement.cpp:
2519         (WebCore::HTMLMediaElement::loadResource):
2520
2521 2020-01-27  Said Abou-Hallawa  <sabouhallawa@apple.com>
2522
2523         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
2524         https://bugs.webkit.org/show_bug.cgi?id=204713
2525
2526         Reviewed by Simon Fraser.
2527
2528         Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
2529
2530         requestAnimationFrame is throttled by a timer although its callback are
2531         serviced by the page RenderingUpdate. This led to excessive rAF firing
2532         which makes it more than the preferred frame per seconds.
2533
2534         The solution is to have two throttling types:
2535
2536         1) Page throttling (or full throttling) which slows down all the steps of
2537            RenderingUpdate for the main document and all the sub-documents.
2538         2) Document throttling (or partial throttling) which only slows down the
2539            rAF of a certain document.
2540
2541         * Headers.cmake:
2542         * WebCore.xcodeproj/project.pbxproj:
2543
2544         * animation/DocumentTimeline.cpp:
2545         (WebCore::DocumentTimeline::animationInterval const):
2546         (WebCore::DocumentTimeline::updateThrottlingState): Deleted.
2547         * animation/DocumentTimeline.h:
2548         There is no need to have DocumentTimeline throttling. It is already 
2549         throttled when the page RenderingUpdate is throttled.
2550
2551         * dom/Document.cpp:
2552         (WebCore::Document::requestAnimationFrame):
2553         (WebCore::Document::updateLastHandledUserGestureTimestamp):
2554         LowPowerMode throttling is now handled by the page. So remove its handling
2555         in the Document side.
2556
2557         * dom/ScriptedAnimationController.cpp:
2558         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2559         (WebCore::ScriptedAnimationController::page const):
2560         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
2561         (WebCore::ScriptedAnimationController::interval const):
2562         (WebCore::ScriptedAnimationController::isThrottled const):
2563         (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const):
2564         (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):
2565         (WebCore::ScriptedAnimationController::registerCallback):
2566         (WebCore::ScriptedAnimationController::cancelCallback):
2567         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2568         (WebCore::ScriptedAnimationController::scheduleAnimation):
2569         (WebCore::throttlingReasonToString): Deleted.
2570         (WebCore::throttlingReasonsToString): Deleted.
2571         (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
2572         (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
2573         (WebCore::ScriptedAnimationController::animationTimerFired): Deleted.
2574         * dom/ScriptedAnimationController.h:
2575         (WebCore::ScriptedAnimationController::addThrottlingReason):
2576         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2577         Get rid of the rAF throttling timer. Service the rAF callback only when
2578         the period from the current time stamp till the last service time stamp
2579         is greater than the preferred rAF interval .
2580
2581         * page/FrameView.cpp:
2582         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2583         ThrottlingReason is now defined outside ScriptedAnimationController.
2584
2585         * page/Page.cpp:
2586         (WebCore::Page::renderingUpdateThrottlingEnabled const):
2587         (WebCore::Page::renderingUpdateThrottlingEnabledChanged):
2588         (WebCore::Page::isRenderingUpdateThrottled const):
2589
2590         (WebCore::Page::preferredRenderingUpdateInterval const):
2591         Calculate the preferred RenderingUpdate interval from the throttling
2592         reasons.
2593
2594         (WebCore::Page::setIsVisuallyIdleInternal):
2595         (WebCore::Page::handleLowModePowerChange):
2596         Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or 
2597         IsVisuallyIdle is toggled.
2598
2599         (WebCore::updateScriptedAnimationsThrottlingReason): Deleted.
2600         * page/Page.h:
2601
2602         * page/RenderingUpdateScheduler.cpp:
2603         (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond):
2604         (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
2605         Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the
2606         throttling is not aggressive e.g. 10_s. Otherwise use the timer.
2607
2608         (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
2609         Call adjustFramesPerSecond() when DisplayRefreshMonitor is created.
2610
2611         (WebCore::RenderingUpdateScheduler::startTimer):
2612         * page/RenderingUpdateScheduler.h:
2613
2614         * page/Settings.yaml:
2615         * page/SettingsBase.cpp:
2616         (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged):
2617         * page/SettingsBase.h:
2618         Add a setting to enable/disable RenderingUpdateThrottling.
2619
2620         * platform/graphics/AnimationFrameRate.h: Added.
2621         (WebCore::preferredFrameInterval):
2622         (WebCore::preferredFramesPerSecond):
2623
2624         * platform/graphics/DisplayRefreshMonitor.h:
2625         (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond):
2626         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2627         (WebCore::DisplayRefreshMonitorManager::monitorForClient):
2628         Rename createMonitorForClient() to monitorForClient() since it may return
2629         a cached DisplayRefreshMonitor.
2630
2631         (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond):
2632         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
2633         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
2634         No need to call registerClient(). This function was just ensuring the
2635         DisplayRefreshMonitor is created. scheduleAnimation() does the same thing.
2636
2637         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted.
2638         (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted.
2639         * platform/graphics/DisplayRefreshMonitorManager.h:
2640         (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted.
2641
2642         * platform/graphics/GraphicsLayerUpdater.cpp:
2643         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
2644         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2645         (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]):
2646         Set the preferredFramesPerSecond of the CADisplayLink.
2647
2648 2020-01-27  Antti Koivisto  <antti@apple.com>
2649
2650         Correct VTT Cue Style handling to match the specification
2651         https://bugs.webkit.org/show_bug.cgi?id=201086
2652         <rdar://problem/54658121>
2653
2654         Reviewed by Brent Fulgham.
2655
2656         The VTT specification requires that only data-URLs are permitted in STYLE blocks.
2657
2658         * css/CSSSelector.cpp:
2659         (WebCore::CSSSelector::selectorText const):
2660
2661         Fix selectorText for function version of ::cue().
2662
2663         * css/parser/CSSParserContext.cpp:
2664         (WebCore::CSSParserContext::completeURL const):
2665
2666         Don't allow non-data URLs in WebVTT parser mode.
2667
2668         * css/parser/CSSParserContext.h:
2669         (WebCore::CSSParserContext::completeURL const): Deleted.
2670         * css/parser/CSSParserMode.h:
2671         (WebCore::isStrictParserMode):
2672         * html/track/WebVTTParser.cpp:
2673         (WebCore::WebVTTParser::collectStyleSheet):
2674         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
2675
2676         Instead of simply validating the original stylesheet, build a new sanitized stylesheet text
2677         from the stylesheet parsed in WebVTT mode. This sanitized stylesheet is then used as the
2678         input for the style system.
2679
2680         * html/track/WebVTTParser.h:
2681
2682 2020-01-27  Ryan Haddad  <ryanhaddad@apple.com>
2683
2684         Unreviewed, rolling out r255131.
2685
2686         Caused assertion failures on iOS debug bots.
2687
2688         Reverted changeset:
2689
2690         "Throttling requestAnimationFrame should be controlled by
2691         RenderingUpdateScheduler"
2692         https://bugs.webkit.org/show_bug.cgi?id=204713
2693         https://trac.webkit.org/changeset/255131
2694
2695 2020-01-27  Antoine Quint  <graouts@apple.com>
2696
2697         [Web Animations] Add support for the options parameter to getAnimations()
2698         https://bugs.webkit.org/show_bug.cgi?id=202191
2699         <rdar://problem/55697751>
2700
2701         Reviewed by Antti Koivisto.
2702
2703         Add support for the GetAnimationsOptions dictionary as a parameter to Animatable.getAnimations(). When it is provided
2704         and has its sole "subtree" property set to "true", we call Document.getAnimations() and filter out animations that are
2705         not targeting elements that are either this element, one of its descendants, one of its pseudo-elements or one of its
2706         descendants' pseudo-elements.
2707
2708         * CMakeLists.txt:
2709         * DerivedSources-input.xcfilelist:
2710         * DerivedSources-output.xcfilelist:
2711         * DerivedSources.make:
2712         * Headers.cmake:
2713         * Sources.txt:
2714         * WebCore.xcodeproj/project.pbxproj:
2715         * animation/Animatable.idl:
2716         * animation/GetAnimationsOptions.h: Added.
2717         * animation/GetAnimationsOptions.idl: Added.
2718         * dom/Element.cpp:
2719         (WebCore::Element::getAnimations):
2720         * dom/Element.h:
2721
2722 2020-01-27  Jonathan Bedard  <jbedard@apple.com>
2723
2724         WebCore: Remove iOS 11 macros from NetworkStorageSessionCocoa.mm
2725         https://bugs.webkit.org/show_bug.cgi?id=206786
2726
2727         Reviewed by Darin Adler.
2728
2729         No functional changes, covered by existing tests.
2730
2731         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2732         (WebCore::cookiesForURL): 
2733         (WebCore::setHTTPCookiesForURL):
2734
2735 2020-01-27  Jonathan Bedard  <jbedard@apple.com>
2736
2737         WebCore: Remove iOS 11 macros from WebItemProviderPasteboard.h
2738         https://bugs.webkit.org/show_bug.cgi?id=206719
2739
2740         Reviewed by Tim Horton.
2741
2742         No functional changes, covered by existing tests.
2743
2744         * platform/ios/WebItemProviderPasteboard.h:
2745
2746 2020-01-27  Zalan Bujtas  <zalan@apple.com>
2747
2748         [LFC][IFC] Display::Run has physical geometry only.
2749         https://bugs.webkit.org/show_bug.cgi?id=206810
2750         <rdar://problem/58905455>
2751
2752         Reviewed by Antti Koivisto.
2753
2754         Since in LFC the Display::Runs are used for painting and hittesting but never for layout,
2755         the geometry is always physical.
2756
2757         * layout/Verification.cpp:
2758         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2759         (WebCore::Layout::checkForMatchingNonTextRuns):
2760         (WebCore::Layout::checkForMatchingTextRuns):
2761         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2762         * layout/displaytree/DisplayPainter.cpp:
2763         (WebCore::Display::paintInlineContent):
2764         * layout/displaytree/DisplayRun.h:
2765         (WebCore::Display::Run::rect const):
2766         (WebCore::Display::Run::topLeft const):
2767         (WebCore::Display::Run::left const):
2768         (WebCore::Display::Run::right const):
2769         (WebCore::Display::Run::top const):
2770         (WebCore::Display::Run::bottom const):
2771         (WebCore::Display::Run::width const):
2772         (WebCore::Display::Run::height const):
2773         (WebCore::Display::Run::setWidth):
2774         (WebCore::Display::Run::setTop):
2775         (WebCore::Display::Run::setlLeft):
2776         (WebCore::Display::Run::moveVertically):
2777         (WebCore::Display::Run::moveHorizontally):
2778         (WebCore::Display::Run::expandVertically):
2779         (WebCore::Display::Run::expandHorizontally):
2780         (WebCore::Display::Run::Run):
2781         (WebCore::Display::Run::logicalRect const): Deleted.
2782         (WebCore::Display::Run::logicalTopLeft const): Deleted.
2783         (WebCore::Display::Run::logicalLeft const): Deleted.
2784         (WebCore::Display::Run::logicalRight const): Deleted.
2785         (WebCore::Display::Run::logicalTop const): Deleted.
2786         (WebCore::Display::Run::logicalBottom const): Deleted.
2787         (WebCore::Display::Run::logicalWidth const): Deleted.
2788         (WebCore::Display::Run::logicalHeight const): Deleted.
2789         (WebCore::Display::Run::setLogicalWidth): Deleted.
2790         (WebCore::Display::Run::setLogicalTop): Deleted.
2791         (WebCore::Display::Run::setLogicalLeft): Deleted.
2792         * layout/integration/LayoutIntegrationLineLayout.cpp:
2793         (WebCore::LayoutIntegration::LineLayout::paint):
2794         (WebCore::LayoutIntegration::LineLayout::hitTest):
2795         * layout/layouttree/LayoutTreeBuilder.cpp:
2796         (WebCore::Layout::outputInlineRuns):
2797         * rendering/RenderTreeAsText.cpp:
2798         (WebCore::writeTextBox):
2799         * rendering/line/LineLayoutTraversal.h:
2800         (WebCore::LineLayoutTraversal::Box::logicalRect const): Deleted.
2801         * rendering/line/LineLayoutTraversalDisplayRunPath.h:
2802         (WebCore::LineLayoutTraversal::linePosition):
2803         (WebCore::LineLayoutTraversal::DisplayRunPath::rect const):
2804         (WebCore::LineLayoutTraversal::DisplayRunPath::logicalRect const): Deleted.
2805
2806 2020-01-26  Antoine Quint  <graouts@apple.com>
2807
2808         [Web Animations] Update all DocumentTimeline objects when updating animations
2809         https://bugs.webkit.org/show_bug.cgi?id=206819
2810
2811         Reviewed by Antti Koivisto.
2812
2813         Developers can create additional DocumentTimeline objects in JavaScript using that class's constructor, and an animation can be
2814         assigned to that timeline after its creation. Until now we would only update an timeline created by a Document when that document's
2815         animations were updated. Now we keep track of all DocumentTimeline objects that are created for a given Document as a vector of weak
2816         references, and we update all of them when updating a document's animations.
2817
2818         * animation/DocumentTimeline.cpp:
2819         (WebCore::DocumentTimeline::DocumentTimeline):
2820         (WebCore::DocumentTimeline::~DocumentTimeline):
2821         * animation/DocumentTimeline.h:
2822         * dom/Document.cpp:
2823         (WebCore::Document::updateAnimationsAndSendEvents):
2824         (WebCore::Document::addTimeline):
2825         (WebCore::Document::removeTimeline):
2826         * dom/Document.h:
2827
2828 2020-01-26  Darin Adler  <darin@apple.com>
2829
2830         Move DOMCacheEngine::errorToException back out of header and into .cpp file
2831         https://bugs.webkit.org/show_bug.cgi?id=206815
2832
2833         Reviewed by Mark Lam.
2834
2835         This is a follow-up to a recent build fix that moved a function, errorToException,
2836         out of a .cpp file and into a header file. This reverses that since we don't need
2837         this function to be inlined.
2838
2839         * Modules/cache/DOMCacheEngine.cpp:
2840         (WebCore::DOMCacheEngine::convertToException): Moved this function from the header
2841         and renamed it from errorToException to match the other function more closely. Also
2842         use the pattern where the switch statement has no default, so we get a warning if
2843         we don't cover all the enum values.
2844         (WebCore::DOMCacheEngine::convertToExceptionAndLog): Updated for new function name.
2845
2846         * Modules/cache/DOMCacheEngine.h: Removed the definition of errorToException and
2847         replaced it with the declaration of it under its new name, convertToException.
2848
2849         * Modules/cache/DOMCacheStorage.cpp:
2850         (WebCore::DOMCacheStorage::retrieveCaches): Updated for new function name.
2851
2852 2020-01-26  youenn fablet  <youenn@apple.com>
2853
2854         Use ObjectIdentifier for remote RealtimeMediaSource
2855         https://bugs.webkit.org/show_bug.cgi?id=206808
2856         <rdar://problem/58705405>
2857
2858         Reviewed by Eric Carlson.
2859
2860         No change of behavior.
2861
2862         * WebCore.xcodeproj/project.pbxproj:
2863         * platform/mediastream/RealtimeMediaSourceIdentifier.h: Added.
2864
2865 2020-01-26  Said Abou-Hallawa  <said@apple.com>
2866
2867         Throttling requestAnimationFrame should be controlled by RenderingUpdateScheduler
2868         https://bugs.webkit.org/show_bug.cgi?id=204713
2869
2870         Reviewed by Simon Fraser.
2871
2872         Test: fast/animation/request-animation-frame-throttling-outside-viewport.html
2873
2874         requestAnimationFrame is throttled by a timer although its callback are
2875         serviced by the page RenderingUpdate. This led to excessive rAF firing
2876         which makes it more than the preferred frame per seconds.
2877
2878         The solution is to have two throttling types:
2879
2880         1) Page throttling (or full throttling) which slows down all the steps of
2881            RenderingUpdate for the main document and all the sub-documents.
2882         2) Document throttling (or partial throttling) which only slows down the
2883            rAF of a certain document.
2884
2885         * Headers.cmake:
2886         * WebCore.xcodeproj/project.pbxproj:
2887
2888         * animation/DocumentTimeline.cpp:
2889         (WebCore::DocumentTimeline::animationInterval const):
2890         (WebCore::DocumentTimeline::updateThrottlingState): Deleted.
2891         * animation/DocumentTimeline.h:
2892         There is no need to have DocumentTimeline throttling. It is already 
2893         throttled when the page RenderingUpdate is throttled.
2894
2895         * dom/Document.cpp:
2896         (WebCore::Document::requestAnimationFrame):
2897         (WebCore::Document::updateLastHandledUserGestureTimestamp):
2898         LowPowerMode throttling is now handled by the page. So remove its handling
2899         in the Document side.
2900
2901         * dom/ScriptedAnimationController.cpp:
2902         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2903         (WebCore::ScriptedAnimationController::page const):
2904         (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const):
2905         (WebCore::ScriptedAnimationController::interval const):
2906         (WebCore::ScriptedAnimationController::isThrottled const):
2907         (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const):
2908         (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const):
2909         (WebCore::ScriptedAnimationController::registerCallback):
2910         (WebCore::ScriptedAnimationController::cancelCallback):
2911         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2912         (WebCore::ScriptedAnimationController::scheduleAnimation):
2913         (WebCore::throttlingReasonToString): Deleted.
2914         (WebCore::throttlingReasonsToString): Deleted.
2915         (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
2916         (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
2917         (WebCore::ScriptedAnimationController::animationTimerFired): Deleted.
2918         * dom/ScriptedAnimationController.h:
2919         (WebCore::ScriptedAnimationController::addThrottlingReason):
2920         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2921         Get rid of the rAF throttling timer. Service the rAF callback only when
2922         the period from the current time stamp till the last service time stamp
2923         is greater than the preferred rAF interval .
2924
2925         * page/FrameView.cpp:
2926         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2927         ThrottlingReason is now defined outside ScriptedAnimationController.
2928
2929         * page/Page.cpp:
2930         (WebCore::Page::renderingUpdateThrottlingEnabled const):
2931         (WebCore::Page::renderingUpdateThrottlingEnabledChanged):
2932         (WebCore::Page::isRenderingUpdateThrottled const):
2933
2934         (WebCore::Page::preferredRenderingUpdateInterval const):
2935         Calculate the preferred RenderingUpdate interval from the throttling
2936         reasons.
2937
2938         (WebCore::Page::setIsVisuallyIdleInternal):
2939         (WebCore::Page::handleLowModePowerChange):
2940         Call adjustRenderingUpdateFrequency() when isLowPowerModeEnabled or 
2941         IsVisuallyIdle is toggled.
2942
2943         (WebCore::updateScriptedAnimationsThrottlingReason): Deleted.
2944         * page/Page.h:
2945
2946         * page/RenderingUpdateScheduler.cpp:
2947         (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond):
2948         (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency):
2949         Change the preferredFramesPerSecond of the DisplayRefreshMonitor if the
2950         throttling is not aggressive e.g. 10_s. Otherwise use the timer.
2951
2952         (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
2953         Call adjustFramesPerSecond() when DisplayRefreshMonitor is created.
2954
2955         (WebCore::RenderingUpdateScheduler::startTimer):
2956         * page/RenderingUpdateScheduler.h:
2957
2958         * page/Settings.yaml:
2959         * page/SettingsBase.cpp:
2960         (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged):
2961         * page/SettingsBase.h:
2962         Add a setting to enable/disable RenderingUpdateThrottling.
2963
2964         * platform/graphics/AnimationFrameRate.h: Added.
2965         (WebCore::preferredFrameInterval):
2966         (WebCore::preferredFramesPerSecond):
2967
2968         * platform/graphics/DisplayRefreshMonitor.h:
2969         (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond):
2970         * platform/graphics/DisplayRefreshMonitorManager.cpp:
2971         (WebCore::DisplayRefreshMonitorManager::monitorForClient):
2972         Rename createMonitorForClient() to monitorForClient() since it may return
2973         a cached DisplayRefreshMonitor.
2974
2975         (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond):
2976         (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
2977         (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
2978         No need to call registerClient(). This function was just ensuring the
2979         DisplayRefreshMonitor is created. scheduleAnimation() does the same thing.
2980
2981         (WebCore::DisplayRefreshMonitorManager::createMonitorForClient): Deleted.
2982         (WebCore::DisplayRefreshMonitorManager::registerClient): Deleted.
2983         * platform/graphics/DisplayRefreshMonitorManager.h:
2984         (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager): Deleted.
2985
2986         * platform/graphics/GraphicsLayerUpdater.cpp:
2987         (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
2988         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2989         (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]):
2990         Set the preferredFramesPerSecond of the CADisplayLink.
2991
2992         * platform/ios/LowPowerModeNotifierIOS.mm:
2993         (-[WebLowPowerModeObserver initWithNotifier:]):
2994         Set the initial state of the low power mode.
2995
2996 2020-01-26  Rob Buis  <rbuis@igalia.com>
2997
2998         Improve compatibility with hyperlink auditing spec
2999         https://bugs.webkit.org/show_bug.cgi?id=188852
3000
3001         Reviewed by Youenn Fablet.
3002
3003         The hyperlink auditing algorithm indicates the fetch should be done
3004         using no-referrer [1], so remove the code to set the referrer HTTP
3005         header.
3006
3007         Tests: http/tests/navigation/ping-attribute/anchor-cross-origin.html
3008                http/tests/navigation/ping-attribute/area-cross-origin.html
3009
3010         [1] https://html.spec.whatwg.org/multipage/links.html#hyperlink-auditing (Step 3)
3011
3012         * loader/PingLoader.cpp:
3013         (WebCore::PingLoader::sendPing):
3014
3015 2020-01-25  Darin Adler  <darin@apple.com>
3016
3017         Tighten up some of the drag state machine logic
3018         https://bugs.webkit.org/show_bug.cgi?id=206798
3019
3020         Reviewed by Wenson Hsieh.
3021
3022         * page/EventHandler.h: Added shouldDispatchEventsToDragSourceElement function and renamed
3023         the existing dispatchDragSrcEvent function to dispatchEventToDragSourceElement.
3024
3025         * page/EventHandler.cpp:
3026         (WebCore::EventHandler::updateDragAndDrop): Call the renamed dispatchEventToDragSourceElement
3027         unconditionally, since it now has the smarts to only dispatch an event when we are supposed to.
3028         (WebCore::EventHandler::cancelDragAndDrop): Ditto.
3029         (WebCore::EventHandler::dragSourceEndedAt): Call the new shouldDispatchEventsToDragSourceElement
3030         function because of the null check it does for dataTransfer, before calling setDestinationOperation
3031         on the dataTransfer, since there isn't an obvious ironclad guarantee we might be here without an
3032         actual drag fully in process and a dataTransfer object allocated. Also call the renamed
3033         dispatchEventToDragSourceElement by its new name.
3034         (WebCore::EventHandler::shouldDispatchDragSourceEvents): Added. Checks thre three conditions that
3035         affect whether we should dispatch events to the drag source. First that there is a drag source.
3036         Second that there is a dataTransfer object, indicating that we got far enough in the logic to
3037         actually start a drag. Third that shouldDispatchEvents is true, indicating this is the type of
3038         drag that should be visible to the website content and so events should be dispatched.
3039         (WebCore::EventHandler::dispatchEventToDragSourceElement): Call shouldDispatchDragSourceEvents
3040         before dispatching the event, so that callers don't all have to do that check.
3041
3042 2020-01-25  Mark Lam  <mark.lam@apple.com>
3043
3044         Introduce a getVTablePointer() utility function.
3045         https://bugs.webkit.org/show_bug.cgi?id=206804
3046         <rdar://problem/58872290>
3047
3048         Reviewed by Yusuke Suzuki and Oliver Hunt.
3049
3050         Updated CodeGeneratorJS to use getVTablePointer() and rebased test results.
3051
3052         * bindings/scripts/CodeGeneratorJS.pm:
3053         (GenerateImplementation):
3054         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3055         (WebCore::toJSNewlyCreated):
3056         * bindings/scripts/test/JS/JSMapLike.cpp:
3057         (WebCore::toJSNewlyCreated):
3058         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3059         (WebCore::toJSNewlyCreated):
3060         * bindings/scripts/test/JS/JSReadOnlySetLike.cpp:
3061         (WebCore::toJSNewlyCreated):
3062         * bindings/scripts/test/JS/JSSetLike.cpp:
3063         (WebCore::toJSNewlyCreated):
3064         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3065         (WebCore::toJSNewlyCreated):
3066         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3067         (WebCore::toJSNewlyCreated):
3068         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3069         (WebCore::toJSNewlyCreated):
3070         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3071         (WebCore::toJSNewlyCreated):
3072         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3073         (WebCore::toJSNewlyCreated):
3074         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3075         (WebCore::toJSNewlyCreated):
3076         * bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
3077         (WebCore::toJSNewlyCreated):
3078         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3079         (WebCore::toJSNewlyCreated):
3080         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3081         (WebCore::toJSNewlyCreated):
3082         * bindings/scripts/test/JS/JSTestException.cpp:
3083         (WebCore::toJSNewlyCreated):
3084         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3085         (WebCore::toJSNewlyCreated):
3086         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3087         (WebCore::toJSNewlyCreated):
3088         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3089         (WebCore::toJSNewlyCreated):
3090         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3091         (WebCore::toJSNewlyCreated):
3092         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3093         (WebCore::toJSNewlyCreated):
3094         * bindings/scripts/test/JS/JSTestIterable.cpp:
3095         (WebCore::toJSNewlyCreated):
3096         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3097         (WebCore::toJSNewlyCreated):
3098         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3099         (WebCore::toJSNewlyCreated):
3100         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3101         (WebCore::toJSNewlyCreated):
3102         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3103         (WebCore::toJSNewlyCreated):
3104         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3105         (WebCore::toJSNewlyCreated):
3106         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3107         (WebCore::toJSNewlyCreated):
3108         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3109         (WebCore::toJSNewlyCreated):
3110         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3111         (WebCore::toJSNewlyCreated):
3112         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3113         (WebCore::toJSNewlyCreated):
3114         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3115         (WebCore::toJSNewlyCreated):
3116         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3117         (WebCore::toJSNewlyCreated):
3118         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3119         (WebCore::toJSNewlyCreated):
3120         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3121         (WebCore::toJSNewlyCreated):
3122         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3123         (WebCore::toJSNewlyCreated):
3124         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
3125         (WebCore::toJSNewlyCreated):
3126         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
3127         (WebCore::toJSNewlyCreated):
3128         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
3129         (WebCore::toJSNewlyCreated):
3130         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
3131         (WebCore::toJSNewlyCreated):
3132         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
3133         (WebCore::toJSNewlyCreated):
3134         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
3135         (WebCore::toJSNewlyCreated):
3136         * bindings/scripts/test/JS/JSTestNode.cpp:
3137         (WebCore::toJSNewlyCreated):
3138         * bindings/scripts/test/JS/JSTestObj.cpp:
3139         (WebCore::toJSNewlyCreated):
3140         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3141         (WebCore::toJSNewlyCreated):
3142         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3143         (WebCore::toJSNewlyCreated):
3144         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3145         (WebCore::toJSNewlyCreated):
3146         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
3147         (WebCore::toJSNewlyCreated):
3148         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
3149         (WebCore::toJSNewlyCreated):
3150         * bindings/scripts/test/JS/JSTestSerialization.cpp:
3151         (WebCore::toJSNewlyCreated):
3152         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3153         (WebCore::toJSNewlyCreated):
3154         * bindings/scripts/test/JS/JSTestStringifier.cpp:
3155         (WebCore::toJSNewlyCreated):
3156         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
3157         (WebCore::toJSNewlyCreated):
3158         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
3159         (WebCore::toJSNewlyCreated):
3160         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
3161         (WebCore::toJSNewlyCreated):
3162         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
3163         (WebCore::toJSNewlyCreated):
3164         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
3165         (WebCore::toJSNewlyCreated):
3166         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
3167         (WebCore::toJSNewlyCreated):
3168         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3169         (WebCore::toJSNewlyCreated):
3170
3171 2020-01-25  Per Arne Vollan  <pvollan@apple.com>
3172
3173         [Cocoa] Media mime types map should be created in the UI process
3174         https://bugs.webkit.org/show_bug.cgi?id=206478
3175
3176         Reviewed by Darin Adler.
3177
3178         Creating this map in the WebContent process will access the launch services daemon, which will be blocked.
3179         This patch creates the map in the UI process and sends it to the WebContent process as part of the WebProcess
3180         creation parameters.
3181
3182         API test: WebKit.MimeTypes
3183
3184         * platform/MIMETypeRegistry.cpp:
3185         (WebCore::overriddenMimeTypesMap):
3186         (WebCore::commonMediaTypes):
3187         (WebCore::commonMimeTypesMap):
3188         (WebCore::typesForCommonExtension):
3189         * platform/MIMETypeRegistry.h:
3190         * testing/Internals.cpp:
3191         (WebCore::Internals::mediaMIMETypeForExtension):
3192         * testing/Internals.h:
3193         * testing/Internals.idl:
3194
3195 2020-01-25  Zalan Bujtas  <zalan@apple.com>
3196
3197         [LFC][IFC] Layout logic should be driven by the type of the inline box
3198         https://bugs.webkit.org/show_bug.cgi?id=206792
3199         <rdar://problem/58889080>
3200
3201         Reviewed by Antti Koivisto.
3202
3203         Use the type of the inline box to decide what layout functions to call and not whether the
3204         box has children or it establishes a formatting context.
3205
3206         * layout/inlineformatting/InlineFormattingContext.cpp:
3207         (WebCore::Layout::nextInPreOrder):
3208         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
3209         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
3210         * layout/inlineformatting/InlineFormattingContext.h:
3211         * layout/inlineformatting/InlineLineBuilder.cpp:
3212         (WebCore::Layout::LineBuilder::isVisuallyNonEmpty const):
3213
3214 2020-01-25  Antti Koivisto  <antti@apple.com>
3215
3216         [LFC][Integration] Re-enable line layout integration
3217         https://bugs.webkit.org/show_bug.cgi?id=206795
3218         <rdar://problem/58853907>
3219
3220         Reviewed by Zalan Bujtas.
3221
3222         * page/RuntimeEnabledFeatures.h:
3223
3224 2020-01-25  youenn fablet  <youenn@apple.com>
3225
3226         HTMLMediaElement should not remove the media session at DOM suspension time
3227         https://bugs.webkit.org/show_bug.cgi?id=206661
3228         <rdar://problem/58800787>
3229
3230         Reviewed by Eric Carlson.
3231
3232         https://trac.webkit.org/changeset/233560 made it so that, on HTMLMediaElement suspension,
3233         its media session is stopped.
3234         This was done to ensure updateNowPlayingInfo is not called synchronously but asynchronously.
3235         The issue is that, once the media session is stopped, it is removed from the media session vector.
3236         On updating the ready state after suspension, and playing, we try to look into the media session vector and do not find the session.
3237         This triggers the ASSERT.
3238
3239         Partially revert the behavior by calling the same code as clientWillPausePlayback
3240         but make sure updateNowPlayingInfo is calling asynchronously when suspending the media element.
3241         Introduce clientWillBeDOMSuspended for that purpose.
3242
3243         Update mediaPlayerReadyStateChanged to enqueue a task to do the update if the media element is suspended.
3244
3245         Covered by test no longer crashing in debug.
3246
3247         * html/HTMLMediaElement.cpp:
3248         (WebCore::HTMLMediaElement::mediaPlayerReadyStateChanged):
3249         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
3250         * platform/audio/PlatformMediaSession.cpp:
3251         (WebCore::PlatformMediaSession::processClientWillPausePlayback):
3252         (WebCore::PlatformMediaSession::clientWillPausePlayback):
3253         (WebCore::PlatformMediaSession::clientWillBeDOMSuspended):
3254         * platform/audio/PlatformMediaSession.h:
3255         * platform/audio/PlatformMediaSessionManager.cpp:
3256         (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
3257         * platform/audio/PlatformMediaSessionManager.h:
3258         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
3259         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
3260         (MediaSessionManagerCocoa::sessionWillEndPlayback):
3261         * platform/audio/ios/MediaSessionManagerIOS.h:
3262         * platform/audio/ios/MediaSessionManagerIOS.mm:
3263         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
3264
3265 2020-01-24  Jack Lee  <shihchieh_lee@apple.com>
3266
3267         Null Ptr Deref READ @ WebCore::RenderMultiColumnFlow::lastMultiColumnSet const
3268         https://bugs.webkit.org/show_bug.cgi?id=206106
3269
3270         Reviewed by Ryosuke Niwa.
3271
3272         Could not write a reproducible fast test case for this.
3273
3274         * rendering/RenderMultiColumnFlow.cpp:
3275         (WebCore::RenderMultiColumnFlow::lastMultiColumnSet const):
3276         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3277         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
3278
3279 2020-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
3280
3281         [iOS] Long pressing text inside a selection should update the selection
3282         https://bugs.webkit.org/show_bug.cgi?id=206769
3283         <rdar://problem/58704316>
3284
3285         Reviewed by Tim Horton.
3286
3287         Remove `hasSelectionAtPosition`, which is no longer needed.
3288
3289         * page/Page.cpp:
3290         (WebCore::Page::hasSelectionAtPosition const): Deleted.
3291         * page/Page.h:
3292
3293 2020-01-24  Zalan Bujtas  <zalan@apple.com>
3294
3295         [LFC][IFC] (Regression) LayoutTests/fast/text/whitespace/029.html fails
3296         https://bugs.webkit.org/show_bug.cgi?id=206773
3297         <rdar://problem/58883388>
3298
3299         Reviewed by Simon Fraser.
3300
3301         While line break is an inline box, it does not have inline content so do not try to cast it to Container.
3302
3303         * layout/inlineformatting/InlineFormattingContext.cpp:
3304         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
3305         (WebCore::Layout::InlineFormattingContext::collectInlineContentIfNeeded):
3306
3307 2020-01-24  Jer Noble  <jer.noble@apple.com>
3308
3309         AirPlay placard not visible when AirPlay is entered in fullscreen mode.
3310         https://bugs.webkit.org/show_bug.cgi?id=206772
3311         <rdar://problem/57098851>
3312
3313         Reviewed by Eric Carlson.
3314
3315         Test: media/modern-media-controls/placard-support/placard-support-airplay-fullscreen-no-controls.html
3316
3317         The AirPlay and Picture-in-picture placards should always become visible, regardless of
3318         whether the <video> element uses the native media controls. So "disabling" the PlacardSupport
3319         object should not remove the listeners for presentation mode and route change events. Instead
3320         merely remember whether the object is disabled, so that the "error placard" will only be shown
3321         if controls are enabled, and PiP and AirPlay placards will always be shown.
3322
3323         * Modules/modern-media-controls/media/placard-support.js:
3324         (PlacardSupport.prototype.enable):
3325         (PlacardSupport.prototype.disable):
3326         (PlacardSupport.prototype._updatePlacard):
3327
3328 2020-01-24  Andres Gonzalez  <andresg_22@apple.com>
3329
3330         Crash in AXIsolatedObject::tagName.
3331         https://bugs.webkit.org/show_bug.cgi?id=206765
3332
3333         Reviewed by Chris Fleizach.
3334
3335         Fixes crash in AXIsolatedObject::tagName.
3336
3337         * accessibility/isolatedtree/AXIsolatedObject.cpp:
3338         (WebCore::AXIsolatedObject::initializeAttributeData): Was missing the isolatedCopy when caching the tagName.
3339
3340 2020-01-24  Ryan Haddad  <ryanhaddad@apple.com>
3341
3342         Unreviewed, rolling out r255089.
3343
3344         Breaks tvOS build.
3345
3346         Reverted changeset:
3347
3348         "WebCore: Remove iOS 11 macros from
3349         WebItemProviderPasteboard.h"
3350         https://bugs.webkit.org/show_bug.cgi?id=206719
3351         https://trac.webkit.org/changeset/255089
3352
3353 2020-01-24  Jonathan Bedard  <jbedard@apple.com>
3354
3355         WebCore: Remove iOS 11 macros from WebItemProviderPasteboard.h
3356         https://bugs.webkit.org/show_bug.cgi?id=206719
3357
3358         Reviewed by Tim Horton.
3359
3360         No functional changes, covered by existing tests.
3361
3362         * platform/ios/WebItemProviderPasteboard.h:
3363
3364 2020-01-24  youenn fablet  <youenn@apple.com>
3365
3366         Add support for MediaRecorder.requestData
3367         https://bugs.webkit.org/show_bug.cgi?id=206731
3368
3369         Reviewed by Eric Carlson.
3370
3371         Add support for requestData that fetches any available data.
3372         Expose MediaRecorder stream.
3373         Covered by updated tests.
3374
3375         * Modules/mediarecorder/MediaRecorder.cpp:
3376         (WebCore::MediaRecorder::requestData):
3377         * Modules/mediarecorder/MediaRecorder.h:
3378         * Modules/mediarecorder/MediaRecorder.idl:
3379
3380 2020-01-24  Jack Lee  <shihchieh_lee@apple.com>
3381
3382         Nullptr deref in WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation when an element is inserted before legend under multi-column layout.
3383         https://bugs.webkit.org/show_bug.cgi?id=206109
3384
3385         Reviewed by Antti Koivisto.
3386
3387         Test: fast/forms/fieldset/fieldset-crash-insert-before-legend-under-multicol.html
3388
3389         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
3390         (WebCore::RenderTreeBuilder::BlockFlow::attach):
3391
3392 2020-01-24  Per Arne Vollan  <pvollan@apple.com>
3393
3394         Unreviewed, rolling out r255050.
3395
3396         Introduced crashes on bots
3397
3398         Reverted changeset:
3399
3400         "[Cocoa] Media mime types map should be created in the UI
3401         process"