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