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