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