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