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