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