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