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