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