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