Make all ScriptWrappable IsoHeap-ed
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-09-18  Yusuke Suzuki  <ysuzuki@apple.com>
2
3         Make all ScriptWrappable IsoHeap-ed
4         https://bugs.webkit.org/show_bug.cgi?id=201846
5         <rdar://problem/55407535>
6
7         Reviewed by Mark Lam.
8
9         This patch puts Event and derived classes under IsoHeap to make all ScriptWrappable classes IsoHeap-ed.
10
11         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
12         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
13         (WebCore::WebKitPlaybackTargetAvailabilityEvent::create): Deleted.
14         (WebCore::WebKitPlaybackTargetAvailabilityEvent::availability const): Deleted.
15         * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
16         * Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
17         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
18         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
19         (WebCore::ApplePayPaymentMethodSelectedEvent::create): Deleted.
20         (WebCore::ApplePayPaymentMethodSelectedEvent::paymentMethod): Deleted.
21         * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
22         * Modules/applepay/ApplePayShippingContactSelectedEvent.h:
23         * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
24         * Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
25         * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
26         * Modules/applepay/ApplePayValidateMerchantEvent.h:
27         (WebCore::ApplePayValidateMerchantEvent::create): Deleted.
28         (WebCore::ApplePayValidateMerchantEvent::validationURL const): Deleted.
29         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
30         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
31         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
32         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.h:
33         (WebCore::WebKitMediaKeyMessageEvent::create): Deleted.
34         (WebCore::WebKitMediaKeyMessageEvent::message const): Deleted.
35         (WebCore::WebKitMediaKeyMessageEvent::destinationURL const): Deleted.
36         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
37         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.h:
38         (WebCore::WebKitMediaKeyNeededEvent::create): Deleted.
39         (WebCore::WebKitMediaKeyNeededEvent::initData const): Deleted.
40         * Modules/gamepad/GamepadEvent.cpp:
41         * Modules/gamepad/GamepadEvent.h:
42         (WebCore::GamepadEvent::create): Deleted.
43         (WebCore::GamepadEvent::gamepad const): Deleted.
44         * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
45         * Modules/indexeddb/IDBRequestCompletionEvent.h:
46         (WebCore::IDBRequestCompletionEvent::create): Deleted.
47         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
48         * Modules/indexeddb/IDBVersionChangeEvent.h:
49         * Modules/mediarecorder/BlobEvent.cpp:
50         * Modules/mediarecorder/BlobEvent.h:
51         * Modules/mediarecorder/MediaRecorderErrorEvent.cpp:
52         * Modules/mediarecorder/MediaRecorderErrorEvent.h:
53         * Modules/mediastream/MediaStreamTrackEvent.cpp:
54         * Modules/mediastream/MediaStreamTrackEvent.h:
55         * Modules/mediastream/OverconstrainedErrorEvent.cpp: Copied from Source/WebCore/Modules/mediastream/RTCDataChannelEvent.h.
56         * Modules/mediastream/OverconstrainedErrorEvent.h:
57         (WebCore::OverconstrainedErrorEvent::create): Deleted.
58         (WebCore::OverconstrainedErrorEvent::error const): Deleted.
59         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent): Deleted.
60         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
61         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
62         * Modules/mediastream/RTCDataChannelEvent.cpp:
63         * Modules/mediastream/RTCDataChannelEvent.h:
64         * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
65         * Modules/mediastream/RTCPeerConnectionIceEvent.h:
66         (WebCore::RTCPeerConnectionIceEvent::url const): Deleted.
67         * Modules/mediastream/RTCTrackEvent.cpp:
68         * Modules/mediastream/RTCTrackEvent.h:
69         (WebCore::RTCTrackEvent::receiver const): Deleted.
70         (WebCore::RTCTrackEvent::track const): Deleted.
71         (WebCore::RTCTrackEvent::streams const): Deleted.
72         (WebCore::RTCTrackEvent::transceiver const): Deleted.
73         (WebCore::RTCTrackEvent::eventInterface const): Deleted.
74         * Modules/paymentrequest/MerchantValidationEvent.cpp:
75         * Modules/paymentrequest/MerchantValidationEvent.h:
76         * Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
77         * Modules/paymentrequest/PaymentMethodChangeEvent.h:
78         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
79         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
80         * Modules/speech/SpeechSynthesisEvent.cpp:
81         * Modules/speech/SpeechSynthesisEvent.h:
82         (WebCore::SpeechSynthesisEvent::charIndex const): Deleted.
83         (WebCore::SpeechSynthesisEvent::elapsedTime const): Deleted.
84         (WebCore::SpeechSynthesisEvent::name const): Deleted.
85         (WebCore::SpeechSynthesisEvent::eventInterface const): Deleted.
86         * Modules/webaudio/AudioProcessingEvent.cpp:
87         * Modules/webaudio/AudioProcessingEvent.h:
88         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
89         * Modules/webaudio/OfflineAudioCompletionEvent.h:
90         * Modules/webgpu/GPUUncapturedErrorEvent.cpp:
91         * Modules/webgpu/GPUUncapturedErrorEvent.h:
92         * Modules/websockets/CloseEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
93         * Modules/websockets/CloseEvent.h:
94         (WebCore::CloseEvent::create): Deleted.
95         (WebCore::CloseEvent::wasClean const): Deleted.
96         (WebCore::CloseEvent::code const): Deleted.
97         (WebCore::CloseEvent::reason const): Deleted.
98         (WebCore::CloseEvent::CloseEvent): Deleted.
99         * Modules/webvr/VRDisplayEvent.cpp:
100         * Modules/webvr/VRDisplayEvent.h:
101         * Sources.txt:
102         * WebCore.xcodeproj/project.pbxproj:
103         * accessibility/AccessibleSetValueEvent.cpp:
104         * accessibility/AccessibleSetValueEvent.h:
105         (WebCore::AccessibleSetValueEvent::create): Deleted.
106         (WebCore::AccessibleSetValueEvent::value const): Deleted.
107         * animation/AnimationPlaybackEvent.cpp:
108         * animation/AnimationPlaybackEvent.h:
109         * bindings/js/ScriptWrappable.cpp: Copied from Source/WebCore/html/canvas/WebGLContextEvent.cpp.
110         * bindings/js/ScriptWrappable.h:
111         * dom/AnimationEvent.cpp:
112         * dom/AnimationEvent.h:
113         * dom/BeforeLoadEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
114         * dom/BeforeLoadEvent.h:
115         * dom/BeforeTextInsertedEvent.cpp:
116         * dom/BeforeTextInsertedEvent.h:
117         * dom/BeforeUnloadEvent.cpp:
118         * dom/BeforeUnloadEvent.h:
119         * dom/ClipboardEvent.cpp:
120         * dom/ClipboardEvent.h:
121         * dom/CompositionEvent.cpp:
122         * dom/CompositionEvent.h:
123         * dom/CustomEvent.cpp:
124         * dom/CustomEvent.h:
125         * dom/DeviceMotionEvent.cpp:
126         * dom/DeviceMotionEvent.h:
127         * dom/DeviceOrientationEvent.cpp:
128         * dom/DeviceOrientationEvent.h:
129         * dom/ErrorEvent.cpp:
130         * dom/ErrorEvent.h:
131         * dom/Event.cpp:
132         * dom/Event.h:
133         * dom/FocusEvent.cpp:
134         * dom/FocusEvent.h:
135         * dom/HashChangeEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
136         * dom/HashChangeEvent.h:
137         * dom/InputEvent.cpp:
138         * dom/InputEvent.h:
139         * dom/KeyboardEvent.cpp:
140         * dom/KeyboardEvent.h:
141         * dom/MessageEvent.cpp:
142         * dom/MessageEvent.h:
143         * dom/MouseEvent.cpp:
144         * dom/MouseEvent.h:
145         * dom/MouseRelatedEvent.cpp:
146         * dom/MouseRelatedEvent.h:
147         * dom/MutationEvent.cpp:
148         * dom/MutationEvent.h:
149         * dom/OverflowEvent.cpp:
150         * dom/OverflowEvent.h:
151         * dom/PageTransitionEvent.cpp:
152         * dom/PageTransitionEvent.h:
153         * dom/PointerEvent.cpp:
154         * dom/PointerEvent.h:
155         * dom/PopStateEvent.cpp:
156         * dom/PopStateEvent.h:
157         * dom/ProgressEvent.cpp:
158         * dom/ProgressEvent.h:
159         * dom/PromiseRejectionEvent.cpp:
160         * dom/PromiseRejectionEvent.h:
161         * dom/SecurityPolicyViolationEvent.cpp: Copied from Source/WebCore/dom/BeforeTextInsertedEvent.cpp.
162         * dom/SecurityPolicyViolationEvent.h:
163         * dom/TextEvent.cpp:
164         * dom/TextEvent.h:
165         * dom/TouchEvent.cpp:
166         * dom/TouchEvent.h:
167         * dom/TransitionEvent.cpp:
168         * dom/TransitionEvent.h:
169         * dom/UIEvent.cpp:
170         * dom/UIEvent.h:
171         * dom/UIEventWithKeyState.cpp:
172         * dom/UIEventWithKeyState.h:
173         * dom/WebKitAnimationEvent.cpp:
174         * dom/WebKitAnimationEvent.h:
175         * dom/WebKitTransitionEvent.cpp:
176         * dom/WebKitTransitionEvent.h:
177         * dom/WheelEvent.cpp:
178         * dom/WheelEvent.h:
179         * html/MediaEncryptedEvent.cpp:
180         * html/MediaEncryptedEvent.h:
181         * html/canvas/WebGLContextEvent.cpp:
182         * html/canvas/WebGLContextEvent.h:
183         * html/shadow/ProgressShadowElement.h:
184         * html/track/TrackEvent.cpp:
185         * html/track/TrackEvent.h:
186         * storage/StorageEvent.cpp:
187         * storage/StorageEvent.h:
188         (WebCore::StorageEvent::key const): Deleted.
189         (WebCore::StorageEvent::oldValue const): Deleted.
190         (WebCore::StorageEvent::newValue const): Deleted.
191         (WebCore::StorageEvent::url const): Deleted.
192         (WebCore::StorageEvent::storageArea const): Deleted.
193         * svg/SVGFEDistantLightElement.h:
194         * svg/SVGFEFuncAElement.h:
195         * svg/SVGFEFuncBElement.h:
196         * svg/SVGFEFuncGElement.h:
197         * svg/SVGFEFuncRElement.h:
198         * svg/SVGFEPointLightElement.h:
199         * svg/SVGFESpotLightElement.h:
200         * svg/SVGZoomEvent.cpp:
201         * svg/SVGZoomEvent.h:
202         * workers/service/ExtendableEvent.cpp:
203         * workers/service/ExtendableEvent.h:
204         * workers/service/ExtendableMessageEvent.cpp:
205         * workers/service/ExtendableMessageEvent.h:
206         * workers/service/FetchEvent.cpp:
207         * workers/service/FetchEvent.h:
208         * xml/XMLHttpRequestProgressEvent.cpp: Copied from Source/WebCore/Modules/encryptedmedia/MediaKeyMessageEvent.cpp.
209         * xml/XMLHttpRequestProgressEvent.h:
210         (WebCore::XMLHttpRequestProgressEvent::create): Deleted.
211         (WebCore::XMLHttpRequestProgressEvent::position const): Deleted.
212         (WebCore::XMLHttpRequestProgressEvent::totalSize const): Deleted.
213         (WebCore::XMLHttpRequestProgressEvent::XMLHttpRequestProgressEvent): Deleted.
214
215 2019-09-18  Loïc Yhuel  <loic.yhuel@softathome.com>  and  Fujii Hironori  <Hironori.Fujii@sony.com>
216
217         JPEGImageDecoder: use libjpeg-turbo RGBA output path even for Adobe transform=0 JPEGs
218         https://bugs.webkit.org/show_bug.cgi?id=200163
219
220         Reviewed by Carlos Garcia Campos.
221
222         Remove the workaround for old libjpeg-turbo which doesn't support
223         BGRA output for Adobe transform=0 images. The bug was fixed in
224         libjpeg-turbo 1.2.1.
225
226         No new tests, no behavior change.
227
228         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
229         (WebCore::JPEGImageReader::decode): Removed code in #if defined(TURBO_JPEG_RGB_SWIZZLE).
230         (colorSpaceHasAlpha): Removed an unused inline function.
231
232 2019-09-18  Joonghun Park  <jh718.park@samsung.com>
233
234         Unreviewed. Remove build warning since r248998.
235
236         This patch removes build warning below.
237         warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
238
239         No new tests, no behavioral change.
240
241         * platform/image-decoders/png/PNGImageDecoder.cpp:
242         (WebCore::PNGImageDecoder::rowAvailable):
243
244 2019-09-18  Fujii Hironori  <Hironori.Fujii@sony.com>
245
246         [cairo] Incorrect targetRect in BackingStoreBackendCairoImpl::scroll
247         https://bugs.webkit.org/show_bug.cgi?id=201895
248
249         Reviewed by Carlos Garcia Campos.
250
251         In BackingStoreBackendCairoImpl::scroll, targetRect is calculated
252         wrongly by shifting maxX and maxY. Bug 59655 fixed the issue by
253         removing the shifting, but only for BackingStoreBackendCairoX11::scroll.
254
255         No new tests, no behavior change.
256
257         * platform/graphics/cairo/BackingStoreBackendCairoImpl.cpp:
258         (WebCore::BackingStoreBackendCairoImpl::scroll): Take intersection of targetRect and scrollRect.
259
260 2019-09-18  Andy Estes  <aestes@apple.com>
261
262         [Cocoa] Add a WKA extension point
263         https://bugs.webkit.org/show_bug.cgi?id=201801
264         <rdar://problem/55372507>
265
266         Reviewed by Alexey Proskuryakov.
267
268         * Modules/applepay/ApplePayRequestBase.cpp:
269         (WebCore::requiresSupportedNetworks):
270         (WebCore::convertAndValidate):
271
272 2019-09-17  Chris Dumez  <cdumez@apple.com>
273
274         Unreviewed, revert change that Alex mistakenly committed at the same time as r250006 and broke the build.
275
276         * page/PerformanceObserver.idl:
277
278 2019-09-17  Chris Dumez  <cdumez@apple.com>
279
280         Stop calling Page::setSessionID() from WebKit2
281         https://bugs.webkit.org/show_bug.cgi?id=201888
282
283         Reviewed by Alex Christensen.
284
285         Stop calling Page::setSessionID() from WebKit2 since Page's sessionID can never change when
286         using WebKit2 (We process-swap and create a new Page in a new process when changing data
287         store). Instead, we now pass the sessionID ID when constructing the Page, as part of the
288         PageConfiguration structure.
289
290         * editing/markup.cpp:
291         (WebCore::createPageForSanitizingWebContent):
292         * loader/EmptyClients.cpp:
293         (WebCore::pageConfigurationWithEmptyClients):
294         * loader/EmptyClients.h:
295         * page/Page.cpp:
296         (WebCore::Page::Page):
297         (WebCore::Page::setSessionID):
298         * page/PageConfiguration.cpp:
299         (WebCore::PageConfiguration::PageConfiguration):
300         * page/PageConfiguration.h:
301         * svg/graphics/SVGImage.cpp:
302         (WebCore::SVGImage::dataChanged):
303         * workers/service/context/ServiceWorkerThreadProxy.cpp:
304         (WebCore::createPageForServiceWorker):
305         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
306
307 2019-09-17  Mark Lam  <mark.lam@apple.com>
308
309         Use constexpr instead of const in symbol definitions that are obviously constexpr.
310         https://bugs.webkit.org/show_bug.cgi?id=201879
311
312         Rubber-stamped by Joseph Pecoraro.
313
314         No new tests.  Covered by existing tests.
315
316         * bindings/js/JSDOMConstructorBase.h:
317         * bindings/js/JSDOMWindowProperties.h:
318         * bindings/scripts/CodeGeneratorJS.pm:
319         (GenerateHeader):
320         (GeneratePrototypeDeclaration):
321         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
322         * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
323         * bindings/scripts/test/JS/JSTestEnabledForContext.h:
324         * bindings/scripts/test/JS/JSTestEventTarget.h:
325         * bindings/scripts/test/JS/JSTestGlobalObject.h:
326         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
327         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
328         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
329         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
330         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
331         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
332         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
333         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
334         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
335         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
336         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
337         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
338         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
339         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
340         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
341         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
342         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
343         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
344         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
345         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
346         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
347         * bindings/scripts/test/JS/JSTestObj.h:
348         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
349         * bindings/scripts/test/JS/JSTestPluginInterface.h:
350         * bindings/scripts/test/JS/JSTestTypedefs.h:
351         * bridge/objc/objc_runtime.h:
352         * bridge/runtime_array.h:
353         * bridge/runtime_method.h:
354         * bridge/runtime_object.h:
355
356 2019-09-17  Ross Kirsling  <ross.kirsling@sony.com>
357
358         Unreviewed restabilization of non-unified build.
359
360         * inspector/InspectorCanvas.cpp:
361         (WebCore::InspectorCanvas::resolveContext const):
362         * platform/win/BString.h:
363         * svg/PatternAttributes.h:
364         * svg/SVGLengthValue.cpp:
365         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
366         * workers/service/ServiceWorkerJob.cpp:
367         * workers/service/WorkerSWClientConnection.cpp:
368         * workers/service/server/SWServerRegistration.cpp:
369
370 2019-09-17  Keith Rollin  <krollin@apple.com>
371
372         Remove some support for < iOS 12
373         https://bugs.webkit.org/show_bug.cgi?id=201851
374         <rdar://problem/55422044>
375
376         Reviewed by Jiewen Tan and Alexey Proskuryakov.
377
378         Remove some support for iOS versions less than 12.0.
379
380         Update conditionals that reference __IPHONE_OS_VERSION_MIN_REQUIRED
381         and __IPHONE_OS_VERSION_MAX_ALLOWED, assuming that they both have
382         values >= 120000. This means that expressions like
383         "__IPHONE_OS_VERSION_MIN_REQUIRED < 101200" are always False and
384         "__IPHONE_OS_VERSION_MIN_REQUIRED >= 101200" are always True.
385
386         This removal is part of a series of patches effecting such removal.
387
388         No new tests -- no new or changed functionality.
389
390         * crypto/mac/CryptoKeyRSAMac.cpp:
391         (WebCore::CryptoKeyRSA::create):
392         (WebCore::castDataArgumentToCCRSACryptorCreateFromDataIfNeeded): Deleted.
393
394 2019-09-17  Nikolas Zimmermann  <zimmermann@kde.org>
395
396         SVG <animateMotion> does not reset the element to its first animation frame if its fill is "remove"
397         https://bugs.webkit.org/show_bug.cgi?id=201565
398
399         Reviewed by Said Abou-Hallawa.
400
401         Fix fill="remove" support for <animateMotion>: properly trigger visual updates.
402         Motion animations are implemented by provding an additional transformation on
403         SVGGraphicsElements: the supplementalTransform().
404
405         When an <animateMotion> element specifies fill="remove" the supplemental transform is
406         correctly reset, when the animation is finished. However, nobody is notified about the
407         change of transformation matrix. Fix by marking the target elements renderer as
408         setNeedsTransformUpdate() and call markForLayoutAndParentResourceInvalidation().
409
410         <animate> elements are not affected by the bug:
411         SVGAnimateElementBase::clearAnimatedType()
412          -> invokes SVGAttributeAnimator::stop()
413             -> invokes applyAnimatedPropertyChange() [via SVGAnimatedPropertyAnimator]
414             -> invokes SVGXXXElement::svgAttributeChanged().
415
416         When animating e.g. the 'transform' attribute SVGGraphicsElement::svgAttributeChanged()
417         will use exactly the same mechanism to trigger visul updates: first call
418         setNeedsTransformUpdate() on the associated renderer, followd by a call to
419         markForLayoutAndParentResourceInvalidation().
420
421         --> Both code paths are now consistent.
422         Also fixes http://web-platform-tests.live/svg/animations/animateMotion-fill-remove.html.
423
424         Tests: svg/animations/fill-remove-support.html
425                svg/animations/animateMotion-remove-freeze-use.svg
426
427         * svg/SVGAnimateMotionElement.cpp:
428         (WebCore::SVGAnimateMotionElement::clearAnimatedType): Call applyResultsToTarget().
429         (WebCore::SVGAnimateMotionElement::calculateAnimatedValue): Stop calling
430         setNeedsTransformUpdate() on the target elements renderer, since applyResultsToTarget()
431         is responsible for modifications of the renderer state.
432         (WebCore::SVGAnimateMotionElement::applyResultsToTarget): Always mark the renderer
433         as setNeedsTransformUpdate() when applying the results, before the call to
434         RenderSVGResource::markForLayoutAndParentResourceInvalidation(). This is more consistent
435         with respect to the code path that updates the SVGElements instances (<use> support).
436
437 2019-09-17  Andy Estes  <aestes@apple.com>
438
439         [Cocoa] Add a WKA extension point
440         https://bugs.webkit.org/show_bug.cgi?id=201801
441         <rdar://problem/55372507>
442
443         Reviewed by Alexey Proskuryakov.
444
445         * Modules/applepay/ApplePayRequestBase.cpp:
446         (WebCore::requiresSupportedNetworks):
447         (WebCore::convertAndValidate):
448
449 2019-09-17  Antti Koivisto  <antti@apple.com>
450
451         TextIterator should convert tabs to spaces
452         https://bugs.webkit.org/show_bug.cgi?id=201863
453
454         Reviewed by Zalan Bujtas.
455
456         As seen in tests
457
458         imported/w3c/web-platform-tests/innerText/getter.html
459         imported/w3c/web-platform-tests/html/dom/elements/the-innertext-idl-attribute/getter.html
460
461         The old simple line layout path in TextIterator used to do this.
462
463         * editing/TextIterator.cpp:
464         (WebCore::TextIterator::handleTextBox):
465
466 2019-09-17  Zalan Bujtas  <zalan@apple.com>
467
468         [LFC[MarginCollapsing] MarginCollapse::estimatedMarginBefore should take pre-computed non-collapsed margin values.
469         https://bugs.webkit.org/show_bug.cgi?id=201848
470         <rdar://problem/55419419>
471
472         Reviewed by Antti Koivisto.
473
474         This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
475         See webkit.org/b/201795
476
477         * layout/blockformatting/BlockFormattingContext.cpp:
478         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
479         * layout/blockformatting/BlockFormattingContext.h:
480         * layout/blockformatting/BlockMarginCollapse.cpp:
481         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
482         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
483         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
484         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
485         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
486
487 2019-09-17  Zalan Bujtas  <zalan@apple.com>
488
489         [First-letter] Use WeakPtr for the first-letter insertion point.
490         https://bugs.webkit.org/show_bug.cgi?id=201842
491         <rdar://problem/51373788>
492
493         Reviewed by Antti Koivisto.
494
495         The about-to-be-removed first letter renderer's sibling could potentially be destroyed too as the result of the anonymous subtree collapsing logic (when the next sibling is a generated anonymous block and it is not needed anymore.)
496
497         Test: fast/text/first-letter-with-columns-crash.html
498
499         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
500         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
501
502 2019-09-17  Carlos Garcia Campos  <cgarcia@igalia.com>
503
504         [GTK] Cannot create EGL window surface: EGL_BAD_ALLOC
505         https://bugs.webkit.org/show_bug.cgi?id=201505
506
507         Reviewed by Žan Doberšek.
508
509         This happens because eglCreateWindowSurface() is called twice for the same window when not using the WPE
510         renderer. New versions of Mesa fail the second time with a EGL_BAD_ALLOC.
511
512         * platform/graphics/egl/GLContextEGL.cpp:
513         (WebCore::GLContextEGL::createWindowContext): Check surface is nullptr before falling back to use
514         eglCreateWindowSurface().
515
516 2019-09-17  Jiewen Tan  <jiewen_tan@apple.com>
517
518         [WebAuthn] Use WebPreferences instead of RuntimeEnabledFeatures in UIProcess
519         https://bugs.webkit.org/show_bug.cgi?id=198176
520         <rdar://problem/55285709>
521
522         Reviewed by Youenn Fablet.
523
524         No changes of behavior.
525
526         * Modules/webauthn/PublicKeyCredential.cpp:
527         (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
528         Resolves the promise with false immediately when the feature flag is false.
529
530 2019-09-17  Rob Buis  <rbuis@igalia.com>
531
532         Access-Control-Expose-Headers parsed incorrectly
533         https://bugs.webkit.org/show_bug.cgi?id=172357
534
535         Reviewed by Youenn Fablet.
536
537         When parsing the list, strip HTTP spaces and verify
538         that the list items are valid HTTP tokens.
539
540         Behavior matches Firefox and Chrome.
541
542         Test: imported/w3c/web-platform-tests/cors/access-control-expose-headers-parsing.window.html
543
544         * platform/network/HTTPParsers.h:
545         (WebCore::addToAccessControlAllowList):
546         (WebCore::parseAccessControlAllowList):
547
548 2019-09-17  Youenn Fablet  <youenn@apple.com>
549
550         Content-Type should be preserved on responses created from DOMCache
551         https://bugs.webkit.org/show_bug.cgi?id=201815
552
553         Reviewed by Alex Christensen.
554
555        Covered by updated test expectations
556
557         * Modules/fetch/FetchResponse.cpp:
558         (WebCore::FetchResponse::create):
559         Update content type when creating the response from DOMCache.
560
561 2019-09-16  Antti Koivisto  <antti@apple.com>
562
563         Move code for traversing reversed text boxes from TextIterator to TextBoxIterator
564         https://bugs.webkit.org/show_bug.cgi?id=201819
565
566         Reviewed by Zalan Bujtas.
567
568         Handle traversal order in TextBoxIterator.
569
570         * editing/TextIterator.cpp:
571         (WebCore::TextIterator::handleTextNode):
572         (WebCore::TextIterator::handleTextBox):
573         (WebCore::TextIterator::handleTextNodeFirstLetter):
574         * editing/TextIterator.h:
575         * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
576         (WebCore::LineLayoutInterface::TextBox::rect const):
577         (WebCore::LineLayoutInterface::TextBox::logicalRect const):
578         (WebCore::LineLayoutInterface::TextBox::hasHyphen const):
579         (WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
580         (WebCore::LineLayoutInterface::TextBox::dirOverride const):
581         (WebCore::LineLayoutInterface::TextBox::text const):
582         (WebCore::LineLayoutInterface::TextBox::localStartOffset const):
583         (WebCore::LineLayoutInterface::TextBox::localEndOffset const):
584         (WebCore::LineLayoutInterface::TextBox::length const):
585         (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
586         (WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInVisualOrder):
587         (WebCore::LineLayoutInterface::TextBoxIterator::traverseNextInTextOrder):
588         (WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
589         (WebCore::LineLayoutInterface::TextBoxIterator::atEnd const):
590         (WebCore::LineLayoutInterface::Provider::firstTextBoxInVisualOrderFor):
591         (WebCore::LineLayoutInterface::Provider::firstTextBoxInTextOrderFor):
592         (WebCore::LineLayoutInterface::Provider::textBoxRangeFor):
593         * rendering/line/LineLayoutInterfaceTextBoxes.h:
594         (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
595         (WebCore::LineLayoutInterface::TextBoxIterator::operator++):
596         (WebCore::LineLayoutInterface::Provider::firstTextBoxFor):
597
598 2019-09-16  Fujii Hironori  <Hironori.Fujii@sony.com>
599
600         [WinCairo][curl] Don't compile unused CertificateCFWin.cpp
601         https://bugs.webkit.org/show_bug.cgi?id=201860
602
603         Reviewed by Alex Christensen.
604
605         Curl port is using ResourceHandle::setClientCertificateInfo
606         instead of ResourceHandle::setClientCertificate.
607
608         * PlatformWin.cmake: Added CertificateCFWin.cpp to WebCore_SOURCES only if USE_CFURLCONNECTION.
609         * platform/network/ResourceHandle.h: Removed an unused method setClientCertificate.
610         * platform/network/curl/ResourceHandleCurl.cpp:
611         (WebCore::ResourceHandle::setClientCertificate): Deleted.
612
613 2019-09-16  Fujii Hironori  <Hironori.Fujii@sony.com>
614
615         [AppleWin] Assertion failure in defaultSupportedImageTypes in UTIRegistry.cpp
616         https://bugs.webkit.org/show_bug.cgi?id=198286
617
618         Reviewed by Brent Fulgham.
619
620         Some image types aren't supported by CG for Windows.
621
622         No new tests, covered by existing tests.
623
624         * platform/graphics/cg/ImageSourceCGWin.cpp:
625         (WebCore::MIMETypeForImageType): Return the correct MIME types for
626         com.microsoft.cur and com.microsoft.ico.
627         * platform/graphics/cg/UTIRegistry.cpp:
628         (WebCore::defaultSupportedImageTypes): Excluded public.jpeg-2000 and public.mpo-image if PLATFORM(WIN).
629
630 2019-09-16  Fujii Hironori  <Hironori.Fujii@sony.com>
631
632         [Cairo] Image::drawTiled → Cairo::drawSurface → cairo_paint_with_alpha → segfault happens in pixman
633         https://bugs.webkit.org/show_bug.cgi?id=201755
634
635         Reviewed by Don Olmstead.
636
637         Segmentation faults happened in pixman while painting a image. In
638         Cairo::drawSurface, originalSrcRect can be slightly larger than
639         the surface size because of floating number calculations.
640         Cairo::drawSurface created a subsurface which is running over the
641         parent surface boundaries.
642
643         * platform/graphics/cairo/CairoOperations.cpp:
644         (WebCore::Cairo::drawSurface): Calculated a intersection with
645         expandedSrcRect and the parent surface size for subsurface size.
646
647 2019-09-16  Eric Liang  <ericliang@apple.com>
648
649         AX: USER: VO: Messages > Message > Shift-VO-M doesn't reveal correct actions
650         https://bugs.webkit.org/show_bug.cgi?id=201840
651
652         Reviewed by Chris Fleizach.
653
654         menuForEvent: expects event-position in window's space, but we pass the position in Core's space. In this case, we need to convert core's space to window's space.
655         Tested that existing tests passed with WK1 and WK2
656
657         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
658         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
659
660 2019-09-16  Jiewen Tan  <jiewen_tan@apple.com>
661
662         [WebAuthn] Support more than two FIDO protocol versions
663         https://bugs.webkit.org/show_bug.cgi?id=198408
664         <rdar://problem/51292176>
665
666         Reviewed by Chris Dumez.
667
668         Covered by new API tests.
669
670         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
671         (fido::readCTAPGetInfoResponse):
672         Remove the check for the array size.
673
674 2019-09-16  Brent Fulgham  <bfulgham@apple.com>
675
676         [FTW] Correct lifespan of other SharedBitmaps
677         https://bugs.webkit.org/show_bug.cgi?id=201800
678
679         Reviewed by Dean Jackson.
680
681         The pop-up menu code creates its own SharedBitmap in the WebContent process,
682         which needs to release its handle before destruction, otherwise the UIProcess
683         will be unable to access the GPU texture (since it will have been cleaned up).
684
685         This patch also audits other uses of SharedBitmap to make sure a similar
686         problem doesn't exist elsewhere.
687
688         * platform/graphics/win/Direct2DUtilities.cpp:
689         (WebCore::Direct2D::toDXGIDevice): Switch to IDXGIDevice1 (since that is our
690         minimum target DX).
691         (WebCore::Direct2D::factoryForDXGIDevice): Ditto.
692         (WebCore::Direct2D::swapChainOfSizeForWindowAndDevice): Added.
693         * platform/graphics/win/Direct2DUtilities.h:
694         * platform/graphics/win/GraphicsContextDirect2D.cpp:
695         (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate): Correct
696         a very silly use-after-move in the implementation.
697         * platform/graphics/win/PlatformContextDirect2D.h:
698         (WebCore::PlatformContextDirect2D::d3dDevice const): Added.
699         (WebCore::PlatformContextDirect2D::setD3DDevice):
700
701 2019-09-16  Chris Dumez  <cdumez@apple.com>
702
703         Simplify WebResourceLoadObserver now that we have one WebProcess per session
704         https://bugs.webkit.org/show_bug.cgi?id=201821
705
706         Reviewed by Brent Fulgham.
707
708         * Modules/websockets/WebSocket.cpp:
709         (WebCore::WebSocket::connect):
710         * loader/ResourceLoadObserver.h:
711         (WebCore::ResourceLoadObserver::logWebSocketLoading):
712         (WebCore::ResourceLoadObserver::statisticsForURL):
713         * testing/Internals.cpp:
714         (WebCore::Internals::resourceLoadStatisticsForURL):
715
716 2019-09-16  ChangSeok Oh  <changseok@webkit.org>
717
718         [GTK] Remove GraphicsContext3D dependency from the outside of WebGL
719         https://bugs.webkit.org/show_bug.cgi?id=201748
720
721         Reviewed by Alex Christensen.
722
723         This is a preliminary change to bring ANGLE support for WebGL to GTK port.
724         GraphicsContext3DANGLE has its own egl context but we want to make ANGLE egl context
725         for WebGL and other GL contexts (i.e., glx, gles/egl) for TextureMapper live together.
726         Mixed uses of GraphicsContext3D outside of WebGL code could cause unintended behaviors.
727         We want to make sure that only WebGL code uses it.
728
729         No new tests since no functionality changed.
730
731         * platform/graphics/GLContext.cpp:
732         * platform/graphics/GLContext.h:
733         * platform/graphics/glx/GLContextGLX.cpp:
734         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
735         (WebCore::GstVideoFrameHolder::platformLayerBuffer):
736         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
737         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
738
739 2019-09-16  Zalan Bujtas  <zalan@apple.com>
740
741         [LFC] Make the nested Geometry/MarginCollapse/Quirks c'tors private.
742         https://bugs.webkit.org/show_bug.cgi?id=201825
743         <rdar://problem/55403474>
744
745         Reviewed by Antti Koivisto.
746
747         The Geometry/MarginCollapse/Quirks objects should be constructed through the corresponding accessor functions.
748         This is also a preparation for being able to pass the layout box in to these stack objects and call geometry(layoutBox)->outOfFlowVerticalGeometry() vs. geometry()->outOfFlowVerticalGeometry(layoutBox). 
749
750         * layout/FormattingContext.h:
751         * layout/blockformatting/BlockFormattingContext.h:
752         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
753         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
754         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
755         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
756         * layout/inlineformatting/InlineFormattingContext.h:
757         * layout/tableformatting/TableFormattingContext.h:
758
759 2019-09-16  Jon Davis  <jond@apple.com>
760
761         Update feature status for Battery Status API, WebGL 2, and Dialog Element
762         https://bugs.webkit.org/show_bug.cgi?id=201469
763
764         Reviewed by Joseph Pecoraro.
765
766         * features.json:
767
768 2019-09-16  Andres Gonzalez  <andresg_22@apple.com>
769
770         Rename [WebAccessibilityObjectWrapper _accessibilityInsertText] to accessibilityInsertText to match accessibility client.
771         https://bugs.webkit.org/show_bug.cgi?id=201820
772
773         Reviewed by Chris Fleizach.
774
775         No new tests necessary since this is a method rename.
776
777         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
778         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
779         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]): Deleted.
780         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
781         (-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
782         (-[WebAccessibilityObjectWrapper _accessibilityInsertText:]): Deleted.
783
784 2019-09-16  Zalan Bujtas  <zalan@apple.com>
785
786         [LFC] Always provide a containing block width value to compute* functions.
787         https://bugs.webkit.org/show_bug.cgi?id=201809
788         <rdar://problem/55383153>
789
790         Reviewed by Antti Koivisto.
791
792         The caller can always make a more informative decision about the default value when the containing block width is not available.
793         (Currently the only case is when computing the preferred width.)
794
795         * layout/FormattingContext.cpp:
796         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
797         * layout/FormattingContextGeometry.cpp:
798         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
799         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
800         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
801         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
802         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
803         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
804         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin const):
805         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
806         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin const):
807         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
808         (WebCore::Layout::FormattingContext::Geometry::computedPadding const):
809         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin const):
810         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin const):
811         * layout/LayoutUnits.h:
812         (WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
813         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
814         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
815         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
816         * layout/inlineformatting/InlineFormattingContext.cpp:
817         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
818         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
819         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
820         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox):
821         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
822         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
823
824 2019-09-16  Zalan Bujtas  <zalan@apple.com>
825
826         [LFC][BFC] BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin should not read containing block's width
827         https://bugs.webkit.org/show_bug.cgi?id=201807
828         <rdar://problem/55381342>
829
830         Reviewed by Antti Koivisto.
831
832         This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
833         See webkit.org/b/201795
834
835         * layout/blockformatting/BlockFormattingContext.h:
836         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
837         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
838         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
839         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
840
841 2019-09-16  Antti Koivisto  <antti@apple.com>
842
843         Eliminate separate simple line layout path from TextIterator
844         https://bugs.webkit.org/show_bug.cgi?id=201760
845
846         Reviewed by Zalan Bujtas.
847
848         Use the new line layout iterator to implement linebox traversal in TextIterator.
849
850         * WebCore.xcodeproj/project.pbxproj:
851         * editing/TextIterator.cpp:
852         (WebCore::TextIterator::advance):
853         (WebCore::TextIterator::handleTextNode):
854         (WebCore::TextIterator::handleTextBox):
855
856         InlineTextBox* -> LineLayoutInterface::TextBoxIterator
857         Delete the seperate simple line layout path.
858
859         (WebCore::TextIterator::handleTextNodeFirstLetter):
860         (WebCore::TextIterator::emitCharacter):
861         (WebCore::TextIterator::emitText):
862         * editing/TextIterator.h:
863         * rendering/RenderTreeAsText.cpp:
864         (WebCore::RenderTreeAsText::writeRenderObject):
865         (WebCore::write):
866         * rendering/SimpleLineLayoutResolver.cpp:
867         (WebCore::SimpleLineLayout::RunResolver::Iterator::Iterator):
868         (WebCore::SimpleLineLayout::RunResolver::Iterator::advanceLines):
869         * rendering/SimpleLineLayoutResolver.h:
870         (WebCore::SimpleLineLayout::RunResolver::Iterator::resolver const):
871         (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode const):
872         (WebCore::SimpleLineLayout::RunResolver::Iterator::operator== const):
873         (WebCore::SimpleLineLayout::RunResolver::Iterator::simpleRun const):
874
875         Make RunResolver::Iterator copyable (so TextBoxIterator becomes copyable too).
876
877         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
878         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
879         * rendering/line/LineLayoutInterfaceTextBoxes.cpp:
880         (WebCore::LineLayoutInterface::TextBox::rect const):
881         (WebCore::LineLayoutInterface::TextBox::logicalRect const):
882         (WebCore::LineLayoutInterface::TextBox::hasHyphen const):
883         (WebCore::LineLayoutInterface::TextBox::isLeftToRightDirection const):
884         (WebCore::LineLayoutInterface::TextBox::dirOverride const):
885         (WebCore::LineLayoutInterface::TextBox::text const):
886         (WebCore::LineLayoutInterface::TextBox::localStartOffset const):
887         (WebCore::LineLayoutInterface::TextBox::localEndOffset const):
888         (WebCore::LineLayoutInterface::TextBox::length const):
889
890         Add offset and length functions.
891
892         (WebCore::LineLayoutInterface::TextBox::iterator const):
893         (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
894         (WebCore::LineLayoutInterface::TextBoxIterator::traverseNext):
895         (WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
896         (WebCore::LineLayoutInterface::TextBoxIterator::atEnd const):
897         (WebCore::LineLayoutInterface::Provider::firstTextBoxFor):
898         (WebCore::LineLayoutInterface::Provider::textBoxRangeFor):
899         (WebCore::LineLayoutInterface::Provider::iteratorForInlineTextBox):
900
901         Add Provider class for making iterators. It constructs and keeps SimpleLineLayout::Resolvers alive during traversal as needed.
902
903         * rendering/line/LineLayoutInterfaceTextBoxes.h:
904         (WebCore::LineLayoutInterface::TextBoxIterator::TextBoxIterator):
905         (WebCore::LineLayoutInterface::TextBoxIterator::operator bool const):
906         (WebCore::LineLayoutInterface::TextBoxIterator::operator== const):
907         (WebCore::LineLayoutInterface::TextBoxIterator::operator!= const):
908         (WebCore::LineLayoutInterface::TextBoxIterator::operator* const):
909         (WebCore::LineLayoutInterface::TextBoxIterator::operator-> const):
910
911         Make TextBoxIterator privately inherit TextBox. This way we don't need to construct temporaries and can easily implement operator->.
912
913         (WebCore::LineLayoutInterface::TextBoxRange::TextBoxRange):
914         (WebCore::LineLayoutInterface::TextBoxRange::begin const):
915         (WebCore::LineLayoutInterface::TextBoxRange::end const):
916
917         Use separate end() type of C++17 ranges.
918
919 2019-09-16  Andres Gonzalez  <andresg_22@apple.com>
920
921         Expose misspelling ranges for editable content to accessibility clients.
922         https://bugs.webkit.org/show_bug.cgi?id=201752
923         <rdar://problem/49556828>
924
925         Reviewed by Chris Fleizach.
926
927         Test: accessibility/misspelling-range.html
928
929         Added [WebAccessibilityObjectWrapper misspellingTextMarkerRange] and
930         underlying AccessibilityObject implementation to expose misspellings to
931         accessibility clients that provide an alternative user interface to
932         spell checking.
933         * accessibility/AccessibilityObject.cpp:
934         (WebCore::AccessibilityObject::getMisspellingRange const):
935         * accessibility/AccessibilityObject.h:
936         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
937         (-[WebAccessibilityObjectWrapper misspellingTextMarkerRange:direction:]):
938         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
939         (accessibilityMisspellingSearchCriteriaForParameterizedAttribute):
940         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
941
942 2019-09-15  Andy Estes  <aestes@apple.com>
943
944         [WebIDL] Derived dictionaries should inherit their inherited dictionaries' partials
945         https://bugs.webkit.org/show_bug.cgi?id=201802
946
947         Reviewed by Sam Weinig.
948
949         Prior to this change, a dictionary D that inherits from dictionary B would not inherit B's
950         partial dictionaries. Fixed this by moving supplemental dependencies processing from
951         generate-bindings.pl to CodeGenerator.pm and reusing it in GetDictionaryByType.
952
953         Added new bindings tests.
954
955         * bindings/scripts/CodeGenerator.pm:
956         (new):
957         (ProcessDocument):
958         (ProcessSupplementalDependencies):
959         (shouldPropertyBeExposed):
960         (GetDictionaryByType):
961         * bindings/scripts/generate-bindings.pl:
962         (generateBindings):
963         (shouldPropertyBeExposed): Deleted.
964         * bindings/scripts/test/JS/JSTestDerivedDictionary.cpp: Added.
965         (WebCore::convertDictionary<TestDerivedDictionary>):
966         (WebCore::convertDictionaryToJS):
967         * bindings/scripts/test/JS/JSTestDerivedDictionary.h: Added.
968         * bindings/scripts/test/JS/JSTestInheritedDictionary.cpp: Added.
969         (WebCore::convertDictionary<TestInheritedDictionary>):
970         (WebCore::convertDictionaryToJS):
971         * bindings/scripts/test/JS/JSTestInheritedDictionary.h: Added.
972         * bindings/scripts/test/TestDerivedDictionary.idl: Added.
973         * bindings/scripts/test/TestInheritedDictionary.idl: Added.
974         * bindings/scripts/test/TestSupplemental.idl:
975
976 2019-09-15  David Kilzer  <ddkilzer@apple.com>
977
978         Missing call to [self init] in -[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]
979         <https://webkit.org/b/201806>
980
981         Reviewed by Simon Fraser.
982
983         * platform/mac/ScrollAnimatorMac.mm:
984         (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
985         Call [self init] and return early if the result is nil.
986
987 2019-09-14  Justin Fan  <justin_fan@apple.com>
988
989         [WebGPU] Make WebGPURenderPipeline and WebGPUComputePipeline inherit from GPUObjectBase
990         https://bugs.webkit.org/show_bug.cgi?id=201207
991
992         Reviewed by Dean Jackson.
993
994         Make remaining WebGPU "client" classes manage their error scopes, instead of the internal classes.
995         Matches Web/GPUBuffer, and allows "invalid" WebGPU objects to create errors.
996
997         Covered by existing tests.
998
999         * Modules/webgpu/WebGPUComputePipeline.cpp:
1000         (WebCore::WebGPUComputePipeline::create):
1001         (WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
1002         * Modules/webgpu/WebGPUComputePipeline.h:
1003         * Modules/webgpu/WebGPUDevice.cpp:
1004         (WebCore::WebGPUDevice::createRenderPipeline const):
1005         (WebCore::WebGPUDevice::createComputePipeline const):
1006         * Modules/webgpu/WebGPURenderPipeline.cpp:
1007         (WebCore::WebGPURenderPipeline::create):
1008         (WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
1009         * Modules/webgpu/WebGPURenderPipeline.h:
1010         * WebCore.xcodeproj/project.pbxproj:
1011         * platform/graphics/gpu/GPUComputePipeline.h:
1012         * platform/graphics/gpu/GPURenderPipeline.h:
1013         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm:
1014         (WebCore::GPUComputePipeline::tryCreate):
1015         (WebCore::GPUComputePipeline::GPUComputePipeline):
1016         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1017         (WebCore::GPURenderPipeline::tryCreate):
1018         (WebCore::GPURenderPipeline::GPURenderPipeline):
1019
1020 2019-09-14  Yusuke Suzuki  <ysuzuki@apple.com>
1021
1022         Retire x86 32bit JIT support
1023         https://bugs.webkit.org/show_bug.cgi?id=201790
1024
1025         Reviewed by Mark Lam.
1026
1027         * cssjit/FunctionCall.h:
1028         (WebCore::FunctionCall::callAndBranchOnBooleanReturnValue):
1029         (WebCore::FunctionCall::swapArguments):
1030
1031 2019-09-14  Zalan Bujtas  <zalan@apple.com>
1032
1033         [LFC] FormattingContext::Geometry::inFlowPositionedPositionOffset should not read containing block's width
1034         https://bugs.webkit.org/show_bug.cgi?id=201797
1035         <rdar://problem/55366244>
1036
1037         Reviewed by Antti Koivisto.
1038
1039         This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
1040         See webkit.org/b/201795
1041
1042         * layout/FormattingContext.h:
1043         * layout/FormattingContextGeometry.cpp:
1044         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
1045         * layout/blockformatting/BlockFormattingContext.cpp:
1046         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
1047         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1048         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1049
1050 2019-09-14  Zalan Bujtas  <zalan@apple.com>
1051
1052         [LFC] FormattingContext::Geometry::inlineReplacedHeightAndMargin should not read containing block's width
1053         https://bugs.webkit.org/show_bug.cgi?id=201796
1054         <rdar://problem/55366109>
1055
1056         Reviewed by Antti Koivisto.
1057
1058         This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
1059         See webkit.org/b/201795
1060
1061         * layout/FormattingContext.h:
1062         * layout/FormattingContextGeometry.cpp:
1063         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1064         (WebCore::Layout::FormattingContext::Geometry::complicatedCases const):
1065         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin const):
1066         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin const):
1067         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1068         * layout/blockformatting/BlockFormattingContext.cpp:
1069         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1070         * layout/blockformatting/BlockFormattingContext.h:
1071         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1072         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1073         * layout/inlineformatting/InlineFormattingContext.cpp:
1074         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1075         * layout/inlineformatting/InlineFormattingContext.h:
1076         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1077         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
1078
1079 2019-09-14  Zalan Bujtas  <zalan@apple.com>
1080
1081         [LFC] FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry should not read containing block's width.
1082         https://bugs.webkit.org/show_bug.cgi?id=201794
1083         <rdar://problem/55365669>
1084
1085         Reviewed by Antti Koivisto.
1086
1087         This is in preparation for using constraint values instead of querying the display tree for containing block geometry information.
1088         See webkit.org/b/201795
1089
1090         * layout/FormattingContext.cpp:
1091         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1092         * layout/FormattingContext.h:
1093         * layout/FormattingContextGeometry.cpp:
1094         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1095         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1096         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
1097
1098 2019-09-14  Chris Dumez  <cdumez@apple.com>
1099
1100         newController may be moved several times under SWClientConnection::notifyClientsOfControllerChange()
1101         https://bugs.webkit.org/show_bug.cgi?id=201792
1102         <rdar://problem/55351284>
1103
1104         Reviewed by Youenn Fablet.
1105
1106         Stop WTFMove()'ing inside the for loop.
1107
1108         * workers/service/SWClientConnection.cpp:
1109         (WebCore::SWClientConnection::notifyClientsOfControllerChange):
1110
1111 2019-09-14  Zalan Bujtas  <zalan@apple.com>
1112
1113         [LFC] FormattingContext::Geometry::computedHeightValue should not read containing block's height.
1114         https://bugs.webkit.org/show_bug.cgi?id=201791
1115         <rdar://problem/55361695>
1116
1117         Reviewed by Antti Koivisto.
1118
1119         While sizing/positioning a particular box, we oftentimes need some containing block geometry information.
1120         The idea here is that instead of calling formattingContext().geometry(containingBlock), these constraint values
1121         would be pushed in to those compute* functions. It helps controlling the access to the display box tree and
1122         prevents formatting context escaping.
1123
1124         * layout/FormattingContext.cpp:
1125         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1126         * layout/FormattingContext.h:
1127         * layout/FormattingContextGeometry.cpp:
1128         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
1129         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight const):
1130         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight const):
1131         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1132         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1133         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry const):
1134         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1135         * layout/LayoutUnits.h:
1136         * layout/blockformatting/BlockFormattingContext.cpp:
1137         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1138
1139 2019-09-11  Dean Jackson  <dino@apple.com>
1140
1141         Provide a prototype for AR QuickLook to trigger processing in the originating page
1142         https://bugs.webkit.org/show_bug.cgi?id=201371
1143         <rdar://54904781>
1144
1145         Reviewed by Simon Fraser.
1146
1147         * dom/Document.cpp:
1148         (WebCore::Document::dispatchSystemPreviewActionEvent): Create and dispatch a MessageEvent.
1149         * dom/Document.h:
1150
1151         * html/HTMLAnchorElement.cpp: Send along the page and frame identifiers for this
1152         object to ensure that any reply goes to the correct place.
1153         (WebCore::HTMLAnchorElement::handleClick):
1154
1155         * loader/FrameLoadRequest.h: Use the new SystemPreviewInfo type.
1156         (WebCore::FrameLoadRequest::isSystemPreview const):
1157         (WebCore::FrameLoadRequest::systemPreviewInfo const):
1158         (WebCore::FrameLoadRequest::systemPreviewRect const): Deleted.
1159         * loader/FrameLoader.cpp:
1160         (WebCore::FrameLoader::loadURL):
1161
1162         * loader/FrameLoaderTypes.h: Provide encoders for the type.
1163         (WebCore::SystemPreviewInfo::encode const):
1164         (WebCore::SystemPreviewInfo::decode):
1165
1166         * platform/network/ResourceRequestBase.cpp: Use the new type.
1167         (WebCore::ResourceRequestBase::isSystemPreview const):
1168         (WebCore::ResourceRequestBase::systemPreviewInfo const):
1169         (WebCore::ResourceRequestBase::setSystemPreviewInfo):
1170         (WebCore::ResourceRequestBase::setSystemPreview): Deleted.
1171         (WebCore::ResourceRequestBase::systemPreviewRect const): Deleted.
1172         (WebCore::ResourceRequestBase::setSystemPreviewRect): Deleted.
1173         * platform/network/ResourceRequestBase.h:
1174
1175         * testing/Internals.cpp: Expose the frame and page identifiers to testing.
1176         (WebCore::Internals::frameIdentifier const):
1177         (WebCore::Internals::pageIdentifier const):
1178         * testing/Internals.h:
1179         * testing/Internals.idl:
1180
1181 2019-09-13  Chris Dumez  <cdumez@apple.com>
1182
1183         Crash under WebCore::firstPositionInNode()
1184         https://bugs.webkit.org/show_bug.cgi?id=201764
1185         <rdar://problem/54823754>
1186
1187         Reviewed by Wenson Hsieh and Geoff Garen.
1188
1189         Make sure to keep a Ref<> to the textNode when we call insertNodeAtTabSpanPosition()
1190         or insertNodeAt().
1191
1192         Test: editing/firstPositionInNode-crash.html
1193
1194         * editing/InsertTextCommand.cpp:
1195         (WebCore::InsertTextCommand::positionInsideTextNode):
1196
1197 2019-09-13  Youenn Fablet  <youenn@apple.com>
1198
1199         Partition processes running service workers by session ID
1200         https://bugs.webkit.org/show_bug.cgi?id=201643
1201
1202         Reviewed by Chris Dumez.
1203
1204         Move the creation of service worker context connection management to SWServer.
1205         This allows to partition service worker context connections by registrable domain and sessionID.
1206         WebKit2 is still responsible to create the IPC creation through a Function given to SWServer at construction
1207         time.
1208         SWServer now keeps a map of registrable domain -> context connection to use for running workers.
1209         It also keeps a map of being-created connections.
1210         In case a context connection is removed from the SWServer, the SWServer will notify all related worker instances
1211         that they are not running. The SWServer will also recreate a context connection if needed.
1212
1213         This allows removing the global server context connection map.
1214         Make SWServerToContextConnection no longer refcounted to simplify the lifetime management.
1215
1216         Covered by API test.
1217
1218         * workers/service/server/SWServer.cpp:
1219         (WebCore::SWServer::SWServer):
1220         (WebCore::SWServer::tryInstallContextData):
1221         (WebCore::SWServer::contextConnectionCreated):
1222         (WebCore::SWServer::unregisterServiceWorkerClient):
1223         (WebCore::SWServer::needsContextConnectionForRegistrableDomain const):
1224         (WebCore::SWServer::addContextConnection):
1225         (WebCore::SWServer::removeContextConnection):
1226         (WebCore::SWServer::createContextConnection):
1227         * workers/service/server/SWServer.h:
1228         (WebCore::SWServer::contextConnectionForRegistrableDomain):
1229         * workers/service/server/SWServerToContextConnection.cpp:
1230         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1231         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1232         * workers/service/server/SWServerToContextConnection.h:
1233         * workers/service/server/SWServerWorker.cpp:
1234         (WebCore::SWServerWorker::contextConnection):
1235
1236 2019-09-13  Zalan Bujtas  <zalan@apple.com>
1237
1238         [LFC] Do not create FormattingContext unless the root has child boxes.
1239         https://bugs.webkit.org/show_bug.cgi?id=201766
1240         <rdar://problem/55344449>
1241
1242         Reviewed by Antti Koivisto.
1243
1244         Just because a box establishes a formatting context, it does not necessarily mean we need to create a formatting context object for it.
1245         The established formatting context is responsible for laying out the descendant content. The formatting context root itself is
1246         laid out in the formatting context it lives in. So if there's no descendent content, we don't need to construct the context objects.
1247
1248         <body><div style="float: left;"></div></body> <- this div establishes a block formatting context (float) but it does not have any content so laying
1249         it out simply means sizing and positioning it in the initial block formatting context.
1250
1251         * layout/FormattingContext.cpp:
1252         (WebCore::Layout::FormattingContext::FormattingContext):
1253         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
1254         (WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
1255         (WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
1256         (WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
1257         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1258         * layout/FormattingContext.h:
1259         (WebCore::Layout::FormattingContext::root const):
1260         * layout/FormattingContextGeometry.cpp:
1261         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1262         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1263         * layout/LayoutState.cpp:
1264         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1265         (WebCore::Layout::LayoutState::establishedFormattingState const):
1266         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
1267         (WebCore::Layout::LayoutState::createFormattingContext):
1268         * layout/LayoutState.h:
1269         (WebCore::Layout::LayoutState::hasFormattingState const):
1270         * layout/blockformatting/BlockFormattingContext.cpp:
1271         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
1272         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
1273         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
1274         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
1275         (WebCore::Layout::BlockFormattingContext::computedIntrinsicWidthConstraints):
1276         * layout/blockformatting/BlockFormattingContext.h:
1277         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1278         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1279         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
1280         * layout/blockformatting/BlockMarginCollapse.cpp:
1281         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough const):
1282         * layout/floats/FloatingContext.h:
1283         (WebCore::Layout::FloatingContext::root const):
1284         * layout/floats/FloatingState.cpp:
1285         (WebCore::Layout::FloatingState::FloatingState):
1286         (WebCore::Layout::FloatingState::bottom const):
1287         (WebCore::Layout::FloatingState::top const):
1288         * layout/floats/FloatingState.h:
1289         (WebCore::Layout::FloatingState::create):
1290         (WebCore::Layout::FloatingState::root const):
1291         (WebCore::Layout::FloatingState::leftBottom const):
1292         (WebCore::Layout::FloatingState::rightBottom const):
1293         (WebCore::Layout::FloatingState::bottom const):
1294         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
1295         * layout/inlineformatting/InlineFormattingContext.cpp:
1296         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
1297         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
1298         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1299         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1300         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
1301         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
1302         * layout/inlineformatting/InlineFormattingContext.h:
1303         (WebCore::Layout::InlineFormattingContext::InlineLayout::formattingRoot const):
1304         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1305         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
1306         * layout/inlineformatting/InlineLine.cpp:
1307         (WebCore::Layout::Line::close):
1308         (WebCore::Layout::Line::adjustBaselineAndLineHeight):
1309         * layout/tableformatting/TableFormattingContext.cpp:
1310         (WebCore::Layout::TableFormattingContext::TableFormattingContext):
1311         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
1312         (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
1313         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
1314         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
1315         * layout/tableformatting/TableFormattingContext.h:
1316
1317 2019-09-13  Ali Juma  <ajuma@chromium.org>
1318
1319         IntersectionObserverEntry#intersectionRatio can be larger than 1
1320         https://bugs.webkit.org/show_bug.cgi?id=200776
1321
1322         Reviewed by Simon Fraser.
1323
1324         When computing the intersection between a target and an intersection observer's 
1325         root, RenderBox::computeVisibleRectInContainer is used to map the target rect
1326         up the containing block chain, clipping along the way. When a RenderBox has
1327         a transform, this method expands the given rect to the enclosing rect in device
1328         pixels. This is fine for the use case of computing an invalidation rect, but for
1329         the intersection observer use case it means that it is possible for the computed
1330         intersection rect to be slightly larger than the original target rect, resulting
1331         in an intersection ratio greater than 1.
1332
1333         Fix this by performing a final intersection between the intersection rect as
1334         computed above and the target rect.
1335
1336         Test: intersection-observer/intersection-clipped-to-target.html
1337
1338         * dom/Document.cpp:
1339         (WebCore::computeIntersectionState):
1340
1341 2019-09-13  Nikolas Zimmermann  <zimmermann@kde.org>
1342
1343         SMIL animations of SVG <view> element have no effect
1344         https://bugs.webkit.org/show_bug.cgi?id=94469
1345
1346         Reviewed by Said Abou-Hallawa.
1347
1348         SMIL animations of the attributes associated with SVGViewElement work fine, but without any
1349         visual effect. When loading an SVG document with a given fragment identifier
1350         (e.g. test.svg#customView) where 'customView' references to an embedded SVGViewElement, the
1351         viewBox/preserveAspectRatio settings should be taken from the SVGViewElement. Currently
1352         there is no link between the SVGViewElement and the SVGSVGElement. The settings from the
1353         SVGViewElement are only pasrsed onco in SVGSVGElement::scrollToFragment(). Dynamic updates
1354         of the 'viewBox' and 'preserveAspectRatio' attributes of the SVGViewElement thus have no
1355         visual effect, since the SVGSVGElement does not re-evaluates its viewBox.
1356
1357         Store a RefPtr to the currently used SVGViewElement in SVGSVGElement, and a WeakPtr back
1358         to the SVGSVGElement that currently references the SVGViewElement. This allows us to
1359         propagate SVGViewElement attribute changes to SVGSVGElement and re-evaluate the viewBox
1360         stored in SVGSVGElement and trigger visual updates.
1361
1362         Tests: svg/custom/animation-on-view-element.html
1363                svg/custom/multiple-view-elements.html
1364
1365         * svg/SVGSVGElement.cpp:
1366         (WebCore::SVGSVGElement::scrollToFragment):
1367         * svg/SVGSVGElement.h:
1368         * svg/SVGViewElement.cpp:
1369         (WebCore::SVGViewElement::svgAttributeChanged): Add missing implementation, tracked by
1370         webkit.org/b/196554. Correctly handle SVGFitToViewBox property changes. Update the viewBox
1371         stored in the SVGSVGElement, that references the SVGViewElement. Afterwards invalidate the
1372         renderer associated with the SVGSVGElement, which properly triggers visual updates.
1373         * svg/SVGViewElement.h:
1374
1375 2019-09-13  Brent Fulgham  <bfulgham@apple.com>
1376
1377         [FTW] ImageBuffer/ImageBufferData is highly inefficient
1378         https://bugs.webkit.org/show_bug.cgi?id=201594
1379
1380         Reviewed by Said Abou-Hallawa.
1381
1382         My initial implementation of ImageBuffer and ImageBufferData for Direct2D involves too
1383         much moving of data from GPU to CPU and back. We only need to make a renderable version
1384         of the ImageBuffer when ImageBuffer::sinkIntoNativeImage or ImageBuffer::copyNativeImage
1385         are called.
1386
1387         Currently, each ImageBuffer putData operation uploads the data to the GPU, and each
1388         ImageBuffer getData pulls the data from the GPU.
1389
1390         This patch does the following:
1391
1392         1. It makes the assumption that the ID2D1Bitmap it holds is under its control (i.e.,
1393            external draw operations do not manipulate the bitmap without marking it dirty).
1394         2. It holds a CPU copy of the data from the ID2D1Bitmap originally used to create it.
1395            It uses this data for all manipulations, and uploads to the bitmap only when
1396            an ID2D1Bitmap is requested for drawing, and before a drawing operation is performed
1397            on the associated ImageBuffer context.
1398         3. It does not read back from the ID2D1Bitmap unless it is told that it is dirty.
1399         4. It does not call 'ID2D1RenderTarget::SetTags' if ASSERTS are disabled because
1400            they are costly, and don't help in release builds.
1401  
1402         * platform/graphics/win/Direct2DOperations.cpp:
1403         (WebCore::Direct2D::fillRect): Use new 'setTags' method.
1404         (WebCore::Direct2D::fillRoundedRect): Ditto.
1405         (WebCore::Direct2D::fillRectWithRoundedHole): Ditto.
1406         (WebCore::Direct2D::fillRectWithGradient): Ditto.
1407         (WebCore::Direct2D::fillPath): Ditto.
1408         (WebCore::Direct2D::strokeRect): Ditto.
1409         (WebCore::Direct2D::strokePath): Ditto.
1410         (WebCore::Direct2D::drawPath): Ditto.
1411         (WebCore::Direct2D::drawWithShadow): Notify observers before and after we drew.
1412         (WebCore::Direct2D::drawWithoutShadow): Ditto.
1413         (WebCore::Direct2D::clearRect): Use new 'setTags' method.
1414         (WebCore::Direct2D::drawGlyphs): Ditto.
1415         (WebCore::Direct2D::drawNativeImage): Ditto.
1416         (WebCore::Direct2D::drawRect): Ditto.
1417         (WebCore::Direct2D::drawLine): Ditto.
1418         (WebCore::Direct2D::fillEllipse): Ditto.
1419         (WebCore::Direct2D::drawEllipse): Ditto.
1420         (WebCore::Direct2D::flush): Notify observer after we drew.
1421         * platform/graphics/win/GradientDirect2D.cpp:
1422         (WebCore::Gradient::fill): Don't call SetTags in non-ASSERT builds.
1423         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1424         (WebCore::ImageBufferData::ensureBackingStore const): Added.
1425         (WebCore::ImageBufferData::getData const): Only read from the GPU if the in-memory
1426         store is empty or out-of-sync.
1427         (WebCore::ImageBufferData::putData): Mark the bitmap as out-of-sync, but don't
1428         upload the data yet.
1429         (WebCore::ImageBufferData::loadDataToBitmapIfNeeded): Helper function to upload data to the GPU.
1430         (WebCore::ImageBufferData::compatibleBitmap): Only upload data if the relevant
1431         bitmap is out of date.
1432         * platform/graphics/win/ImageBufferDataDirect2D.h:
1433         * platform/graphics/win/ImageBufferDirect2D.cpp:
1434         (WebCore::ImageBuffer::ImageBuffer): Update constructor to register the ImageBufferData
1435         lambdas as observer for draw operations.
1436         * platform/graphics/win/PlatformContextDirect2D.cpp:
1437         (WebCore::PlatformContextDirect2D::PlatformContextDirect2D): Update constructor to accept
1438         lambdas to run before and after draw operations.
1439         (WebCore::PlatformContextDirect2D::setTags): Added.
1440         (WebCore::PlatformContextDirect2D::notifyPreDrawObserver): Added.
1441         (WebCore::PlatformContextDirect2D::notifyPostDrawObserver): Added.
1442         * platform/graphics/win/PlatformContextDirect2D.h:
1443         (WebCore::PlatformContextDirect2D::PlatformContextDirect2D):
1444
1445 2019-09-13  Russell Epstein  <repstein@apple.com>
1446
1447         Unreviewed, rolling out r249709.
1448
1449         Layout test added in this patch has been consistently failing
1450         since it landed.
1451
1452         Reverted changeset:
1453
1454         "Option + arrow moves caret past whitespace on iOS"
1455         https://bugs.webkit.org/show_bug.cgi?id=201575
1456         https://trac.webkit.org/changeset/249709
1457
1458 2019-09-13  Zalan Bujtas  <zalan@apple.com>
1459
1460         [LFC] Rename FormattingContext::layout to layoutInFlowContent()
1461         https://bugs.webkit.org/show_bug.cgi?id=201763
1462         <rdar://problem/55340435>
1463
1464         Reviewed by Antti Koivisto.
1465
1466         FormattingContext::layout() only takes care of the inflow content. Out-out-flow boxes are laid out through FormattingContext::layoutOutOfFlowContent.
1467
1468         * layout/FormattingContext.cpp:
1469         (WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
1470         * layout/FormattingContext.h:
1471         * layout/LayoutState.cpp:
1472         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
1473         * layout/blockformatting/BlockFormattingContext.cpp:
1474         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
1475         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot):
1476         (WebCore::Layout::BlockFormattingContext::layout): Deleted.
1477         * layout/blockformatting/BlockFormattingContext.h:
1478         * layout/inlineformatting/InlineFormattingContext.cpp:
1479         (WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
1480         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
1481         (WebCore::Layout::InlineFormattingContext::layout): Deleted.
1482         * layout/inlineformatting/InlineFormattingContext.h:
1483         * layout/tableformatting/TableFormattingContext.cpp:
1484         (WebCore::Layout::TableFormattingContext::layoutInFlowContent):
1485         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
1486         (WebCore::Layout::TableFormattingContext::layout): Deleted.
1487         * layout/tableformatting/TableFormattingContext.h:
1488
1489 2019-09-13  Zalan Bujtas  <zalan@apple.com>
1490
1491         [LFC] FormattingContext::displayBoxForLayoutBox should be split into 2 functions
1492         https://bugs.webkit.org/show_bug.cgi?id=201754
1493         <rdar://problem/55328753>
1494
1495         Reviewed by Antti Koivisto.
1496
1497         1. FormattingContext::geometryForBox() returns a const Display::Box. Use this function to access
1498         already computed geometry such as the containing block's content box width.
1499         This function can escape the current formatting context in certain cases and read geometry from parent/ancestor formatting contexts. 
1500         2. FormattingState::displayBox() returns a non-const version of the Display::Box. Use this function to
1501         create/get the display box of a particular layout box to set computed values. This call should never escape the
1502         current formatting context (as no one should mutate ancestor boxes).
1503         
1504         Normally while laying out a particular box, we need to collect some geometry information from other boxes in the tree like previous sibling, containing block.
1505         <div style="width: 100px"><div></div></div> <- the inner div's used width is based on the outer div's width. 
1506         However we should never mutate the geometry information on those other boxes (outer div). This patch helps avoiding accidental mutation on ancestors by
1507         returning a const version of the Display::Box.  
1508
1509         * layout/FormattingContext.cpp:
1510         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
1511         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
1512         (WebCore::Layout::FormattingContext::computeBorderAndPadding):
1513         (WebCore::Layout::mapHorizontalPositionToAncestor):
1514         (WebCore::Layout::FormattingContext::mapTopToFormattingContextRoot const):
1515         (WebCore::Layout::FormattingContext::mapLeftToFormattingContextRoot const):
1516         (WebCore::Layout::FormattingContext::mapRightToFormattingContextRoot const):
1517         (WebCore::Layout::FormattingContext::geometryForBox const):
1518         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
1519         (WebCore::Layout::FormattingContext::displayBoxForLayoutBox const): Deleted.
1520         * layout/FormattingContext.h:
1521         (WebCore::Layout::FormattingContext::hasDisplayBox const): Deleted.
1522         * layout/FormattingContextGeometry.cpp:
1523         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue const):
1524         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const):
1525         (WebCore::Layout::FormattingContext::Geometry::staticVerticalPositionForOutOfFlowPositioned const):
1526         (WebCore::Layout::FormattingContext::Geometry::staticHorizontalPositionForOutOfFlowPositioned const):
1527         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry const):
1528         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1529         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry const):
1530         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry const):
1531         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin const):
1532         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset const):
1533         * layout/FormattingContextQuirks.cpp:
1534         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1535         * layout/FormattingState.cpp:
1536         (WebCore::Layout::FormattingState::displayBox const):
1537         * layout/FormattingState.h:
1538         * layout/blockformatting/BlockFormattingContext.cpp:
1539         (WebCore::Layout::BlockFormattingContext::usedAvailableWidthForFloatAvoider const):
1540         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren):
1541         (WebCore::Layout::BlockFormattingContext::computeStaticVerticalPosition):
1542         (WebCore::Layout::BlockFormattingContext::computeStaticHorizontalPosition):
1543         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
1544         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear):
1545         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition):
1546         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats):
1547         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin):
1548         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
1549         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
1550         * layout/blockformatting/BlockFormattingContext.h:
1551         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1552         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1553         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin const):
1554         (WebCore::Layout::BlockFormattingContext::Geometry::staticVerticalPosition const):
1555         (WebCore::Layout::BlockFormattingContext::Geometry::staticHorizontalPosition const):
1556         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1557         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1558         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1559         * layout/blockformatting/BlockMarginCollapse.cpp:
1560         (WebCore::Layout::BlockFormattingContext::MarginCollapse::hasClearance const):
1561         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore const):
1562         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter const):
1563         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore const):
1564         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance const):
1565         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter const):
1566         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling const):
1567         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
1568         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1569         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
1570         (WebCore::Layout::hasClearance): Deleted.
1571         * layout/floats/FloatingContext.cpp:
1572         (WebCore::Layout::FloatingContext::positionForFloat const):
1573         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1574         (WebCore::Layout::FloatingContext::absoluteDisplayBoxCoordinates const):
1575         (WebCore::Layout::FloatingContext::mapToFloatingStateRoot const):
1576         (WebCore::Layout::FloatingContext::mapTopToFloatingStateRoot const):
1577         (WebCore::Layout::FloatingContext::mapPointFromFormattingContextRootToFloatingStateRoot const):
1578         * layout/inlineformatting/InlineFormattingContext.cpp:
1579         (WebCore::Layout::InlineFormattingContext::layout):
1580         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthConstraints):
1581         (WebCore::Layout::InlineFormattingContext::initializeMarginBorderAndPaddingForGenericInlineBox):
1582         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPaddingForInlineContainer):
1583         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingRoot):
1584         (WebCore::Layout::InlineFormattingContext::computeHorizontalMargin):
1585         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin):
1586         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin):
1587         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot):
1588         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1589         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin const):
1590         * layout/inlineformatting/InlineFormattingContextLineLayout.cpp:
1591         (WebCore::Layout::inlineItemWidth):
1592         (WebCore::Layout::LineLayout::placeInlineItem):
1593         (WebCore::Layout::InlineFormattingContext::InlineLayout::layout const):
1594         (WebCore::Layout::InlineFormattingContext::InlineLayout::computedIntrinsicWidth const):
1595         (WebCore::Layout::InlineFormattingContext::InlineLayout::createDisplayRuns const):
1596         * layout/inlineformatting/InlineFormattingContextQuirks.cpp:
1597         (WebCore::Layout::InlineFormattingContext::Quirks::lineDescentNeedsCollapsing const):
1598         * layout/inlineformatting/InlineLine.cpp:
1599         (WebCore::Layout::isInlineContainerConsideredEmpty):
1600         (WebCore::Layout::Line::isVisuallyEmpty const):
1601         (WebCore::Layout::Line::close):
1602         (WebCore::Layout::Line::appendNonReplacedInlineBox):
1603         (WebCore::Layout::Line::inlineItemContentHeight const):
1604         * layout/tableformatting/TableFormattingContext.cpp:
1605         (WebCore::Layout::TableFormattingContext::layout):
1606         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
1607         (WebCore::Layout::TableFormattingContext::positionTableCells):
1608         (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
1609         (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
1610         (WebCore::Layout::TableFormattingContext::computedTableWidth):
1611
1612 2019-09-13  Youenn Fablet  <youenn@apple.com>
1613
1614         Use WebProcess processIdentifier to identify Service Worker connections
1615         https://bugs.webkit.org/show_bug.cgi?id=201459
1616
1617         Reviewed by Chris Dumez.
1618
1619         No observable change of behavior.
1620
1621         * workers/service/ServiceWorkerClient.cpp:
1622         (WebCore::ServiceWorkerClient::postMessage):
1623         Pass sessionID to ease NetworkProcess selection of the client process connection.
1624         * workers/service/ServiceWorkerTypes.h:
1625         Mark server connection identifier be process identifier based.
1626         * workers/service/context/SWContextManager.h:
1627         * workers/service/server/SWServer.cpp:
1628         (WebCore::SWServer::Connection::Connection):
1629         * workers/service/server/SWServer.h:
1630         Let connection identifier be set in constructor instead of generated.
1631
1632 2019-09-13  Adrian Perez de Castro  <aperez@igalia.com>
1633
1634         Factor out duplicated functions from HTTPParsers.cpp and HTTPHeaderField.cpp
1635         https://bugs.webkit.org/show_bug.cgi?id=201721
1636
1637         Reviewed by Don Olmstead.
1638
1639         No new tests needed.
1640
1641         * loader/HTTPHeaderField.cpp: Remove "static" from prototypes of functions needed in HTTPParsers.cpp.
1642         (WebCore::RFC7230::isDelimiter):
1643         (WebCore::RFC7230::isQuotedPairSecondOctet):
1644         (WebCore::RFC7230::isCommentText):
1645         * loader/HTTPHeaderField.h: Add prototypes of functions needed in HTTPParsers.cpp.
1646         * platform/network/HTTPParsers.cpp: Use functionality from WebCore::RFC7230 where possible.
1647         (WebCore::skipWhile): Moved to allow implementing skipWhiteSpace() in terms of skipWhile().
1648         (WebCore::skipWhiteSpace): Implement using skipWhile() and the RFC7230::isWhitespace() predicate.
1649         (WebCore::isValidAcceptHeaderValue): Replace usage of isDelimiterCharacter() with RFC7230::isDelimiter().
1650         (WebCore::isValidHTTPToken): Replace usage of isHTTPTokenCharacter() with RFC7230::isTokenCharacter().
1651         (WebCore::skipQuotedPair): Partially reimplement in terms of RFC7230::isQuotedPairSecondOctet().
1652         (WebCore::skipComment): Replace usage of isCommentTextCharacter() with RFC7230::isCommentText().
1653         (WebCore::skipHTTPToken): Replace usage of isHTTPTokenCharacter() with RFC7230::isTokenCharacter().
1654
1655 2019-09-12  Zan Dobersek  <zdobersek@igalia.com>
1656
1657         Unreviewed debug build fix for GLib-based ports.
1658
1659         * platform/glib/UserAgentGLib.cpp: Add the HTTPParsers.h header
1660         inclusion to bring in the isValidUserAgentHeaderValue() declaration as
1661         required for an assertion check.
1662
1663 2019-09-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
1664
1665         SVGLengthValue should use two enums for 'type' and 'mode' instead of one unsigned for 'units'
1666         https://bugs.webkit.org/show_bug.cgi?id=201663
1667
1668         Reviewed by Simon Fraser, Nikolas Zimmermann.
1669
1670         SVGLengthValue had one unsigned to store SVGLengthMode and SVGLengthType.
1671         It used to allocate the least significant 4 bits of this unsigned to the
1672         SVGLengthMode while it leaves the rest for SVGLengthType.
1673
1674         This will not be needed if SVGLengthMode and SVGLengthType are made of
1675         size uint_8.
1676
1677         Also in this patch:
1678
1679         -- SVGLengthNegativeValuesMode is made enum class.
1680
1681         -- SVGLengthValue::blend() is moved to SVGLengthValue.cpp so we do not
1682            need to include SVGLengthContext.h in SVGLengthValue.h.
1683
1684         -- SVGLengthType and SVGLengthMode are moved to SVGLengthValue.h. Instead
1685            of having SVGLengthValue.h includes SVGLengthConttext.h, the opposite
1686            will happen.
1687
1688         -- SVGAnimatedPropertyDescription.h is deleted. It should have been deleted
1689            with the SVG tear off objects removal.
1690
1691         -- SVGPropertyTraits<SVGAngleValue> and SVGPropertyTraits<SVGLengthValue>
1692            are deleted. They should have been deleted with SVGAnimatedType removal.
1693
1694         -- SVGLengthValue::lengthModeForAnimatedLengthAttribute() is deleted. It
1695            was only called from SVGPropertyTraits<SVGLengthValue>.
1696
1697         * WebCore.xcodeproj/project.pbxproj:
1698         * css/StyleResolver.h:
1699         * page/animation/CSSPropertyAnimation.cpp:
1700         (WebCore::blendFunc):
1701         * rendering/style/SVGRenderStyle.h:
1702         (WebCore::SVGRenderStyle::initialBaselineShiftValue):
1703         (WebCore::SVGRenderStyle::initialKerning):
1704         * rendering/svg/RenderSVGEllipse.cpp:
1705         (WebCore::RenderSVGEllipse::calculateRadiiAndCenter):
1706         * rendering/svg/RenderSVGRect.cpp:
1707         (WebCore::RenderSVGRect::updateShapeFromElement):
1708         * rendering/svg/SVGPathData.cpp:
1709         (WebCore::pathFromCircleElement):
1710         (WebCore::pathFromEllipseElement):
1711         (WebCore::pathFromRectElement):
1712         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1713         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift const):
1714         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
1715         (WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing):
1716         * svg/LinearGradientAttributes.h:
1717         (WebCore::LinearGradientAttributes::LinearGradientAttributes):
1718         * svg/RadialGradientAttributes.h:
1719         (WebCore::RadialGradientAttributes::RadialGradientAttributes):
1720         * svg/SVGAngleValue.h:
1721         (WebCore::SVGPropertyTraits<SVGAngleValue>::initialValue): Deleted.
1722         (WebCore::SVGPropertyTraits<SVGAngleValue>::toString): Deleted.
1723         * svg/SVGCircleElement.cpp:
1724         (WebCore::SVGCircleElement::parseAttribute):
1725         * svg/SVGCircleElement.h:
1726         * svg/SVGCursorElement.cpp:
1727         (WebCore::SVGCursorElement::parseAttribute):
1728         * svg/SVGCursorElement.h:
1729         * svg/SVGEllipseElement.cpp:
1730         (WebCore::SVGEllipseElement::parseAttribute):
1731         * svg/SVGEllipseElement.h:
1732         * svg/SVGFilterElement.cpp:
1733         (WebCore::SVGFilterElement::parseAttribute):
1734         * svg/SVGFilterElement.h:
1735         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1736         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
1737         * svg/SVGFilterPrimitiveStandardAttributes.h:
1738         * svg/SVGForeignObjectElement.cpp:
1739         (WebCore::SVGForeignObjectElement::parseAttribute):
1740         * svg/SVGForeignObjectElement.h:
1741         * svg/SVGImageElement.cpp:
1742         (WebCore::SVGImageElement::parseAttribute):
1743         * svg/SVGImageElement.h:
1744         * svg/SVGLength.h:
1745         (WebCore::SVGLength::unitType const):
1746         (WebCore::SVGLength::setValueForBindings):
1747         (WebCore::SVGLength::newValueSpecifiedUnits):
1748         (WebCore::SVGLength::convertToSpecifiedUnits):
1749         (WebCore::SVGLength::unitType): Deleted.
1750         * svg/SVGLengthContext.cpp:
1751         (WebCore::SVGLengthContext::valueForLength):
1752         (WebCore::SVGLengthContext::convertValueToUserUnits const):
1753         (WebCore::SVGLengthContext::convertValueFromUserUnits const):
1754         (WebCore::SVGLengthContext::convertValueFromUserUnitsToPercentage const):
1755         (WebCore::SVGLengthContext::convertValueFromPercentageToUserUnits const):
1756         * svg/SVGLengthContext.h:
1757         (): Deleted.
1758         * svg/SVGLengthList.h:
1759         (WebCore::SVGLengthList::create):
1760         * svg/SVGLengthValue.cpp:
1761         (WebCore::lengthTypeToString):
1762         (WebCore::parseLengthType):
1763         (WebCore::primitiveTypeToLengthType):
1764         (WebCore::lengthTypeToPrimitiveType):
1765         (WebCore::SVGLengthValue::SVGLengthValue):
1766         (WebCore::SVGLengthValue::construct):
1767         (WebCore::SVGLengthValue::blend):
1768         (WebCore::SVGLengthValue::fromCSSPrimitiveValue):
1769         (WebCore::SVGLengthValue::toCSSPrimitiveValue):
1770         (WebCore::SVGLengthValue::setValueAsString):
1771         (WebCore::SVGLengthValue::valueAsString const):
1772         (WebCore::SVGLengthValue::valueForBindings const):
1773         (WebCore::SVGLengthValue::setValue):
1774         (WebCore::SVGLengthValue::convertToSpecifiedUnits):
1775         (WebCore::storeUnit): Deleted.
1776         (WebCore::extractMode): Deleted.
1777         (WebCore::extractType): Deleted.
1778         (WebCore::SVGLengthValue::operator== const): Deleted.
1779         (WebCore::SVGLengthValue::operator!= const): Deleted.
1780         (WebCore::SVGLengthValue::unitType const): Deleted.
1781         (WebCore::SVGLengthValue::unitMode const): Deleted.
1782         (WebCore::SVGLengthValue::valueAsPercentage const): Deleted.
1783         (WebCore::SVGLengthValue::newValueSpecifiedUnits): Deleted.
1784         (WebCore::SVGLengthValue::lengthModeForAnimatedLengthAttribute): Deleted.
1785         * svg/SVGLengthValue.h:
1786         (WebCore::SVGLengthValue::lengthType const):
1787         (WebCore::SVGLengthValue::lengthMode const):
1788         (WebCore::SVGLengthValue::isZero const):
1789         (WebCore::SVGLengthValue::isRelative const):
1790         (WebCore::SVGLengthValue::valueAsPercentage const):
1791         (WebCore::SVGLengthValue::valueInSpecifiedUnits const):
1792         (WebCore::operator==):
1793         (WebCore::operator!=):
1794         (WebCore::SVGLengthValue::blend const): Deleted.
1795         (WebCore::SVGPropertyTraits<SVGLengthValue>::initialValue): Deleted.
1796         (WebCore::SVGPropertyTraits<SVGLengthValue>::parse): Deleted.
1797         (WebCore::SVGPropertyTraits<SVGLengthValue>::toString): Deleted.
1798         * svg/SVGLineElement.cpp:
1799         (WebCore::SVGLineElement::parseAttribute):
1800         * svg/SVGLineElement.h:
1801         * svg/SVGLinearGradientElement.cpp:
1802         (WebCore::SVGLinearGradientElement::parseAttribute):
1803         * svg/SVGLinearGradientElement.h:
1804         * svg/SVGMarkerElement.cpp:
1805         (WebCore::SVGMarkerElement::parseAttribute):
1806         * svg/SVGMarkerElement.h:
1807         * svg/SVGMaskElement.cpp:
1808         (WebCore::SVGMaskElement::parseAttribute):
1809         * svg/SVGMaskElement.h:
1810         * svg/SVGPatternElement.cpp:
1811         (WebCore::SVGPatternElement::parseAttribute):
1812         * svg/SVGPatternElement.h:
1813         * svg/SVGRadialGradientElement.cpp:
1814         (WebCore::SVGRadialGradientElement::parseAttribute):
1815         * svg/SVGRadialGradientElement.h:
1816         * svg/SVGRectElement.cpp:
1817         (WebCore::SVGRectElement::parseAttribute):
1818         * svg/SVGRectElement.h:
1819         * svg/SVGSVGElement.cpp:
1820         (WebCore::SVGSVGElement::parseAttribute):
1821         (WebCore::SVGSVGElement::hasIntrinsicWidth const):
1822         (WebCore::SVGSVGElement::hasIntrinsicHeight const):
1823         (WebCore::SVGSVGElement::intrinsicWidth const):
1824         (WebCore::SVGSVGElement::intrinsicHeight const):
1825         * svg/SVGSVGElement.h:
1826         * svg/SVGTextContentElement.cpp:
1827         (WebCore::SVGTextContentElement::parseAttribute):
1828         (WebCore::SVGTextContentElement::textLengthAnimated):
1829         * svg/SVGTextContentElement.h:
1830         * svg/SVGTextPathElement.cpp:
1831         (WebCore::SVGTextPathElement::parseAttribute):
1832         * svg/SVGTextPathElement.h:
1833         * svg/SVGTextPositioningElement.h:
1834         * svg/SVGUseElement.cpp:
1835         (WebCore::SVGUseElement::parseAttribute):
1836         * svg/SVGUseElement.h:
1837         * svg/properties/SVGAnimatedPropertyAccessorImpl.h:
1838         * svg/properties/SVGAnimatedPropertyDescription.h: Removed.
1839         * svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
1840         (WebCore::SVGAnimationLengthListFunction::animate):
1841         * svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
1842         (WebCore::SVGAnimationLengthFunction::animate):
1843         * svg/properties/SVGValuePropertyAnimatorImpl.h:
1844         * svg/properties/SVGValuePropertyListAnimatorImpl.h:
1845
1846 2019-09-12  Chris Dumez  <cdumez@apple.com>
1847
1848         Node.replaceChild()'s pre-replacement validations are not done in the right order
1849         https://bugs.webkit.org/show_bug.cgi?id=201741
1850
1851         Reviewed by Geoffrey Garen.
1852
1853         Node.replaceChild()'s pre-replacement validations are not done in the right order (spec order):
1854         - https://dom.spec.whatwg.org/#concept-node-replace
1855
1856         In particular, we do not do check 3 (If child’s parent is not parent, then throw a
1857         "NotFoundError" DOMException.) at the right time, because we were making this check
1858         *after* checkPreReplacementValidity(), instead of *during*.
1859
1860         No new tests, rebaselined existing test.
1861
1862         * dom/ContainerNode.cpp:
1863         (WebCore::checkAcceptChild):
1864         (WebCore::ContainerNode::ensurePreInsertionValidity):
1865         (WebCore::checkPreReplacementValidity):
1866         (WebCore::ContainerNode::replaceChild):
1867
1868 2019-09-12  Ryan Haddad  <ryanhaddad@apple.com>
1869
1870         Unreviewed, rolling out r249801.
1871
1872         Caused two servier worker layout tests to become flaky.
1873
1874         Reverted changeset:
1875
1876         "Use WebProcess processIdentifier to identify Service Worker
1877         connections"
1878         https://bugs.webkit.org/show_bug.cgi?id=201459
1879         https://trac.webkit.org/changeset/249801
1880
1881 2019-09-12  Chris Dumez  <cdumez@apple.com>
1882
1883         [WKTR] Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED()
1884         https://bugs.webkit.org/show_bug.cgi?id=201546
1885
1886         Reviewed by Alex Christensen.
1887
1888         Drop TestRunner.setPrivateBrowsingEnabled_DEPRECATED() from WebKitTestRunner as it does not do
1889         the right thing for WebKit2 and tests have been rewritten to not use it.
1890
1891         * page/PageGroup.cpp:
1892         (WebCore::PageGroup::addPage):
1893         (WebCore::PageGroup::setSessionIDForTesting): Deleted.
1894         * page/PageGroup.h:
1895         (): Deleted.
1896
1897 2019-09-12  Saam Barati  <sbarati@apple.com>
1898
1899         [WHLSL] Slim down WSLMatrix and inline constructors in native code
1900         https://bugs.webkit.org/show_bug.cgi?id=201568
1901
1902         Reviewed by Robin Morisset.
1903
1904         Before, our WSL Matrix in MSL had templates to figure out how we're 
1905         constructing it. For example, with a list of elements, or a list of
1906         columns. However, we can remove this template code since when we're
1907         emitting Metal code, we know exactly how we're constructing the WSL
1908         matrix. So the NativeFunctionWriter now inlines the proper stores
1909         into the WSLMatrix elements.
1910         
1911         This patch speeds up Metal compile times in boids by ~4ms (16%) with
1912         a p-value of 0.0001.
1913
1914         Covered by existing tests.
1915
1916         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
1917         (WebCore::WHLSL::Metal::metalCodePrologue):
1918         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp:
1919         (WebCore::WHLSL::Metal::inlineNativeFunction):
1920
1921 2019-09-12  Wenson Hsieh  <wenson_hsieh@apple.com>
1922
1923         [Cocoa] Text indicator for an image link on the front page of apple.com looks wrong
1924         https://bugs.webkit.org/show_bug.cgi?id=201724
1925         <rdar://problem/54622894>
1926
1927         Reviewed by Tim Horton.
1928
1929         When computing the bounds of the range (<a>, 0) to (<a>, 1) for a text indicator snapshot where <a> is a link
1930         with a single non-breaking whitespace character, we currently use the text rect of the single space. This leads
1931         to a confusing text indicator, as the resulting snapshot is a tiny blank square in the top left corner of the
1932         link. This problem manifests when starting a drag or showing the system context menu on iOS, or force clicking
1933         or three-finger tapping to show a preview on macOS.
1934
1935         To address this scenario, tweak the heuristic in the case where the text indicator option
1936         TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges is specified, such that we consider a range
1937         containing only text with whitespaces to be "complex"; additionally, instead of falling back to the range's
1938         bounding rect (which in this case is still tiny), fall back to the common ancestor container's bounding rect,
1939         which encompasses not only the text inside the range but also the element containing the range (in this case,
1940         the anchor element).
1941
1942         Test: fast/text-indicator/text-indicator-empty-link.html
1943
1944         * page/TextIndicator.cpp:
1945         (WebCore::containsOnlyWhiteSpaceText):
1946
1947         Add a helper to determine whether a Range is comprised only of rendered text that only contains whitespace
1948         characters.
1949
1950         (WebCore::initializeIndicator):
1951
1952         See ChangeLog entry above for more detail.
1953
1954 2019-09-12  Brady Eidson  <beidson@apple.com>
1955
1956         PDF exporting on iOS should include URL rects.
1957         <rdar://problem/54900133> and https://bugs.webkit.org/show_bug.cgi?id=201693
1958
1959         Reviewed by Tim Horton.
1960
1961         Turns out that PDF exporting on iOS works fine.
1962
1963         Tracking back through history it was disabled at least pre-2014.
1964
1965         It was almost certainly disabled because it didn't work way back then,
1966         but it works great now.
1967
1968         * platform/graphics/cg/GraphicsContextCG.cpp:
1969         (WebCore::GraphicsContext::setURLForRect): Remove the iOS platform exclusion.
1970
1971 2019-09-12  Adrian Perez de Castro  <aperez@igalia.com>
1972
1973         [GTK][WPE] webkit_settings_set_user_agent() allows content forbidden in HTTP headers
1974         https://bugs.webkit.org/show_bug.cgi?id=201077
1975
1976         Reviewed by Carlos Garcia Campos.
1977
1978         Add a function to validate whether a string contains a valid value
1979         which can be used in a HTTP User-Agent header.
1980
1981         Covered by new WebCore API test HTTPParsers.ValidateUserAgentValues.
1982
1983         * platform/glib/UserAgentGLib.cpp:
1984         (WebCore::standardUserAgent): Assert that the returned string is a valid User-Agent.
1985         (WebCore::standardUserAgentForURL): Ditto.
1986         * platform/network/HTTPParsers.cpp: Added a series of helper functions which skip over
1987         characters of a string, which can be used to scan over the different elements of an
1988         User-Agent value; all of them receive the position from the input string where to start
1989         scanning, updating it to the position right after the scanned item (this follow the
1990         convention already in use by other functions in the source file). Each of them has
1991         been annotated with the RFC number and section which contains the definition of the
1992         scanned item, and the corresponding BNF rules to make the code easier to follow.
1993         (WebCore::skipWhile): Added.
1994         (WebCore::isVisibleCharacter): Added.
1995         (WebCore::isOctectInFieldContentCharacter): Added.
1996         (WebCore::isCommentTextCharacter): Added.
1997         (WebCore::isHTTPTokenCharacter): Added.
1998         (WebCore::isValidHTTPToken): Refactored to use the new isHTTPTokenCharacter()
1999         helper function instead of having the test inside the loop.
2000         (WebCore::skipCharacter): Added.
2001         (WebCore::skipQuotedPair): Added.
2002         (WebCore::skipComment): Added.
2003         (WebCore::skipHTTPToken): Added.
2004         (WebCore::skipUserAgentProduct): Added.
2005         (WebCore::isValidUserAgentHeaderValue): Added.
2006         * platform/network/HTTPParsers.h: Add prototype for isValidUserAgentHeaderValue().
2007
2008 2019-09-12  Mark Lam  <mark.lam@apple.com>
2009
2010         Harden JSC against the abuse of runtime options.
2011         https://bugs.webkit.org/show_bug.cgi?id=201597
2012         <rdar://problem/55167068>
2013
2014         Reviewed by Filip Pizlo.
2015
2016         No new tests.  Covered by existing tests.
2017
2018         Enable Options::useDollarVM before we tell the JSGlobalObject to exposeDollarVM().
2019         The $vm utility is now hardened to require that Options::useDollarVM be
2020         enabled in order for it to be used.
2021
2022         * testing/js/WebCoreTestSupport.cpp:
2023         (WebCoreTestSupport::injectInternalsObject):
2024
2025 2019-09-12  Youenn Fablet  <youenn@apple.com>
2026
2027         Use typed identifiers for IDB connection identifiers
2028         https://bugs.webkit.org/show_bug.cgi?id=201682
2029
2030         Reviewed by Chris Dumez.
2031
2032         Migrate from uint64_t to a typed identifier for IDB connection identifiers.
2033         The identifier is reusing the process identifier type.
2034         No change of behavior.
2035
2036         * Modules/indexeddb/client/IDBConnectionProxy.h:
2037         (WebCore::IDBClient::IDBConnectionProxy::serverConnectionIdentifier const):
2038         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
2039         (WebCore::IDBClient::IDBConnectionToServer::identifier const):
2040         * Modules/indexeddb/client/IDBConnectionToServer.h:
2041         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2042         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
2043         (WebCore::IDBServer::IDBConnectionToClient::identifier const):
2044         * Modules/indexeddb/server/IDBConnectionToClient.h:
2045         * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2046         * Modules/indexeddb/server/IDBServer.cpp:
2047         (WebCore::IDBServer::IDBServer::getAllDatabaseNames):
2048         (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
2049         (WebCore::IDBServer::IDBServer::didGetAllDatabaseNames):
2050         * Modules/indexeddb/server/IDBServer.h:
2051         * Modules/indexeddb/shared/IDBRequestData.cpp:
2052         (WebCore::IDBRequestData::serverConnectionIdentifier const):
2053         * Modules/indexeddb/shared/IDBRequestData.h:
2054         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
2055         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
2056         (WebCore::IDBResourceIdentifier::emptyValue):
2057         (WebCore::IDBResourceIdentifier::deletedValue):
2058         (WebCore::IDBResourceIdentifier::isHashTableDeletedValue const):
2059         (WebCore::IDBResourceIdentifier::loggingString const):
2060         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
2061         (WebCore::IDBResourceIdentifier::hash const):
2062         (WebCore::IDBResourceIdentifier::connectionIdentifier const):
2063         (WTF::crossThreadCopy):
2064         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2065         (WebCore::InProcessIDBServer::identifier const):
2066         * Modules/indexeddb/shared/InProcessIDBServer.h:
2067
2068 2019-09-12  Youenn Fablet  <youenn@apple.com>
2069
2070         Use WebProcess processIdentifier to identify Service Worker connections
2071         https://bugs.webkit.org/show_bug.cgi?id=201459
2072
2073         Reviewed by Chris Dumez.
2074
2075         No observable change of behavior.
2076
2077         * workers/service/ServiceWorkerClient.cpp:
2078         (WebCore::ServiceWorkerClient::postMessage):
2079         Pass sessionID to ease NetworkProcess selection of the client process connection.
2080         * workers/service/ServiceWorkerTypes.h:
2081         Mark server connection identifier be process identifier based.
2082         * workers/service/context/SWContextManager.h:
2083         * workers/service/server/SWServer.cpp:
2084         (WebCore::SWServer::Connection::Connection):
2085         * workers/service/server/SWServer.h:
2086         Let connection identifier be set in constructor instead of generated.
2087
2088 2019-09-11  Youenn Fablet  <youenn@apple.com>
2089
2090         Disable DTLS1.0
2091         https://bugs.webkit.org/show_bug.cgi?id=201679
2092
2093         Reviewed by Alex Christensen.
2094
2095         Add an option to force to use DTLS1.0 and nothing else.
2096         Add internals API to enter in that mode to verify that normal configurations cannot communicate with DTLS1.0.
2097
2098         Test: webrtc/datachannel/dtls10.html
2099
2100         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2101         (WebCore::LibWebRTCProvider::setEnableWebRTCEncryption):
2102         (WebCore::LibWebRTCProvider::setUseDTLS10):
2103         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2104         * testing/Internals.cpp:
2105         (WebCore::Internals::setUseDTLS10):
2106         * testing/Internals.h:
2107         * testing/Internals.idl:
2108
2109 2019-09-11  Keith Rollin  <krollin@apple.com>
2110
2111         Log timeoutValue passed on to CFNetwork
2112         https://bugs.webkit.org/show_bug.cgi?id=201701
2113         <rdar://problem/55279683>
2114
2115         Reviewed by Chris Dumez.
2116
2117         Export ResourceRequest::timeoutValue for use in WebKit.
2118
2119         No new tests -- no new or changed functionality.
2120
2121         * platform/network/ResourceRequestBase.h:
2122
2123 2019-09-11  Saam Barati  <sbarati@apple.com>
2124
2125         [WHLSL] Remove null from the standard library
2126         https://bugs.webkit.org/show_bug.cgi?id=201672
2127
2128         Reviewed by Robin Morisset.
2129
2130         I meant to remove `null` from the standard library in r249351, but
2131         I had omitted the code I wrote to do that when I rebased that patch.
2132         This patch removes it and ensures all tests pass when parsing the entire
2133         standard library.
2134
2135         * Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt:
2136
2137 2019-09-11  Chris Dumez  <cdumez@apple.com>
2138
2139         Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header
2140         https://bugs.webkit.org/show_bug.cgi?id=201694
2141
2142         Reviewed by Alex Christensen.
2143
2144         Use same parser for <meta http-equiv="refresh"> and `Refresh` HTTP header. This aligns
2145         our behavior with Blink and makes us more compliant on web-platform-tests. This also
2146         simplifies our code.
2147
2148         No new tests, rebaselined existing test.
2149
2150         * loader/FrameLoader.cpp:
2151         (WebCore::FrameLoader::receivedFirstData):
2152         * platform/network/HTTPParsers.cpp:
2153         (WebCore::parseHTTPRefresh): Deleted.
2154         * platform/network/HTTPParsers.h:
2155
2156 2019-09-11  Saam Barati  <sbarati@apple.com>
2157
2158         [WHLSL] Ensure structs/arrays with pointers as fields are disallowed
2159         https://bugs.webkit.org/show_bug.cgi?id=201525
2160
2161         Reviewed by Robin Morisset.
2162
2163         This patch adds a pass which both ensures that references are always initialized with
2164         concrete values and that we support logical mode validation by disallowing nested references.
2165         
2166         Specifically, the pass:
2167         
2168         1. Disallows structs to have fields which are references. This prevents us from having to
2169         figure out how to default initialize such a struct. We could relax this in the future if we
2170         did an analysis on which structs contain reference fields, and ensure such struct variables
2171         always have initializers. This would also require us to create constructors for structs which
2172         initialize each field.
2173         2. We also do the same for arrays.
2174         3. References can only be one level deep. So no pointers to pointers. No references to
2175         references, etc. This is to support logical mode validation rules.
2176
2177         Test: webgpu/whlsl/ensure-proper-pointer-usage.html
2178
2179         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Added.
2180         (WebCore::WHLSL::checkReferenceTypes):
2181         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Added.
2182         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2183         (WebCore::WHLSL::Checker::visit):
2184         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2185         (WebCore::WHLSL::prepareShared):
2186         * Sources.txt:
2187         * WebCore.xcodeproj/project.pbxproj:
2188
2189 2019-09-11  Devin Rousso  <drousso@apple.com>
2190
2191         Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
2192         https://bugs.webkit.org/show_bug.cgi?id=201650
2193
2194         Reviewed by Joseph Pecoraro.
2195
2196         Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
2197
2198         A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
2199         required (e.g. compute pipeline).  We should treat the `GPUCanvasContext` almost like a
2200         `-webkit-canvas` client of a `WebGPUDevice`.
2201
2202         Tests: inspector/canvas/create-context-webgpu.html
2203                inspector/canvas/requestClientNodes-webgpu.html
2204                inspector/canvas/resolveContext-webgpu.html
2205
2206         * Modules/webgpu/WebGPUAdapter.cpp:
2207         (WebCore::WebGPUAdapter::requestDevice const):
2208         Notify web inspector after a device is created.
2209
2210         * Modules/webgpu/WebGPUDevice.idl:
2211         * Modules/webgpu/WebGPUDevice.h:
2212         * Modules/webgpu/WebGPUDevice.cpp:
2213         (WebCore::WebGPUDevice::instances): Added.
2214         (WebCore::WebGPUDevice::instancesMutex): Added.
2215         (WebCore::WebGPUDevice::~WebGPUDevice): Added.
2216         Notify web inspector when the device is about to be destructed.
2217
2218         * Modules/webgpu/GPUCanvasContext.h:
2219         * Modules/webgpu/GPUCanvasContext.cpp:
2220         (WebCore::GPUCanvasContext::create):
2221         (WebCore::GPUCanvasContext::configureSwapChain):
2222
2223         * inspector/InspectorCanvas.h:
2224         * inspector/InspectorCanvas.cpp:
2225         (WebCore::canvasIfContextMatchesDevice): Added.
2226         (WebCore::InspectorCanvas::create):
2227         (WebCore::InspectorCanvas::InspectorCanvas):
2228         (WebCore::InspectorCanvas::canvasContext const): Added.
2229         (WebCore::InspectorCanvas::canvasElement const): Added.
2230         (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Added.
2231         (WebCore::InspectorCanvas::deviceContext const): Added.
2232         (WebCore::InspectorCanvas::scriptExecutionContext const): Added.
2233         (WebCore::InspectorCanvas::resolveContext const): Added.
2234         (WebCore::InspectorCanvas::clientNodes const): Added.
2235         (WebCore::InspectorCanvas::canvasChanged):
2236         (WebCore::InspectorCanvas::resetRecordingData):
2237         (WebCore::InspectorCanvas::recordAction):
2238         (WebCore::InspectorCanvas::buildObjectForCanvas):
2239         (WebCore::InspectorCanvas::releaseObjectForRecording):
2240         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
2241         (WebCore::InspectorCanvas::buildInitialState):
2242         (WebCore::InspectorCanvas::canvasElement): Deleted.
2243         * inspector/InspectorInstrumentation.cpp:
2244         (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Added.
2245         (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Added.
2246         (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Added.
2247         * inspector/InspectorInstrumentation.h:
2248         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Added.
2249         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Added.
2250         (WebCore::InspectorInstrumentation::willConfigureSwapChain): Added.
2251
2252         * inspector/agents/InspectorCanvasAgent.h:
2253         * inspector/agents/InspectorCanvasAgent.cpp:
2254         (WebCore::InspectorCanvasAgent::enable):
2255         (WebCore::InspectorCanvasAgent::requestClientNodes): Added.
2256         (WebCore::InspectorCanvasAgent::resolveContext): Added.
2257         (WebCore::InspectorCanvasAgent::startRecording):
2258         (WebCore::InspectorCanvasAgent::stopRecording):
2259         (WebCore::InspectorCanvasAgent::frameNavigated):
2260         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
2261         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
2262         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2263         (WebCore::InspectorCanvasAgent::recordCanvasAction):
2264         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2265         (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Added.
2266         (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Added.
2267         (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Added.
2268         (WebCore::InspectorCanvasAgent::clearCanvasData):
2269         (WebCore::InspectorCanvasAgent::bindCanvas):
2270         (WebCore::InspectorCanvasAgent::unbindCanvas):
2271         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
2272         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): Deleted.
2273         (WebCore::contextAsScriptValue): Deleted.
2274         (WebCore::InspectorCanvasAgent::resolveCanvasContext): Deleted.
2275
2276         * inspector/InspectorShaderProgram.cpp:
2277         (WebCore::InspectorShaderProgram::context const):
2278
2279 2019-09-11  Chris Dumez  <cdumez@apple.com>
2280
2281         Posting a message to a redundant service worker should fail silently instead of throwing
2282         https://bugs.webkit.org/show_bug.cgi?id=201696
2283
2284         Reviewed by Geoffrey Garen.
2285
2286         Posting a message to a redundant service worker should fail silently instead of throwing:
2287         - https://w3c.github.io/ServiceWorker/#dom-serviceworker-postmessage-message-options
2288         - https://w3c.github.io/ServiceWorker/#run-service-worker (step 2)
2289
2290         No new tests, rebaselined existing test.
2291
2292         * workers/service/ServiceWorker.cpp:
2293         (WebCore::ServiceWorker::postMessage):
2294         * workers/service/server/SWServer.cpp:
2295         (WebCore::SWServer::runServiceWorkerIfNecessary):
2296
2297 2019-09-11  Chris Dumez  <cdumez@apple.com>
2298
2299         Align our XPath API with the specification and other browsers
2300         https://bugs.webkit.org/show_bug.cgi?id=201660
2301
2302         Reviewed by Geoffrey Garen.
2303
2304         Align our XPath API with the specification and other browsers:
2305         - Document/XPathEvaluator.createExpression()'s first parameter should be mandatory
2306         - Document/XPathEvaluator.evaluate()'s first 2 parameters should be mandatory
2307         - XPathExpression.evaluate()'s first parameter should be mandatory
2308
2309         I have confirmed in the latest Chrome and Firefox that they match the specification.
2310         
2311         No new tests, rebaselined existing test.
2312
2313         * dom/Document.cpp:
2314         (WebCore::Document::evaluate):
2315         * dom/Document.h:
2316         * dom/Document.idl:
2317         * inspector/InspectorNodeFinder.cpp:
2318         (WebCore::InspectorNodeFinder::searchUsingXPath):
2319         * xml/XPathEvaluator.cpp:
2320         (WebCore::XPathEvaluator::evaluate):
2321         * xml/XPathEvaluator.h:
2322         * xml/XPathEvaluator.idl:
2323         * xml/XPathExpression.cpp:
2324         (WebCore::XPathExpression::evaluate):
2325         * xml/XPathExpression.h:
2326         * xml/XPathExpression.idl:
2327         * xml/XPathUtil.cpp:
2328         (WebCore::XPath::isValidContextNode):
2329         * xml/XPathUtil.h:
2330
2331 2019-09-11  Simon Fraser  <simon.fraser@apple.com>
2332
2333         REGRESSION (iOS 13): Top fixed element on apple.com flickers in size while pinching in
2334         https://bugs.webkit.org/show_bug.cgi?id=201668
2335         rdar://problem/51934041
2336
2337         Reviewed by Frédéric Wang.
2338
2339         When computing the new layout viewport rect in ScrollingTreeFrameScrollingNode, use
2340         "StickToDocumentBounds" mode, not "StickToViewportBounds", because otherwise we'll compute
2341         a layout viewport that has negative top/left offsets which causes fixed elements to jump outside
2342         the viewport. The only code that should be moving things outside the viewport (a temporary effect
2343         that happens when pinching) is the 'isBelowMinimumScale' path in WebPageProxy::computeCustomFixedPositionRect().
2344
2345         With this change ScrollingTreeFrameScrollingNode no longer needs m_behaviorForFixed; it can be removed later.
2346
2347         Not currently testable, since it involves pinching in past minimum zoom and transients state.
2348
2349         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2350         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
2351
2352 2019-09-11  Truitt Savell  <tsavell@apple.com>
2353
2354         Unreviewed, rolling out r249753.
2355
2356         caused inspector/canvas/shaderProgram-add-remove-webgl.html to
2357         crash on all Mac platforms.
2358
2359         Reverted changeset:
2360
2361         "Web Inspector: Canvas: instrument WebGPUDevice instead of
2362         GPUCanvasContext"
2363         https://bugs.webkit.org/show_bug.cgi?id=201650
2364         https://trac.webkit.org/changeset/249753
2365
2366 2019-09-11  Antti Koivisto  <antti@apple.com>
2367
2368         REGRESSION (245006): can't scroll in "read more" view in Eventbrite app
2369         https://bugs.webkit.org/show_bug.cgi?id=201683
2370         <rdar://problem/54582602>
2371
2372         Reviewed by Simon Fraser.
2373
2374         * platform/RuntimeApplicationChecks.h:
2375         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2376         (WebCore::IOSApplication::isEventbrite):
2377
2378 2019-09-11  Ryan Haddad  <ryanhaddad@apple.com>
2379
2380         Unreviewed, rolling out r249758.
2381
2382         Breaks the watchOS build.
2383
2384         Reverted changeset:
2385
2386         "[WHLSL] Ensure structs/arrays with pointers as fields are
2387         disallowed"
2388         https://bugs.webkit.org/show_bug.cgi?id=201525
2389         https://trac.webkit.org/changeset/249758
2390
2391 2019-09-11  Ali Juma  <ajuma@chromium.org>
2392
2393         Prevent reentrancy FrameLoader::dispatchUnloadEvents()
2394         https://bugs.webkit.org/show_bug.cgi?id=200738
2395
2396         Reviewed by Brady Eidson.
2397
2398         Reentrancy causes m_pageDismissalEventBeingDispatched to be incorrectly
2399         updated, so don't allow reentrancy.
2400
2401         Since this prevents m_pageDismissalEventBeingDispatched from being reset
2402         inside a reentrant call, it can have the unintended effect of causing
2403         FrameLoader::stopAllLoaders to early-out when called from
2404         FrameLoader::detachFromParent while a frame's unload event handler
2405         calls document.open() on a parent frame and causes itself to become
2406         detached. Allowing a load to continue in a detached frame will lead to
2407         a crash. To prevent this, add a new argument to FrameLoader::stopAllLoaders
2408         that FrameLoader::detachFromParent can use to prevent an early-out.
2409
2410         * loader/FrameLoader.cpp:
2411         (WebCore::FrameLoader::stopAllLoaders):
2412         (WebCore::FrameLoader::detachFromParent):
2413         (WebCore::FrameLoader::dispatchUnloadEvents):
2414         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2415         Ensure that m_pageDismissalEventBeingDispatched is reset to its previous value, even if this is not None.
2416         * loader/FrameLoader.h:
2417         * loader/FrameLoaderTypes.h:
2418         Add a StopLoadingPolicy enum.
2419
2420 2019-09-11  Charlie Turner  <cturner@igalia.com>
2421
2422         [GStreamer] Do not adopt floating references.
2423         https://bugs.webkit.org/show_bug.cgi?id=201685
2424
2425         Reviewed by Carlos Garcia Campos.
2426
2427         Covered by existing tests.
2428
2429         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2430         (WebCore::initializeGStreamer): gst_element_factory_make returns
2431         floating references, you do not adopt such references, rather you
2432         sink them.
2433
2434 2019-09-11  Saam Barati  <sbarati@apple.com>
2435
2436         [WHLSL] Ensure structs/arrays with pointers as fields are disallowed
2437         https://bugs.webkit.org/show_bug.cgi?id=201525
2438
2439         Reviewed by Robin Morisset.
2440
2441         This patch adds a pass which both ensures that references are always initialized with
2442         concrete values and that we support logical mode validation by disallowing nested references.
2443         
2444         Specifically, the pass:
2445         
2446         1. Disallows structs to have fields which are references. This prevents us from having to
2447         figure out how to default initialize such a struct. We could relax this in the future if we
2448         did an analysis on which structs contain reference fields, and ensure such struct variables
2449         always have initializers. This would also require us to create constructors for structs which
2450         initialize each field.
2451         2. We also do the same for arrays.
2452         3. References can only be one level deep. So no pointers to pointers. No references to
2453         references, etc. This is to support logical mode validation rules.
2454
2455         Test: webgpu/whlsl/ensure-proper-pointer-usage.html
2456
2457         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.cpp: Added.
2458         (WebCore::WHLSL::checkReferenceTypes):
2459         * Modules/webgpu/WHLSL/WHLSLCheckReferenceTypes.h: Added.
2460         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2461         (WebCore::WHLSL::Checker::visit):
2462         * Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
2463         (WebCore::WHLSL::prepareShared):
2464         * Sources.txt:
2465         * WebCore.xcodeproj/project.pbxproj:
2466
2467 2019-09-10  Devin Rousso  <drousso@apple.com>
2468
2469         Web Inspector: Canvas: instrument WebGPUDevice instead of GPUCanvasContext
2470         https://bugs.webkit.org/show_bug.cgi?id=201650
2471
2472         Reviewed by Joseph Pecoraro.
2473
2474         Most of the actual "work" done with Web GPU actually uses a `WebGPUDevice`.
2475
2476         A `GPUCanvasContext` is basically just a display "client" of the device, and isn't even
2477         required (e.g. compute pipeline).  We should treat the `GPUCanvasContext` almost like a
2478         `-webkit-canvas` client of a `WebGPUDevice`.
2479
2480         Tests: inspector/canvas/create-context-webgpu.html
2481                inspector/canvas/requestClientNodes-webgpu.html
2482                inspector/canvas/resolveContext-webgpu.html
2483
2484         * Modules/webgpu/WebGPUAdapter.cpp:
2485         (WebCore::WebGPUAdapter::requestDevice const):
2486         Notify web inspector after a device is created.
2487
2488         * Modules/webgpu/WebGPUDevice.idl:
2489         * Modules/webgpu/WebGPUDevice.h:
2490         * Modules/webgpu/WebGPUDevice.cpp:
2491         (WebCore::WebGPUDevice::instances): Added.
2492         (WebCore::WebGPUDevice::instancesMutex): Added.
2493         (WebCore::WebGPUDevice::~WebGPUDevice): Added.
2494         Notify web inspector when the device is about to be destructed.
2495
2496         * Modules/webgpu/GPUCanvasContext.h:
2497         * Modules/webgpu/GPUCanvasContext.cpp:
2498         (WebCore::GPUCanvasContext::create):
2499         (WebCore::GPUCanvasContext::configureSwapChain):
2500
2501         * inspector/InspectorCanvas.h:
2502         * inspector/InspectorCanvas.cpp:
2503         (WebCore::canvasIfContextMatchesDevice): Added.
2504         (WebCore::InspectorCanvas::create):
2505         (WebCore::InspectorCanvas::InspectorCanvas):
2506         (WebCore::InspectorCanvas::canvasContext const): Added.
2507         (WebCore::InspectorCanvas::canvasElement const): Added.
2508         (WebCore::InspectorCanvas::isDeviceForCanvasContext const): Added.
2509         (WebCore::InspectorCanvas::deviceContext const): Added.
2510         (WebCore::InspectorCanvas::scriptExecutionContext const): Added.
2511         (WebCore::InspectorCanvas::resolveContext const): Added.
2512         (WebCore::InspectorCanvas::clientNodes const): Added.
2513         (WebCore::InspectorCanvas::canvasChanged):
2514         (WebCore::InspectorCanvas::resetRecordingData):
2515         (WebCore::InspectorCanvas::recordAction):
2516         (WebCore::InspectorCanvas::buildObjectForCanvas):
2517         (WebCore::InspectorCanvas::releaseObjectForRecording):
2518         (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
2519         (WebCore::InspectorCanvas::buildInitialState):
2520         (WebCore::InspectorCanvas::canvasElement): Deleted.
2521         * inspector/InspectorInstrumentation.cpp:
2522         (WebCore::InspectorInstrumentation::didCreateWebGPUDeviceImpl): Added.
2523         (WebCore::InspectorInstrumentation::willDestroyWebGPUDeviceImpl): Added.
2524         (WebCore::InspectorInstrumentation::willConfigureSwapChainImpl): Added.
2525         * inspector/InspectorInstrumentation.h:
2526         (WebCore::InspectorInstrumentation::didCreateWebGPUDevice): Added.
2527         (WebCore::InspectorInstrumentation::willDestroyWebGPUDevice): Added.
2528         (WebCore::InspectorInstrumentation::willConfigureSwapChain): Added.
2529
2530         * inspector/agents/InspectorCanvasAgent.h:
2531         * inspector/agents/InspectorCanvasAgent.cpp:
2532         (WebCore::InspectorCanvasAgent::enable):
2533         (WebCore::InspectorCanvasAgent::requestClientNodes): Added.
2534         (WebCore::InspectorCanvasAgent::resolveContext): Added.
2535         (WebCore::InspectorCanvasAgent::startRecording):
2536         (WebCore::InspectorCanvasAgent::stopRecording):
2537         (WebCore::InspectorCanvasAgent::frameNavigated):
2538         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
2539         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
2540         (WebCore::InspectorCanvasAgent::canvasDestroyed):
2541         (WebCore::InspectorCanvasAgent::recordCanvasAction):
2542         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2543         (WebCore::InspectorCanvasAgent::didCreateWebGPUDevice): Added.
2544         (WebCore::InspectorCanvasAgent::willDestroyWebGPUDevice): Added.
2545         (WebCore::InspectorCanvasAgent::willConfigureSwapChain): Added.
2546         (WebCore::InspectorCanvasAgent::clearCanvasData):
2547         (WebCore::InspectorCanvasAgent::bindCanvas):
2548         (WebCore::InspectorCanvasAgent::unbindCanvas):
2549         (WebCore::InspectorCanvasAgent::findInspectorCanvas):
2550         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes): Deleted.
2551         (WebCore::contextAsScriptValue): Deleted.
2552         (WebCore::InspectorCanvasAgent::resolveCanvasContext): Deleted.
2553
2554         * inspector/InspectorShaderProgram.cpp:
2555         (WebCore::InspectorShaderProgram::context const):
2556
2557 2019-09-10  Chris Dumez  <cdumez@apple.com>
2558
2559         Nullptr crash in Page::sessionID() via WebKit::WebFrameLoaderClient::detachedFromParent2()
2560         https://bugs.webkit.org/show_bug.cgi?id=201625
2561
2562         Reviewed by Ryosuke Niwa.
2563
2564         This is based on a patch from Ryosuke Niwa.
2565
2566         Drop setHasFrameSpecificStorageAccess() in WebCore and call it from the WebKit layer instead.
2567
2568         * dom/DocumentStorageAccess.cpp:
2569         (WebCore::DocumentStorageAccess::requestStorageAccess):
2570         (WebCore::DocumentStorageAccess::setHasFrameSpecificStorageAccess): Deleted.
2571         * dom/DocumentStorageAccess.h:
2572         * loader/EmptyFrameLoaderClient.h:
2573         * loader/FrameLoaderClient.h:
2574
2575 2019-09-10  Brady Eidson  <beidson@apple.com>
2576
2577         Add SPI to save a PDF from the contents of a WKWebView.
2578         <rdar://problem/48955900> and https://bugs.webkit.org/show_bug.cgi?id=195765
2579
2580         Reviewed by Tim Horton.
2581
2582         Covered by API tests.
2583
2584         * page/FrameView.cpp:
2585         (WebCore::FrameView::paintContents): Don't paint the debug color outside of the FrameRect.
2586
2587         * platform/graphics/cg/GraphicsContextCG.cpp:
2588         (WebCore::GraphicsContext::setURLForRect):
2589
2590         * rendering/PaintPhase.h: Add "AnnotateLinks" option to always gather and annotation links.
2591
2592         * rendering/RenderElement.cpp:
2593         (WebCore::RenderElement::hasOutlineAnnotation const): Also return true when the PaintOptions include "AnnotateLinks"
2594
2595 2019-09-10  Jiewen Tan  <jiewen_tan@apple.com>
2596
2597         REGRESSION: [ Catalina WK2 ] http/wpt/webauthn/public-key-credential-create-success-u2f.https.html is failing
2598         https://bugs.webkit.org/show_bug.cgi?id=201620
2599         <rdar://problem/51524958>
2600
2601         Reviewed by Alex Christensen.
2602
2603         Covered by existing tests.
2604
2605         * Modules/webauthn/fido/U2fResponseConverter.cpp:
2606         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
2607         Change the way how the aaguid is initialized to see if that fixes the issue.
2608
2609 2019-09-10  Chris Dumez  <cdumez@apple.com>
2610
2611         Add missing origin check for Service-Worker-Allowed header
2612         https://bugs.webkit.org/show_bug.cgi?id=201653
2613
2614         Reviewed by Geoffrey Garen.
2615
2616         Add missing origin check for Service-Worker-Allowed header:
2617         - https://w3c.github.io/ServiceWorker/#update-algorithm (step 15. 2.)
2618
2619         * workers/service/ServiceWorkerJob.cpp:
2620         (WebCore::ServiceWorkerJob::didReceiveResponse):
2621
2622 2019-09-10  Sihui Liu  <sihui_liu@apple.com>
2623
2624         IndexedDB: cache prepared SQLiteStatement in SQLiteIDBCursor
2625         https://bugs.webkit.org/show_bug.cgi?id=201548
2626
2627         Reviewed by Alex Christensen.
2628
2629         This should be a performance improvement as we don't compile the same SQLiteStatement everytime it is used.
2630
2631         No new tests, no behavior change.
2632
2633         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2634         (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
2635         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2636
2637 2019-09-10  Youenn Fablet  <youenn@apple.com>
2638
2639         RTCPeerConnection can only be instantiated in documents
2640         https://bugs.webkit.org/show_bug.cgi?id=201639
2641
2642         Reviewed by Alex Christensen.
2643
2644         Make it clear that RTCDataChannel expects Document since peer connections
2645         and data channels can only be instantiated in document environments.
2646         We keep one downcast in RTCPeerConnection constructor due to a limitation
2647         in binding generator for JS built-ins.
2648         No change of behavior.
2649
2650         * Modules/mediastream/RTCDataChannel.cpp:
2651         (WebCore::RTCDataChannel::create):
2652         (WebCore::RTCDataChannel::RTCDataChannel):
2653         * Modules/mediastream/RTCDataChannel.h:
2654         * Modules/mediastream/RTCPeerConnection.cpp:
2655         (WebCore::RTCPeerConnection::create):
2656         (WebCore::RTCPeerConnection::RTCPeerConnection):
2657         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
2658         (WebCore::RTCPeerConnection::createDataChannel):
2659         (WebCore::RTCPeerConnection::document):
2660         * Modules/mediastream/RTCPeerConnection.h:
2661         * Modules/mediastream/RTCPeerConnection.idl:
2662         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
2663         (WebCore::LibWebRTCDataChannelHandler::channelEvent):
2664         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2665         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2666         (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
2667
2668 2019-09-10  Youenn Fablet  <youenn@apple.com>
2669
2670         Remove MediaStreamPrivate::scheduleDeferredTask
2671         https://bugs.webkit.org/show_bug.cgi?id=200975
2672
2673         Reviewed by Eric Carlson.
2674
2675         All calls to scheduleDeferredTask are done on the main thread.
2676         This was initially done to trigger less reconfiguration.
2677         But this makes the implementation significantly more complex.
2678
2679         For instance, we have to wait for the document to update its media state
2680         and send it to UIProcess before calling the allow completion handler.
2681
2682         Covered by existing tests.
2683
2684         * Modules/mediastream/MediaStream.cpp:
2685         (WebCore::MediaStream::MediaStream):
2686         Make sure to update the document media state once the tracks have been added, similarly to the other constructor.
2687         This ensures the document media state is computed with the new MediaStreamTrack.
2688         * Modules/mediastream/UserMediaRequest.cpp:
2689         (WebCore::isMediaStreamCorrectlyStarted):
2690         (WebCore::UserMediaRequest::allow):
2691         (WebCore::UserMediaRequest::stop):
2692         (WebCore::UserMediaRequest::mediaStreamDidFail):
2693         * Modules/mediastream/UserMediaRequest.h:
2694         * page/MediaProducer.h:
2695         (WebCore::MediaProducer::isCapturing):
2696         Make sure to include getDisplayMedia as part of capture check.
2697         * platform/mediastream/MediaStreamPrivate.cpp:
2698         (WebCore::MediaStreamPrivate::trackMutedChanged):
2699         (WebCore::MediaStreamPrivate::trackEnabledChanged):
2700         (WebCore::MediaStreamPrivate::trackStarted):
2701         (WebCore::MediaStreamPrivate::trackEnded):
2702         * platform/mediastream/MediaStreamPrivate.h:
2703
2704 2019-09-10  Youenn Fablet  <youenn@apple.com>
2705
2706         Audio sometimes fail to capture in WebRTC
2707         https://bugs.webkit.org/show_bug.cgi?id=180748
2708         <rdar://problem/36032346>
2709
2710         Reviewed by Eric Carlson.
2711
2712         In some cases, Safari is not receiving unsuspend notifications.
2713         In that case, the capture unit might stay in suspend state forever.
2714         To work around that, we force to unsuspend whenever there is a new capture happening.
2715         This will make it so that reloading the page will unsuspend the page.
2716
2717         Manually tested by triggering Siri, starting to use the microphone and quickly going back to a capturing page.
2718
2719         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2720         (WebCore::CoreAudioSharedUnit::provideSpeakerData):
2721         When suspension happens, the buffer size might change.
2722         Since this is only an issue if there are some references data, we now do not fail the capture when there
2723         is no reference data.
2724         (WebCore::CoreAudioSharedUnit::resume):
2725         (WebCore::CoreAudioSharedUnit::prepareForNewCapture):
2726         Make sure to start with a clean slate by setting suspend state to false for the shared unit.
2727         And failing all previous sources in case we are going back from suspension.
2728         (WebCore::CoreAudioSharedUnit::startInternal):
2729         (WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager):
2730         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2731
2732 2019-09-10  Adrian Perez de Castro  <aperez@igalia.com>
2733
2734         [GTK][WPE] Fixes for non-unified builds after r249022
2735         https://bugs.webkit.org/show_bug.cgi?id=201610
2736
2737         Reviewed by Joseph Pecoraro.
2738
2739         No new tests needed.
2740
2741         * fileapi/NetworkSendQueue.h: Add missing inclusion of wtf/WeakPtr.h; add the namespace to WTF::WeakPtr
2742         which is needed because there is no "using" clause.
2743         * inspector/InspectorInstrumentation.cpp: Add missing inclusion of the PageDOMDebuggerAgent.h header.
2744         * inspector/agents/WebDebuggerAgent.cpp: Add missing inclusion of the ScriptExecutionContext.h header.
2745         * inspector/agents/page/PageDOMDebuggerAgent.cpp: Add missing inclusion of the InstrumentingAgents.h header.
2746
2747 2019-09-10  Youenn Fablet  <youenn@apple.com>
2748
2749         Add support to RTCDataChannel.send(Blob)
2750         https://bugs.webkit.org/show_bug.cgi?id=201377
2751
2752         Reviewed by Chris Dumez.
2753
2754         Make use of NetworkSendQueue to enqueue and send properly messages.
2755         Test: imported/w3c/web-platform-tests/webrtc/RTCDataChannel-send-blob-order.html
2756
2757         * Modules/mediastream/RTCDataChannel.cpp:
2758         (WebCore::RTCDataChannel::createMessageQueue):
2759         (WebCore::RTCDataChannel::RTCDataChannel):
2760         (WebCore::RTCDataChannel::send):
2761         (WebCore::RTCDataChannel::close):
2762         * Modules/mediastream/RTCDataChannel.h:
2763
2764 2019-09-10  Ryosuke Niwa  <rniwa@webkit.org>
2765
2766         Option + arrow moves caret past whitespace on iOS
2767         https://bugs.webkit.org/show_bug.cgi?id=201575
2768
2769         Reviewed by Wenson Hsieh.
2770
2771         The bug was caused by findNextWordFromIndex on iOS behaving differently from macOS and UIKit by skipping
2772         trailing whitespace after a word when moving forward and not skipping leading whitespace when moving backward.
2773
2774         This patch introduces a new mode (StopAfterWord) of findNextWordFromIndex in iOS that better matches
2775         the behavior of findNextWordFromIndex on macOS and UIKit, and use it in various modify* functions of
2776         FrameSelection when the selection update is triggered by user.
2777
2778         The legacy mode (LegacyStopBeforeWord) is used in all other call sites as well as when modify* functions
2779         are invoked from author scripts.
2780
2781         Test: editing/selection/ios/move-by-word-with-keyboard.html
2782
2783         * editing/FrameSelection.cpp:
2784         (WebCore::nextWordWhitespaceModeInIOS): Added. A helper to convert EUserTriggered to NextWordModeInIOS.
2785         (WebCore::FrameSelection::nextWordPositionForPlatform):
2786         (WebCore::FrameSelection::modifyExtendingRight):
2787         (WebCore::FrameSelection::modifyExtendingForward):
2788         (WebCore::FrameSelection::modifyMovingRight):
2789         (WebCore::FrameSelection::modifyMovingForward):
2790         (WebCore::FrameSelection::modifyExtendingLeft):
2791         (WebCore::FrameSelection::modifyExtendingBackward):
2792         (WebCore::FrameSelection::modifyMovingLeft):
2793         (WebCore::FrameSelection::modifyMovingBackward):
2794         (WebCore::FrameSelection::modify):
2795         (WebCore::FrameSelection::updateAppearance):
2796         * editing/FrameSelection.h:
2797         * editing/TextIterator.cpp:
2798         (WebCore::SearchBuffer::isWordStartMatch const):
2799         * editing/VisibleUnits.cpp:
2800         (WebCore::previousWordPositionBoundary):
2801         (WebCore::previousWordPosition):
2802         (WebCore::nextWordPositionBoundary):
2803         (WebCore::nextWordPosition):
2804         * editing/VisibleUnits.h:
2805         * platform/text/TextBoundaries.cpp:
2806         (WebCore::findNextWordFromIndex):
2807         * platform/text/TextBoundaries.h:
2808         * platform/text/mac/TextBoundaries.mm:
2809         (WebCore::findNextWordFromIndex): Added a new mode.
2810
2811 2019-09-09  Chris Dumez  <cdumez@apple.com>
2812
2813         REGRESSION: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html is frequently timing out on iOS EWS bots
2814         https://bugs.webkit.org/show_bug.cgi?id=201550
2815
2816         Reviewed by Alex Christensen.
2817
2818         * loader/ResourceLoadObserver.h:
2819         (WebCore::ResourceLoadObserver::hasStatistics const):
2820
2821 2019-09-09  Timothy Hatcher  <timothy@apple.com>
2822
2823         Tap and hold on Facebook sometimes creates a tall empty selection.
2824         https://bugs.webkit.org/show_bug.cgi?id=201618
2825         rdar://53630145
2826
2827         Reviewed by Megan Gardner.
2828
2829         API Test: SelectionTests.ByWordAtEndOfDocument
2830
2831         * editing/VisibleUnits.cpp:
2832         (WebCore::wordRangeFromPosition):
2833         Remove special case code for the possibility of an empty paragraph and at the end
2834         of the document. This is no longer needed and was causing a large selection to be
2835         created on Facebook due to large areas of non-selectable content on the page.
2836
2837 2019-09-09  Joonghun Park  <jh718.park@samsung.com>
2838
2839         getComputedStyle for line-height: normal should return the keyword instead of a length
2840         https://bugs.webkit.org/show_bug.cgi?id=201296
2841
2842         Reviewed by Ryosuke Niwa.
2843
2844         Per https://github.com/w3c/csswg-drafts/issues/3749,
2845         Gecko and Blink has this behavior already.
2846
2847         This patch makes WebKit has the same behavior with them.
2848
2849         Tests: imported/w3c/web-platform-tests/css/css-inline/parsing/line-height-computed.html
2850                imported/w3c/web-platform-tests/css/cssom/getComputedStyle-line-height.html
2851                imported/w3c/web-platform-tests/html/rendering/replaced-elements/the-select-element/select-1-line-height.html
2852
2853         * css/CSSComputedStyleDeclaration.cpp:
2854         (WebCore::lineHeightFromStyle):
2855
2856 2019-09-09  Alex Christensen  <achristensen@webkit.org>
2857
2858         Disable TLS 1.0 and 1.1 in WebSockets
2859         https://bugs.webkit.org/show_bug.cgi?id=201573
2860
2861         Reviewed by Youenn Fablet.
2862
2863         This expands on what I started in r249019 when I disabled legacy TLS for our use of NSURLSession.
2864         Since our WebSocket implementation uses a different network interface, disable legacy TLS for them, too.
2865         I use the same temporary default to re-enable legacy TLS.  I also add a unit test for both WebSockets and NSURLSession use.
2866
2867         * platform/network/cf/SocketStreamHandleImpl.h:
2868         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2869         (WebCore::Function<bool):
2870         (WebCore::SocketStreamHandleImpl::setLegacyTLSEnabledCheck):
2871         (WebCore::SocketStreamHandleImpl::createStreams):
2872
2873 2019-09-09  Saam Barati  <sbarati@apple.com>
2874
2875         Unreviewed follow up to r249630. We need padding for ADDRESS32 CPUs to allow replaceWith to work on the intended types.
2876
2877         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
2878
2879 2019-09-09  Zalan Bujtas  <zalan@apple.com>
2880
2881         [LFC][TFC] Introduce cell spacing.
2882         https://bugs.webkit.org/show_bug.cgi?id=201605
2883         <rdar://problem/55184009>
2884
2885         Reviewed by Antti Koivisto.
2886
2887         This patch adds support for horizontal and vertical cell spacing (border-spacing). Now LFC matches table geometry for simple table content with multiple columns and rows. 
2888
2889         * layout/FormattingContextGeometry.cpp:
2890         (WebCore::Layout::FormattingContext::Geometry::contentHeightForFormattingContextRoot const): Now we can use the generic, check the inflow content logic for table height.
2891         * layout/LayoutUnits.h:
2892         (WebCore::Layout::HorizontalEdges::width const):
2893         (WebCore::Layout::VerticalEdges::height const):
2894         * layout/Verification.cpp:
2895         (WebCore::Layout::verifyAndOutputSubtree):
2896         * layout/tableformatting/TableFormattingContext.cpp:
2897         (WebCore::Layout::TableFormattingContext::layout):
2898         (WebCore::Layout::TableFormattingContext::layoutTableCellBox):
2899         (WebCore::Layout::TableFormattingContext::positionTableCells):
2900         (WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
2901         (WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
2902         (WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
2903         (WebCore::Layout::TableFormattingContext::ensureTableGrid):
2904         (WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
2905         (WebCore::Layout::TableFormattingContext::computedTableWidth):
2906         (WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth):
2907         * layout/tableformatting/TableFormattingContext.h:
2908         * layout/tableformatting/TableFormattingContextGeometry.cpp:
2909         (WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const):
2910         * layout/tableformatting/TableGrid.cpp:
2911         (WebCore::Layout::TableGrid::appendCell):
2912         (WebCore::Layout::TableGrid::widthConstraints const):
2913         (WebCore::Layout::TableGrid::ColumnsContext::useAsLogicalWidth): Deleted.
2914         * layout/tableformatting/TableGrid.h:
2915         (WebCore::Layout::TableGrid::setHorizontalSpacing):
2916         (WebCore::Layout::TableGrid::horizontalSpacing const):
2917         (WebCore::Layout::TableGrid::setVerticalSpacing):
2918         (WebCore::Layout::TableGrid::verticalSpacing const):
2919         (WebCore::Layout::TableGrid::ColumnsContext::logicalWidth const):
2920
2921 2019-09-09  Ryan Haddad  <ryanhaddad@apple.com>
2922
2923         Unreviewed, rolling out r249574.
2924
2925         Caused fast/mediastream/media-stream-track-source-failure.html
2926         to become flaky.
2927
2928         Reverted changeset:
2929
2930         "Remove MediaStreamPrivate::scheduleDeferredTask"
2931         https://bugs.webkit.org/show_bug.cgi?id=200975
2932         https://trac.webkit.org/changeset/249574
2933
2934 2019-09-09  Rob Buis  <rbuis@igalia.com>
2935
2936         [GTK][WPE] Remove attributes deprecated from MathML3
2937         https://bugs.webkit.org/show_bug.cgi?id=197492
2938
2939         Reviewed by Frédéric Wang.
2940
2941         Remove some MathML3 deprecated attributes:
2942         https://github.com/mathml-refresh/mathml/issues/5#issuecomment-475506856
2943
2944         This change also maps the dir attribute to direction for MathML Core.
2945
2946         Test: imported/w3c/web-platform-tests/mathml/relations/css-styling/attribute-mapping-001.html
2947
2948         * mathml/MathMLElement.cpp:
2949         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
2950
2951 2019-09-09  Youenn Fablet  <youenn@apple.com>
2952
2953         Move checkProcessLocalPortForActivity from provider to registry
2954         https://bugs.webkit.org/show_bug.cgi?id=201400
2955
2956         Reviewed by Alex Christensen.
2957
2958         Update the registry to take a callback that is used to implement checkProcessLocalPortForActivity.
2959         This allows WK1 and WK2 to have their own implementation.
2960
2961         Make the call to checkProcessLocalPortForActivity directly on the registry.
2962         Remove unneeded worker checkProcessLocalPortForActivity method.
2963         No change of behavior.
2964
2965         * dom/messageports/MessagePortChannel.cpp:
2966         (WebCore::MessagePortChannel::checkRemotePortForActivity):
2967         * dom/messageports/MessagePortChannelProvider.h:
2968         * dom/messageports/MessagePortChannelProviderImpl.cpp:
2969         (WebCore::createMessagePortChannelRegistry):
2970         (WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl):
2971         (WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity): Deleted.
2972         * dom/messageports/MessagePortChannelProviderImpl.h:
2973         * dom/messageports/MessagePortChannelRegistry.cpp:
2974         (WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry):
2975         (WebCore::MessagePortChannelRegistry::checkProcessLocalPortForActivity):
2976         * dom/messageports/MessagePortChannelRegistry.h:
2977         (WebCore::MessagePortChannelRegistry::provider): Deleted.
2978         * dom/messageports/WorkerMessagePortChannelProvider.cpp:
2979         (WebCore::WorkerMessagePortChannelProvider::checkProcessLocalPortForActivity): Deleted.
2980         * dom/messageports/WorkerMessagePortChannelProvider.h:
2981
2982 2019-09-08  Saam Barati  <sbarati@apple.com>
2983
2984         [WHLSL] Add back a version of the property resolver
2985         https://bugs.webkit.org/show_bug.cgi?id=201251
2986
2987         Reviewed by Robin Morisset.
2988
2989         This patch adds back the property resolver to aid in how we emit metal code.
2990         The goal of the new property resolver phase is to allow two things:
2991         1. For property access expressions, metal codegen should be allowed to evaluate
2992         the base, and if it's an index expression, the index, as many times as needed.
2993         So this patch ensures that if Metal evaluates such things, effects aren't performed
2994         more than once.
2995         
2996         2. For ReadModifyWrite expressions, metal codegen should be able to evaluate the
2997         leftValueExpression as many times as it'd like without performing the effects of
2998         leftValueExpression more than once.
2999         
3000         Here are a couple examples of this transformation:
3001         `a()[b()]` -> `(temp1 = a(), temp2 = b(), temp1[temp2])`
3002         `(*a())[b()] += 42;` -> `(temp1 = &*a(), temp2 = b(), (*temp1)[temp2] += 42)`
3003         
3004         The interesting rules break down like:
3005         - When the base is an lvalue, we take its address and replace the old base
3006         with a dereference of the new pointer variable.
3007         - When the base is an rvalue, we evaluate it and store it in a temporary
3008         variable, and switch the base to be a reference of that variable.
3009         - All indices are evaluated before the property access instruction and
3010         replaced with a reference to the temporary variable.
3011
3012         Test: webgpu/whlsl/property-evaluation-order.html
3013
3014         * Modules/webgpu/WHLSL/AST/WHLSLExpression.cpp:
3015         (WebCore::WHLSL::AST::Expression::mayBeEffectful const):
3016         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3017         * Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
3018         * Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
3019         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
3020         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
3021         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
3022         (WebCore::WHLSL::findHighZombies):
3023         * Modules/webgpu/WHLSL/WHLSLPropertyResolver.cpp:
3024         (WebCore::WHLSL::PropertyResolver::handleLeftHandSideBase):
3025         (WebCore::WHLSL::PropertyResolver::handlePropertyAccess):
3026         (WebCore::WHLSL::resolveProperties):
3027
3028 2019-09-07  Chris Dumez  <cdumez@apple.com>
3029
3030         Add support for postMessage buffering between the service worker and window
3031         https://bugs.webkit.org/show_bug.cgi?id=201169
3032
3033         Reviewed by Youenn Fablet.
3034
3035         As per the Service Worker specification, a service worker client's message
3036         queue is initially disabled and only gets enabled after:
3037         - The DOMContentLoaded event has been fired
3038         or
3039         - The client sets the navigator.serviceWorker.onmessage event handler
3040         or
3041         - navigator.serviceWorker.startMessages() is called
3042
3043         While the message queue is disabled, messages posted by the service worker
3044         to the client simply get queued and only get processed once the queue gets
3045         enabled.
3046
3047         No new tests, rebaselined existing test.
3048
3049         * dom/Document.cpp:
3050         (WebCore::Document::finishedParsing):
3051         Call startMessages() on the ServiceWorkerContainer once the DOMContentLoaded event has
3052         been fired.
3053
3054         * dom/ScriptExecutionContext.cpp:
3055         (WebCore::ScriptExecutionContext::ensureServiceWorkerContainer):
3056         * dom/ScriptExecutionContext.h:
3057         * workers/service/SWClientConnection.cpp:
3058         (WebCore::SWClientConnection::postMessageToServiceWorkerClient):
3059         Fix a bug where a service worker would not be able to post a message to a client until
3060         that client has accessed navigator.serviceWorker (since the ServiceWorkerContainer is
3061         lazy initialized). To address the issue, we now initialize the ServiceWorkerContainer
3062         when a message is received from the service worker. Previously, messages were just
3063         getting dropped.
3064
3065         * workers/service/ServiceWorkerContainer.cpp:
3066         (WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
3067         When the ServiceWorkerContainer is constructed, suspend its message queue if its context
3068         document is still parsing.
3069
3070         (WebCore::ServiceWorkerContainer::startMessages):
3071         Resume the message queue when startMessages() is called.
3072
3073         (WebCore::ServiceWorkerContainer::postMessage):
3074         Enqueue the event instead of firing it right away.
3075
3076         (WebCore::ServiceWorkerContainer::addEventListener):
3077         if navigator.serviceWorker.onmessage event handler gets set by the JavaScript, call
3078         startMessages().
3079
3080         * workers/service/ServiceWorkerContainer.h:
3081
3082 2019-09-07  Chris Dumez  <cdumez@apple.com>
3083
3084         [Service Workers] Drop support for registration resurrection
3085         https://bugs.webkit.org/show_bug.cgi?id=201584
3086
3087         Reviewed by Alex Christensen.
3088
3089         Drop support for registration resurrection (Unregistering then quickly re-registering would resurrect
3090         the original registration instead of creating a new one). This behavior is no longer in the
3091         specification (No more "isUninstalling" flag on the registration, and the registration is removed
3092         from the "scope to registration map" right away upon unregistering).
3093
3094         This resurrection behavior was causing a lot of flakiness in the tests so it is likely we will be able
3095         to unskip some tests. This is also what was causing the flakiness that caused Bug 201169 to be rolled
3096         out.
3097
3098         No new tests, updated existing tests.
3099
3100         * workers/service/server/SWServer.cpp:
3101         (WebCore::SWServer::activeWorkerFromRegistrationID):
3102         (WebCore::SWServer::getRegistration):
3103         (WebCore::SWServer::addRegistration):
3104         (WebCore::SWServer::removeRegistration):
3105         (WebCore::SWServer::getRegistrations):
3106         (WebCore::SWServer::clearAll):
3107         (WebCore::SWServer::clear):
3108         (WebCore::SWServer::terminatePreinstallationWorker):
3109         (WebCore::SWServer::didFinishActivation):
3110         (WebCore::SWServer::claim):
3111         (WebCore::SWServer::addClientServiceWorkerRegistration):
3112         (WebCore::SWServer::removeClientServiceWorkerRegistration):
3113         (WebCore::SWServer::installContextData):
3114         (WebCore::SWServer::runServiceWorker):
3115         (WebCore::SWServer::doRegistrationMatching):
3116         (WebCore::SWServer::registrationFromServiceWorkerIdentifier):
3117         (WebCore::SWServer::registerServiceWorkerClient):
3118         (WebCore::SWServer::unregisterServiceWorkerClient):
3119         (WebCore::SWServer::removeFromScopeToRegistrationMap):
3120         (WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
3121         * workers/service/server/SWServer.h:
3122         * workers/service/server/SWServerJobQueue.cpp:
3123         (WebCore::SWServerJobQueue::runRegisterJob):
3124         (WebCore::SWServerJobQueue::runUnregisterJob):
3125         (WebCore::SWServerJobQueue::runUpdateJob):
3126         * workers/service/server/SWServerRegistration.cpp:
3127         (WebCore::SWServerRegistration::clear):
3128         (WebCore::SWServerRegistration::handleClientUnload):
3129         (WebCore::SWServerRegistration::isUnregistered const):
3130         * workers/service/server/SWServerRegistration.h:
3131         (WebCore::SWServerRegistration::scopeURLWithoutFragment const):
3132         * workers/service/server/SWServerWorker.cpp:
3133         (WebCore::SWServerWorker::SWServerWorker):
3134         (WebCore::m_scriptResourceMap):
3135         (WebCore::SWServerWorker::contextData const):
3136         (WebCore::SWServerWorker::skipWaiting):
3137         (WebCore::SWServerWorker::setHasPendingEvents):
3138         (WebCore::SWServerWorker::setState):
3139         (WebCore::SWServerWorker::registration const):
3140         * workers/service/server/SWServerWorker.h:
3141
3142 2019-09-07  Ryan Haddad  <ryanhaddad@apple.com>
3143
3144         Unreviewed, rolling out r249353.
3145
3146         The test for this change is a flaky failure.
3147
3148         Reverted changeset:
3149
3150         "Add support for postMessage buffering between the service
3151         worker and window"
3152         https://bugs.webkit.org/show_bug.cgi?id=201169
3153         https://trac.webkit.org/changeset/249353
3154
3155 2019-09-07  Alex Christensen  <achristensen@webkit.org>
3156
3157         Deprecate WKContextGetWebsiteDataStore
3158         https://bugs.webkit.org/show_bug.cgi?id=200050
3159
3160         Reviewed by Geoff Garen.
3161
3162         * platform/network/CacheValidation.cpp:
3163         (WebCore::collectVaryingRequestHeaders):
3164         (WebCore::verifyVaryingRequestHeaders):
3165         * platform/network/CacheValidation.h:
3166         Replace a few NetworkStorageSession& with NetworkStorageSession*
3167         so I can replace defaultStorageSession with the correct NetworkStorageSession in NetworkCache.cpp.
3168
3169 2019-09-06  Brent Fulgham  <bfulgham@apple.com>
3170
3171         [FTW] Minor cleanups to avoid crashes during web browsing
3172         https://bugs.webkit.org/show_bug.cgi?id=201572
3173
3174         Reviewed by Alexey Proskuryakov.
3175
3176         This patch addresses a few crashes seen when doing general web browsing using
3177         the FTW build of WebKit:
3178
3179         1. ImageBuffer::sinkIntoImage was attempting to use a render target after WTFMoving it elsewhere.
3180         2. ImageBuffer::copyNativeImage was not properly checking the type of the render
3181            target to make sure it was suitable for Bitmap operations.
3182         3. BackingStoreBackendDirect2DImpl::scroll would crash if the scroll offset was
3183            outside the bounds of the current view. In that case, it would attempt to allocate
3184            a zero-size texture, which triggered a crash.
3185
3186         * platform/graphics/win/BackingStoreBackendDirect2DImpl.cpp:
3187         (WebCore::BackingStoreBackendDirect2DImpl::scroll):
3188         * platform/graphics/win/ImageBufferDirect2D.cpp:
3189         (WebCore::ImageBuffer::sinkIntoImage):
3190         (WebCore::ImageBuffer::copyNativeImage const):
3191
3192 2019-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>
3193
3194         Incorrect selection rect revealed after pasting images in a contenteditable element
3195         https://bugs.webkit.org/show_bug.cgi?id=201549
3196         <rdar://problem/50956429>
3197
3198         Reviewed by Simon Fraser.
3199
3200         Editor::replaceSelectionWithFragment currently scrolls to reveal the selection after inserting the given
3201         DocumentFragment. However, this scrolling occurs before any inserted images have loaded yet, which causes the
3202         wrong caret rect to be revealed, since all image elements inserted during paste will be empty.
3203
3204         To fix this, we defer revealing the selection after inserting the fragment until after all images that have
3205         been inserted are done loading. While waiting for images to load, if any layers which may be scrolled as a
3206         result of revealing the selection are scrolled, we additionally cancel the deferred selection reveal. See
3207         comments below for more detail.
3208
3209         Tests: editing/pasteboard/do-not-reveal-selection-after-programmatic-scroll.html
3210                editing/pasteboard/reveal-selection-after-pasting-images.html
3211                PasteImage.RevealSelectionAfterPastingImage
3212
3213         * editing/Editing.cpp:
3214         (WebCore::visibleImageElementsInRangeWithNonLoadedImages):
3215
3216         Add a new helper to iterate through a range and collect all image elements in that range, that contain cached
3217         images that have not finished loading yet.
3218
3219         * editing/Editing.h:
3220         * editing/Editor.cpp:
3221         (WebCore::Editor::replaceSelectionWithFragment):
3222
3223         Instead of always immediately revealing the selection after applying the ReplaceSelectionCommand, collect the
3224         image elements that were just inserted, and avoid immediately revealing the selection if any of these images
3225         have non-null cached images, but are not loaded yet. Instead, hold on to these images in a set, remove them once
3226         they finish loading using the new method below, and once all images are removed, reveal the selection.
3227
3228         (WebCore::Editor::revealSelectionIfNeededAfterLoadingImageForElement):
3229         (WebCore::Editor::renderLayerDidScroll):
3230
3231         Called whenever a scrollable RenderLayer is scrolled (or in the case of FrameView, the root layer). In the case
3232         where Editor is waiting to reveal the selection, we check to see if the scrolled layer is an ancestor of the
3233         layer enclosing the start of the selection.
3234
3235         (WebCore::Editor::respondToChangedSelection):
3236
3237         If the selection changes between pasting and waiting for pasted images to load, just cancel waiting to reveal
3238         the selection after pasting.
3239
3240         * editing/Editor.h:
3241         * editing/ReplaceSelectionCommand.cpp:
3242         (WebCore::ReplaceSelectionCommand::insertedContentRange const):
3243
3244         Add a helper method to grab the Range of content inserted after applying the command.
3245
3246         * editing/ReplaceSelectionCommand.h:
3247         * page/FrameView.cpp:
3248         (WebCore::FrameView::scrollPositionChanged):
3249         * page/FrameView.h:
3250         * page/Page.cpp:
3251         (WebCore::Page::didFinishLoadingImageForElement):
3252
3253         Notify Editor after an image finishes loading.
3254
3255         * rendering/RenderLayer.cpp:
3256         (WebCore::RenderLayer::scrollTo):
3257
3258 2019-09-06  Brent Fulgham  <bfulgham@apple.com>
3259
3260         PathDirect2D Cleanups
3261         https://bugs.webkit.org/show_bug.cgi?id=201534
3262
3263         Reviewed by Fujii Hironori.
3264
3265         1. Add a COMPtr<> move operator.
3266         2. Reduce copying ID2D1Geometry objects.
3267         3. Protect against using the ID2D1PathGeometry after the
3268            ID2D1GeometrySink's Close operation is used.
3269         4. Add a debug-only 'refCount' function to COMPtr to help
3270            track down memory errors.
3271
3272         * platform/graphics/Path.h:
3273         (WebCore::Path::activePath const): Deleted.
3274         * platform/graphics/win/Direct2DOperations.cpp:
3275         (WebCore::Direct2D::fillPath):
3276         (WebCore::Direct2D::drawPath):
3277         * platform/graphics/win/PathDirect2D.cpp:
3278         * platform/win/COMPtr.h:
3279         (COMPtr::COMPtr):
3280         (=):
3281         (refCount):
3282
3283 2019-09-06  Chris Dumez  <cdumez@apple.com>
3284
3285         Move the ResourceLoadObserver logic to WebKit2
3286         https://bugs.webkit.org/show_bug.cgi?id=201517
3287
3288         Reviewed by Brent Fulgham.
3289
3290         Move the ResourceLoadObserver logic to WebKit2 since it is not used by WebKit1. This allows us to simplify
3291         code.
3292
3293         In a follow-up patch, I will simplify the code even further by leveraging the fact that a WebContent process
3294         is always associated with a single WebsiteDataStore / sessionID:
3295         - No need for a HashMap of sessionIDs
3296         - No need to even allocate the ResourceLoadObserver if the WebProcess is associated with an ephemeral session.
3297
3298         * dom/Document.h:
3299         * loader/ResourceLoadObserver.cpp:
3300         (WebCore::sharedObserver):
3301         (WebCore::ResourceLoadObserver::setShared):
3302         (WebCore::ResourceLoadObserver::shared):
3303         * loader/ResourceLoadObserver.h:
3304         (WebCore::ResourceLoadObserver::~ResourceLoadObserver):
3305         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3306         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3307         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3308         (WebCore::ResourceLoadObserver::logFontLoad):
3309         (WebCore::ResourceLoadObserver::logCanvasRead):
3310         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
3311         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
3312         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
3313         (WebCore::ResourceLoadObserver::statisticsForURL):
3314         (WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
3315         (WebCore::ResourceLoadObserver::clearState):
3316         (WebCore::ResourceLoadObserver::setShouldLogUserInteraction):
3317         * page/DeprecatedGlobalSettings.h:
3318
3319 2019-09-06  Justin Fan  <justin_fan@apple.com>
3320
3321         [WebGPU] Update several interface and enum names to match spec
3322         https://bugs.webkit.org/show_bug.cgi?id=201564
3323
3324         Reviewed by Dean Jackson.
3325
3326         Rename GPUShaderStageBit -> GPUShaderStage.
3327         Rename GPUColorWriteBits -> GPUColorWrite.
3328         Rename TRANSFER_SRC/DST -> COPY_SRC/DST.
3329         Rename GPUPipelineStageDescriptor -> GPUProgrammableStageDescriptor.
3330
3331         Existing tests trivially updated to match.
3332
3333         * CMakeLists.txt:
3334         * DerivedSources-input.xcfilelist:
3335         * DerivedSources-output.xcfilelist:
3336         * DerivedSources.make:
3337         * Modules/webgpu/GPUBindGroupLayoutBinding.h:
3338         * Modules/webgpu/GPUBufferUsage.idl:
3339         * Modules/webgpu/GPUColorStateDescriptor.idl:
3340         * Modules/webgpu/GPUColorWrite.idl: Renamed from Source/WebCore/Modules/webgpu/GPUColorWriteBits.idl.
3341         * Modules/webgpu/GPUShaderStage.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderStageBit.h.
3342         * Modules/webgpu/GPUShaderStage.idl: Renamed from Source/WebCore/Modules/webgpu/GPUShaderStageBit.idl.
3343         * Modules/webgpu/GPUTextureUsage.idl:
3344         * Modules/webgpu/WebGPUComputePipelineDescriptor.cpp:
3345         (WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
3346         * Modules/webgpu/WebGPUComputePipelineDescriptor.h:
3347         * Modules/webgpu/WebGPUComputePipelineDescriptor.idl:
3348         * Modules/webgpu/WebGPUDevice.cpp:
3349         * Modules/webgpu/WebGPUProgrammableStageDescriptor.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPUPipelineStageDescriptor.cpp.
3350         (WebCore::WebGPUProgrammableStageDescriptor::tryCreateGPUProgrammableStageDescriptor const):
3351         * Modules/webgpu/WebGPUProgrammableStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUPipelineStageDescriptor.h.
3352         * Modules/webgpu/WebGPUProgrammableStageDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUPipelineStageDescriptor.idl.
3353         * Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
3354         (WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
3355         * Modules/webgpu/WebGPURenderPipelineDescriptor.h:
3356         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
3357         * Sources.txt:
3358         * WebCore.xcodeproj/project.pbxproj:
3359         * bindings/js/WebCoreBuiltinNames.h:
3360         * platform/graphics/gpu/GPUBuffer.h:
3361         (WebCore::GPUBuffer::isCopySource const):
3362         (WebCore::GPUBuffer::isCopyDestination const):
3363         (WebCore::GPUBuffer::isTransferSource const): Deleted.
3364         (WebCore::GPUBuffer::isTransferDestination const): Deleted.
3365         * platform/graphics/gpu/GPUBufferUsage.h:
3366         * platform/graphics/gpu/GPUColorStateDescriptor.h:
3367         * platform/graphics/gpu/GPUColorWrite.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUColorWriteBits.h.
3368         * platform/graphics/gpu/GPUComputePipelineDescriptor.h:
3369         (WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
3370         * platform/graphics/gpu/GPUPipelineDescriptorBase.h:
3371         * platform/graphics/gpu/GPUProgrammableStageDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUPipelineStageDescriptor.h.
3372         (WebCore::GPUProgrammableStageDescriptor::GPUProgrammableStageDescriptor):
3373         * platform/graphics/gpu/GPURenderPipelineDescriptor.h:
3374         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
3375         * platform/graphics/gpu/GPUTexture.h:
3376         (WebCore::GPUTexture::isCopySource const):
3377         (WebCore::GPUTexture::isCopyDestination const):
3378         (WebCore::GPUTexture::isReadOnly const):
3379         (WebCore::GPUTexture::isTransferSource const): Deleted.
3380         (WebCore::GPUTexture::isTransferDestination const): Deleted.
3381         * platform/graphics/gpu/GPUTextureUsage.h:
3382         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3383         (WebCore::GPUBindGroupLayout::tryCreate):
3384         * platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
3385         (WebCore::GPUBindGroup::tryCreate):
3386         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
3387         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3388         (WebCore::GPUCommandBuffer::copyBufferToBuffer):
3389         (WebCore::GPUCommandBuffer::copyBufferToTexture):
3390         (WebCore::GPUCommandBuffer::copyTextureToBuffer):
3391         (WebCore::GPUCommandBuffer::copyTextureToTexture):
3392         * platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: