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