WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-04-12  Ross Kirsling  <ross.kirsling@sony.com>
2
3         WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
4         https://bugs.webkit.org/show_bug.cgi?id=196845
5
6         Reviewed by Ryosuke Niwa.
7
8         * html/canvas/CanvasRenderingContext2DBase.cpp:
9         (WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
10         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
11         (WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
12         (WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
13         (WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
14         (WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
15         (WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
16         Remove inline specifier to address linking errors (regardless of CMake platform).
17         Doing this in a .cpp file interferes with symbol creation.
18
19         * Modules/mediastream/MediaStreamTrack.cpp:
20         * Modules/webvr/VREyeParameters.cpp:
21         * Modules/webvr/VRFrameData.cpp:
22         * Modules/webvr/VRPose.cpp:
23         * accessibility/AccessibilityList.cpp:
24         * accessibility/isolatedtree/AXIsolatedTree.cpp:
25         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
26         * bindings/js/JSDOMConvertWebGL.cpp:
27         * bindings/js/JSHistoryCustom.cpp:
28         * bindings/js/JSIDBCursorWithValueCustom.cpp:
29         * bindings/js/JSPerformanceObserverCustom.cpp:
30         * bindings/js/WindowProxy.cpp:
31         * platform/ColorData.gperf:
32         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
33         * platform/network/DNSResolveQueue.cpp:
34         * workers/service/ServiceWorkerClientQueryOptions.h:
35         * workers/service/ServiceWorkerContainer.cpp:
36         Add missing includes to address compiler errors on GTK.
37
38 2019-04-12  Zalan Bujtas  <zalan@apple.com>
39
40         REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
41         https://bugs.webkit.org/show_bug.cgi?id=196789
42         <rdar://problem/49855255>
43
44         Reviewed by Tim Horton.
45
46         Disable auto-sizing mode at the start of each test.
47
48         * testing/Internals.cpp:
49         (WebCore::Internals::resetToConsistentState):
50
51 2019-04-12  Eric Carlson  <eric.carlson@apple.com>
52
53         Update AudioSession route sharing policy
54         https://bugs.webkit.org/show_bug.cgi?id=196776
55         <rdar://problem/46501611>
56
57         Reviewed by Jer Noble.
58
59         No new tests, updated an API test.
60
61         * platform/audio/AudioSession.cpp:
62         (WebCore::convertEnumerationToString):
63         * platform/audio/AudioSession.h:
64         (WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
65         (WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
66         * platform/audio/cocoa/MediaSessionManagerCocoa.mm:
67         (MediaSessionManagerCocoa::updateSessionState):
68         * platform/audio/ios/AudioSessionIOS.mm:
69         (WebCore::AudioSession::setCategory):
70         (WebCore::AudioSession::routeSharingPolicy const):
71         * platform/audio/mac/AudioSessionMac.cpp:
72         (WebCore::AudioSession::setCategory):
73
74 2019-04-12  Antoine Quint  <graouts@apple.com>
75
76         Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
77         https://bugs.webkit.org/show_bug.cgi?id=196830
78         <rdar://problem/49124313>
79
80         Reviewed by Wenson Hsieh.
81
82         We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
83         simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
84         document to see if it matches some known websites that require this quirk.
85
86         We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
87         flag to ensure we correctly created touch regions for simulated mouse events.
88
89         * dom/EventNames.h:
90         (WebCore::EventNames::isTouchRelatedEventType const):
91         * dom/Node.cpp:
92         (WebCore::Node::moveNodeToNewDocument):
93         (WebCore::tryAddEventListener):
94         (WebCore::tryRemoveEventListener):
95         (WebCore::Node::defaultEventHandler):
96         * loader/DocumentLoader.h:
97         (WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
98         (WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
99         * page/DOMWindow.cpp:
100         (WebCore::DOMWindow::addEventListener):
101         (WebCore::DOMWindow::removeEventListener):
102         * page/Quirks.cpp:
103         (WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
104         (WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
105         * page/Quirks.h:
106
107 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
108
109         [iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
110         https://bugs.webkit.org/show_bug.cgi?id=196146
111
112         Reviewed by Antti Koivisto.
113         
114         computeCoordinatedPositioningForLayer() failed to handle nested positions elements
115         inside overflow scroll, because it only walked up to the first containing block of
116         a nested position:absolute. We need to walk all the way up the ancestor layer chain,
117         looking at containing block, scroller and composited ancestor relationships.
118
119         Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
120         trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
121         more ancestor traversals, but we now only run this code if there's composited scrolling
122         in the ancestor chain.
123
124         Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
125                scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
126                scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
127                scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
128
129         * rendering/RenderLayerCompositor.cpp:
130         (WebCore::enclosingCompositedScrollingLayer):
131         (WebCore::isScrolledByOverflowScrollLayer):
132         (WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
133         (WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
134         (WebCore::collectStationaryLayerRelatedOverflowNodes):
135         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
136         (WebCore::collectRelatedCoordinatedScrollingNodes):
137         (WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.
138
139 2019-04-12  Manuel Rego Casasnovas  <rego@igalia.com>
140
141         [css-flex][css-grid] Fix synthesized baseline
142         https://bugs.webkit.org/show_bug.cgi?id=196312
143
144         Reviewed by Javier Fernandez.
145
146         When a flex or grid container has no baseline,
147         its baseline should be synthesized from the border edges.
148         The same happens for flex and grid items.
149         
150         Right now we were using the content box in some cases
151         and even using the margin box in a particular scenario.
152         The patch fixes this.
153         
154         At the same time this is also fixing the baseline for
155         inline flex/grid containers to make it interoperable with Firefox.
156         Inline blocks have a special behavior per legacy reasons,
157         which applies to inline flex/grid containers when they have no items;
158         otherwise the items should be used to compute its baseline.
159         See more at: https://github.com/w3c/csswg-drafts/issues/3416
160
161         Note that we need to keep current behavior for buttons,
162         as the flexbox spec doesn't apply to them.
163
164         Tests: css3/flexbox/flexbox-baseline-margins.html
165                fast/css-grid-layout/grid-baseline-margins-1.html
166                fast/css-grid-layout/grid-baseline-margins-2.html
167                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
168                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
169                imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html
170
171         * rendering/RenderButton.cpp:
172         (WebCore::synthesizedBaselineFromContentBox):
173         (WebCore::RenderButton::baselinePosition const):
174         * rendering/RenderButton.h:
175         * rendering/RenderFlexibleBox.cpp:
176         (WebCore::synthesizedBaselineFromBorderBox):
177         (WebCore::RenderFlexibleBox::baselinePosition const):
178         (WebCore::RenderFlexibleBox::firstLineBaseline const):
179         (WebCore::RenderFlexibleBox::inlineBlockBaseline const):
180         * rendering/RenderGrid.cpp:
181         (WebCore::RenderGrid::baselinePosition const):
182         (WebCore::RenderGrid::inlineBlockBaseline const):
183
184 2019-04-11  Simon Fraser  <simon.fraser@apple.com>
185
186         Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
187         https://bugs.webkit.org/show_bug.cgi?id=196848
188
189         Reviewed by Zalan Bujtas.
190
191         Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
192         in the layer tree. We only need to do work related to making positioned scrolling tree nodes
193         for layers which are layer tree descendants of overflow:scroll.
194
195         * rendering/RenderLayer.cpp:
196         (WebCore::RenderLayer::RenderLayer):
197         (WebCore::RenderLayer::updateLayerPositions):
198         (WebCore::outputPaintOrderTreeLegend):
199         (WebCore::outputPaintOrderTreeRecursive):
200         * rendering/RenderLayer.h:
201         * rendering/RenderLayerCompositor.cpp:
202         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
203         (WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
204         (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
205         (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
206         (WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
207
208 2019-04-11  Zalan Bujtas  <zalan@apple.com>
209
210         Try to fix Windows build.
211
212         * page/PrintContext.cpp:
213         (WebCore::PrintContext::computedPageMargin):
214
215 2019-04-11  Megan Gardner  <megan_gardner@apple.com>
216
217         Update 'Save Image' to more clear instructions
218         https://bugs.webkit.org/show_bug.cgi?id=196833
219         <rdar://problem/47446845>
220
221         Reviewed by Wenson Hsieh.
222
223         Not testable, UI change only.
224
225         * en.lproj/Localizable.strings:
226
227 2019-04-11  Zalan Bujtas  <zalan@apple.com>
228
229         Add @page margin support
230         https://bugs.webkit.org/show_bug.cgi?id=196680
231         <rdar://problem/45217707>
232
233         Reviewed by Tim Horton.
234
235         This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
236         We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
237         UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
238         in the WebProcess if needed (see PrintInfo for current printer margins).
239
240         Tests: printing/page-with-10mm-left-margin.html
241                printing/page-with-zero-margin.html
242
243         * page/PrintContext.cpp:
244         (WebCore::PrintContext::computedPageMargin):
245         (WebCore::PrintContext::computedPageSize):
246         * page/PrintContext.h:
247         * page/RuntimeEnabledFeatures.h:
248         (WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
249         (WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):
250
251 2019-04-11  Dean Jackson  <dino@apple.com>
252
253         Extract UTI mapping and allow for additions
254         https://bugs.webkit.org/show_bug.cgi?id=196822
255         <rdar://problem/49822339>
256
257         Reviewed by Tim Horton.
258
259         Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
260         of accepted MIME types. And add a new helper to map
261         MIME types to UTI types when the system was unable to
262         find an existing type.
263
264         * platform/MIMETypeRegistry.cpp:
265         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
266         * platform/network/mac/UTIUtilities.mm:
267         (WebCore::UTIFromUnknownMIMEType):
268         (WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
269
270 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
271
272         [iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
273         https://bugs.webkit.org/show_bug.cgi?id=196670
274
275         Reviewed by Wenson Hsieh.
276
277         The bug was ultimately caused by two reasons:
278          1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
279          2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.
280
281         When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
282         and then previousWordPositionBoundary would identify it as a word boundary.
283
284         Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
285         character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
286         to make SimplifiedBackwardsTextIterator directly testable in layout tests.
287
288         This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
289         In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
290         which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
291         of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
292         the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
293         granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
294         with sentence granularity at the beginning of a line as indicated by the new tests.
295
296         Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
297                editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
298                editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
299                editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
300                editing/text-iterator/backwards-text-iterator-basic.html
301
302         * accessibility/AXObjectCache.cpp:
303         (WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
304         the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
305         an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
306         (WebCore::AXObjectCache::startCharacterOffsetOfSentence):
307         * accessibility/AXObjectCache.h:
308         (WebCore::CharacterOffset::isEqual const):
309         * editing/TextIterator.cpp:
310         (WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
311         lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
312         of a line fails on iOS.
313         (WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
314         * editing/TextIterator.h:
315         * editing/VisibleUnits.cpp:
316         (WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
317         This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
318         Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
319         the current position, and fixed a bug that an early return for the text node was not taking the suffix length
320         into account when deciding whether next position resides in the starting container node or not.
321         (WebCore::startSentenceBoundary):
322         (WebCore::startOfSentence):
323         * testing/Internals.cpp:
324         (WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Added.
325         * testing/Internals.h:
326         * testing/Internals.idl:
327
328 2019-04-11  Wenson Hsieh  <wenson_hsieh@apple.com>
329
330         Allow the MediaSource API to be enabled via website policy
331         https://bugs.webkit.org/show_bug.cgi?id=196429
332         <rdar://problem/48774333>
333
334         Reviewed by Tim Horton.
335
336         Add support in DocumentLoader for adjusting page settings using its per-site policies. See WebKit ChangeLog for
337         more detail (in particular, the implementation of applyToDocumentLoader).
338
339         Test: fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html
340
341         * loader/DocumentLoader.cpp:
342         (WebCore::DocumentLoader::applyPoliciesToSettings const):
343         (WebCore::DocumentLoader::attachToFrame):
344         * loader/DocumentLoader.h:
345
346         Add an enum class for MediaSource policies; while we're at it, make all of these enum values 8 bits wide.
347
348         (WebCore::DocumentLoader::mediaSourcePolicy const):
349         (WebCore::DocumentLoader::setMediaSourcePolicy):
350
351 2019-04-11  Youenn Fablet  <youenn@apple.com>
352
353         Support RTCDataChannel blob binaryType
354         https://bugs.webkit.org/show_bug.cgi?id=196821
355
356         Reviewed by Eric Carlson.
357
358         Add support for receiving blobs.
359         Default value is still left to 'arraybuffer' which is not spec compliant.
360         Covered by rebased test.
361
362         * Modules/mediastream/RTCDataChannel.cpp:
363         (WebCore::RTCDataChannel::setBinaryType):
364         (WebCore::RTCDataChannel::didReceiveRawData):
365
366 2019-04-11  Devin Rousso  <drousso@apple.com>
367
368         Web Inspector: Timelines: can't reliably stop/start a recording
369         https://bugs.webkit.org/show_bug.cgi?id=196778
370         <rdar://problem/47606798>
371
372         Reviewed by Timothy Hatcher.
373
374         * inspector/agents/InspectorTimelineAgent.cpp:
375         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
376         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
377         It is possible to determine when programmatic capturing starts/stops in the frontend based
378         on the state when the backend causes the state to change, such as if the state is "inactive"
379         when the frontend is told that the backend has started capturing.
380
381         * inspector/agents/InspectorCPUProfilerAgent.cpp:
382         (WebCore::InspectorCPUProfilerAgent::stopTracking):
383         * inspector/agents/InspectorMemoryAgent.cpp:
384         (WebCore::InspectorMemoryAgent::stopTracking):
385         Send an end timestamp to match other instruments.
386
387 2019-04-11  Truitt Savell  <tsavell@apple.com>
388
389         Unreviewed, rolling out r244158.
390
391         Casued 8 inspector/timeline/ test failures.
392
393         Reverted changeset:
394
395         "Web Inspector: Timelines: can't reliably stop/start a
396         recording"
397         https://bugs.webkit.org/show_bug.cgi?id=196778
398         https://trac.webkit.org/changeset/244158
399
400 2019-04-11  Pablo Saavedra  <psaavedra@igalia.com>
401
402         [WPE] Build error with ENABLE_VIDEO=OFF after r244078
403         https://bugs.webkit.org/show_bug.cgi?id=196811
404
405         createGenericCue() is only defined when VIDEO_TRACK is enabled.
406
407         Reviewed by Eric Carlson.
408
409         * testing/Internals.cpp:
410         (WebCore::Internals::createGenericCue):
411         * testing/Internals.h:
412
413 2019-04-11  Carlos Garcia Campos  <cgarcia@igalia.com>
414
415         [GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
416         https://bugs.webkit.org/show_bug.cgi?id=146718
417         <rdar://problem/21722487>
418
419         Reviewed by Joanmarie Diggs.
420
421         Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
422         aria-hidden="false".
423
424         Fixes: accessibility/aria-hidden-false-works-in-subtrees.html
425
426         * accessibility/AccessibilityNodeObject.cpp:
427         (WebCore::AccessibilityNodeObject::textUnderElement const):
428         * accessibility/atk/WebKitAccessible.cpp:
429         (roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
430         <div role="roup">test</div>.
431
432 2019-04-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
433
434         requestAnimationFrame should execute before the next frame
435         https://bugs.webkit.org/show_bug.cgi?id=177484
436
437         Reviewed by Simon Fraser.
438
439         This change fixes these issues with animation timing:
440
441         1. Calling the requestAnimationFrame callbacks would have happened when
442            the DisplayLink fires. This may have happened even if the frame is
443            missed and no display is committed.
444
445         2. Style changes and layout triggered by script could trigger painting
446            at more than 60fps. CoreAnimation commits could happen at more than
447            60fps, although WindowServer will throttle those, and only some will
448            be shown on the screen.
449
450         This change introduces a new paint scheduling model where painting is
451         driven by a "RenderingUpdateScheduler", which only triggers paints once
452         per 16.7ms frame.
453
454         Code that previously scheduled a compositing layer flush now schedules a
455         "RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
456         callback. When the render happens, we service requestAnimationFrame callbacks,
457         Web Animations, intersection observations and resize observations per the
458         "Update the rendering" step of the HTML Event Loop specification:
459         <https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
460
461         In the future, more rendering steps will be added to this code.
462
463         * Sources.txt:
464         * WebCore.xcodeproj/project.pbxproj:
465         * accessibility/mac/AXObjectCacheMac.mm:
466         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
467         Fix layout tests by adding null check.
468
469         * animation/DocumentAnimationScheduler.cpp: Removed.
470         * animation/DocumentAnimationScheduler.h: Removed.
471         * animation/DocumentTimeline.cpp:
472         (WebCore::DocumentTimeline::DocumentTimeline):
473         (WebCore::DocumentTimeline::updateThrottlingState):
474         (WebCore::DocumentTimeline::suspendAnimations):
475         (WebCore::DocumentTimeline::resumeAnimations):
476         (WebCore::DocumentTimeline::liveCurrentTime const):
477         (WebCore::DocumentTimeline::currentTime):
478         (WebCore::DocumentTimeline::cacheCurrentTime):
479         (WebCore::DocumentTimeline::animationTimingDidChange):
480         (WebCore::DocumentTimeline::scheduleAnimationResolution):
481         (WebCore::DocumentTimeline::unscheduleAnimationResolution):
482         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
483         (WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
484         (WebCore::DocumentTimeline::scheduleNextTick):
485         (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
486         Simplify this function by handling the case of no-animations separately.
487
488         (WebCore::DocumentTimeline::resolveAnimationsForElement):
489         Simplify the loop and delete hasPendingAcceleratedAnimations because it
490         is initialized to true and is not changed inside the loop.
491
492         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
493         (WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
494         * animation/DocumentTimeline.h:
495         * dom/Document.cpp:
496         (WebCore::Document::resolveStyle):
497         There is no need to force update in resolveStyle(). notifyFlushRequired()
498         will be called eventually which will scheduleRenderingUpdate().
499
500         (WebCore::Document::prepareForDestruction):
501         (WebCore::Document::updateAnimationsAndSendEvents):
502         (WebCore::Document::serviceRequestAnimationFrameCallbacks):
503         (WebCore::Document::windowScreenDidChange):
504         (WebCore::Document::scheduleRenderingUpdate):
505         (WebCore::Document::updateIntersectionObservations):
506         (WebCore::Document::addResizeObserver):
507         (WebCore::Document::updateResizeObservations):
508         (WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
509         (WebCore::Document::scheduleResizeObservations): Deleted.
510         (WebCore::Document::animationScheduler): Deleted.
511         No need to schedule web-animations, intersection observations and resize
512         observations updates separately. All of them will be updated through the
513         "Update the rendering" step, i.e. Page::updateRendering().        
514
515         * dom/Document.h:
516         (WebCore::Document::numberOfIntersectionObservers const):
517         * dom/ScriptedAnimationController.cpp:
518         (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
519         (WebCore::ScriptedAnimationController::scheduleAnimation):
520         (WebCore::ScriptedAnimationController::animationTimerFired):
521         (WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
522         (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
523         * dom/ScriptedAnimationController.h:
524         * page/FrameView.cpp:
525         (WebCore::FrameView::didLayout):
526         (WebCore::FrameView::viewportContentsChanged):
527         * page/FrameViewLayoutContext.cpp:
528         (WebCore::FrameViewLayoutContext::layoutTimerFired):
529         * page/IntersectionObserver.cpp:
530         (WebCore::IntersectionObserver::observe):
531         * page/Page.cpp:
532         (WebCore::Page::Page):
533         (WebCore::Page::layoutIfNeeded):
534         (WebCore::Page::updateRendering):
535         (WebCore::Page::renderingUpdateScheduler):
536         (WebCore::Page::willDisplayPage): Deleted.
537         (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
538         (WebCore::Page::updateIntersectionObservations): Deleted.
539         (WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
540         (WebCore::Page::hasResizeObservers const): Deleted.
541         (WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
542         (WebCore::Page::checkResizeObservations): Deleted.
543         (WebCore::Page::scheduleResizeObservations): Deleted.
544         (WebCore::Page::notifyResizeObservers): Deleted.
545         * page/Page.h:
546         (WebCore::Page::setNeedsCheckResizeObservations): Deleted.
547         (WebCore::Page::needsCheckResizeObservations const): Deleted.
548         The IntersectionObserver and the ResizeObserver do not need to schedule
549         their own timers. The RenderingUpdateScheduler will schedule the "Update
550         the rendering" step in which these obverses will be served.
551
552         * page/PageOverlayController.cpp:
553         (WebCore::PageOverlayController::didChangeViewExposedRect):
554         (WebCore::PageOverlayController::notifyFlushRequired):
555         Force committing the layers to be 60 fps at maximum.
556
557         * page/RenderingUpdateScheduler.cpp: Added.
558         (WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
559         (WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
560         (WebCore::RenderingUpdateScheduler::isScheduled const):
561         (WebCore::RenderingUpdateScheduler::startTimer):
562         (WebCore::RenderingUpdateScheduler::clearScheduled):
563         (WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
564         (WebCore::RenderingUpdateScheduler::windowScreenDidChange):
565         (WebCore::RenderingUpdateScheduler::displayRefreshFired):
566         (WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
567         * page/RenderingUpdateScheduler.h: Added.
568         (WebCore::RenderingUpdateScheduler::create):
569         * page/ResizeObserver.cpp:
570         (WebCore::ResizeObserver::observe):
571         (WebCore::ResizeObserver::scheduleObservations): Deleted.
572         * page/ResizeObserver.h:
573         (WebCore::ResizeObserver::hasActiveObservations const):
574         * page/ios/ContentChangeObserver.h:
575         * page/mac/ServicesOverlayController.mm:
576         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
577         * page/scrolling/ScrollingStateTree.cpp:
578         * rendering/RenderLayerCompositor.cpp:
579         (WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
580         (WebCore::RenderLayerCompositor::layerTreeAsText):
581
582 2019-04-10  Ryosuke Niwa  <rniwa@webkit.org>
583
584         Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
585         https://bugs.webkit.org/show_bug.cgi?id=193027
586
587         Reviewed by Wenson Hsieh.
588
589         Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
590         during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
591         like removing contenteditable content attribute during DOM mutations or when the destination becomes
592         disconnected (orphaned) from the document due to bugs elsewhere in the codebase.
593
594         Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html
595
596         * editing/CompositeEditCommand.cpp:
597         (WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.
598
599 2019-04-10  Devin Rousso  <drousso@apple.com>
600
601         Web Inspector: save sheet should be anchored underneath the tab bar when detached
602         https://bugs.webkit.org/show_bug.cgi?id=196722
603         <rdar://problem/49613280>
604
605         Reviewed by Timothy Hatcher.
606
607         No web observable change.
608
609         * inspector/InspectorFrontendClient.h:
610         (WebCore::InspectorFrontendClient::changeSheetRect): Added.
611
612         * inspector/InspectorFrontendClientLocal.h:
613         * inspector/InspectorFrontendClientLocal.cpp:
614         (WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.
615
616         * inspector/InspectorFrontendHost.idl:
617         * inspector/InspectorFrontendHost.h:
618         * inspector/InspectorFrontendHost.cpp:
619         (WebCore::InspectorFrontendHost::setSheetRect): Added.
620
621         * testing/Internals.cpp:
622         (WebCore::InspectorStubFrontend::setSheetRect): Added.
623
624 2019-04-10  Devin Rousso  <drousso@apple.com>
625
626         Web Inspector: Inspector: lazily create the agent
627         https://bugs.webkit.org/show_bug.cgi?id=195971
628         <rdar://problem/49039645>
629
630         Reviewed by Joseph Pecoraro.
631
632         No change in functionality.
633
634         * inspector/InspectorController.h:
635         * inspector/InspectorController.cpp:
636         (WebCore::InspectorController::InspectorController):
637         (WebCore::InspectorController::createLazyAgents):
638         (WebCore::InspectorController::evaluateForTestInFrontend):
639         (WebCore::InspectorController::ensureInspectorAgent):
640
641 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
642
643         Remove unneeded extern C
644         https://bugs.webkit.org/show_bug.cgi?id=196786
645
646         Reviewed by Tim Horton.
647
648         No tests needed, just needs to compile.
649
650         Removing staging hack for Reveal framework.
651
652         * editing/cocoa/DictionaryLookup.mm:
653
654 2019-04-10  Devin Rousso  <drousso@apple.com>
655
656         Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
657         https://bugs.webkit.org/show_bug.cgi?id=196725
658         <rdar://problem/49669810>
659
660         Reviewed by Timothy Hatcher.
661
662         Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
663         functions so that callers into `InspectorController` can be guaranteed to have a valid
664         instance of the agent.
665
666         This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
667         There is no `DOM.enable` command, so there's no issue there either.
668
669         * inspector/InspectorController.h:
670         (WebCore::InspectorController::pageAgent): Deleted.
671         * inspector/InspectorController.cpp:
672         (WebCore::InspectorController::createLazyAgents):
673         (WebCore::InspectorController::inspect):
674         (WebCore::InspectorController::hideHighlight):
675         (WebCore::InspectorController::ensureDOMAgent): Added.
676         (WebCore::InspectorController::ensurePageAgent): Added.
677
678         * inspector/InspectorFrontendClientLocal.cpp:
679         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
680
681 2019-04-10  Alex Christensen  <achristensen@webkit.org>
682
683         Add SPI WKNavigationResponse._downloadAttribute
684         https://bugs.webkit.org/show_bug.cgi?id=196755
685         <rdar://49587365>
686
687         Reviewed by Brady Eidson.
688
689         Covered by an API test that validates the attribute is correctly sent through the FrameLoader to the API.
690         When a user clicks on a link with a download attribute, the download attribute should be used as the suggested filename sometimes.
691         The application needs this information after it has received the response in order to make fully informed decisions about downloads.
692         In order to get this attribute to the decidePolicyForNavigationResponse, we need to store the attribute on the DocumentLoader
693         from the FrameLoadRequest then send it from the DocumentLoader when the response is received.
694
695         * loader/DocumentLoader.h:
696         (WebCore::DocumentLoader::setDownloadAttribute):
697         (WebCore::DocumentLoader::downloadAttribute const):
698         * loader/EmptyFrameLoaderClient.h:
699         * loader/FrameLoader.cpp:
700         (WebCore::FrameLoader::checkContentPolicy):
701         (WebCore::FrameLoader::loadURL):
702         (WebCore::FrameLoader::loadWithNavigationAction):
703         (WebCore::FrameLoader::loadPostRequest):
704         * loader/FrameLoader.h:
705         (WebCore::FrameLoader::loadWithNavigationAction):
706         * loader/FrameLoaderClient.h:
707
708 2019-04-10  Youenn Fablet  <youenn@apple.com>
709
710         SWClientConnection should not double hop to fire some events
711         https://bugs.webkit.org/show_bug.cgi?id=196735
712
713         Reviewed by Alex Christensen.
714
715         Some events, like postMessage in service workers is hopping from main thread to service worker thread to dispatch events.
716         Some other events, like service worker state update, are hopping from main thread to service worker thread, then posting a task to dispatch events.
717         This may create ordering problems.
718
719         To fix the issue, we now hop to the service worker thread and dispatch the events.
720         In addition, for documents, we post a task and do the whole service worker processing in it.
721         This ensures that some tests, like whether there is a service worker container,
722         or creation of a service worker are done consistently.
723
724         Covered by unflaked test.
725
726         * workers/service/SWClientConnection.cpp:
727         (WebCore::SWClientConnection::updateRegistrationState):
728         (WebCore::SWClientConnection::updateWorkerState):
729         (WebCore::SWClientConnection::fireUpdateFoundEvent):
730         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
731         * workers/service/ServiceWorker.cpp:
732         (WebCore::ServiceWorker::updateState):
733         * workers/service/ServiceWorker.h:
734         * workers/service/ServiceWorkerContainer.cpp:
735         (WebCore::ServiceWorkerContainer::updateRegistrationState):
736         (WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
737         (WebCore::ServiceWorkerContainer::fireControllerChangeEvent):
738         * workers/service/ServiceWorkerContainer.h:
739         * workers/service/ServiceWorkerJob.cpp:
740         (WebCore::ServiceWorkerJob::notifyFinished):
741         Notify of the script URL in the error message.
742         This will help diagnose flakiness issues.
743         * workers/service/ServiceWorkerRegistration.cpp:
744         (WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
745         * workers/service/ServiceWorkerRegistration.h:
746
747 2019-04-10  Devin Rousso  <drousso@apple.com>
748
749         Web Inspector: Timelines: can't reliably stop/start a recording
750         https://bugs.webkit.org/show_bug.cgi?id=196778
751         <rdar://problem/47606798>
752
753         Reviewed by Timothy Hatcher.
754
755         * inspector/agents/InspectorTimelineAgent.cpp:
756         (WebCore::InspectorTimelineAgent::startProgrammaticCapture):
757         (WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
758         It is possible to determine when programmatic capturing starts/stops in the frontend based
759         on the state when the backend causes the state to change, such as if the state is "inactive"
760         when the frontend is told that the backend has started capturing.
761
762         * inspector/agents/InspectorCPUProfilerAgent.cpp:
763         (WebCore::InspectorCPUProfilerAgent::stopTracking):
764         * inspector/agents/InspectorMemoryAgent.cpp:
765         (WebCore::InspectorMemoryAgent::stopTracking):
766         Send an end timestamp to match other instruments.
767
768 2019-04-10  Tim Horton  <timothy_horton@apple.com>
769
770         Add modern API for overriding the page's specified viewport configuration
771         https://bugs.webkit.org/show_bug.cgi?id=167734
772         <rdar://problem/30331795>
773
774         Reviewed by Simon Fraser.
775
776         New API test: WebKit.OverrideViewportArguments
777
778         * dom/Document.cpp:
779         (WebCore::Document::updateViewportArguments):
780         * dom/Document.h:
781         (WebCore::Document::viewportArguments const):
782         Make the viewportArguments() getter respect the overridden arguments.
783
784         * dom/ViewportArguments.cpp:
785         (WebCore::numericPrefix):
786         (WebCore::findSizeValue):
787         (WebCore::findScaleValue):
788         (WebCore::findBooleanValue):
789         (WebCore::parseViewportFitValue):
790         (WebCore::viewportErrorMessage):
791         (WebCore::reportViewportWarning):
792         (WebCore::setViewportFeature):
793         * dom/ViewportArguments.h:
794         Make it possible to parse ViewportArguments without a Document, so
795         that it can be used in the UI process. We only used the Document for
796         two things: error reporting, and getting the state of one setting.
797         Refactor error handling to use a passed-arund function, and add a
798         variant of setViewportFeature() that doesn't take a Document.
799
800 2019-04-10  Justin Fan  <justin_fan@apple.com>
801
802         [Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
803         https://bugs.webkit.org/show_bug.cgi?id=196758
804
805         Reviewed by Dean Jackson.
806
807         Test: webgpu/draw-indexed-triangles.html
808
809         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed to enable indexed drawing.
810         Disable GPUCommandEncoders with active pass encoders from being submitted or encoding blits. 
811
812         Prevent active GPUCommandEncoders from being submitted or encoding blit commands:
813         * Modules/webgpu/WebGPUCommandEncoder.cpp:
814         (WebCore::WebGPUCommandEncoder::finish):
815         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
816         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
817         (WebCore::GPUCommandBuffer::copyBufferToTexture):
818         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
819         (WebCore::GPUCommandBuffer::copyTextureToTexture):
820
821         Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed:
822         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
823         (WebCore::WebGPURenderPassEncoder::setIndexBuffer):
824         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Remove unnecessary move operations.
825         (WebCore::WebGPURenderPassEncoder::drawIndexed): Added.
826         * Modules/webgpu/WebGPURenderPassEncoder.h:
827         * Modules/webgpu/WebGPURenderPassEncoder.idl:
828         * platform/graphics/gpu/GPUBuffer.h:
829         (WebCore::GPUBuffer::isIndex const):
830         * platform/graphics/gpu/GPUInputStateDescriptor.h:
831         * platform/graphics/gpu/GPURenderPassEncoder.h: Cache the index buffer, as Metal does not set the index buffer separate from the draw call.
832         * platform/graphics/gpu/GPURenderPipeline.h:
833         (WebCore::GPURenderPipeline::indexFormat const):
834         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
835         (WebCore::GPURenderPassEncoder::setIndexBuffer):
836         (WebCore::GPURenderPassEncoder::setVertexBuffers):
837         (WebCore::mtlPrimitiveTypeForGPUPrimitiveTopology):
838         (WebCore::GPURenderPassEncoder::draw):
839         (WebCore::mtlIndexTypeForGPUIndexFormat): Added.
840         (WebCore::GPURenderPassEncoder::drawIndexed): Added.
841         (WebCore::primitiveTypeForGPUPrimitiveTopology): Deleted.
842         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
843         (WebCore::GPURenderPipeline::tryCreate):
844         (WebCore::GPURenderPipeline::GPURenderPipeline):
845
846 2019-04-09  Ryosuke Niwa  <rniwa@webkit.org>
847
848         OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
849         https://bugs.webkit.org/show_bug.cgi?id=196759
850
851         Reviewed by Eric Carlson.
852
853         OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
854         But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
855         OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().
856
857         Also removed the debug assertion in offlineRender which always hits when we run the relevant test.
858
859         Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html
860
861         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
862         (WebCore::OfflineAudioDestinationNode::startRendering):
863         (WebCore::OfflineAudioDestinationNode::offlineRender):
864         (WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
865         * Modules/webaudio/OfflineAudioDestinationNode.h:
866
867 2019-04-10  Megan Gardner  <megan_gardner@apple.com>
868
869         Fix text autoscrolling when typing in modern webkit
870         https://bugs.webkit.org/show_bug.cgi?id=196718
871         <rdar://problem/49225507>
872
873         Reviewed by Tim Horton.
874
875         Tests: fast/events/autoscroll-when-input-is-offscreen.html
876                fast/events/autoscroll-with-software-keyboard.html
877
878         We have been relying on UIKit to scroll editable text, but
879         since we cannot give them enough information for them to always
880         do the right thing, we should just do all the work in WebKit.
881         This has the added benifit of fixing some tricky autoscrolling
882         bugs that have cropped up recently.
883
884         * editing/Editor.cpp:
885         (WebCore::Editor::insertTextWithoutSendingTextEvent):
886         (WebCore::Editor::revealSelectionAfterEditingOperation):
887         We should be scrolling the main frame in WebKit. We have been relying on UIKit,
888         but we cannot give them enough information to guarantee a correct scroll, so just
889         do all the work in WebKit.
890         * page/FrameView.cpp:
891         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
892         Update to use the rect that is actually visible, accounting for the software keyboard.
893
894 2019-04-10  Ross Kirsling  <ross.kirsling@sony.com>
895
896         WebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
897         https://bugs.webkit.org/show_bug.cgi?id=196762
898
899         Reviewed by Ryosuke Niwa.
900
901         * Modules/indexeddb/IDBCursor.h:
902         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
903         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
904         * Modules/websockets/WebSocketFrame.cpp:
905         * accessibility/AccessibilityARIAGridRow.cpp:
906         (WebCore::AccessibilityARIAGridRow::parentTable const):
907         * accessibility/AccessibilityObject.cpp:
908         * accessibility/AccessibilityRenderObject.cpp:
909         * animation/CSSAnimation.cpp:
910         * animation/DeclarativeAnimation.cpp:
911         * bindings/js/DOMGCOutputConstraint.h:
912         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
913         (WebCore::root):
914         (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
915         (WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
916         * bindings/js/JSDOMConvertNumbers.cpp:
917         * bindings/js/JSDOMWindowCustom.cpp:
918         * bindings/js/JSExtendableMessageEventCustom.cpp:
919         * bindings/js/SerializedScriptValue.cpp:
920         * css/CSSFontFaceSource.cpp:
921         * css/CSSFontFaceSource.h:
922         * css/MediaQueryMatcher.h:
923         * css/parser/CSSPropertyParserHelpers.cpp:
924         * dom/DocumentParser.cpp:
925         * dom/EventPath.cpp:
926         * dom/MouseEvent.h:
927         * dom/SpectreGadget.cpp:
928         * dom/SpectreGadget.h:
929         * editing/ChangeListTypeCommand.cpp:
930         * editing/EditAction.cpp:
931         * editing/ReplaceSelectionCommand.cpp:
932         * editing/TextGranularity.h:
933         * html/HTMLFormControlsCollection.cpp:
934         * html/HTMLImageElement.cpp:
935         * html/canvas/CanvasRenderingContext2DBase.cpp:
936         * inspector/InspectorController.cpp:
937         * inspector/agents/InspectorApplicationCacheAgent.cpp:
938         * inspector/agents/InspectorCanvasAgent.cpp:
939         * inspector/agents/WebHeapAgent.cpp:
940         * inspector/agents/page/PageAuditAgent.cpp:
941         * inspector/agents/page/PageConsoleAgent.cpp:
942         * inspector/agents/page/PageNetworkAgent.cpp:
943         * inspector/agents/worker/WorkerAuditAgent.cpp:
944         * loader/CrossOriginAccessControl.h:
945         * loader/CrossOriginPreflightResultCache.h:
946         * loader/NavigationAction.cpp:
947         * loader/ResourceLoadObserver.cpp:
948         * page/FrameTree.cpp:
949         * page/IntersectionObserver.cpp:
950         * page/PageConfiguration.cpp:
951         * page/PerformanceResourceTiming.cpp:
952         * page/ResizeObservation.cpp:
953         * page/UndoManager.cpp:
954         * plugins/PluginData.cpp:
955         * rendering/Grid.h:
956         * rendering/GridBaselineAlignment.cpp:
957         * rendering/GridBaselineAlignment.h:
958         * rendering/GridLayoutFunctions.cpp:
959         * rendering/GridLayoutFunctions.h:
960         * rendering/GridTrackSizingAlgorithm.h:
961         * rendering/RenderDeprecatedFlexibleBox.cpp:
962         * rendering/RenderFlexibleBox.cpp:
963         * rendering/RenderIFrame.cpp:
964         * rendering/RenderLayerFilters.cpp:
965         * rendering/TextDecorationPainter.cpp:
966         * rendering/TextDecorationPainter.h:
967         * rendering/TextPainter.cpp:
968         * rendering/TextPainter.h:
969         * rendering/style/StyleRareNonInheritedData.cpp:
970         * rendering/style/StyleRareNonInheritedData.h:
971         * rendering/svg/SVGRenderSupport.h:
972         * rendering/updating/RenderTreeBuilder.cpp:
973         * rendering/updating/RenderTreeBuilderSVG.cpp:
974         * style/InlineTextBoxStyle.cpp:
975         * style/InlineTextBoxStyle.h:
976         * style/StylePendingResources.cpp:
977         * svg/SVGMatrix.h:
978         * svg/SVGViewSpec.h:
979         * svg/SVGZoomAndPan.h:
980         * workers/WorkerScriptLoader.cpp:
981         * workers/WorkerScriptLoader.h:
982         * workers/service/ServiceWorker.cpp:
983         * workers/service/ServiceWorkerClientData.cpp:
984         * workers/service/ServiceWorkerClients.cpp:
985         * workers/service/ServiceWorkerClients.h:
986         * workers/service/ServiceWorkerGlobalScope.cpp:
987         * workers/service/ServiceWorkerJob.cpp:
988         * workers/service/ServiceWorkerProvider.cpp:
989         * workers/service/context/ServiceWorkerFetch.cpp:
990         * workers/service/context/ServiceWorkerInspectorProxy.h:
991         * workers/service/context/ServiceWorkerThread.cpp:
992         * workers/service/context/ServiceWorkerThreadProxy.cpp:
993         * workers/service/server/SWServerJobQueue.cpp:
994         * workers/service/server/SWServerToContextConnection.cpp:
995         * workers/service/server/SWServerWorker.cpp:
996         * workers/service/server/SWServerWorker.h:
997         * worklets/Worklet.h:
998
999 2019-04-10  Antoine Quint  <graouts@apple.com>
1000
1001         Enable Pointer Events on watchOS
1002         https://bugs.webkit.org/show_bug.cgi?id=196771
1003         <rdar://problem/49040909>
1004
1005         Reviewed by Dean Jackson.
1006
1007         * Configurations/FeatureDefines.xcconfig:
1008
1009 2019-04-10  Youenn Fablet  <youenn@apple.com>
1010
1011         Delay initialization of quota users until the first quota request
1012         https://bugs.webkit.org/show_bug.cgi?id=196467
1013
1014         Reviewed by Chris Dumez.
1015
1016         Instead of triggering initialization of each user when being added,
1017         delay initialization until the first call to requestSpace with a non zero task size.
1018         This will make sure we do not load Cache API information in memory or check for
1019         IDB space until actually necessary.
1020
1021         To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
1022         the value is the user initialization state.
1023
1024         When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
1025         can be taken into consideration.
1026
1027         This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
1028         Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.
1029
1030         Covered by existing tests.
1031
1032         * storage/StorageQuotaManager.cpp:
1033         (WebCore::StorageQuotaManager::initializeUsersIfNeeded):
1034         (WebCore::StorageQuotaManager::askUserToInitialize):
1035         (WebCore::StorageQuotaManager::addUser):
1036         (WebCore::StorageQuotaManager::requestSpace):
1037         * storage/StorageQuotaManager.h:
1038
1039 2019-04-10  Philippe Normand  <pnormand@igalia.com>
1040
1041         there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
1042         https://bugs.webkit.org/show_bug.cgi?id=196615
1043
1044         Reviewed by Xabier Rodriguez-Calvar.
1045
1046         Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.
1047
1048         No new tests, existing web-platform-tests cover this change.
1049
1050         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
1051         (WebCore::GStreamerRegistryScanner::initialize):
1052
1053 2019-04-10  Philippe Normand  <pnormand@igalia.com>
1054
1055         [GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
1056         https://bugs.webkit.org/show_bug.cgi?id=196765
1057
1058         Reviewed by Xabier Rodriguez-Calvar.
1059
1060         Without the following patch in gst-plugins-bad, the uridownloader
1061         doesn't relay need-context messages to its parent, so in our case
1062         the player can't share its context with secondary webkitwebsrc
1063         elements and a RELEASE_ASSERT is hit in the WebProcess.
1064
1065         So the workaround is to use again webkit+ protocol prefixes for
1066         GStreamer versions older than 1.12.
1067
1068         https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733
1069
1070         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1071         (WebCore::convertToInternalProtocol):
1072         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
1073         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
1074         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1075         (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
1076         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1077         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1078         (webKitWebSrcStart):
1079         (webKitWebSrcGetProtocols):
1080         (convertPlaybinURI):
1081         (webKitWebSrcSetUri):
1082         (CachedResourceStreamingClient::responseReceived):
1083         (webKitSrcWouldTaintOrigin):
1084         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
1085
1086 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1087
1088         [ATK] Defer the emision of AtkObject::children-changed signal after layout is done
1089         https://bugs.webkit.org/show_bug.cgi?id=187948
1090
1091         Reviewed by Michael Catanzaro.
1092
1093         The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
1094         AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
1095         of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
1096         most of them update the backing store at the beginning.
1097
1098         Fixes: accessibility/children-changed-sends-notification.html
1099
1100         * accessibility/AXObjectCache.cpp:
1101         (WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
1102         * accessibility/AXObjectCache.h:
1103         * accessibility/atk/AXObjectCacheAtk.cpp:
1104         (WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
1105         (WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
1106         (WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
1107         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
1108         in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
1109         * accessibility/ios/AXObjectCacheIOS.mm:
1110         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
1111         * accessibility/mac/AXObjectCacheMac.mm:
1112         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
1113         * accessibility/win/AXObjectCacheWin.cpp:
1114         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
1115         * accessibility/wpe/AXObjectCacheWPE.cpp:
1116         (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
1117
1118 2019-04-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1119
1120         [ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
1121         https://bugs.webkit.org/show_bug.cgi?id=172281
1122         <rdar://problem/37030990>
1123
1124         Reviewed by Joanmarie Diggs.
1125
1126         The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
1127         first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
1128         things differently, we don't include the static text elements individually, but parent element uses
1129         textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
1130
1131         Fixes: accessibility/insert-children-assert.html
1132
1133         * accessibility/AccessibilityRenderObject.cpp:
1134         (WebCore::AccessibilityRenderObject::textUnderElement const):
1135
1136 2019-04-09  Keith Rollin  <krollin@apple.com>
1137
1138         Unreviewed build maintenance -- update .xcfilelists.
1139
1140         * DerivedSources-input.xcfilelist:
1141         * DerivedSources-output.xcfilelist:
1142
1143 2019-04-09  Zalan Bujtas  <zalan@apple.com>
1144
1145         [AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
1146         https://bugs.webkit.org/show_bug.cgi?id=196743
1147         <rdar://problem/43897551>
1148
1149         Reviewed by Tim Horton.
1150
1151         This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
1152         Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
1153         and triggers scrolling the same way the non-auto-sizing mode does.
1154
1155         * page/FrameView.cpp:
1156         (WebCore::FrameView::autoSizeIfEnabled):
1157         (WebCore::FrameView::enableAutoSizeMode):
1158         * page/FrameView.h:
1159         * testing/Internals.cpp:
1160         (WebCore::Internals::enableAutoSizeMode):
1161         * testing/Internals.h:
1162         * testing/Internals.idl:
1163
1164 2019-04-09  Youenn Fablet  <youenn@apple.com>
1165
1166         Close service worker database on network process suspension
1167         https://bugs.webkit.org/show_bug.cgi?id=196623
1168         <rdar://problem/48930869>
1169
1170         Reviewed by Alex Christensen.
1171
1172         Add suspend/resume support to SWServer.
1173         On suspend, close the service worker database and stop pushing for changes.
1174         On resume, push changes if needed.
1175
1176         * workers/service/server/RegistrationDatabase.cpp:
1177         (WebCore::RegistrationDatabase::close):
1178         * workers/service/server/RegistrationDatabase.h:
1179         (WebCore::RegistrationDatabase::isClosed const): Deleted.
1180         * workers/service/server/RegistrationStore.cpp:
1181         (WebCore::RegistrationStore::closeDatabase):
1182         * workers/service/server/RegistrationStore.cpp:
1183         (WebCore::RegistrationStore::pushChangesToDatabase):
1184         (WebCore::RegistrationStore::clearAll):
1185         (WebCore::RegistrationStore::startSuspension):
1186         (WebCore::RegistrationStore::endSuspension):
1187         * workers/service/server/RegistrationStore.h:
1188         * workers/service/server/SWServer.cpp:
1189         (WebCore::SWServer::startSuspension):
1190         (WebCore::SWServer::endSuspension):
1191         * workers/service/server/SWServer.h:
1192
1193 2019-04-09  Justin Fan  <justin_fan@apple.com>
1194
1195         [Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
1196         https://bugs.webkit.org/show_bug.cgi?id=196719
1197
1198         Reviewed by Myles C. Maxfield.
1199
1200         Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.
1201
1202         Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html
1203
1204         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
1205         (WebCore::WebGPURenderPassEncoder::setBlendColor):
1206         (WebCore::WebGPURenderPassEncoder::setViewport):
1207         (WebCore::WebGPURenderPassEncoder::setScissorRect):
1208         * Modules/webgpu/WebGPURenderPassEncoder.h:
1209         * Modules/webgpu/WebGPURenderPassEncoder.idl:
1210         * platform/graphics/gpu/GPURenderPassEncoder.h:
1211         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1212         (WebCore::GPURenderPassEncoder::setBlendColor):
1213         (WebCore::GPURenderPassEncoder::setViewport):
1214         (WebCore::GPURenderPassEncoder::setScissorRect):
1215
1216 2019-04-09  Andy Estes  <aestes@apple.com>
1217
1218         [Apple Pay] Add release logging to PaymentCoordinator
1219         https://bugs.webkit.org/show_bug.cgi?id=196738
1220
1221         Reviewed by Alex Christensen.
1222
1223         When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.
1224
1225         The following information might be logged: names of functions called, merchant API versions,
1226         boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
1227         completePaymentSession() was called with a final state result, boolean results of
1228         shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
1229         user scripts, and whether a client supports unrestricted Apple Pay.
1230
1231         * Modules/applepay/PaymentCoordinator.cpp:
1232         (WebCore::PaymentCoordinator::supportsVersion const):
1233         (WebCore::PaymentCoordinator::canMakePayments):
1234         (WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
1235         (WebCore::PaymentCoordinator::openPaymentSetup):
1236         (WebCore::PaymentCoordinator::beginPaymentSession):
1237         (WebCore::PaymentCoordinator::completeMerchantValidation):
1238         (WebCore::PaymentCoordinator::completeShippingMethodSelection):
1239         (WebCore::PaymentCoordinator::completeShippingContactSelection):
1240         (WebCore::PaymentCoordinator::completePaymentMethodSelection):
1241         (WebCore::PaymentCoordinator::completePaymentSession):
1242         (WebCore::PaymentCoordinator::abortPaymentSession):
1243         (WebCore::PaymentCoordinator::cancelPaymentSession):
1244         (WebCore::PaymentCoordinator::validateMerchant):
1245         (WebCore::PaymentCoordinator::didAuthorizePayment):
1246         (WebCore::PaymentCoordinator::didSelectPaymentMethod):
1247         (WebCore::PaymentCoordinator::didSelectShippingMethod):
1248         (WebCore::PaymentCoordinator::didSelectShippingContact):
1249         (WebCore::PaymentCoordinator::didCancelPaymentSession):
1250         (WebCore::PaymentCoordinator::shouldAllowApplePay const):
1251         (WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
1252         * Modules/applepay/PaymentCoordinatorClient.h:
1253         (WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
1254         * platform/Logging.h:
1255         * testing/MockPaymentCoordinator.h:
1256
1257 2019-04-09  John Wilander  <wilander@apple.com>
1258
1259         Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
1260         https://bugs.webkit.org/show_bug.cgi?id=196558
1261         <rdar://problem/47650245>
1262
1263         Reviewed by Youenn Fablet.
1264
1265         Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
1266                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
1267                http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html
1268
1269         The existing API tests were expanded too.
1270
1271         * html/HTMLAnchorElement.cpp:
1272         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1273            Enhanced the use of AdClickAttribution::MaxEntropy.
1274         * loader/AdClickAttribution.cpp:
1275         (WebCore::AdClickAttribution::parseConversionRequest):
1276             New function to parse and validate URLs with a path starting with
1277             /.well-known/ad-click-attribution/.
1278         (WebCore::AdClickAttribution::toString const):
1279             Added output for the conversion priority for testing purposes.
1280         * loader/AdClickAttribution.h:
1281         (WebCore::AdClickAttribution::Campaign::isValid const):
1282         (WebCore::AdClickAttribution::Conversion::isValid const):
1283            Enhanced the use of AdClickAttribution::MaxEntropy.
1284
1285 2019-04-09  Don Olmstead  <don.olmstead@sony.com>
1286
1287         [CMake] Apple builds should use ICU_INCLUDE_DIRS
1288         https://bugs.webkit.org/show_bug.cgi?id=196720
1289
1290         Reviewed by Konstantin Tokarev.
1291
1292         * PlatformMac.cmake:
1293
1294 2019-04-09  Jer Noble  <jer.noble@apple.com>
1295
1296         Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
1297         https://bugs.webkit.org/show_bug.cgi?id=196097
1298
1299         Reviewed by Eric Carlson.
1300
1301         Test: media/track/track-in-band-metadata-display-order.html
1302
1303         Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
1304         by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
1305         TextTrackCueGeneric for testing.
1306
1307         Drive-by fixes:
1308
1309         Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
1310         parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
1311         a HTMLMediaElement*
1312
1313         TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
1314         enable use of is<> and downcast<>.
1315
1316         * Source/WebCore/CMakeLists.txt:
1317         * DerivedSources-input.xcfilelist:
1318         * DerivedSources-output.xcfilelist:
1319         * DerivedSources.make:
1320         * WebCore.xcodeproj/project.pbxproj:
1321         * Sources.txt:
1322         * html/shadow/MediaControlElementTypes.cpp:
1323         (WebCore::parentMediaElement):
1324         * html/shadow/MediaControlElementTypes.h:
1325         * html/shadow/MediaControlElements.cpp:
1326         (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
1327         (WebCore::MediaControlTextTrackContainerElement::logger const):
1328         (WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
1329         (WebCore::MediaControlTextTrackContainerElement::logChannel const):
1330         * html/shadow/MediaControlElements.h:
1331         * html/track/DataCue.h:
1332         (isType):
1333         * html/track/TextTrackCueGeneric.h:
1334         (isType):
1335         * html/track/TextTrackCueGeneric.idl: Added.
1336         * html/track/VTTCue.h:
1337         (isType):
1338         * testing/Internals.cpp:
1339         (WebCore::Internals::createGenericCue):
1340         * testing/Internals.h:
1341         * testing/Internals.idl:
1342
1343 2019-04-09  Sihui Liu  <sihui_liu@apple.com>
1344
1345         Remove unnecessary network process assertion for IDB close
1346         https://bugs.webkit.org/show_bug.cgi?id=196693
1347
1348         Reviewed by Geoffrey Garen.
1349
1350         We already took assertion at WebCore::SQLiteDatabase::close.
1351
1352         * Modules/indexeddb/server/IDBServer.cpp:
1353         (WebCore::IDBServer::IDBServer::create):
1354         (WebCore::IDBServer::IDBServer::IDBServer):
1355         (WebCore::IDBServer::m_quotaManagerGetter): Deleted.
1356         (WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
1357         (WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
1358         * Modules/indexeddb/server/IDBServer.h:
1359         (WebCore::IDBServer::IDBServer::create): Deleted.
1360         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1361         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1362         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
1363         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
1364         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1365         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
1366         (WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
1367         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1368
1369 2019-04-09  Eike Rathke  <erack@redhat.com>
1370
1371         Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
1372         https://bugs.webkit.org/show_bug.cgi?id=196350
1373
1374         Reviewed by Xabier Rodriguez-Calvar.
1375
1376         trackTypeAsString was uninitialized in the
1377         TrackPrivateBaseGStreamer::TrackType::Text case when calling
1378         GST_INFO_OBJECT().
1379
1380         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1381         (WebCore::MediaPlayerPrivateGStreamer::enableTrack):
1382
1383 2019-04-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1384
1385         [ATK] Cleanup WebKitAccessibleHyperlink
1386         https://bugs.webkit.org/show_bug.cgi?id=196602
1387
1388         Reviewed by Michael Catanzaro.
1389
1390         Cleanups:
1391
1392          - Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
1393            the object data here.
1394          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
1395            struct are no longer leaked.
1396          - Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
1397          - Use nullptr instead of 0 and other coding style issues.
1398
1399         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1400         (webkitAccessibleHyperlinkActionDoAction):
1401         (webkitAccessibleHyperlinkActionGetNActions):
1402         (webkitAccessibleHyperlinkActionGetDescription):
1403         (webkitAccessibleHyperlinkActionGetKeybinding):
1404         (webkitAccessibleHyperlinkActionGetName):
1405         (atk_action_interface_init):
1406         (webkitAccessibleHyperlinkGetURI):
1407         (webkitAccessibleHyperlinkGetObject):
1408         (rangeLengthForObject):
1409         (webkitAccessibleHyperlinkGetStartIndex):
1410         (webkitAccessibleHyperlinkGetEndIndex):
1411         (webkitAccessibleHyperlinkIsValid):
1412         (webkitAccessibleHyperlinkGetNAnchors):
1413         (webkitAccessibleHyperlinkIsSelectedLink):
1414         (webkitAccessibleHyperlinkGetProperty):
1415         (webkitAccessibleHyperlinkSetProperty):
1416         (webkit_accessible_hyperlink_class_init):
1417         (webkitAccessibleHyperlinkGetOrCreate):
1418         (core): Deleted.
1419         (atkActionInterfaceInit): Deleted.
1420         (getRangeLengthForObject): Deleted.
1421         (webkitAccessibleHyperlinkFinalize): Deleted.
1422         (webkitAccessibleHyperlinkClassInit): Deleted.
1423         (webkitAccessibleHyperlinkInit): Deleted.
1424         (webkitAccessibleHyperlinkGetType): Deleted.
1425         (webkitAccessibleHyperlinkNew): Deleted.
1426         (webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
1427         * accessibility/atk/WebKitAccessibleHyperlink.h:
1428         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
1429         (webkitAccessibleHyperlinkImplGetHyperlink):
1430         (webkitAccessibleHyperlinkImplInterfaceInit):
1431
1432 2019-04-08  Simon Fraser  <simon.fraser@apple.com>
1433
1434         Remove some iOS #ifdefs around sticky-related code
1435         https://bugs.webkit.org/show_bug.cgi?id=196726
1436
1437         Reviewed by Zalan Bujtas.
1438
1439         Now that async overflow scrolling can be enabled on macOS, RenderLayerCompositor::isAsyncScrollableStickyLayer()
1440         should not have iOS-only code.
1441
1442         The answer to the FIXME in RenderLayerCompositor::computeStickyViewportConstraints is obvious: composited
1443         overflow:scroll can be the container for sticky. The assertion can be removed.
1444
1445         * rendering/RenderLayer.cpp: Fix spacing in some logging.
1446         (WebCore::outputPaintOrderTreeRecursive):
1447         * rendering/RenderLayerCompositor.cpp:
1448         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
1449         (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
1450
1451 2019-04-08  Don Olmstead  <don.olmstead@sony.com>
1452
1453         [CMake][WinCairo] Separate copied headers into different directories
1454         https://bugs.webkit.org/show_bug.cgi?id=196655
1455
1456         Reviewed by Michael Catanzaro.
1457
1458         * CMakeLists.txt:
1459         * PlatformWin.cmake:
1460
1461 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
1462
1463         AX: Automatically compute accessibility labels for Apple Pay buttons
1464         https://bugs.webkit.org/show_bug.cgi?id=196661
1465
1466         Reviewed by Joanmarie Diggs.
1467
1468         Detect Apple Pay buttons and return a standard role and label for them based on their type.
1469
1470         Test: accessibility/mac/apple-pay-labels.html
1471               accessibility/mac/apple-pay-session-v4.html
1472
1473         * accessibility/AccessibilityNodeObject.cpp:
1474         (WebCore::AccessibilityNodeObject::isControl const):
1475         * accessibility/AccessibilityNodeObject.h:
1476         * accessibility/AccessibilityRenderObject.cpp:
1477         (WebCore::AccessibilityRenderObject::applePayButtonDescription const):
1478         (WebCore::AccessibilityRenderObject::titleElementText const):
1479         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1480         (WebCore::AccessibilityRenderObject::isApplePayButton const):
1481         (WebCore::AccessibilityRenderObject::applePayButtonType const):
1482         * accessibility/AccessibilityRenderObject.h:
1483         * en.lproj/Localizable.strings:
1484         * platform/LocalizedStrings.cpp:
1485         (WebCore::AXApplePayPlainLabel):
1486         (WebCore::AXApplePayBuyLabel):
1487         (WebCore::AXApplePaySetupLabel):
1488         (WebCore::AXApplePayDonateLabel):
1489         (WebCore::AXApplePayCheckOutLabel):
1490         (WebCore::AXApplePayBookLabel):
1491         (WebCore::AXApplePaySubscribeLabel):
1492         * platform/LocalizedStrings.h:
1493
1494 2019-04-08  Chris Fleizach  <cfleizach@apple.com>
1495
1496         AX: Support API: accessibilityReplaceRange:withText
1497         https://bugs.webkit.org/show_bug.cgi?id=196636
1498
1499         Reviewed by Daniel Bates.
1500
1501         Support this platform API on mac to provide a way to replace a range of editable text.
1502
1503         Test: accessibility/mac/replace-text-with-range.html
1504
1505         * accessibility/AccessibilityObject.cpp:
1506         (WebCore::AccessibilityObject::replaceTextInRange):
1507         * accessibility/AccessibilityObject.h:
1508         * accessibility/mac/AccessibilityObjectBase.mm:
1509         (WebCore::PlainTextRange::PlainTextRange):
1510         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1511         (-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
1512
1513 2019-04-08  Wenson Hsieh  <wenson_hsieh@apple.com>
1514
1515         [iOS] Do not allow starting selection drags when selection views are not visible
1516         https://bugs.webkit.org/show_bug.cgi?id=196686
1517         <rdar://problem/49399192>
1518
1519         Reviewed by Tim Horton.
1520
1521         See WebKit ChangeLog for more details.
1522
1523         Tests:  DragAndDropTests.CanDragImageWhenNotFirstResponder
1524                 DragAndDropTests.DoNotPerformSelectionDragWhenNotFirstResponder
1525
1526         * page/DragController.cpp:
1527         (WebCore::DragController::draggableElement const):
1528
1529         Make this respect the case where m_dragSourceAction does not include DragSourceActionSelection. All the other
1530         drag source types are currently consulted in this method, with the exception of DragSourceActionSelection.
1531
1532 2019-04-08  Youenn Fablet  <youenn@apple.com>
1533
1534         Add a test to check for the service worker process name
1535         https://bugs.webkit.org/show_bug.cgi?id=196621
1536
1537         Reviewed by Chris Dumez.
1538
1539         Add a service worker internal API to get process name.
1540         Covered by updated test.
1541
1542         * WebCore.xcodeproj/project.pbxproj:
1543         * testing/ServiceWorkerInternals.cpp:
1544         (WebCore::ServiceWorkerInternals::processName const):
1545         * testing/ServiceWorkerInternals.h:
1546         * testing/ServiceWorkerInternals.idl:
1547         * testing/ServiceWorkerInternals.mm: Added.
1548
1549 2019-04-08  Yusuke Suzuki  <ysuzuki@apple.com>
1550
1551         Unreviewed, speculative fix for build failure in old macOS after r243887
1552         https://bugs.webkit.org/show_bug.cgi?id=196475
1553
1554         * dom/NodeList.h:
1555
1556 2019-04-08  Justin Fan  <justin_fan@apple.com>
1557
1558         [Web GPU] Fix Web GPU experimental feature on iOS
1559         https://bugs.webkit.org/show_bug.cgi?id=196632
1560
1561         Reviewed by Myles C. Maxfield.
1562
1563         Add feature conditionals for iOS 11.
1564         Properly make Web GPU available on iOS 11+.
1565
1566         * Configurations/FeatureDefines.xcconfig:
1567         * Configurations/WebKitTargetConditionals.xcconfig:
1568
1569 2019-04-08  Timothy Hatcher  <timothy@apple.com>
1570
1571         Unreviewed build fix for iOSMac after r243893.
1572         https://bugs.webkit.org/show_bug.cgi?id=196707
1573
1574         * dom/Element.cpp:
1575         (WebCore::parentCrossingFrameBoundaries): Remove ENABLE(POINTER_EVENTS) since computedTouchActions()
1576         no longer uses parentCrossingFrameBoundaries().
1577
1578 2019-04-08  Youenn Fablet  <youenn@apple.com>
1579
1580         Lazily construct Navigator serviceWorker
1581         https://bugs.webkit.org/show_bug.cgi?id=196692
1582
1583         Reviewed by Chris Dumez.
1584
1585         Make NavigatorBase a ContextDestructionObserver.
1586         This allows to get the navigator script execution context.
1587         Use it when creating the navigator ServiceWorkerContainer object.
1588         For GC, introduce serviceWorkerIfAny which returns the container if created.
1589         No JS observable change of behavior.
1590         Covered by existing tests.
1591
1592         * bindings/js/JSNavigatorCustom.cpp:
1593         (WebCore::JSNavigator::visitAdditionalChildren):
1594         * bindings/js/JSWorkerNavigatorCustom.cpp:
1595         (WebCore::JSWorkerNavigator::visitAdditionalChildren):
1596         * page/NavigatorBase.cpp:
1597         (WebCore::NavigatorBase::NavigatorBase):
1598         (WebCore::NavigatorBase::serviceWorkerIfAny):
1599         (WebCore::NavigatorBase::serviceWorker):
1600         * page/NavigatorBase.h:
1601
1602 2019-04-08  Antti Koivisto  <antti@apple.com>
1603
1604         Update touch-action region on property changes
1605         https://bugs.webkit.org/show_bug.cgi?id=196608
1606
1607         Reviewed by Simon Fraser.
1608
1609         Test: pointerevents/ios/touch-action-region-dynamic.html
1610
1611         * rendering/EventRegion.cpp:
1612         (WebCore::EventRegion::touchActionsForPoint const):
1613
1614         Correctly return 'auto' when nothing is found from the regions (this code is not used yet).
1615
1616         * rendering/RenderElement.cpp:
1617         (WebCore::RenderElement::styleWillChange):
1618
1619         React to 'touch-action' property changes, similarly to 'pointer-events'.
1620
1621         * rendering/RenderLayer.cpp:
1622         (WebCore::RenderLayer::invalidateEventRegion):
1623
1624         Test if need to invalidate.
1625
1626         * rendering/RenderLayerBacking.cpp:
1627         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
1628         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1629
1630         Call invalidateEventRegion explicitly instead of relying on compositing update. This ensures
1631         that we update the top level event region correctly when we have touch-actions.
1632
1633 2019-04-08  Javier Fernandez  <jfernandez@igalia.com>
1634
1635         Implement white-space:break-spaces value
1636         https://bugs.webkit.org/show_bug.cgi?id=177327
1637
1638         Reviewed by Myles Maxfield and Zalan Bujtas.
1639
1640         Finally the CSS WG decided [1] to move back the 'break-spaces' value to
1641         the 'white-space' property. This makes the parsing logic easier than
1642         the previous approach of using the 'overflow-wrap' property.
1643
1644         This new value prevents the white-space sequence to collapse and gives
1645         breaking opportunities after every preserved white-space.
1646
1647         https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces
1648
1649         Additionally, unlike 'pre-wrap', non-collapsible spaces or tabs at the
1650         end of a line cannot be hung or visually collapsed, since we want them
1651         to be preserved and broken.
1652
1653         [1] https://github.com/w3c/csswg-drafts/pull/2841
1654
1655         Tests: imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-008.html
1656                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-003.html
1657                imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-009.html
1658
1659         * css/CSSPrimitiveValueMappings.h:
1660         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping for CSSVaueBreakSpaces.
1661         (WebCore::CSSPrimitiveValue::operator WhiteSpace const): New value BreakSpaces for the Whitespace enum.
1662         * css/CSSProperties.json: new 'break-spaces' value for the 'white-space' property.
1663         * css/CSSValueKeywords.in: new break-spaces keyword
1664         * css/parser/CSSParserFastPaths.cpp:
1665         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1666         * rendering/SimpleLineLayout.cpp:  The SimpleLineLayut codepath must handle properly the new behavior of preserved whitespaces.
1667         (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace const): Require that m_trailingWhitespaceWidth being greater than zero.
1668         (WebCore::SimpleLineLayout::LineState::hasWhitespaceFragments const): New function to detect former whitespae fragments that could be breaking opportunities.
1669         (WebCore::SimpleLineLayout::removeTrailingWhitespace): The 'break-spaces' feature forbids to remove any trailing whitespace.
1670         (WebCore::SimpleLineLayout::firstFragment): We have now leading whitespace sequences comming from the previous line.
1671         (WebCore::SimpleLineLayout::createLineRuns): We should revert some breaking opportunities if others were formerly found in the line.
1672         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1673         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): New style fields to determine whether the break-space feature is being used. Also split out the break-all and breal-all values.
1674         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1675         * rendering/line/BreakingContext.h: Different codepath but similar changes to properly handle the new behavior of preserved whitespace.
1676         (WebCore::BreakingContext::BreakingContext): New class field to determine whether there are some whitespace that may prevent the word ot be broken.
1677         (WebCore::BreakingContext::handleText): New line-breaking logic to implement the break-spaces behavior.
1678         (WebCore::BreakingContext::trailingSpacesHang): Cases where the preserved breakspaces should hand or overflow.
1679         * rendering/style/RenderStyle.h:
1680         (WebCore::RenderStyle::collapseWhiteSpace): With break-spaces collapsing whitespaces is not allowed.
1681         (WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Add the WhiteSpace::BreakSpaces to this group.
1682         * rendering/style/RenderStyleConstants.h: A new constan added.
1683
1684 2019-04-08  Youenn Fablet  <youenn@apple.com>
1685
1686         LibWebRTCMediaEndpoint does not need to hop to the signaling thread to gather stats
1687         https://bugs.webkit.org/show_bug.cgi?id=196697
1688         <rdar://problem/47477113>
1689
1690         Reviewed by Eric Carlson.
1691
1692         It is not thread safe to use m_backend in another thread than the main thread.
1693         It is not useful anymore to hop to the signaling thread to gather stats.
1694         No change of behavior.
1695
1696         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1697         (WebCore::LibWebRTCMediaEndpoint::getStats):
1698         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
1699
1700 2019-04-08  Antoine Quint  <graouts@apple.com>
1701
1702         [ Mac WK2 iOS Debug ] REGRESSION(r233667) Layout Test imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html is a flaky failure
1703         https://bugs.webkit.org/show_bug.cgi?id=195233
1704         <rdar://problem/48527231>
1705
1706         Reviewed by Dean Jackson.
1707
1708         We need to create the "main" document timeline (document.timeline) if it doesn't already exist and use its current time as a basis for any other DocumentTimeline instance.
1709
1710         * animation/DocumentTimeline.cpp:
1711         (WebCore::DocumentTimeline::currentTime):
1712
1713 2019-04-08  Antoine Quint  <graouts@apple.com>
1714
1715         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
1716         https://bugs.webkit.org/show_bug.cgi?id=196118
1717         <rdar://problem/46614137>
1718
1719         Reviewed by Chris Dumez.
1720
1721         Test: webanimations/js-wrapper-kept-alive.html
1722
1723         We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
1724         We also need to ensure that the new implementation of hasPendingActivity() does not interfere with the ability of pages to enter the page
1725         cache when running animations.
1726
1727         * animation/WebAnimation.cpp:
1728         (WebCore::WebAnimation::canSuspendForDocumentSuspension const):
1729         (WebCore::WebAnimation::stop):
1730         (WebCore::WebAnimation::hasPendingActivity const):
1731         * animation/WebAnimation.h:
1732
1733 2019-04-08  Eric Liang  <ericliang@apple.com>
1734
1735         AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
1736         https://bugs.webkit.org/show_bug.cgi?id=156774
1737
1738         Reviewed by Chris Fleizach.
1739
1740         Labelled SVGs without accessible descendants are exposed as AXImage rather than groups.
1741
1742         Unlabelled equivalents are not exposed. Otherwise, SVGs with accessible descendants are exposed as AXGroup. 
1743         Also added back functionalities from last patch of determining whether a SVG element should be ignored.
1744         
1745         Test: accessibility/svg-shape-labelled.html
1746
1747         * accessibility/AccessibilityRenderObject.cpp:
1748         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
1749         * accessibility/AccessibilitySVGElement.cpp:
1750         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
1751
1752 2019-04-08  Youenn Fablet  <youenn@apple.com>
1753
1754         Make sure UniqueIDBDatabaseConnection unregisters itself even if its database is gone
1755         https://bugs.webkit.org/show_bug.cgi?id=196651
1756
1757         Reviewed by Brady Eidson.
1758
1759         In UniqueIDBDatabase methods, many operations are refing the transaction
1760         so that it stays alive until a quota check decision is made.
1761         This extends the lifetime of the transaction which may be lasting
1762         longer than its database that may be cleared without waiting for the quota check decisions.
1763
1764         We therefore need to make sure that the transaction is cleaning itself correctly at destruction time.
1765
1766         Make sure that the transaction is unregistering itself from its IDBServer.
1767         To do so, the transaction keeps a weak ref to the IDBServer.
1768
1769         This is timing sensitive hence difficult to test.
1770
1771         * Modules/indexeddb/server/IDBServer.h:
1772         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1773         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1774         Like done below for UniqueIDBDatabaseConnection::didCommitTransaction,
1775         add a check to ensure that either the database is we are in an error case.
1776         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
1777         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
1778         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
1779         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
1780
1781 2019-04-08  Christopher Reid  <chris.reid@sony.com>
1782
1783         Undefined Behavior: m_experimentalImageMenuEnabled isn't initialized in HTMLImageElement when SERVICE_CONTROLS is disabled
1784         https://bugs.webkit.org/show_bug.cgi?id=196664
1785
1786         Reviewed by Ross Kirsling.
1787
1788         No observable change in behavior.
1789
1790         Initialize m_experimentalImageMenuEnabled regardless of ENABLE(SERVICE_CONTROLS)
1791
1792         * html/HTMLImageElement.cpp:
1793
1794 2019-04-08  Ryan Haddad  <ryanhaddad@apple.com>
1795
1796         Unreviewed, rolling out r243943.
1797
1798         Caused test262 failures.
1799
1800         Reverted changeset:
1801
1802         "[JSC] Filter DontEnum properties in
1803         ProxyObject::getOwnPropertyNames()"
1804         https://bugs.webkit.org/show_bug.cgi?id=176810
1805         https://trac.webkit.org/changeset/243943
1806
1807 2019-04-05  Sergio Villar Senin  <svillar@igalia.com>
1808
1809         [GTK][WPE] outlook.live.com displays old-fashioned UI
1810         https://bugs.webkit.org/show_bug.cgi?id=196642
1811
1812         Reviewed by Carlos Garcia Campos.
1813
1814         The new good looking UI is shown as long as pretend we're a Mac in the UA.
1815
1816         * platform/UserAgentQuirks.cpp:
1817         (WebCore::urlRequiresChromeBrowser):
1818
1819 2019-04-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1820
1821         [ATK] Cleanup accessible wrapper base class
1822         https://bugs.webkit.org/show_bug.cgi?id=196601
1823
1824         Reviewed by Mario Sanchez Prada.
1825
1826         Cleanups:
1827
1828          - Rename WebKitAccessibleWrapperAtk cpp and header as WebKitAccessible for consistency with the class name.
1829          - Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
1830            struct are no longer leaked.
1831          - Move core object pointer to the private struct.
1832          - Remove confusing core() function and simply get the core object from the private struct.
1833          - Use nullptr instead of 0 and other coding style issues.
1834          - Rename cacheAndReturnAtkProperty as webkitAccessibleCacheAndReturnAtkProperty and use WebKitAccessible as
1835            instance parameter.
1836          - Make webkitAccessibleGetAccessibilityObject() return a reference, since we use a fallback object on detach it
1837            never returns nullptr.
1838          - Move objectFocusedAndCaretOffsetUnignored() to WebKitAccessibleUtil.
1839
1840         * SourcesGTK.txt:
1841         * accessibility/atk/AXObjectCacheAtk.cpp:
1842         * accessibility/atk/WebKitAccessible.cpp: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp.
1843         (webkitAccessibleGetName):
1844         (webkitAccessibleGetDescription):
1845         (setAtkRelationSetFromCoreObject):
1846         (isRootObject):
1847         (webkitAccessibleGetParent):
1848         (webkitAccessibleGetNChildren):
1849         (webkitAccessibleRefChild):
1850         (webkitAccessibleGetIndexInParent):
1851         (webkitAccessibleGetAttributes):
1852         (atkRole):
1853         (webkitAccessibleGetRole):
1854         (webkitAccessibleRefStateSet):
1855         (webkitAccessibleRefRelationSet):
1856         (webkitAccessibleInit):
1857         (webkitAccessibleGetObjectLocale):
1858         (webkit_accessible_class_init):
1859         (interfaceMaskFromObject):
1860         (uniqueAccessibilityTypeName):
1861         (accessibilityTypeFromObject):
1862         (webkitAccessibleNew):
1863         (webkitAccessibleGetAccessibilityObject):
1864         (webkitAccessibleDetach):
1865         (webkitAccessibleIsDetached):
1866         (webkitAccessibleCacheAndReturnAtkProperty):
1867         * accessibility/atk/WebKitAccessible.h: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.h.
1868         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1869         (core):
1870         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
1871         (core):
1872         (webkitAccessibleActionGetKeybinding):
1873         (webkitAccessibleActionGetName):
1874         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
1875         (core):
1876         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
1877         (core):
1878         (documentAttributeValue):
1879         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
1880         (core):
1881         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
1882         (core):
1883         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
1884         (core):
1885         (webkitAccessibleImageGetImageDescription):
1886         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
1887         (core):
1888         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1889         (core):
1890         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
1891         (core):
1892         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1893         (core):
1894         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
1895         (core):
1896         * accessibility/atk/WebKitAccessibleUtil.cpp:
1897         (objectFocusedAndCaretOffsetUnignored):
1898         * accessibility/atk/WebKitAccessibleUtil.h:
1899         * editing/atk/FrameSelectionAtk.cpp:
1900
1901 2019-04-06  Antti Koivisto  <antti@apple.com>
1902
1903         Combine event and touch action regions into a single class
1904         https://bugs.webkit.org/show_bug.cgi?id=196644
1905         <rdar://problem/49643614>
1906
1907         Reviewed by Darin Adler.
1908
1909         This patch replaces the existing TouchActionRegion class with the more general EventRegion class.
1910         It collects both the overall event region and the touch action regions. This avoids duplication
1911         and simplifies the code.
1912
1913         The patch also adds serialization support for EventRegion, so touch-action regions gets passed
1914         to the UI process too.
1915
1916         * Sources.txt:
1917         * WebCore.xcodeproj/project.pbxproj:
1918         * platform/graphics/GraphicsLayer.cpp:
1919         (WebCore::GraphicsLayer::setEventRegion):
1920         (WebCore::GraphicsLayer::dumpProperties const):
1921         (WebCore::GraphicsLayer::setTouchActionRegion): Deleted.
1922         * platform/graphics/GraphicsLayer.h:
1923         (WebCore::GraphicsLayer::eventRegion const):
1924         (WebCore::GraphicsLayer::touchActionRegion const): Deleted.
1925         * platform/graphics/Region.cpp:
1926         (WebCore::operator<<):
1927         * platform/graphics/ca/GraphicsLayerCA.cpp:
1928         (WebCore::GraphicsLayerCA::setEventRegion):
1929         (WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted.
1930         * platform/graphics/ca/GraphicsLayerCA.h:
1931         * platform/graphics/ca/PlatformCALayer.h:
1932         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1933         * rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp.
1934         (WebCore::EventRegion::operator== const):
1935         (WebCore::EventRegion::unite):
1936         (WebCore::EventRegion::translate):
1937         (WebCore::EventRegion::uniteTouchActions):
1938         (WebCore::EventRegion::touchActionsForPoint const):
1939         (WebCore::operator<<):
1940         (WebCore::TouchActionRegion::unite): Deleted.
1941         (WebCore::TouchActionRegion::actionsForPoint const): Deleted.
1942         (WebCore::TouchActionRegion::translate): Deleted.
1943         * rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h.
1944         (WebCore::EventRegion::isEmpty const):
1945         (WebCore::EventRegion::contains const):
1946         (WebCore::EventRegion::hasTouchActions const):
1947         (WebCore::EventRegion::encode const):
1948         (WebCore::EventRegion::decode):
1949         (WebCore::TouchActionRegion::isEmpty const): Deleted.
1950         (WebCore::TouchActionRegion::operator== const): Deleted.
1951         * rendering/InlineTextBox.cpp:
1952         (WebCore::InlineTextBox::paint):
1953         * rendering/PaintInfo.h:
1954         * rendering/RenderBlock.cpp:
1955         (WebCore::RenderBlock::paintObject):
1956         * rendering/RenderLayer.cpp:
1957         (WebCore::RenderLayer::collectEventRegionForFragments):
1958         * rendering/RenderLayer.h:
1959         * rendering/RenderLayerBacking.cpp:
1960         (WebCore::RenderLayerBacking::updateEventRegion):
1961         * rendering/RenderLayerModelObject.cpp:
1962         * rendering/SimpleLineLayoutFunctions.cpp:
1963         (WebCore::SimpleLineLayout::paintFlow):
1964         * rendering/TouchActionRegion.cpp: Removed.
1965         * rendering/TouchActionRegion.h: Removed.
1966
1967 2019-04-05  Yongjun Zhang  <yongjun_zhang@apple.com>
1968
1969         We should pass minimumEffectiveDeviceWidth to web process on new page creation.
1970         https://bugs.webkit.org/show_bug.cgi?id=196077
1971         <rdar://problem/49108202>
1972
1973         Reviewed by Chris Dumez.
1974
1975         If the page doesn't specify it requires to use the device width in viewport tag, we should try to scale down
1976         the page to fit the window width.
1977
1978         Test: fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html
1979
1980         * page/ViewportConfiguration.cpp:
1981         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Also update the minimum layout size
1982             when the default configuration is changed.
1983         (WebCore::ViewportConfiguration::nativeWebpageParametersWithShrinkToFit): Make sure we fit the content
1984             to window width.
1985
1986 2019-04-05  Jer Noble  <jer.noble@apple.com>
1987
1988         [Cocoa] Deactivate the audio session before the WebProcess suspends.
1989         https://bugs.webkit.org/show_bug.cgi?id=196658
1990
1991         Reviewed by Eric Carlson.
1992
1993         Test: platform/mac/media/audio-session-deactivated-when-suspended.html
1994
1995         Deactivate the audio session when we are notified that the session will suspend.
1996
1997         Drive-by fix: don't try to begin playback when the process is suspended.
1998
1999         * platform/audio/PlatformMediaSessionManager.cpp:
2000         (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2001         (WebCore::PlatformMediaSessionManager::processWillSuspend):
2002         (WebCore::PlatformMediaSessionManager::processDidResume):
2003         * platform/audio/PlatformMediaSessionManager.h:
2004         (WebCore::PlatformMediaSessionManager::processIsSuspended const):
2005         * testing/InternalSettings.cpp:
2006         (WebCore::InternalSettings::Backup::Backup):
2007         (WebCore::InternalSettings::Backup::restoreTo):
2008         (WebCore::InternalSettings::setShouldDeactivateAudioSession):
2009         * testing/InternalSettings.h:
2010         * testing/InternalSettings.idl:
2011         * testing/Internals.cpp:
2012         (WebCore::Internals::processWillSuspend):
2013         (WebCore::Internals::processDidResume):
2014         * testing/Internals.h:
2015         * testing/Internals.idl:
2016
2017 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
2018
2019         [iOS] Web process gets suspended while holding locked database files
2020         https://bugs.webkit.org/show_bug.cgi?id=196519
2021         <rdar://problem/49531797>
2022
2023         Reviewed by Chris Dumez.
2024
2025         Don't use DatabaseTracker singleton before it is initialized.
2026
2027         * Modules/webdatabase/DatabaseTracker.cpp:
2028         (WebCore::DatabaseTracker::isInitialized):
2029         * Modules/webdatabase/DatabaseTracker.h:
2030
2031 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
2032
2033         Make WeakPtr<Element> possible and deploy it in form associated elements code
2034         https://bugs.webkit.org/show_bug.cgi?id=196626
2035
2036         Reviewed by Antti Koivisto.
2037
2038         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
2039
2040         No new tests sine there should be no behavioral change.
2041
2042         * dom/Element.h:
2043         * html/FormAssociatedElement.cpp:
2044         (WebCore::FormAssociatedElement::FormAssociatedElement):
2045         (WebCore::FormAssociatedElement::insertedIntoAncestor):
2046         (WebCore::FormAssociatedElement::setForm):
2047         (WebCore::FormAssociatedElement::resetFormOwner):
2048         (WebCore::FormAssociatedElement::formAttributeChanged):
2049         * html/FormAssociatedElement.h:
2050         (WebCore::FormAssociatedElement::form const):
2051         * html/HTMLElement.cpp:
2052         (WebCore::HTMLElement::asFormNamedItem):
2053         (WebCore::HTMLElement::asFormAssociatedElement):
2054         * html/HTMLElement.h:
2055         (WebCore::HTMLElement::asFormNamedItem): Deleted.
2056         * html/HTMLFormControlElement.h:
2057         * html/HTMLFormControlsCollection.cpp:
2058         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
2059         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
2060         * html/HTMLFormControlsCollection.h:
2061         * html/HTMLFormElement.cpp:
2062         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
2063         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
2064         (WebCore::HTMLFormElement::registerImgElement):
2065         (WebCore::HTMLFormElement::defaultButton const):
2066         (WebCore::HTMLFormElement::resetDefaultButton):
2067         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
2068         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
2069         * html/HTMLFormElement.h:
2070         * html/HTMLImageElement.cpp:
2071         (WebCore::HTMLImageElement::HTMLImageElement):
2072         (WebCore::HTMLImageElement::insertedIntoAncestor):
2073         * html/HTMLImageElement.h:
2074         * html/HTMLInputElement.h:
2075         * html/HTMLMediaElement.h:
2076         * html/HTMLObjectElement.h:
2077         * html/HTMLPictureElement.h:
2078         * html/HTMLSlotElement.h:
2079         * svg/SVGElement.h:
2080
2081 2019-04-05  Caitlin Potter  <caitp@igalia.com>
2082
2083         [JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
2084         https://bugs.webkit.org/show_bug.cgi?id=176810
2085
2086         Reviewed by Saam Barati.
2087
2088         Previously, there was a comment here indicating uncertainty of whether it
2089         was necessary to filter DontEnum properties explicitly or not. It turns
2090         out that it was necessary in the case of JSC ProxyObjects.
2091
2092         This patch adds DontEnum filtering for ProxyObjects, however we continue
2093         to explicitly filter them in JSDOMConvertRecord, which needs to use the
2094         property descriptor after filtering. This change prevents observably
2095         fetching the property descriptor twice per property.
2096
2097         * bindings/js/JSDOMConvertRecord.h:
2098
2099 2019-04-05  Michael Catanzaro  <mcatanzaro@igalia.com>
2100
2101         Unreviewed manual rollout of r243929
2102         https://bugs.webkit.org/show_bug.cgi?id=196626
2103
2104         * dom/Element.h:
2105         * html/FormAssociatedElement.cpp:
2106         (WebCore::FormAssociatedElement::FormAssociatedElement):
2107         (WebCore::FormAssociatedElement::insertedIntoAncestor):
2108         (WebCore::FormAssociatedElement::setForm):
2109         (WebCore::FormAssociatedElement::resetFormOwner):
2110         (WebCore::FormAssociatedElement::formAttributeChanged):
2111         * html/FormAssociatedElement.h:
2112         (WebCore::FormAssociatedElement::form const):
2113         * html/HTMLElement.cpp:
2114         (WebCore::HTMLElement::asFormNamedItem): Deleted.
2115         (WebCore::HTMLElement::asFormAssociatedElement): Deleted.
2116         * html/HTMLElement.h:
2117         (WebCore::HTMLElement::asFormNamedItem):
2118         * html/HTMLFormControlElement.h:
2119         * html/HTMLFormControlsCollection.cpp:
2120         (WebCore:: const):
2121         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
2122         * html/HTMLFormControlsCollection.h:
2123         * html/HTMLFormElement.cpp:
2124         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
2125         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
2126         (WebCore::HTMLFormElement::registerImgElement):
2127         (WebCore::HTMLFormElement::defaultButton const):
2128         (WebCore::HTMLFormElement::resetDefaultButton):
2129         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
2130         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
2131         * html/HTMLFormElement.h:
2132         * html/HTMLImageElement.cpp:
2133         (WebCore::HTMLImageElement::HTMLImageElement):
2134         (WebCore::HTMLImageElement::insertedIntoAncestor):
2135         * html/HTMLImageElement.h:
2136         * html/HTMLInputElement.h:
2137         * html/HTMLMediaElement.h:
2138         * html/HTMLObjectElement.h:
2139         * html/HTMLPictureElement.h:
2140         * html/HTMLSlotElement.h:
2141         * svg/SVGElement.h:
2142
2143 2019-04-05  Sihui Liu  <sihui_liu@apple.com>
2144
2145         [iOS] Web process gets suspended while holding locked database files
2146         https://bugs.webkit.org/show_bug.cgi?id=196519
2147         <rdar://problem/49531797>
2148
2149         Reviewed by Chris Dumez.
2150
2151         We should close all databases and make sure not open new databases when web process is ready to suspend.
2152
2153         * platform/sql/SQLiteDatabase.cpp:
2154         (WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
2155         (WebCore::SQLiteDatabase::open):
2156         * platform/sql/SQLiteDatabase.h:
2157         * platform/sql/SQLiteDatabaseTracker.cpp:
2158         (WebCore::SQLiteDatabaseTracker::setClient):
2159         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
2160         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
2161         (WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
2162
2163 2019-04-05  Commit Queue  <commit-queue@webkit.org>
2164
2165         Unreviewed, rolling out r243833.
2166         https://bugs.webkit.org/show_bug.cgi?id=196645
2167
2168         This change breaks build of WPE and GTK ports (Requested by
2169         annulen on #webkit).
2170
2171         Reverted changeset:
2172
2173         "[CMake][WTF] Mirror XCode header directories"
2174         https://bugs.webkit.org/show_bug.cgi?id=191662
2175         https://trac.webkit.org/changeset/243833
2176
2177 2019-04-05  David Kilzer  <ddkilzer@apple.com>
2178
2179         REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
2180
2181         Caused by:
2182             [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
2183             https://bugs.webkit.org/show_bug.cgi?id=196475
2184
2185         * css/CSSComputedStyleDeclaration.h:
2186         * dom/DOMRectReadOnly.h:
2187         * dom/LiveNodeList.h:
2188         * dom/NodeIterator.h:
2189         * dom/TreeWalker.h:
2190         * fileapi/Blob.h:
2191         * fileapi/File.h:
2192         * fileapi/FileList.h:
2193         * html/CachedHTMLCollection.h:
2194         * html/HTMLFormElement.h:
2195         * html/HTMLNameCollection.h:
2196         * html/canvas/GPUBasedCanvasRenderingContext.h:
2197         * page/RemoteDOMWindow.h:
2198
2199 2019-04-05  Ryosuke Niwa  <rniwa@webkit.org>
2200
2201         Make WeakPtr<Element> possible and deploy it in form associated elements code
2202         https://bugs.webkit.org/show_bug.cgi?id=196626
2203
2204         Reviewed by Antti Koivisto.
2205
2206         Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
2207
2208         No new tests sine there should be no behavioral change.
2209
2210         * dom/Element.h:
2211         * html/FormAssociatedElement.cpp:
2212         (WebCore::FormAssociatedElement::FormAssociatedElement):
2213         (WebCore::FormAssociatedElement::insertedIntoAncestor):
2214         (WebCore::FormAssociatedElement::setForm):
2215         (WebCore::FormAssociatedElement::resetFormOwner):
2216         (WebCore::FormAssociatedElement::formAttributeChanged):
2217         * html/FormAssociatedElement.h:
2218         (WebCore::FormAssociatedElement::form const):
2219         * html/HTMLElement.cpp:
2220         (WebCore::HTMLElement::asFormNamedItem):
2221         (WebCore::HTMLElement::asFormAssociatedElement):
2222         * html/HTMLElement.h:
2223         (WebCore::HTMLElement::asFormNamedItem): Deleted.
2224         * html/HTMLFormControlElement.h:
2225         * html/HTMLFormControlsCollection.cpp:
2226         (WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
2227         (WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
2228         * html/HTMLFormControlsCollection.h:
2229         * html/HTMLFormElement.cpp:
2230         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
2231         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
2232         (WebCore::HTMLFormElement::registerImgElement):
2233         (WebCore::HTMLFormElement::defaultButton const):
2234         (WebCore::HTMLFormElement::resetDefaultButton):
2235         (WebCore::HTMLFormElement::matchesValidPseudoClass const):
2236         (WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
2237         * html/HTMLFormElement.h:
2238         * html/HTMLImageElement.cpp:
2239         (WebCore::HTMLImageElement::HTMLImageElement):
2240         (WebCore::HTMLImageElement::insertedIntoAncestor):
2241         * html/HTMLImageElement.h:
2242         * html/HTMLInputElement.h:
2243         * html/HTMLMediaElement.h:
2244         * html/HTMLObjectElement.h:
2245         * html/HTMLPictureElement.h:
2246         * html/HTMLSlotElement.h:
2247         * svg/SVGElement.h:
2248
2249 2019-04-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2250
2251         [ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
2252         https://bugs.webkit.org/show_bug.cgi?id=196593
2253         <rdar://problem/49599153>
2254
2255         Reviewed by Michael Catanzaro.
2256
2257         We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
2258         WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
2259         WebKitAccessible instances. This requires a few casts to AtkObject.
2260
2261         * accessibility/AccessibilityObject.h:
2262         (WebCore::AccessibilityObject::setWrapper):
2263         * accessibility/AccessibilityObjectInterface.h:
2264         * accessibility/atk/AXObjectCacheAtk.cpp:
2265         (WebCore::AXObjectCache::detachWrapper):
2266         (WebCore::AXObjectCache::attachWrapper):
2267         (WebCore::notifyChildrenSelectionChange):
2268         (WebCore::AXObjectCache::postPlatformNotification):
2269         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2270         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
2271         (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
2272         * accessibility/atk/AccessibilityObjectAtk.cpp:
2273         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
2274         (webkitAccessibleComponentRefAccessibleAtPoint):
2275         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
2276         (webkitAccessibleHypertextGetLink):
2277         (webkitAccessibleHypertextGetNLinks):
2278         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
2279         (webkitAccessibleSelectionRefSelection):
2280         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2281         (webkitAccessibleTableRefAt):
2282         (webkitAccessibleTableGetColumnHeader):
2283         (webkitAccessibleTableGetRowHeader):
2284         (webkitAccessibleTableGetCaption):
2285         * accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
2286         (convertToGPtrArray):
2287         (webkitAccessibleTableCellGetTable):
2288         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2289         (accessibilityObjectLength):
2290         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2291         (setAtkRelationSetFromCoreObject):
2292         (atkParentOfRootObject):
2293         (webkitAccessibleGetParent):
2294         (webkitAccessibleRefChild):
2295         (isTextWithCaret):
2296         * editing/atk/FrameSelectionAtk.cpp:
2297         (WebCore::emitTextSelectionChange):
2298         (WebCore::maybeEmitTextFocusChange):
2299
2300 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
2301
2302         [iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
2303         https://bugs.webkit.org/show_bug.cgi?id=195584
2304
2305         Reviewed by Zalan Bujtas.
2306
2307         Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
2308         RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
2309         just as we do for frames.
2310
2311         AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
2312
2313         Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
2314         ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
2315         callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
2316         ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
2317
2318         Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
2319         the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
2320         already been put in the right locations, but the UI process needs to know that a scroll happened).
2321         However, we need to prevent notifications from programmatic scrolls getting back to the
2322         web process, because this causes jumpiness. This is done via an early return in
2323         RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
2324
2325         Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
2326                scrollingcoordinator/ios/programmatic-page-scroll.html
2327
2328         * page/scrolling/AsyncScrollingCoordinator.cpp:
2329         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2330         * page/scrolling/AsyncScrollingCoordinator.h:
2331         * page/scrolling/ScrollingCoordinator.h:
2332         (WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
2333         * page/scrolling/ScrollingTree.cpp:
2334         (WebCore::ScrollingTree::commitTreeState):
2335         (WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
2336         * page/scrolling/ScrollingTree.h:
2337         (WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
2338         (WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
2339         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2340         (WebCore::ScrollingTreeScrollingNode::scrollBy):
2341         (WebCore::ScrollingTreeScrollingNode::scrollTo):
2342         * page/scrolling/ScrollingTreeScrollingNode.h:
2343         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2344         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
2345         * rendering/RenderLayer.cpp:
2346         (WebCore::RenderLayer::scrollToOffset):
2347         (WebCore::RenderLayer::scrollingNodeID const):
2348         * rendering/RenderLayer.h:
2349         * rendering/RenderMarquee.cpp:
2350         (WebCore::RenderMarquee::timerFired):
2351
2352 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
2353
2354         Unreviewed, speculative fix for build failure
2355         https://bugs.webkit.org/show_bug.cgi?id=196475
2356
2357         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
2358
2359 2019-04-04  Ryosuke Niwa  <rniwa@webkit.org>
2360
2361         Element::isFocusable() debug asserts too frequently
2362         https://bugs.webkit.org/show_bug.cgi?id=196634
2363
2364         Reviewed by Geoffrey Garen.
2365
2366         Remove the debug assertion for now.
2367
2368         * dom/Element.cpp:
2369         (WebCore::Element::isFocusable const):
2370
2371 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
2372
2373         Have ScrollableArea store a ScrollType for the current scroll
2374         https://bugs.webkit.org/show_bug.cgi?id=196627
2375
2376         Reviewed by Zalan Bujtas.
2377
2378         RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
2379         so just have ScrollableArea store a ScrollType.
2380
2381         RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
2382         it onto the base class.
2383
2384         AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
2385         incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.
2386
2387         No behavior change.
2388
2389         * page/FrameView.cpp:
2390         (WebCore::FrameView::setFrameRect):
2391         (WebCore::FrameView::topContentInsetDidChange):
2392         (WebCore::FrameView::updateLayoutViewport):
2393         (WebCore::FrameView::setScrollPosition):
2394         (WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
2395         (WebCore::FrameView::setWasScrolledByUser):
2396         * page/FrameViewLayoutContext.cpp:
2397         (WebCore::LayoutScope::LayoutScope):
2398         (WebCore::LayoutScope::~LayoutScope):
2399         * page/ios/FrameIOS.mm:
2400         (WebCore::Frame::overflowScrollPositionChangedForNode):
2401         * page/scrolling/AsyncScrollingCoordinator.cpp:
2402         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2403         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2404         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2405         * platform/ScrollView.cpp:
2406         (WebCore::ScrollView::setScrollPosition):
2407         * platform/ScrollableArea.cpp:
2408         (WebCore::ScrollableArea::ScrollableArea):
2409         * platform/ScrollableArea.h:
2410         (WebCore::ScrollableArea::currentScrollType const):
2411         (WebCore::ScrollableArea::setCurrentScrollType):
2412         (WebCore::ScrollableArea::setIsUserScroll): Deleted.
2413         (WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
2414         (WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
2415         * rendering/RenderLayer.cpp:
2416         (WebCore::RenderLayer::RenderLayer):
2417         (WebCore::RenderLayer::scrollToXPosition):
2418         (WebCore::RenderLayer::scrollToYPosition):
2419         (WebCore::RenderLayer::scrollToOffset):
2420         (WebCore::RenderLayer::scrollTo):
2421         * rendering/RenderLayer.h:
2422         * rendering/RenderLayerBacking.cpp:
2423         (WebCore::RenderLayerBacking::updateScrollOffset):
2424         * rendering/RenderMarquee.cpp:
2425         (WebCore::RenderMarquee::start):
2426
2427 2019-04-04  Shawn Roberts  <sroberts@apple.com>
2428
2429         Unreviewed, rolling out r243868.
2430
2431         Causing timeouts failures on several queues
2432
2433         Reverted changeset:
2434
2435         "[Web Animations] JS wrapper may be deleted while animation is
2436         yet to dispatch its finish event"
2437         https://bugs.webkit.org/show_bug.cgi?id=196118
2438         https://trac.webkit.org/changeset/243868
2439
2440 2019-04-04  Youenn Fablet  <youenn@apple.com>
2441
2442         Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
2443         https://bugs.webkit.org/show_bug.cgi?id=196543
2444
2445         Reviewed by Alex Christensen.
2446
2447         Add a default routine to compute a third party quota from a per origin quota.
2448         No change of behavior.
2449
2450         * storage/StorageQuotaManager.h:
2451         (WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
2452         (WebCore::StorageQuotaManager::defaultThirdPartyQuota):
2453
2454 2019-04-04  Commit Queue  <commit-queue@webkit.org>
2455
2456         Unreviewed, rolling out r243807 and r243824.
2457         https://bugs.webkit.org/show_bug.cgi?id=196611
2458
2459         Test added is a flaky timeout on iOS Simulator, 3 tests
2460         unskipped are flaky failures (Requested by ShawnRoberts on
2461         #webkit).
2462
2463         Reverted changesets:
2464
2465         "Blob type cannot be stored correctly in IDB when
2466         IDBObjectStore has autoIncrement and keyPath options"
2467         https://bugs.webkit.org/show_bug.cgi?id=196128
2468         https://trac.webkit.org/changeset/243807
2469
2470         "Follow up fix for r243807: Use MarkedArgumentBuffer instead
2471         of Vector for JSValue"
2472         https://bugs.webkit.org/show_bug.cgi?id=196547
2473         https://trac.webkit.org/changeset/243824
2474
2475 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
2476
2477         Fix rare crash under collectRelatedCoordinatedScrollingNodes()
2478         https://bugs.webkit.org/show_bug.cgi?id=196610
2479         rdar://problem/49595426
2480
2481         Reviewed by Zalan Bujtas.
2482
2483         hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
2484         to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
2485         needs to check whether there's backing.
2486
2487         * rendering/RenderLayerCompositor.cpp:
2488         (WebCore::collectRelatedCoordinatedScrollingNodes):
2489
2490 2019-04-04  Simon Fraser  <simon.fraser@apple.com>
2491
2492         Move "inProgrammaticScroll" down to ScrollableArea
2493         https://bugs.webkit.org/show_bug.cgi?id=196614
2494
2495         Reviewed by Zalan Bujtas.
2496
2497         A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
2498         inProgrammaticScroll() down to ScrollableArea.
2499
2500         ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
2501         to reduce confusion. It might be possible to remove this in future with some refactoring.
2502
2503         Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
2504
2505         * dom/Element.cpp:
2506         (WebCore::Element::setScrollLeft):
2507         (WebCore::Element::setScrollTop):
2508         * page/EventHandler.cpp:
2509         (WebCore::EventHandler::completeWidgetWheelEvent):
2510         (WebCore::EventHandler::handleWheelEvent):
2511         * page/FrameView.cpp:
2512         (WebCore::FrameView::setFrameRect):
2513         (WebCore::FrameView::topContentInsetDidChange):
2514         (WebCore::FrameView::updateLayoutViewport):
2515         (WebCore::FrameView::setScrollPosition):
2516         (WebCore::FrameView::setWasScrolledByUser):
2517         * page/FrameView.h:
2518         * platform/ScrollView.h:
2519         (WebCore::ScrollView::inProgrammaticScroll const): Deleted.
2520         * platform/ScrollableArea.cpp:
2521         (WebCore::ScrollableArea::ScrollableArea):
2522         * platform/ScrollableArea.h:
2523         (WebCore::ScrollableArea::inProgrammaticScroll const):
2524         (WebCore::ScrollableArea::setInProgrammaticScroll):
2525         (WebCore::ScrollableArea::scrollShouldClearLatchedState const):
2526         (WebCore::ScrollableArea::setScrollShouldClearLatchedState):
2527         (WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
2528         (WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
2529
2530 2019-04-04  Sihui Liu  <sihui_liu@apple.com>
2531
2532         Leak of UniqueIDBDatabase in network process running layout tests
2533         https://bugs.webkit.org/show_bug.cgi?id=196565
2534         <rdar://problem/49346139>
2535
2536         Reviewed by Geoffrey Garen.
2537
2538         UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
2539         is possible that the web process to network process connection closes before servers gets the 
2540         confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a 
2541         conenctionClosedFromClient.
2542
2543         No new test because this bug is caused by race between network receiving conenctionClosedFromClient and 
2544         receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak 
2545         option.
2546
2547         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2548         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
2549         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2550
2551 2019-04-04  Chris Dumez  <cdumez@apple.com>
2552
2553         Unreviewed, fix iOS build with recent SDKs.
2554
2555         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2556         (WebCore::GameControllerGamepad::GameControllerGamepad):
2557
2558 2019-04-04  Eric Carlson  <eric.carlson@apple.com>
2559
2560         [MediaStream] Host should be able to mute screen capture and camera/microphone independently
2561         https://bugs.webkit.org/show_bug.cgi?id=196555
2562         <rdar://problem/47303865>
2563
2564         Reviewed by Youenn Fablet.
2565
2566         Test: fast/mediastream/media-stream-page-muted.html
2567
2568         * Modules/mediastream/MediaStream.cpp:
2569         (WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted 
2570         state to tracks.
2571         (WebCore::MediaStream::startProducingData): Ditto.
2572         (WebCore::MediaStream::setCaptureTracksMuted): New.
2573         * Modules/mediastream/MediaStream.h:
2574
2575         * Modules/mediastream/MediaStreamTrack.cpp:
2576         (WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
2577         (WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
2578         (WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
2579         (WebCore::MediaStreamTrack::mediaState const): Update for new page state.
2580         * Modules/mediastream/MediaStreamTrack.h:
2581
2582         * page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.
2583
2584         * page/Page.h:
2585         (WebCore::Page::isMediaCaptureMuted const): Update for state changes.
2586
2587         * platform/mediastream/MediaStreamPrivate.cpp:
2588         (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
2589         (WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
2590         * platform/mediastream/MediaStreamPrivate.h:
2591
2592         * platform/mediastream/RealtimeMediaSource.cpp:
2593         (WebCore::RealtimeMediaSource::setMuted): Log state.
2594         (WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
2595         next runloop so events aren't dispatched synchronously.
2596
2597         * testing/Internals.cpp:
2598         (WebCore::Internals::setPageMuted): Add new state.
2599
2600 2019-04-04  Chris Dumez  <cdumez@apple.com>
2601
2602         Unreviewed, update r243884 to use macros in Compiler.h instead.
2603
2604         * platform/ios/LegacyTileGrid.mm:
2605         (WebCore::LegacyTileGrid::dropDistantTiles):
2606
2607 2019-04-04  Chris Fleizach  <cfleizach@apple.com>
2608
2609         AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
2610         https://bugs.webkit.org/show_bug.cgi?id=196600
2611         <rdar://problem/49572996>
2612
2613         Reviewed by Joanmarie Diggs.
2614
2615         Audit AX code to not dereference renderer before checking if it's null.
2616         Not clear how to reproduce at this time.
2617
2618         * accessibility/AccessibilityRenderObject.cpp:
2619         (WebCore::webAreaIsPresentational):
2620         (WebCore::AccessibilityRenderObject::layoutCount const):
2621         (WebCore::AccessibilityRenderObject::widget const):
2622
2623 2019-04-04  Antti Koivisto  <antti@apple.com>
2624
2625         Compute accurate regions for touch-action
2626         https://bugs.webkit.org/show_bug.cgi?id=196536
2627         <rdar://problem/49516022>
2628
2629         Reviewed by Simon Fraser.
2630
2631         Tests: pointerevents/ios/touch-action-region-basic.html
2632                pointerevents/ios/touch-action-region-layers.html
2633                pointerevents/ios/touch-action-region-pan-x-y.html
2634
2635         - Use style system to compute effective touch-action without additional tree walks.
2636         - Compute touch-action region in a fake paint, at the same time with the event region.
2637
2638         This patch doesn't yet use the computed region for anything except test output.
2639
2640         * Sources.txt:
2641         * WebCore.xcodeproj/project.pbxproj:
2642         * css/StyleResolver.cpp:
2643         (WebCore::computeEffectiveTouchActions):
2644         (WebCore::StyleResolver::adjustRenderStyle):
2645
2646         Update RenderStyle::effectiveTouchAction.
2647
2648         * dom/Element.cpp:
2649         (WebCore::Element::computedTouchActions const):
2650
2651         Just get it from the style.
2652
2653         * platform/graphics/GraphicsLayer.cpp:
2654         (WebCore::GraphicsLayer::setEventRegion):
2655         (WebCore::GraphicsLayer::setTouchActionRegion):
2656         (WebCore::GraphicsLayer::dumpProperties const):
2657         * platform/graphics/GraphicsLayer.h:
2658         (WebCore::GraphicsLayer::touchActionRegion const):
2659         * platform/graphics/ca/GraphicsLayerCA.cpp:
2660         (WebCore::GraphicsLayerCA::setTouchActionRegion):
2661         * platform/graphics/ca/GraphicsLayerCA.h:
2662         * rendering/PaintInfo.h:
2663         * rendering/RenderBlock.cpp:
2664         (WebCore::RenderBlock::paintObject):
2665         * rendering/RenderLayer.cpp:
2666         (WebCore::RenderLayer::collectEventRegionForFragments):
2667         * rendering/RenderLayer.h:
2668         * rendering/RenderLayerBacking.cpp:
2669         (WebCore::RenderLayerBacking::updateConfiguration):
2670
2671         Need to do this for the top compositing layer too.
2672
2673         (WebCore::RenderLayerBacking::updateEventRegion):
2674
2675         Compute touch-action region too.
2676         As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.
2677
2678         * rendering/TouchActionRegion.cpp: Added.
2679         (WebCore::toIndex):
2680         (WebCore::toTouchAction):
2681         (WebCore::toString):
2682         (WebCore::TouchActionRegion::unite):
2683         (WebCore::TouchActionRegion::actionsForPoint const):
2684         (WebCore::TouchActionRegion::translate):
2685         (WebCore::operator<<):
2686         * rendering/TouchActionRegion.h: Added.
2687
2688         Class for collecting and maintaining touch-action region.
2689
2690         (WebCore::TouchActionRegion::isEmpty const):
2691         (WebCore::TouchActionRegion::operator== const):
2692         * rendering/style/RenderStyle.h:
2693         (WebCore::RenderStyle::effectiveTouchActions const):
2694         (WebCore::RenderStyle::setEffectiveTouchActions):
2695
2696         Implement as inherited property for efficiency (touch-action itself is non-inherited).
2697
2698         * rendering/style/StyleRareInheritedData.cpp:
2699         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
2700         (WebCore::StyleRareInheritedData::operator== const):
2701         * rendering/style/StyleRareInheritedData.h:
2702
2703 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
2704
2705         Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
2706         https://bugs.webkit.org/show_bug.cgi?id=196475
2707
2708         We did not have RTCIceTransport.cpp in Sources.txt.
2709
2710         * WebCore.xcodeproj/project.pbxproj:
2711
2712 2019-04-04  Yusuke Suzuki  <ysuzuki@apple.com>
2713
2714         [WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
2715         https://bugs.webkit.org/show_bug.cgi?id=196475
2716
2717         Reviewed by Saam Barati.
2718
2719         This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
2720         because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
2721         classes into IsoHeap too.
2722
2723         This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.
2724
2725             1. DOM collections (HTMLCollection etc.)
2726             2. WebAudio nodes
2727             3. IDB classes
2728             4. FileSystem API classes
2729             5. Canvas contexts
2730             6. WebRTC classses
2731             7. XMLHttpRequest related classes
2732             8. WebSocket related classes
2733             9. Worker and Worklet related classes
2734             10. Other misc classes
2735
2736         * Modules/applepay/ApplePaySession.cpp:
2737         * Modules/applepay/ApplePaySession.h:
2738         * Modules/encryptedmedia/MediaKeySession.cpp:
2739         * Modules/encryptedmedia/MediaKeySession.h:
2740         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2741         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
2742         * Modules/entriesapi/DOMFileSystem.cpp:
2743         * Modules/entriesapi/DOMFileSystem.h:
2744         (WebCore::DOMFileSystem::createEntryForFile): Deleted.
2745         (WebCore::DOMFileSystem::name const): Deleted.
2746         * Modules/entriesapi/FileSystemDirectoryEntry.h:
2747         * Modules/entriesapi/FileSystemDirectoryReader.cpp:
2748         * Modules/entriesapi/FileSystemDirectoryReader.h:
2749         * Modules/entriesapi/FileSystemEntry.cpp:
2750         * Modules/entriesapi/FileSystemEntry.h:
2751         * Modules/entriesapi/FileSystemFileEntry.h:
2752         * Modules/geolocation/Geolocation.cpp:
2753         * Modules/geolocation/Geolocation.h:
2754         (WebCore::Geolocation::document const): Deleted.
2755         (WebCore::Geolocation::frame const): Deleted.
2756         (WebCore::Geolocation::resetIsAllowed): Deleted.
2757         (WebCore::Geolocation::isAllowed const): Deleted.
2758         (WebCore::Geolocation::isDenied const): Deleted.
2759         (WebCore::Geolocation::hasListeners const): Deleted.
2760         * Modules/indexeddb/IDBCursor.cpp:
2761         * Modules/indexeddb/IDBCursor.h:
2762         * Modules/indexeddb/IDBCursorWithValue.cpp:
2763         * Modules/indexeddb/IDBCursorWithValue.h:
2764         * Modules/indexeddb/IDBDatabase.cpp:
2765         * Modules/indexeddb/IDBDatabase.h:
2766         (WebCore::IDBDatabase::info const): Deleted.
2767         (WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
2768         (WebCore::IDBDatabase::connectionProxy): Deleted.
2769         (WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
2770         * Modules/indexeddb/IDBKeyRange.cpp:
2771         * Modules/indexeddb/IDBKeyRange.h:
2772         (WebCore::IDBKeyRange::lower const): Deleted.
2773         (WebCore::IDBKeyRange::upper const): Deleted.
2774         (WebCore::IDBKeyRange::lowerOpen const): Deleted.
2775         (WebCore::IDBKeyRange::upperOpen const): Deleted.
2776         * Modules/indexeddb/IDBOpenDBRequest.cpp:
2777         * Modules/indexeddb/IDBOpenDBRequest.h:
2778         * Modules/indexeddb/IDBRequest.cpp:
2779         * Modules/indexeddb/IDBRequest.h:
2780         * Modules/indexeddb/IDBTransaction.cpp:
2781         * Modules/indexeddb/IDBTransaction.h:
2782         (WebCore::IDBTransaction::mode const): Deleted.
2783         (WebCore::IDBTransaction::info const): Deleted.
2784         (WebCore::IDBTransaction::database): Deleted.
2785         (WebCore::IDBTransaction::database const): Deleted.
2786         (WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
2787         (WebCore::IDBTransaction::isVersionChange const): Deleted.
2788         (WebCore::IDBTransaction::isReadOnly const): Deleted.
2789         (WebCore::IDBTransaction::isFinished const): Deleted.
2790         * Modules/mediarecorder/MediaRecorder.cpp:
2791         * Modules/mediarecorder/MediaRecorder.h:
2792         * Modules/mediasession/MediaRemoteControls.cpp:
2793         * Modules/mediasession/MediaRemoteControls.h:
2794         (WebCore::MediaRemoteControls::create): Deleted.
2795         (WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
2796         (WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
2797         * Modules/mediasource/MediaSource.cpp:
2798         * Modules/mediasource/MediaSource.h:
2799         * Modules/mediasource/SourceBuffer.cpp:
2800         * Modules/mediasource/SourceBuffer.h:
2801         * Modules/mediasource/SourceBufferList.cpp:
2802         * Modules/mediasource/SourceBufferList.h:
2803         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
2804         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
2805         * Modules/mediastream/MediaDeviceInfo.cpp:
2806         * Modules/mediastream/MediaDeviceInfo.h:
2807         (WebCore::MediaDeviceInfo::label const): Deleted.
2808         (WebCore::MediaDeviceInfo::deviceId const): Deleted.
2809         (WebCore::MediaDeviceInfo::groupId const): Deleted.
2810         (WebCore::MediaDeviceInfo::kind const): Deleted.
2811         * Modules/mediastream/MediaDevices.cpp:
2812         * Modules/mediastream/MediaDevices.h:
2813         * Modules/mediastream/MediaStream.cpp:
2814         * Modules/mediastream/MediaStream.h:
2815         * Modules/mediastream/MediaStreamTrack.cpp:
2816         * Modules/mediastream/MediaStreamTrack.h:
2817         * Modules/mediastream/RTCDTMFSender.cpp:
2818         * Modules/mediastream/RTCDTMFSender.h:
2819         * Modules/mediastream/RTCDataChannel.cpp:
2820         * Modules/mediastream/RTCDataChannel.h:
2821         * Modules/mediastream/RTCIceCandidate.cpp:
2822         * Modules/mediastream/RTCIceCandidate.h:
2823         (WebCore::RTCIceCandidate::candidate const): Deleted.
2824         (WebCore::RTCIceCandidate::sdpMid const): Deleted.
2825         (WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
2826         (WebCore::RTCIceCandidate::setCandidate): Deleted.
2827         * Modules/mediastream/RTCIceTransport.cpp:
2828         * Modules/mediastream/RTCIceTransport.h:
2829         (WebCore::RTCIceTransport::create): Deleted.
2830         (WebCore::RTCIceTransport::state const): Deleted.
2831         (WebCore::RTCIceTransport::setState): Deleted.
2832         (WebCore::RTCIceTransport::gatheringState const): Deleted.
2833         (WebCore::RTCIceTransport::setGatheringState): Deleted.
2834         (WebCore::RTCIceTransport::RTCIceTransport): Deleted.
2835         * Modules/mediastream/RTCPeerConnection.cpp:
2836         * Modules/mediastream/RTCPeerConnection.h:
2837         * Modules/mediastream/RTCRtpReceiver.cpp:
2838         * Modules/mediastream/RTCRtpReceiver.h:
2839         (WebCore::RTCRtpReceiver::create): Deleted.
2840         (WebCore::RTCRtpReceiver::setBackend): Deleted.
2841         (WebCore::RTCRtpReceiver::getParameters): Deleted.
2842         (WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
2843         (WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
2844         (WebCore::RTCRtpReceiver::track): Deleted.
2845         (WebCore::RTCRtpReceiver::backend): Deleted.
2846         * Modules/mediastream/RTCRtpSender.cpp:
2847         * Modules/mediastream/RTCRtpSender.h:
2848         (WebCore::RTCRtpSender::track): Deleted.
2849         (WebCore::RTCRtpSender::trackId const): Deleted.
2850         (WebCore::RTCRtpSender::trackKind const): Deleted.
2851         (WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
2852         (WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
2853         (WebCore::RTCRtpSender::isStopped const): Deleted.
2854         (WebCore::RTCRtpSender::backend): Deleted.
2855         * Modules/mediastream/RTCRtpTransceiver.cpp:
2856         * Modules/mediastream/RTCRtpTransceiver.h:
2857         (WebCore::RTCRtpTransceiver::create): Deleted.
2858         (WebCore::RTCRtpTransceiver::sender): Deleted.
2859         (WebCore::RTCRtpTransceiver::receiver): Deleted.
2860         (WebCore::RTCRtpTransceiver::iceTransport): Deleted.
2861         (WebCore::RTCRtpTransceiver::backend): Deleted.
2862         * Modules/mediastream/RTCSessionDescription.cpp:
2863         * Modules/mediastream/RTCSessionDescription.h:
2864         (WebCore::RTCSessionDescription::type const): Deleted.
2865         (WebCore::RTCSessionDescription::sdp const): Deleted.
2866         (WebCore::RTCSessionDescription::setSdp): Deleted.
2867         * Modules/notifications/Notification.cpp:
2868         * Modules/notifications/Notification.h:
2869         * Modules/paymentrequest/PaymentRequest.cpp:
2870         * Modules/paymentrequest/PaymentRequest.h:
2871         * Modules/paymentrequest/PaymentResponse.cpp:
2872         * Modules/paymentrequest/PaymentResponse.h:
2873         * Modules/speech/SpeechSynthesisUtterance.cpp:
2874         * Modules/speech/SpeechSynthesisUtterance.h:
2875         * Modules/webaudio/AnalyserNode.cpp:
2876         * Modules/webaudio/AnalyserNode.h:
2877         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2878         * Modules/webaudio/AudioBasicInspectorNode.h:
2879         * Modules/webaudio/AudioBasicProcessorNode.cpp:
2880         * Modules/webaudio/AudioBasicProcessorNode.h:
2881         * Modules/webaudio/AudioBufferSourceNode.cpp:
2882         * Modules/webaudio/AudioBufferSourceNode.h:
2883         * Modules/webaudio/AudioContext.cpp:
2884         * Modules/webaudio/AudioContext.h:
2885         * Modules/webaudio/AudioDestinationNode.cpp:
2886         * Modules/webaudio/AudioDestinationNode.h:
2887         * Modules/webaudio/AudioNode.cpp:
2888         * Modules/webaudio/AudioNode.h:
2889         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2890         * Modules/webaudio/AudioScheduledSourceNode.h:
2891         * Modules/webaudio/BiquadFilterNode.cpp:
2892         * Modules/webaudio/BiquadFilterNode.h:
2893         * Modules/webaudio/ChannelMergerNode.cpp:
2894         * Modules/webaudio/ChannelMergerNode.h:
2895         * Modules/webaudio/ChannelSplitterNode.cpp:
2896         * Modules/webaudio/ChannelSplitterNode.h:
2897         * Modules/webaudio/ConvolverNode.cpp:
2898         * Modules/webaudio/ConvolverNode.h:
2899         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2900         * Modules/webaudio/DefaultAudioDestinationNode.h:
2901         * Modules/webaudio/DelayNode.cpp:
2902         * Modules/webaudio/DelayNode.h:
2903         * Modules/webaudio/DynamicsCompressorNode.cpp:
2904         * Modules/webaudio/DynamicsCompressorNode.h:
2905         * Modules/webaudio/GainNode.cpp:
2906         * Modules/webaudio/GainNode.h:
2907         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
2908         * Modules/webaudio/MediaElementAudioSourceNode.h:
2909         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2910         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
2911         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
2912         * Modules/webaudio/MediaStreamAudioSourceNode.h:
2913         * Modules/webaudio/OfflineAudioContext.cpp:
2914         * Modules/webaudio/OfflineAudioContext.h:
2915         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2916         * Modules/webaudio/OfflineAudioDestinationNode.h:
2917         * Modules/webaudio/OscillatorNode.cpp:
2918         * Modules/webaudio/OscillatorNode.h:
2919         * Modules/webaudio/PannerNode.cpp:
2920         * Modules/webaudio/PannerNode.h:
2921         * Modules/webaudio/ScriptProcessorNode.cpp:
2922         * Modules/webaudio/ScriptProcessorNode.h:
2923         * Modules/webaudio/WaveShaperNode.cpp:
2924         * Modules/webaudio/WaveShaperNode.h:
2925         * Modules/webgpu/GPUCanvasContext.cpp:
2926         * Modules/webgpu/GPUCanvasContext.h:
2927         * Modules/websockets/WebSocket.cpp:
2928         * Modules/websockets/WebSocket.h:
2929         * Modules/webvr/VRDisplay.cpp:
2930         * Modules/webvr/VRDisplay.h:
2931         (WebCore::VRDisplay::isPresenting const): Deleted.
2932         (WebCore::VRDisplay::displayName const): Deleted.
2933         (WebCore::VRDisplay::displayId const): Deleted.
2934         (WebCore::VRDisplay::depthNear const): Deleted.
2935         (WebCore::VRDisplay::setDepthNear): Deleted.
2936         (WebCore::VRDisplay::depthFar const): Deleted.
2937         (WebCore::VRDisplay::setDepthFar): Deleted.
2938         (WebCore::VRDisplay::document): Deleted.
2939         * Sources.txt:
2940         * WebCore.xcodeproj/project.pbxproj:
2941         * animation/CSSAnimation.cpp:
2942         * animation/CSSAnimation.h:
2943         * animation/CSSTransition.cpp:
2944         * animation/CSSTransition.h:
2945         * animation/DeclarativeAnimation.cpp:
2946         * animation/DeclarativeAnimation.h:
2947         * animation/WebAnimation.cpp:
2948         * animation/WebAnimation.h:
2949         * bindings/js/ScriptWrappable.h:
2950         * css/CSSComputedStyleDeclaration.cpp:
2951         * css/CSSComputedStyleDeclaration.h:
2952         * css/CSSStyleDeclaration.cpp:
2953         (): Deleted.
2954         * css/CSSStyleDeclaration.h:
2955         * css/DOMMatrix.h:
2956         * css/DOMMatrixReadOnly.cpp:
2957         * css/DOMMatrixReadOnly.h:
2958         * css/FontFaceSet.cpp:
2959         * css/FontFaceSet.h:
2960         * css/PropertySetCSSStyleDeclaration.cpp:
2961         * css/PropertySetCSSStyleDeclaration.h:
2962         * css/WebKitCSSMatrix.cpp:
2963         * css/WebKitCSSMatrix.h:
2964         * css/typedom/TypedOMCSSImageValue.cpp: Added.
2965         * css/typedom/TypedOMCSSImageValue.h:
2966         * css/typedom/TypedOMCSSNumericValue.cpp: Added.
2967         * css/typedom/TypedOMCSSNumericValue.h:
2968         * css/typedom/TypedOMCSSStyleValue.cpp: Added.
2969         * css/typedom/TypedOMCSSStyleValue.h:
2970         * css/typedom/TypedOMCSSUnitValue.cpp: Added.
2971         * css/typedom/TypedOMCSSUnitValue.h:
2972         * css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
2973         * css/typedom/TypedOMCSSUnparsedValue.h:
2974         * dom/AbortController.cpp:
2975         * dom/AbortController.h:
2976         * dom/AbortSignal.cpp:
2977         * dom/AbortSignal.h:
2978         * dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
2979         * dom/AllDescendantsCollection.h:
2980         * dom/ChildNodeList.cpp:
2981         * dom/ChildNodeList.h:
2982         * dom/ClassCollection.cpp:
2983         * dom/ClassCollection.h:
2984         * dom/DOMImplementation.cpp:
2985         * dom/DOMImplementation.h:
2986         (WebCore::DOMImplementation::ref): Deleted.
2987         (WebCore::DOMImplementation::deref): Deleted.
2988         (WebCore::DOMImplementation::document): Deleted.
2989         (WebCore::DOMImplementation::hasFeature): Deleted.
2990         * dom/DOMPoint.h:
2991         * dom/DOMPointReadOnly.cpp:
2992         * dom/DOMPointReadOnly.h:
2993         * dom/DOMQuad.cpp:
2994         * dom/DOMQuad.h:
2995         * dom/DOMRect.h:
2996         * dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
2997         * dom/DOMRectReadOnly.h:
2998         * dom/DataTransferItemList.cpp:
2999         * dom/DataTransferItemList.h:
3000         (WebCore::DataTransferItemList::ref): Deleted.
3001         (WebCore::DataTransferItemList::deref): Deleted.
3002         (WebCore::DataTransferItemList::dataTransfer): Deleted.
3003         (WebCore::DataTransferItemList::hasItems const): Deleted.
3004         (WebCore::DataTransferItemList::items const): Deleted.
3005         * dom/DatasetDOMStringMap.cpp:
3006         * dom/DatasetDOMStringMap.h:
3007         * dom/DocumentParser.h:
3008         * dom/EventTarget.cpp:
3009         * dom/EventTarget.h:
3010         * dom/LiveNodeList.cpp:
3011         * dom/LiveNodeList.h:
3012         * dom/MessageChannel.cpp:
3013         * dom/MessagePort.cpp:
3014         * dom/MessagePort.h:
3015         * dom/NameNodeList.cpp:
3016         * dom/NameNodeList.h:
3017         * dom/NamedNodeMap.cpp:
3018         * dom/NamedNodeMap.h:
3019         (WebCore::NamedNodeMap::NamedNodeMap): Deleted.
3020         (WebCore::NamedNodeMap::element): Deleted.
3021         * dom/NodeIterator.cpp:
3022         * dom/NodeIterator.h:
3023         (WebCore::NodeIterator::detach): Deleted.
3024         (WebCore::NodeIterator::referenceNode const): Deleted.
3025         (WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
3026         * dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
3027         * dom/NodeList.h:
3028         * dom/NodeRareData.cpp:
3029         * dom/ScriptExecutionContext.cpp:
3030         * dom/SimulatedClick.cpp:
3031         * dom/StaticNodeList.cpp:
3032         * dom/StaticNodeList.h:
3033         * dom/TagCollection.cpp:
3034         * dom/TagCollection.h:
3035         * dom/TreeWalker.cpp:
3036         * dom/TreeWalker.h:
3037         (WebCore::TreeWalker::create): Deleted.
3038         (WebCore::TreeWalker::currentNode): Deleted.
3039         (WebCore::TreeWalker::currentNode const): Deleted.
3040         * fileapi/Blob.cpp:
3041         * fileapi/Blob.h:
3042         * fileapi/File.cpp:
3043         * fileapi/File.h:
3044         * fileapi/FileList.cpp:
3045         * fileapi/FileList.h:
3046         (WebCore::FileList::create): Deleted.
3047         (WebCore::FileList::length const): Deleted.
3048         (WebCore::FileList::isEmpty const): Deleted.
3049         (WebCore::FileList::files const): Deleted.
3050         (WebCore::FileList::file const): Deleted.
3051         (WebCore::FileList::FileList): Deleted.
3052         (WebCore::FileList::append): Deleted.
3053         (WebCore::FileList::clear): Deleted.
3054         * fileapi/FileReader.cpp:
3055         * fileapi/FileReader.h:
3056         * html/CachedHTMLCollection.h:
3057         * html/GenericCachedHTMLCollection.cpp:
3058         * html/GenericCachedHTMLCollection.h:
3059         * html/HTMLAllCollection.cpp:
3060         * html/HTMLAllCollection.h:
3061         * html/HTMLCollection.cpp:
3062         * html/HTMLCollection.h:
3063         * html/HTMLFormControlsCollection.cpp:
3064         * html/HTMLFormControlsCollection.h:
3065         * html/HTMLNameCollection.cpp:
3066         * html/HTMLNameCollection.h:
3067         * html/HTMLOptionsCollection.cpp:
3068         * html/HTMLOptionsCollection.h:
3069         * html/HTMLTableRowsCollection.cpp:
3070         * html/HTMLTableRowsCollection.h:
3071         * html/ImageBitmap.cpp:
3072         * html/ImageBitmap.h:
3073         (WebCore::ImageBitmap::isDetached const): Deleted.
3074         (WebCore::ImageBitmap::buffer): Deleted.
3075         (WebCore::ImageBitmap::originClean const): Deleted.
3076         * html/LabelsNodeList.cpp:
3077         * html/LabelsNodeList.h:
3078         * html/MediaController.cpp:
3079         * html/MediaController.h:
3080         * html/OffscreenCanvas.cpp:
3081         * html/OffscreenCanvas.h:
3082         * html/RadioNodeList.cpp:
3083         * html/RadioNodeList.h:
3084         * html/canvas/CanvasRenderingContext.cpp:
3085         * html/canvas/CanvasRenderingContext.h:
3086         * html/canvas/CanvasRenderingContext2D.cpp:
3087         * html/canvas/CanvasRenderingContext2D.h:
3088         * html/canvas/CanvasRenderingContext2DBase.cpp:
3089         * html/canvas/CanvasRenderingContext2DBase.h:
3090         * html/canvas/GPUBasedCanvasRenderingContext.h:
3091         * html/canvas/ImageBitmapRenderingContext.cpp:
3092         * html/canvas/ImageBitmapRenderingContext.h:
3093         * html/canvas/OffscreenCanvasRenderingContext2D.cpp:
3094         * html/canvas/OffscreenCanvasRenderingContext2D.h:
3095         * html/canvas/PaintRenderingContext2D.cpp:
3096         * html/canvas/PaintRenderingContext2D.h:
3097         * html/canvas/PlaceholderRenderingContext.cpp:
3098         * html/canvas/PlaceholderRenderingContext.h:
3099         * html/canvas/WebGL2RenderingContext.cpp:
3100         * html/canvas/WebGL2RenderingContext.h:
3101         * html/canvas/WebGLRenderingContext.cpp:
3102         * html/canvas/WebGLRenderingContext.h:
3103         * html/canvas/WebGLRenderingContextBase.cpp:
3104         * html/canvas/WebGLRenderingContextBase.h:
3105         * html/track/AudioTrackList.h:
3106         * html/track/DataCue.cpp:
3107         * html/track/DataCue.h:
3108         * html/track/InbandDataTextTrack.cpp:
3109         * html/track/InbandDataTextTrack.h:
3110         * html/track/InbandGenericTextTrack.cpp:
3111         * html/track/InbandGenericTextTrack.h:
3112         * html/track/InbandTextTrack.cpp:
3113         * html/track/InbandTextTrack.h:
3114         * html/track/InbandWebVTTTextTrack.cpp:
3115         * html/track/InbandWebVTTTextTrack.h:
3116         * html/track/LoadableTextTrack.cpp:
3117         * html/track/LoadableTextTrack.h:
3118         * html/track/TextTrack.cpp:
3119         * html/track/TextTrack.h:
3120         * html/track/TextTrackCue.cpp:
3121         * html/track/TextTrackCue.h:
3122         * html/track/TextTrackCueGeneric.cpp:
3123         * html/track/TextTrackCueGeneric.h:
3124         * html/track/TextTrackList.cpp:
3125         * html/track/TextTrackList.h:
3126         * html/track/TrackListBase.cpp:
3127         * html/track/TrackListBase.h:
3128         * html/track/VTTCue.cpp:
3129         * html/track/VTTCue.h:
3130         * html/track/VideoTrackList.h:
3131         * loader/appcache/DOMApplicationCache.cpp:
3132         * loader/appcache/DOMApplicationCache.h:
3133         * page/AbstractDOMWindow.cpp:
3134         * page/AbstractDOMWindow.h:
3135         * page/BarProp.cpp:
3136         * page/BarProp.h:
3137         (WebCore::BarProp::create): Deleted.
3138         * page/DOMWindow.cpp:
3139         * page/DOMWindow.h:
3140         * page/EventSource.cpp:
3141         * page/EventSource.h:
3142         * page/History.cpp:
3143         * page/History.h:
3144         * page/Location.cpp:
3145         * page/Location.h:
3146         (WebCore::Location::create): Deleted.
3147         (WebCore::Location::toString const): Deleted.
3148         * page/Navigator.cpp:
3149         * page/Navigator.h:
3150         * page/Performance.cpp:
3151         * page/Performance.h:
3152         * page/RemoteDOMWindow.cpp:
3153         * page/RemoteDOMWindow.h:
3154         * page/Screen.cpp:
3155         * page/Screen.h:
3156         * page/VisualViewport.cpp:
3157         * page/VisualViewport.h:
3158         * plugins/DOMMimeTypeArray.cpp:
3159         * plugins/DOMMimeTypeArray.h:
3160         (WebCore::DOMMimeTypeArray::create): Deleted.
3161         * plugins/DOMPlugin.cpp:
3162         * plugins/DOMPlugin.h:
3163         (WebCore::DOMPlugin::create): Deleted.
3164         * plugins/DOMPluginArray.cpp:
3165         * plugins/DOMPluginArray.h:
3166         (WebCore::DOMPluginArray::create): Deleted.
3167         * storage/Storage.cpp:
3168         * storage/Storage.h:
3169         (WebCore::Storage::area const): Deleted.
3170         * workers/AbstractWorker.cpp:
3171         * workers/AbstractWorker.h:
3172         * workers/DedicatedWorkerGlobalScope.cpp:
3173         * workers/DedicatedWorkerGlobalScope.h:
3174         * workers/Worker.cpp:
3175         * workers/Worker.h:
3176         * workers/WorkerGlobalScope.cpp:
3177         * workers/WorkerGlobalScope.h:
3178         * workers/service/ServiceWorker.cpp:
3179         * workers/service/ServiceWorker.h:
3180         * workers/service/ServiceWorkerContainer.cpp:
3181         * workers/service/ServiceWorkerContainer.h:
3182         * workers/service/ServiceWorkerGlobalScope.cpp:
3183         * workers/service/ServiceWorkerGlobalScope.h:
3184         * workers/service/ServiceWorkerRegistration.cpp:
3185         * workers/service/ServiceWorkerRegistration.h:
3186         * worklets/PaintWorkletGlobalScope.cpp:
3187         * worklets/PaintWorkletGlobalScope.h:
3188         * worklets/Worklet.cpp:
3189         * worklets/Worklet.h:
3190         * worklets/WorkletGlobalScope.cpp:
3191         * worklets/WorkletGlobalScope.h:
3192         * xml/XMLHttpRequest.cpp:
3193         * xml/XMLHttpRequest.h:
3194         * xml/XMLHttpRequestEventTarget.h:
3195         * xml/XMLHttpRequestUpload.cpp:
3196         * xml/XMLHttpRequestUpload.h:
3197         * xml/XPathParser.cpp:
3198
3199 2019-04-04  Chris Dumez  <cdumez@apple.com>
3200
3201         Unreviewed, fix iOS build with recent SDKs.
3202
3203         std::ptr_fun() is deprecated.
3204
3205         * platform/ios/LegacyTileGrid.mm:
3206         (WebCore::LegacyTileGrid::dropDistantTiles):
3207
3208 2019-04-04  Antoine Quint  <graouts@apple.com>
3209
3210         [Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
3211         https://bugs.webkit.org/show_bug.cgi?id=196118
3212         <rdar://problem/46614137>
3213
3214         Reviewed by Ryosuke Niwa.
3215
3216         Test: webanimations/js-wrapper-kept-alive.html
3217
3218         We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
3219
3220         * animation/WebAnimation.cpp:
3221         (WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
3222         (WebCore::WebAnimation::hasPendingActivity const):
3223         * animation/WebAnimation.h:
3224
3225 2019-04-04  Miguel Gomez  <magomez@igalia.com>
3226
3227         [GTK][WPE] Use a timer to request the creation of pending tiles
3228         https://bugs.webkit.org/show_bug.cgi?id=196594
3229
3230         Reviewed by Žan Doberšek.
3231
3232         Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
3233         while inside a layer flush.
3234
3235         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3236         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
3237         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3238         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3239         (WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
3240         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3241
3242 2019-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3243
3244         [ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache::attachWrapper()
3245         https://bugs.webkit.org/show_bug.cgi?id=196538
3246
3247         Reviewed by Michael Catanzaro.
3248
3249         In most of the cases the parent is not found, probably because the child is not a direct descendant of the
3250         parent returned by parentObjectUnignored(). We need to handle the case of find() returning notFound.
3251
3252         * accessibility/atk/AXObjectCacheAtk.cpp:
3253         (WebCore::AXObjectCache::attachWrapper): Use -1 as the index when find() returns notFound.
3254
3255 2019-04-03  Timothy Hatcher  <timothy@apple.com>
3256
3257         Update AutoFill field icons to be SVG instead of PNG images.
3258         https://bugs.webkit.org/show_bug.cgi?id=196557
3259         rdar://problem/48292514
3260
3261         Reviewed by Tim Horton.
3262
3263         * css/html.css:
3264         (input::-webkit-credentials-auto-fill-button):
3265         (input::-webkit-contacts-auto-fill-button):
3266         (input::-webkit-credit-card-auto-fill-button):
3267
3268 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
3269
3270         Simplify some "programmaticScroll" code paths
3271         https://bugs.webkit.org/show_bug.cgi?id=196589
3272
3273         Reviewed by Zalan Bujtas.
3274
3275         AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() just returned early if programmaticScroll
3276         was true, so instead, just never call it. This means we can remove the "programmaticScroll" argument from 
3277         scheduleUpdateScrollPositionAfterAsyncScroll(). Also change some callers to use the ScrollType enum
3278         instead of a bool.
3279
3280         Now, ThreadedScrollingTree::scrollingTreeNodeDidScroll() just returns early. Programmatic scrolls
3281         update state on the main thread before updating the scrolling tree, so this makes sense.
3282
3283         * page/scrolling/AsyncScrollingCoordinator.cpp:
3284         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
3285         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
3286         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
3287         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3288         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
3289         * page/scrolling/AsyncScrollingCoordinator.h:
3290         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
3291         (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType const):
3292         * page/scrolling/ScrollingCoordinator.cpp:
3293         (WebCore::operator<<):
3294         * page/scrolling/ScrollingCoordinator.h:
3295         (WebCore::ScrollingCoordinator::reconcileScrollingState):
3296         * page/scrolling/ThreadedScrollingTree.cpp:
3297         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
3298
3299 2019-04-03  Youenn Fablet  <youenn@apple.com>
3300
3301         Add logging and ASSERTs to investigate issue with VPModuleInitialize
3302         https://bugs.webkit.org/show_bug.cgi?id=196573
3303
3304         Reviewed by Eric Carlson.
3305
3306         Add some ASSERTs.
3307         No change of behavior.
3308
3309         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
3310         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
3311         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
3312
3313 2019-04-03  Simon Fraser  <simon.fraser@apple.com>
3314
3315         Remove some redundant memebers from ScrollingStateFrameScrollingNode
3316         https://bugs.webkit.org/show_bug.cgi?id=196571
3317
3318         Reviewed by Zalan Bujtas.
3319
3320         m_requestedScrollPosition and m_requestedScrollPositionRepresentsProgrammaticScroll were
3321         duplicated on ScrollingStateFrameScrollingNode and ScrollingStateScrollingNode, so
3322         remove them from the derived class.
3323
3324         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3325         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3326         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
3327         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3328
3329 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
3330
3331         REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
3332         https://bugs.webkit.org/show_bug.cgi?id=196518
3333
3334         Reviewed by Simon Fraser.
3335
3336         r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().
3337
3338         RenderSVGRect tries to optimize its layout and drawing if the rectangle
3339         is not rounded. So it uses the flag m_usePathFallback to know whether to
3340         use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
3341         is rounded but its boundingSize is empty, m_path will be cleared,
3342         m_innerStrokeRect and m_outerStrokeRect will be recalculated but
3343         m_usePathFallback will not be reset to false. Therefore when calling 
3344         RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
3345         will assert since m_path is null.
3346
3347         Test: svg/animations/animate-rounded-corner-rect-zero-height.svg
3348
3349         * rendering/svg/RenderSVGRect.cpp:
3350         (WebCore::RenderSVGRect::updateShapeFromElement):
3351         Reset m_usePathFallback to false once clearPath() is called.
3352
3353 2019-04-03  Ryosuke Niwa  <rniwa@webkit.org>
3354
3355         Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
3356         https://bugs.webkit.org/show_bug.cgi?id=196579
3357
3358         Reviewed by Simon Fraser.
3359
3360         Avoid crashing accessing the unengated optional's value in relese builds for now.
3361
3362         Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
3363         getting out out of sync would require a significant re-architecturing of the whole selection
3364         repainting / state managing mechanism.
3365
3366         * rendering/SelectionRangeData.h:
3367         (WebCore::SelectionRangeData::startPosition const):
3368         (WebCore::SelectionRangeData::endPosition const):
3369
3370 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
3371
3372         -apple-trailing-word is needed for browser detection
3373         https://bugs.webkit.org/show_bug.cgi?id=196575
3374
3375         Unreviewed.
3376
3377         This is an unreviewed partial revert of r243819. Turns out there are some websites
3378         which use this property to do browser detection. So, we need to continue to parse
3379         the property, but we don't need the property to do anything.
3380
3381         Test: fast/text/trailing-word-detection.html
3382
3383         * Configurations/FeatureDefines.xcconfig:
3384         * css/CSSComputedStyleDeclaration.cpp:
3385         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3386         * css/CSSPrimitiveValueMappings.h:
3387         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3388         (WebCore::CSSPrimitiveValue::operator TrailingWord const):
3389         * css/CSSProperties.json:
3390         * css/CSSValueKeywords.in:
3391         * css/parser/CSSParserFastPaths.cpp:
3392         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3393         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3394         * rendering/style/RenderStyle.h:
3395         (WebCore::RenderStyle::trailingWord const):
3396         (WebCore::RenderStyle::setTrailingWord):
3397         (WebCore::RenderStyle::initialTrailingWord):
3398         * rendering/style/RenderStyleConstants.h:
3399
3400 2019-04-03  Don Olmstead  <don.olmstead@sony.com>
3401
3402         [CMake][WTF] Mirror XCode header directories
3403         https://bugs.webkit.org/show_bug.cgi?id=191662
3404
3405         Reviewed by Konstantin Tokarev.
3406
3407         Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
3408         builds.
3409
3410         * CMakeLists.txt:
3411         * PlatformWin.cmake:
3412
3413 2019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
3414
3415         Remove SVG properties tear-off objects
3416         https://bugs.webkit.org/show_bug.cgi?id=191237
3417
3418         Reviewed by Simon Fraser.
3419
3420         This patch cleans the code from unused SVG sources and get rid off the
3421         remaining SVG properties tear-off objects. Here are more details:
3422
3423         -- Remove the SVGAttributeAnimationController and move its code to the
3424            SVGAnimateElementBase. SVGAttributeAnimationController was introduced
3425            to allow animating the SVG properties whether they are backed by tear
3426            off objects or not. Since there will be no tear off objects anymore,
3427            one animation controller will be needed. But in this case, it will be
3428            better if we make SVGAnimateElementBase is the animation controller
3429            and make it manage the animator directly.
3430
3431         -- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual
3432            function SVGElement::attributeOwnerProxy(). Remove also all the
3433            overriding functions attributeOwnerProxy() from all the SVGElements.
3434
3435         -- Remove isKnownAttribute() from all the SVG header files except from 
3436            four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace
3437            and SVGExternalResourcesRequired.
3438
3439         -- Remove all the SVG animated properties classifying functions from
3440            SVGElement. This is now handled by SVGPropertyRegistry.
3441
3442         -- There is no need for the enum AnimatedPropertyType anymore. The SVG
3443            property accessor knows its type, knows how to access it and know what
3444            animator it should be created for it.
3445
3446         * Sources.txt:
3447         * WebCore.xcodeproj/project.pbxproj:
3448         * dom/Element.cpp:
3449         (WebCore::Element::synchronizeAllAttributes const):
3450         (WebCore::Element::synchronizeAttribute const):
3451         (WebCore::Element::fastAttributeLookupAllowed const):
3452         These functions are surprisingly marked 'const'. They were calling 'const'
3453         functions in SVGElement and SVGElement was casting 'this' as non 'const'
3454         before calling the non 'const' functions through the non 'const' 'this'
3455         pointer. Change this by moving the casting to the Element functions.
3456
3457         * rendering/svg/RenderSVGResourceGradient.cpp:
3458         (WebCore::RenderSVGResourceGradient::applyResource):
3459         * rendering/svg/RenderSVGResourcePattern.cpp:
3460         (WebCore::RenderSVGResourcePattern::applyResource):
3461         * svg/SVGAElement.h:
3462         * svg/SVGAltGlyphElement.h:
3463         * svg/SVGAnimateElementBase.cpp:
3464         (WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
3465         (WebCore::SVGAnimateElementBase::animator const):
3466         (WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
3467         (WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
3468         (WebCore::SVGAnimateElementBase::setTargetElement):
3469         (WebCore::SVGAnimateElementBase::setAttributeName):
3470         (WebCore::SVGAnimateElementBase::resetAnimation):
3471         (WebCore::SVGAnimateElementBase::calculateFromAndToValues):
3472         (WebCore::SVGAnimateElementBase::calculateFromAndByValues):
3473         (WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
3474         (WebCore::SVGAnimateElementBase::resetAnimatedType):
3475         (WebCore::SVGAnimateElementBase::calculateAnimatedValue):
3476         (WebCore::SVGAnimateElementBase::applyResultsToTarget):
3477         (WebCore::SVGAnimateElementBase::clearAnimatedType):
3478         (WebCore::SVGAnimateElementBase::calculateDistance):
3479         (WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted.
3480         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted.
3481         (WebCore::SVGAnimateElementBase::isAdditive const): Deleted.
3482         * svg/SVGAnimateElementBase.h:
3483         (WebCore::SVGAnimateElementBase::animatorIfExists const):
3484         (WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted.
3485         The order of the functions was changed to resemble the order of running
3486         the animation:
3487           -- Setting the animation range
3488           -- Starting the animation
3489           -- Progressing the animation
3490           -- Applying the the progressed animaVal() to the target element
3491           -- Stopping the animation
3492
3493         * svg/SVGAnimateMotionElement.cpp:
3494         (WebCore::SVGAnimateMotionElement::calculateDistance):
3495         * svg/SVGAnimateMotionElement.h:
3496         * svg/SVGAnimationElement.cpp:
3497         (WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
3498         (WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted.
3499         * svg/SVGAnimationElement.h:
3500         (WebCore::SVGAnimationElement::attributeRegistry): Deleted.
3501         (WebCore::SVGAnimationElement::calculateDistance): Deleted.
3502         * svg/SVGAttributeAnimationController.cpp: Removed.
3503         * svg/SVGAttributeAnimationController.h: Removed.
3504         * svg/SVGAttributeAnimationControllerBase.cpp: Removed.
3505         * svg/SVGAttributeAnimationControllerBase.h: Removed.
3506         * svg/SVGCircleElement.h:
3507         * svg/SVGClipPathElement.h:
3508         * svg/SVGComponentTransferFunctionElement.h:
3509         * svg/SVGCursorElement.h:
3510         * svg/SVGDefsElement.h:
3511         * svg/SVGElement.cpp:
3512         (WebCore::SVGElement::synchronizeAttribute):
3513         (WebCore::SVGElement::synchronizeAllAttributes):
3514         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
3515         (WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted.
3516         (WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted.
3517         (WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
3518         (WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
3519         (WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted.
3520         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted.
3521         (WebCore::SVGElement::isAnimatableCSSProperty): Deleted.
3522         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted.
3523         * svg/SVGElement.h:
3524         (WebCore::SVGElement::attributeOwnerProxy const): Deleted.
3525         (WebCore::SVGElement::attributeRegistry): Deleted.
3526         (WebCore::SVGElement::synchronizeAttribute): Deleted.
3527         (WebCore::SVGElement::synchronizeAttributes): Deleted.
3528         (WebCore::SVGElement::animatedTypes const): Deleted.
3529         (WebCore::SVGElement::lookupAnimatedProperty const): Deleted.
3530         (WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted.
3531         (WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted.
3532         (WebCore::SVGElement::isKnownAttribute): Deleted.
3533         * svg/SVGEllipseElement.h:
3534         * svg/SVGExternalResourcesRequired.h:
3535         (WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted.
3536         (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted.
3537         * svg/SVGFEBlendElement.h:
3538         * svg/SVGFEColorMatrixElement.h:
3539         * svg/SVGFEComponentTransferElement.h:
3540         * svg/SVGFECompositeElement.h:
3541         * svg/SVGFEConvolveMatrixElement.h:
3542         * svg/SVGFEDiffuseLightingElement.h:
3543         * svg/SVGFEDisplacementMapElement.h:
3544         * svg/SVGFEDropShadowElement.h:
3545         * svg/SVGFEGaussianBlurElement.h:
3546         * svg/SVGFEImageElement.h:
3547         * svg/SVGFELightElement.h:
3548         * svg/SVGFEMergeNodeElement.h:
3549         * svg/SVGFEMorphologyElement.h:
3550         * svg/SVGFEOffsetElement.h:
3551         * svg/SVGFESpecularLightingElement.h:
3552         * svg/SVGFETileElement.h:
3553         * svg/SVGFETurbulenceElement.h:
3554         * svg/SVGFilterElement.h:
3555         * svg/SVGFilterPrimitiveStandardAttributes.h:
3556         (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted.
3557         * svg/SVGFitToViewBox.h:
3558         (WebCore::SVGFitToViewBox::attributeRegistry): Deleted.
3559         * svg/SVGFontElement.h:
3560         * svg/SVGForeignObjectElement.h:
3561         * svg/SVGGElement.h:
3562         * svg/SVGGeometryElement.h:
3563         * svg/SVGGlyphRefElement.h:
3564         * svg/SVGGradientElement.cpp:
3565         (WebCore::SVGGradientElement::svgAttributeChanged):
3566         * svg/SVGGradientElement.h:
3567         (WebCore::SVGGradientElement::attributeRegistry): Deleted.
3568         (WebCore::SVGGradientElement::isKnownAttribute): Deleted.
3569         * svg/SVGGraphicsElement.h:
3570         (WebCore::SVGGraphicsElement::attributeRegistry): Deleted.
3571         * svg/SVGImageElement.h:
3572         * svg/SVGLineElement.h:
3573         * svg/SVGLinearGradientElement.h:
3574         * svg/SVGMPathElement.h:
3575         * svg/SVGMarkerElement.cpp:
3576         * svg/SVGMarkerElement.h:
3577         * svg/SVGMaskElement.h:
3578         * svg/SVGPathElement.h:
3579         * svg/SVGPatternElement.h:
3580         * svg/SVGPolyElement.h:
3581         * svg/SVGRadialGradientElement.h:
3582         * svg/SVGRectElement.h:
3583         * svg/SVGSVGElement.h:
3584         * svg/SVGScriptElement.h:
3585         * svg/SVGStopElement.h:
3586         * svg/SVGSwitchElement.h:
3587         * svg/SVGSymbolElement.h:
3588         * svg/SVGTRefElement.h:
3589         * svg/SVGTests.cpp:
3590         (WebCore::SVGTests::svgAttributeChanged):
3591         (WebCore::SVGTests::attributeRegistry): Deleted.
3592         (WebCore::SVGTests::isKnownAttribute): Deleted.
3593         * svg/SVGTests.h:
3594         * svg/SVGTextContentElement.cpp:
3595         * svg/SVGTextContentElement.h:
3596         (WebCore::SVGTextContentElement::attributeRegistry): Deleted.
3597         * svg/SVGTextPathElement.h:
3598         * svg/SVGTextPositioningElement.h:
3599         (WebCore::SVGTextPositioningElement::attributeRegistry): Deleted.
3600         * svg/SVGURIReference.cpp:
3601         (WebCore::SVGURIReference::SVGURIReference):
3602         (WebCore::SVGURIReference::attributeRegistry): Deleted.
3603         * svg/SVGURIReference.h:
3604         * svg/SVGUseElement.h:
3605         * svg/SVGViewElement.h:
3606         * svg/SVGViewSpec.cpp:
3607         (WebCore::SVGViewSpec::SVGViewSpec):
3608         * svg/SVGViewSpec.h:
3609         * svg/SVGZoomAndPanType.h:
3610         * svg/properties/SVGAnimatedListPropertyTearOff.h: Removed.
3611         * svg/properties/SVGAnimatedPropertyAnimator.h:
3612         * svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
3613         * svg/properties/SVGAnimatedPropertyPairAnimator.h:
3614         * svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
3615         * svg/properties/SVGAnimatedPropertyTearOff.h: Removed.
3616         * svg/properties/SVGAnimatedPropertyType.h: Removed.
3617
3618         * svg/properties/SVGAnimationAdditiveFunction.h:
3619         (WebCore::SVGAnimationAdditiveFunction::animate):
3620         (WebCore::SVGAnimationAdditiveFunction::progress): Deleted.
3621         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
3622         (WebCore::SVGAnimationLengthListFunction::animate):
3623         (WebCore::SVGAnimationNumberListFunction::animate):
3624         (WebCore::SVGAnimationPointListFunction::animate):
3625         (WebCore::SVGAnimationTransformListFunction::animate):
3626         (WebCore::SVGAnimationLengthListFunction::progress): Deleted.
3627         (WebCore::SVGAnimationNumberListFunction::progress): Deleted.
3628         (WebCore::SVGAnimationPointListFunction::progress): Deleted.
3629         (WebCore::SVGAnimationTransformListFunction::progress): Deleted.
3630         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
3631         (WebCore::SVGAnimationAngleFunction::animate):
3632         (WebCore::SVGAnimationColorFunction::animate):
3633         (WebCore::SVGAnimationIntegerFunction::animate):
3634         (WebCore::SVGAnimationLengthFunction::animate):
3635         (WebCore::SVGAnimationNumberFunction::animate):
3636         (WebCore::SVGAnimationPathSegListFunction::animate):
3637         (WebCore::SVGAnimationRectFunction::animate):
3638         (WebCore::SVGAnimationAngleFunction::progress): Deleted.
3639         (WebCore::SVGAnimationColorFunction::progress): Deleted.
3640         (WebCore::SVGAnimationIntegerFunction::progress): Deleted.
3641         (WebCore::SVGAnimationLengthFunction::progress): Deleted.
3642         (WebCore::SVGAnimationNumberFunction::progress): Deleted.
3643         (WebCore::SVGAnimationPathSegListFunction::progress): Deleted.
3644         (WebCore::SVGAnimationRectFunction::progress): Deleted.
3645         * svg/properties/SVGAnimationDiscreteFunction.h:
3646         (WebCore::SVGAnimationDiscreteFunction::animate):
3647         (WebCore::SVGAnimationDiscreteFunction::progress): Deleted.
3648         * svg/properties/SVGAnimationFunction.h:
3649         (WebCore::SVGAnimationFunction::calculateDistance const):
3650         -- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction
3651            to 'animate()'.
3652         -- Rename the argument 'percentage' of these function to 'progress'
3653         -- Make calculateDistance return Optional<float> so it does not have to
3654            return -1 in case of error.
3655
3656         * svg/properties/SVGAttribute.h: Removed.
3657         * svg/properties/SVGAttributeAccessor.h: Removed.
3658         * svg/properties/SVGAttributeAnimator.h:
3659         (WebCore::SVGAttributeAnimator::calculateDistance const):
3660         * svg/properties/SVGAttributeOwnerProxy.cpp: Removed.
3661         * svg/properties/SVGAttributeOwnerProxy.h: Removed.
3662         * svg/properties/SVGAttributeOwnerProxyImpl.h: Removed.
3663         * svg/properties/SVGAttributeRegistry.h: Removed.
3664         * svg/properties/SVGLegacyAnimatedProperty.cpp: Removed.
3665         * svg/properties/SVGLegacyAnimatedProperty.h: Removed.
3666         * svg/properties/SVGLegacyProperty.h: Removed.
3667         * svg/properties/SVGListProperty.h: Removed.
3668         * svg/properties/SVGListPropertyTearOff.h: Removed.
3669         * svg/properties/SVGPrimitivePropertyAnimator.h:
3670         * svg/properties/SVGProperty.h:
3671         * svg/properties/SVGPropertyAnimator.h:
3672         * svg/properties/SVGPropertyTearOff.h: Removed.
3673         * svg/properties/SVGValuePropertyAnimator.h:
3674         * svg/properties/SVGValuePropertyListAnimator.h:
3675
3676 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
3677
3678         Documents can be destroyed before their CSSFontFaceSet is destroyed
3679         https://bugs.webkit.org/show_bug.cgi?id=195830
3680
3681         Reviewed by Darin Adler.
3682
3683         CSSFontFaceSet has a raw pointer to its owning document. JS can keep the CSSFontFaceSet alive (by using FontFaceSet)
3684         and can destroy the document at any time. When the document is destroyed, the link between the two objects needs to
3685         be severed.
3686
3687         Test: fast/text/font-face-set-destroy-document.html
3688
3689         * css/CSSFontFace.cpp:
3690         (WebCore::CSSFontFace::CSSFontFace):
3691         * css/CSSFontFace.h:
3692         * css/CSSFontFaceSet.cpp:
3693         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
3694         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
3695         * css/CSSFontFaceSet.h:
3696         * css/CSSFontSelector.cpp:
3697         (WebCore::CSSFontSelector::CSSFontSelector):
3698         (WebCore::CSSFontSelector::addFontFaceRule):
3699         * css/CSSFontSelector.h:
3700         * css/FontFace.cpp:
3701         (WebCore::FontFace::FontFace):
3702
3703 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
3704
3705         Follow up fix for r243807: Use MarkedArgumentBuffer instead of Vector for JSValue
3706         https://bugs.webkit.org/show_bug.cgi?id=196547
3707
3708         Reviewed by Geoffrey Garen.
3709
3710         JSValue in Vector could be garbage collected because GC doesn't know Vector memory on C++ heap.
3711
3712         * bindings/js/JSIDBRequestCustom.cpp:
3713         (WebCore::JSIDBRequest::result const):
3714
3715 2019-04-03  Chris Dumez  <cdumez@apple.com>
3716
3717         HTML fragment serialization should not strip whitespace from URL attribute values
3718         https://bugs.webkit.org/show_bug.cgi?id=196551
3719
3720         Reviewed by Ryosuke Niwa.
3721
3722         HTML fragment serialization should not strip whitespace from URL attribute values as per:
3723         - https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm
3724
3725         WebKit was stripping such whitespace, Gecko and Blink are not. Align WebKit with other
3726         browser engines and the specification.
3727
3728         No new tests, rebaselined existing test.
3729
3730         * editing/MarkupAccumulator.cpp:
3731         (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
3732
3733 2019-04-02  Ryosuke Niwa  <rniwa@webkit.org>
3734
3735         Crash in HTMLCanvasElement::createContext2d after the element got adopted to a new document
3736         https://bugs.webkit.org/show_bug.cgi?id=196527
3737
3738         Reviewed by Antti Koivisto.
3739
3740         We need to update CanvasBase::m_scriptExecutionContext when HTMLCanvasElement moves from
3741         one document to another. Fixed the bug by making CanvasBase::scriptExecutionContext make
3742         a virtual function call instead of directly storing a raw pointer. In HTMLCanvasElement,
3743         we use Node::scriptExecutionContext(). Use ContextDestructionObserver in CustomPaintCanvas
3744         and OffscreenCanvas instead of a raw pointer.
3745
3746         Unfortunately, no new tests since there is no reproducible test case.
3747
3748         * html/CanvasBase.cpp:
3749         (WebCore::CanvasBase::CanvasBase):
3750         * html/CanvasBase.h:
3751         (WebCore::CanvasBase::scriptExecutionContext const):
3752         * html/CustomPaintCanvas.cpp:
3753         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
3754         * html/CustomPaintCanvas.h:
3755         * html/HTMLCanvasElement.cpp:
3756         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
3757         * html/HTMLCanvasElement.h:
3758         * html/OffscreenCanvas.cpp:
3759         (WebCore::OffscreenCanvas::OffscreenCanvas):
3760         * html/OffscreenCanvas.h:
3761
3762 2019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
3763
3764         Remove support for -apple-trailing-word
3765         https://bugs.webkit.org/show_bug.cgi?id=196525
3766
3767         Reviewed by Zalan Bujtas.
3768
3769         This CSS property is nonstandard and not used.
3770
3771         * Configurations/FeatureDefines.xcconfig:
3772         * css/CSSComputedStyleDeclaration.cpp:
3773         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3774         * css/CSSPrimitiveValueMappings.h:
3775         (WebCore::CSSPrimitiveValue::operator TrailingWord const): Deleted.
3776         * css/CSSProperties.json:
3777         * css/CSSValueKeywords.in:
3778         * css/parser/CSSParserFastPaths.cpp:
3779         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3780         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3781         * rendering/SimpleLineLayout.cpp:
3782         (WebCore::SimpleLineLayout::canUseForStyle):
3783         * rendering/SimpleLineLayoutCoverage.cpp:
3784         (WebCore::SimpleLineLayout::printReason):
3785         * rendering/SimpleLineLayoutCoverage.h:
3786         * rendering/line/BreakingContext.h:
3787         (WebCore::BreakingContext::BreakingContext):
3788         (WebCore::BreakingContext::lineBreak):
3789         (WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
3790         (WebCore::BreakingContext::commitLineBreakClear):
3791         (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
3792         (WebCore::BreakingContext::handleBR):
3793         (WebCore::BreakingContext::handleFloat):
3794         (WebCore::BreakingContext::handleText):
3795         (WebCore::BreakingContext::handleEndOfLine):
3796         (WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Deleted.
3797         (WebCore::BreakingContext::InlineIteratorHistory::push): Deleted.
3798         (WebCore::BreakingContext::InlineIteratorHistory::update): Deleted.
3799         (WebCore::BreakingContext::InlineIteratorHistory::renderer const): Deleted.
3800         (WebCore::BreakingContext::InlineIteratorHistory::offset const): Deleted.
3801         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition const): Deleted.
3802         (WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator const): Deleted.
3803         (WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode const): Deleted.
3804         (WebCore::BreakingContext::InlineIteratorHistory::get const): Deleted.
3805         (WebCore::BreakingContext::InlineIteratorHistory::current const): Deleted.
3806         (WebCore::BreakingContext::InlineIteratorHistory::historyLength const): Deleted.
3807         (WebCore::BreakingContext::InlineIteratorHistory::moveTo): Deleted.
3808         (WebCore::BreakingContext::InlineIteratorHistory::increment): Deleted.
3809         (WebCore::BreakingContext::InlineIteratorHistory::clear): Deleted.
3810         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Deleted.
3811         * rendering/style/RenderStyle.h:
3812         (WebCore::RenderStyle::trailingWord const): Deleted.
3813         (WebCore::RenderStyle::setTrailingWord): Deleted.
3814         (WebCore::RenderStyle::initialTrailingWord): Deleted.
3815         * rendering/style/RenderStyleConstants.h:
3816         * rendering/style/StyleRareInheritedData.cpp:
3817         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3818         (WebCore::StyleRareInheritedData::operator== const):
3819         * rendering/style/StyleRareInheritedData.h:
3820
3821 2019-04-03  Youenn Fablet  <youenn@apple.com>
3822
3823         Use makePendingActivity in DOMCache
3824         https://bugs.webkit.org/show_bug.cgi?id=196515
3825
3826         Reviewed by Geoffrey Garen.
3827
3828         No change of behavior, just modernizing the code.
3829
3830         * Modules/cache/DOMCache.cpp:
3831         (WebCore::DOMCache::retrieveRecords):
3832         (WebCore::DOMCache::batchDeleteOperation):
3833         (WebCore::DOMCache::batchPutOperation):
3834         * Modules/cache/DOMCacheStorage.cpp:
3835         (WebCore::DOMCacheStorage::match):
3836
3837 2019-04-03  Chris Dumez  <cdumez@apple.com>
3838
3839         [XML Parser] Insert the error message block when stopping parsing and an error occurred
3840         https://bugs.webkit.org/show_bug.cgi?id=196546
3841
3842         Reviewed by Alexey Proskuryakov.
3843
3844         Insert the error message block when stopping parsing and an error occurred. This is based
3845         on the following Blink commit:
3846         - https://chromium.googlesource.com/chromium/src.git/+/565958bc22e2d49fed7af144482c2bf4d416fec5
3847
3848         No new tests, rebaselined existing test.
3849
3850         * xml/parser/XMLDocumentParser.cpp:
3851         (WebCore::XMLDocumentParser::end):
3852         Avoid showing the error message block twice in some cases. No need to ever call
3853         insertErrorMessageBlock() if we're already stopped since stopParsing() already
3854         takes care of doing this.
3855
3856         * xml/parser/XMLDocumentParserLibxml2.cpp:
3857         (WebCore::XMLDocumentParser::stopParsing):
3858         When XMLDocumentParser::stopParsing() is called to stop parsing, call
3859         insertErrorMessageBlock() to insert the <parsererror> element if an error
3860         occurred.
3861
3862 2019-04-03  Youenn Fablet  <youenn@apple.com>
3863
3864         Clear WorkerCacheStorageConnection callbacks on WorkerGlobalScope termination
3865         https://bugs.webkit.org/show_bug.cgi?id=196521
3866
3867         Reviewed by Alex Christensen.
3868
3869         When the worker global scope is preparing for termination,
3870         all ActiveDOMObjects are stopped.
3871         At that time, the completion handlers related to
3872         WorkerCacheStorageConnection should be cleared to be able to free
3873         memory, and as they are now no-op anyway.
3874
3875         We clear the completion handlers once the active DOM objects are stopped
3876         to limit the processing triggered by clearing them.
3877
3878         Introducing a new Stopped error code to handle this case.
3879         Add an assertion so that this error does not surface to JS.
3880
3881         Covered by existing tests.
3882
3883         * Modules/cache/CacheStorageConnection.cpp:
3884         (WebCore::CacheStorageConnection::clearPendingRequests):
3885         * Modules/cache/CacheStorageConnection.h:
3886         * Modules/cache/DOMCacheEngine.cpp:
3887         (WebCore::DOMCacheEngine::errorToException):
3888         * Modules/cache/DOMCacheEngine.h:
3889         * workers/WorkerGlobalScope.cpp:
3890         (WebCore::WorkerGlobalScope::prepareForTermination):
3891         (WebCore::WorkerGlobalScope::stopIndexedDatabase):
3892
3893 2019-04-03  Youenn Fablet  <youenn@apple.com>
3894
3895         Adopt new VCP SPI
3896         https://bugs.webkit.org/show_bug.cgi?id=193357
3897         <rdar://problem/43656651>
3898
3899         Reviewed by Eric Carlson.
3900
3901         Covered by existing tests.
3902
3903         * testing/Internals.cpp:
3904         (WebCore::Internals::supportsVCPEncoder):
3905
3906 2019-04-03  Chris Dumez  <cdumez@apple.com>
3907
3908         Remove legacy webkitRequestAnimationFrame time quirk
3909         https://bugs.webkit.org/show_bug.cgi?id=196458
3910         <rdar://problem/49490207>
3911
3912         Reviewed by Simon Fraser.
3913
3914         Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
3915         warning whenever webkitRequestAnimationFrame is called.
3916
3917         * dom/ScriptedAnimationController.cpp:
3918         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3919         * page/DOMWindow.cpp:
3920         (WebCore::DOMWindow::requestAnimationFrame):
3921         (WebCore::DOMWindow::webkitRequestAnimationFrame):
3922
3923 2019-04-03  Sihui Liu  <sihui_liu@apple.com>
3924
3925         Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
3926         https://bugs.webkit.org/show_bug.cgi?id=196128
3927
3928         Reviewed by Geoffrey Garen.
3929
3930         If a key is auto-generated, it should become a property of the value object. Network process would perform the 
3931         key injection by deserializing IDBValue into script value, setting the property, serializing the result and 
3932         storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to 
3933         deserialize types including Blob and File.
3934
3935         To solve this issue, we move the key injection to web process and let network process store the original value 
3936         it gets. In this case, when web process asks for some value, network process should return key, value and key 
3937         path so that web process can decide whether it should perform a key injection before returning the result. Note
3938         that the auto-generated key would always be stored as the key in a ObjectStore record.
3939
3940         Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
3941
3942         * Modules/indexeddb/IDBCursor.cpp:
3943         (WebCore::IDBCursor::setGetResult):
3944         * Modules/indexeddb/IDBCursor.h:
3945         (WebCore::IDBCursor::primaryKeyPath):
3946         * Modules/indexeddb/IDBGetAllResult.cpp:
3947         (WebCore::IDBGetAllResult::isolatedCopy):
3948         (WebCore::IDBGetAllResult::addKey):
3949         (WebCore::IDBGetAllResult::addValue):
3950         (WebCore::IDBGetAllResult::keys const):
3951         (WebCore::IDBGetAllResult::values const):
3952         (WebCore::IDBGetAllResult::allBlobFilePaths const):
3953         (WebCore::isolatedCopyOfVariant): Deleted.
3954
3955         * Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
3956         because we only needed to store either key or value before, and now the stored value could be incomplete.
3957         (WebCore::IDBGetAllResult::IDBGetAllResult):
3958         (WebCore::IDBGetAllResult::keyPath const):
3959         (WebCore::IDBGetAllResult::encode const):
3960         (WebCore::IDBGetAllResult::decode):
3961
3962         * Modules/indexeddb/IDBGetResult.cpp:
3963         (WebCore::IDBGetResult::setValue):
3964         * Modules/indexeddb/IDBGetResult.h:
3965         (WebCore::IDBGetResult::IDBGetResult):
3966         (WebCore::IDBGetResult::keyPath const):
3967         * Modules/indexeddb/IDBObjectStore.cpp:
3968         * Modules/indexeddb/IDBRequest.cpp:
3969         (WebCore::IDBRequest::setResult):
3970         (WebCore::IDBRequest::setResultToStructuredClone):
3971         * Modules/indexeddb/IDBRequest.h:
3972         * Modules/indexeddb/IDBTransaction.cpp:
3973         (WebCore::IDBTransaction::didGetAllRecordsOnServer):
3974         (WebCore::IDBTransaction::didGetRecordOnServer):
3975         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3976         (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
3977         * Modules/indexeddb/server/MemoryIndex.cpp:
3978         (WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
3979         (WebCore::IDBServer::MemoryIndex::getAllRecords const):
3980         * Modules/indexeddb/server/MemoryIndexCursor.cpp: