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