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