ee4ff5bdad8340d230da99731c7a8c4624dfe5b4
[WebKit.git] / Source / WebCore / ChangeLog
1 2019-02-06  Benjamin Poulain  <benjamin@webkit.org>
2
3         Unreviewed, rolling out r240759 and r240944.
4
5         Some timer uses are done off the main thread, WebCore::Timer
6         cannot be used
7
8         Reverted changesets:
9
10         "<rdar://problem/47570443> Responsiveness timers are too
11         expensive for frequent events"
12         https://bugs.webkit.org/show_bug.cgi?id=194003
13         https://trac.webkit.org/changeset/240759
14
15         "Use deferrable timer to restart the Responsiveness Timer on
16         each wheel event"
17         https://bugs.webkit.org/show_bug.cgi?id=194135
18         https://trac.webkit.org/changeset/240944
19
20 2019-02-06  Keith Rollin  <krollin@apple.com>
21
22         Update .xcfilelist files
23
24         Unreviewed build fix.
25
26         * DerivedSources-input.xcfilelist:
27         * DerivedSources-output.xcfilelist:
28
29 2019-02-06  Devin Rousso  <drousso@apple.com>
30
31         Web Inspector: DOM: don't send the entire function string with each event listener
32         https://bugs.webkit.org/show_bug.cgi?id=194293
33         <rdar://problem/47822809>
34
35         Reviewed by Joseph Pecoraro.
36
37         Test: inspector/dom/getEventListenersForNode.html
38
39         * inspector/agents/InspectorDOMAgent.cpp:
40         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
41
42 2019-02-06  Andy Estes  <aestes@apple.com>
43
44         [Payment Request] It should be possible to require a phonetic name for shipping contacts
45         https://bugs.webkit.org/show_bug.cgi?id=194311
46         <rdar://46733045>
47
48         Reviewed by Alex Christensen.
49
50         It should be possible to require that a shipping contact has a phonetic name in Payment Request.
51         To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
52         ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
53
54         Since required shipping contact fields can now be specified both in
55         requiredShippingContactFields and PaymentOptions, we merge the required fields from these
56         two sources such that, e.g., email is required if it is specified in either place.
57
58         So that clients can detect this new feature, the API version number is bumped from 5 to 6.
59
60         Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
61
62         * DerivedSources.make:
63         * Modules/applepay/ApplePayPaymentRequest.h:
64         * Modules/applepay/ApplePayPaymentRequest.idl:
65         * Modules/applepay/ApplePayRequestBase.cpp:
66         (WebCore::convertAndValidate):
67         * Modules/applepay/ApplePayRequestBase.h:
68         * Modules/applepay/ApplePayRequestBase.idl:
69         * Modules/applepay/ApplePaySession.cpp:
70         (WebCore::convertAndValidate):
71         * Modules/applepay/PaymentCoordinatorClient.cpp: Added.
72         (WebCore::PaymentCoordinatorClient::supportsVersion):
73         * Modules/applepay/PaymentCoordinatorClient.h:
74         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
75         (WebCore::mergePaymentOptions):
76         (WebCore::ApplePayPaymentHandler::show):
77         * SourcesCocoa.txt:
78         * WebCore.xcodeproj/project.pbxproj:
79         * loader/EmptyClients.cpp:
80         * testing/MockPaymentContactFields.h: Added.
81         (WebCore::MockPaymentContactFields::MockPaymentContactFields):
82         * testing/MockPaymentContactFields.idl: Added.
83         * testing/MockPaymentCoordinator.cpp:
84         (WebCore::MockPaymentCoordinator::showPaymentUI):
85         (WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
86         * testing/MockPaymentCoordinator.h:
87         * testing/MockPaymentCoordinator.idl:
88
89 2019-02-06  Yusuke Suzuki  <ysuzuki@apple.com>
90
91         [JSC] PrivateName to PublicName hash table is wasteful
92         https://bugs.webkit.org/show_bug.cgi?id=194277
93
94         Reviewed by Michael Saboff.
95
96         Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
97
98         * bindings/js/JSDOMWindowCustom.cpp:
99         (WebCore::addCrossOriginPropertyNames):
100         * bindings/js/JSLocationCustom.cpp:
101         (WebCore::getOwnPropertySlotCommon):
102         (WebCore::putCommon):
103         * bindings/js/WebCoreBuiltinNames.h:
104
105 2019-02-06  Keith Rollin  <krollin@apple.com>
106
107         Really enable the automatic checking and regenerations of .xcfilelists during builds
108         https://bugs.webkit.org/show_bug.cgi?id=194357
109         <rdar://problem/47861231>
110
111         Reviewed by Chris Dumez.
112
113         Bug 194124 was supposed to enable the automatic checking and
114         regenerating of .xcfilelist files during the build. While related
115         changes were included in that patch, the change to actually enable the
116         operation somehow was omitted. This patch actually enables the
117         operation. The check-xcfilelist.sh scripts now check
118         WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
119         from the checking.
120
121         No new tests since there should be no observable behavior difference.
122
123         * Scripts/check-xcfilelists.sh:
124
125 2019-02-06  John Wilander  <wilander@apple.com>
126
127         Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
128         https://bugs.webkit.org/show_bug.cgi?id=194325
129         <rdar://problem/47840283>
130
131         Reviewed by Chris Dumez.
132
133         No new tests. This is just data forwarding. Once the data is stored, I will create
134         test infrastructure to query it.
135
136         * html/HTMLAnchorElement.cpp:
137         (WebCore::HTMLAnchorElement::handleClick):
138         * loader/AdClickAttribution.h:
139         (WebCore::AdClickAttribution::encode const):
140         (WebCore::AdClickAttribution::decode):
141         (WebCore::AdClickAttribution::Conversion::encode const):
142         (WebCore::AdClickAttribution::Conversion::decode):
143             Infrastructure for IPC.
144         * loader/FrameLoader.cpp:
145         (WebCore::FrameLoader::urlSelected):
146         (WebCore::FrameLoader::loadURLIntoChildFrame):
147         (WebCore::FrameLoader::loadFrameRequest):
148         (WebCore::FrameLoader::loadURL):
149             These functions forward the optional WebCore::AdClickAttribution object
150             FrameLoader::loadURL() creates the NavigationAction object and sets the
151             WebCore::AdClickAttribution object on there.
152         * loader/FrameLoader.h:
153         (WebCore::FrameLoader::urlSelected):
154         (WebCore::FrameLoader::loadURL):
155         * loader/NavigationAction.h:
156         (WebCore::NavigationAction::adClickAttribution):
157         (WebCore::NavigationAction::setAdClickAttribution):
158
159 2019-02-06  Justin Fan  <justin_fan@apple.com>
160
161         [Web GPU] Implement supporting dictionaries for GPUTexture
162         https://bugs.webkit.org/show_bug.cgi?id=194354
163
164         Reviewed by Dean Jackson.
165
166         Add dictionaries needed to create a GPUTextureDescriptor.
167
168         No new tests; no change in behavior. 
169
170         New interface and dictionaries added:
171         * Modules/webgpu/GPUExtent3D.idl:
172         * Modules/webgpu/GPUTextureDescriptor.idl:
173         * Modules/webgpu/GPUTextureDimension.idl:
174         * Modules/webgpu/GPUTextureUsage.idl:
175         * platform/graphics/gpu/GPUExtent3D.h:
176         * platform/graphics/gpu/GPUTextureDescriptor.h:
177         * platform/graphics/gpu/GPUTextureDimension.h:
178         * platform/graphics/gpu/GPUTextureUsage.h:
179
180         Update WebGPUTextureFormatEnum to GPUTextureFormat:
181         * Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
182         * Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
183         * platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
184         * Modules/webgpu/WebGPUSwapChain.cpp:
185         * Modules/webgpu/WebGPUSwapChain.h:
186         * Modules/webgpu/WebGPUSwapChain.idl:
187         * platform/graphics/gpu/GPUSwapChain.h:
188         * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
189         (WebCore::platformTextureFormatForGPUTextureFormat):
190         (WebCore::GPUSwapChain::setFormat):
191
192         Update project files with new symbols:
193         * CMakeLists.txt:
194         * DerivedSources.make:
195         * Sources.txt:
196         * WebCore.xcodeproj/project.pbxproj:
197         * bindings/js/WebCoreBuiltinNames.h:
198
199 2019-02-06  Dean Jackson  <dino@apple.com>
200
201         Fix potential build error in GPUDevice
202         https://bugs.webkit.org/show_bug.cgi?id=194359
203
204         Reviewed by Joseph Pecoraro.
205
206         Add an UNUSED_PARAM for non-macOS platforms.
207
208         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
209         (WebCore::GPUDevice::create):
210
211 2019-02-06  Daniel Bates  <dabates@apple.com>
212
213         Standardize on ControlKey instead of CtrlKey
214         https://bugs.webkit.org/show_bug.cgi?id=194317
215
216         Reviewed by Tim Horton.
217
218         * dom/UIEventWithKeyState.cpp:
219         (WebCore::UIEventWithKeyState::modifiersFromInitializer):
220         (WebCore::UIEventWithKeyState::setModifierKeys):
221         * dom/UIEventWithKeyState.h:
222         (WebCore::UIEventWithKeyState::ctrlKey const):
223         * page/ios/EventHandlerIOS.mm:
224         (WebCore::EventHandler::accessKeyModifiers):
225         * page/mac/EventHandlerMac.mm:
226         (WebCore::EventHandler::accessKeyModifiers):
227         * platform/PlatformEvent.h:
228         (WebCore::PlatformEvent::controlKey const):
229         (WebCore::PlatformEvent::PlatformEvent):
230         (WebCore::PlatformEvent::ctrlKey const): Deleted.
231         * platform/cocoa/KeyEventCocoa.mm:
232         (WebCore::PlatformKeyboardEvent::getCurrentModifierState):
233         * platform/gtk/PlatformKeyboardEventGtk.cpp:
234         (WebCore::modifiersForGdkKeyEvent):
235         * platform/gtk/PlatformMouseEventGtk.cpp:
236         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
237         * platform/gtk/PlatformWheelEventGtk.cpp:
238         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
239         * platform/ios/KeyEventIOS.mm:
240         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
241         * platform/ios/PlatformEventFactoryIOS.mm:
242         (WebCore::modifiersForEvent):
243         * platform/mac/KeyEventMac.mm:
244         (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
245         * platform/mac/PlatformEventFactoryMac.mm:
246         (WebCore::modifiersForEvent):
247         * testing/Internals.cpp:
248         (WebCore::Internals::accessKeyModifiers const):
249
250 2019-02-06  Alex Christensen  <achristensen@webkit.org>
251
252         Fix WatchOS build
253         https://bugs.webkit.org/show_bug.cgi?id=194353
254
255         Rubber stamped by Tim Horton and Wenson Hsieh.
256
257         * rendering/RenderThemeIOS.mm:
258         (WebCore::iconForAttachment):
259
260 2019-02-06  Olivier Blin  <olivier.blin@softathome.com>
261
262         [SVG] fix SVGURIReference build by including SVGElement
263         https://bugs.webkit.org/show_bug.cgi?id=194292
264
265         Reviewed by Michael Catanzaro.
266
267         * svg/SVGURIReference.h:
268         SVGURIReference is making use of SVGElement in its constructor, but
269         it was not declared.
270
271         The issue was not seen in unified builds because it was grouped with
272         other files including SVGElement.
273
274 2019-02-06  Zalan Bujtas  <zalan@apple.com>
275
276         [LFC][IFC] Move line layout code to a dedicated file
277         https://bugs.webkit.org/show_bug.cgi?id=194328
278
279         Reviewed by Antti Koivisto.
280
281         * Sources.txt:
282         * WebCore.xcodeproj/project.pbxproj:
283         * layout/inlineformatting/InlineFormattingContext.cpp:
284         (WebCore::Layout::InlineFormattingContext::layout const):
285         (WebCore::Layout::isTrimmableContent): Deleted.
286         (WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
287         (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
288         (WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
289         (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
290         (WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
291         (WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
292         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
293         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
294         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
295         * layout/inlineformatting/InlineFormattingContext.h:
296         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
297         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
298         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
299         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
300         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
301         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
302         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
303         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
304         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
305         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
306         (WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
307         (WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
308         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
309         (WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
310         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
311         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
312         (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
313         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
314         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
315         (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
316         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
317         (WebCore::Layout::adjustedLineLogicalLeft): Deleted.
318         (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
319         (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
320         (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
321         (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
322         * layout/inlineformatting/Line.cpp:
323         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
324         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
325         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
326         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
327         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
328         (WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
329         (WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
330         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
331         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
332         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
333         (WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
334         (WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
335
336 2019-02-06  Youenn Fablet  <youenn@apple.com>
337
338         CoreAudioCaptureSource should not configure its audio unit until it starts producing data
339         https://bugs.webkit.org/show_bug.cgi?id=194310
340
341         Reviewed by Eric Carlson.
342
343         Delay the configuration of the audio unit until the source is instructed to start producing data.
344         This allows the UIProcess to not start changing the audio unit when
345         checking for constraints during getUserMedia call before the prompt.
346         Covered by manual testing.
347
348         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
349         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
350         (WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
351         (WebCore::CoreAudioCaptureSource::startProducingData):
352         * platform/mediastream/mac/CoreAudioCaptureSource.h:
353
354 2019-02-06  Youenn Fablet  <youenn@apple.com>
355
356         Disable audio ducking at Audio Unit setup time
357         https://bugs.webkit.org/show_bug.cgi?id=194303
358
359         Reviewed by Eric Carlson.
360
361         When creating a CoreAudioCaptureSource, the audio unit might be
362         reconfigured if a past audio capture was done.
363         This might trigger audio ducking which is undone in startInternal.
364         In some cases, startInternal will never call start.
365         In that case, the audio unit will continue ducking the other processing.
366         To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
367
368         In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
369         This might affect all applications.
370         Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
371         This has noticeable effects in the quality of audio being played on bluetooth devices.
372
373         Covered by manual tests.
374
375         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
376         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
377         (WebCore::CoreAudioSharedUnit::unduck):
378         (WebCore::CoreAudioSharedUnit::startInternal):
379         (WebCore::CoreAudioSharedUnit::captureFailed):
380         (WebCore::CoreAudioSharedUnit::stopProducingData):
381
382 2019-02-06  Antti Koivisto  <antti@apple.com>
383
384         RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
385         https://bugs.webkit.org/show_bug.cgi?id=194333
386         <rdar://problem/47822929>
387
388         Reviewed by Zalan Bujtas.
389
390         Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
391         the legacy animation code triggering a resource load.
392
393         Test: http/tests/contentextensions/css-display-none-keyframe.html
394
395         * style/StyleScope.cpp:
396         (WebCore::Style::Scope::scheduleUpdate):
397
398         Avoid clearing the style resolver if we are in the middle of a style resolution.
399         A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
400
401 2019-02-06  Pablo Saavedra  <psaavedra@igalia.com>
402
403         Build failure after r240315
404         https://bugs.webkit.org/show_bug.cgi?id=194341
405
406         Reviewed by Wenson Hsieh.
407
408         * bindings/js/JSUndoItemCustom.cpp:
409         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
410
411 2019-02-05  Ryosuke Niwa  <rniwa@webkit.org>
412
413         REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
414         https://bugs.webkit.org/show_bug.cgi?id=194329
415
416         Reviewed by Geoffrey Garen.
417
418         The bug was caused by the code path for when navigating with a specific target frame name that does not exist
419         never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
420         navigation, resulting in this release assertion.
421
422         Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
423
424         Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
425
426         * loader/FrameLoader.cpp:
427         (WebCore::FrameLoader::loadURL):
428
429 2019-02-05  Claudio Saavedra  <csaavedra@igalia.com>
430
431         [FreeType] Build fix for Debian stable
432
433         Unreviewed build fix.
434
435         Debian stable currently has a version of fontconfig that doesn't
436         yet have FC_COLOR. #ifdef its use to fix the build.
437
438         * platform/graphics/freetype/FontCacheFreeType.cpp:
439         (WebCore::FontCache::systemFallbackForCharacters):
440
441 2019-02-05  Alex Christensen  <achristensen@webkit.org>
442
443         Stop using blobRegistry in NetworkProcess
444         https://bugs.webkit.org/show_bug.cgi?id=194027
445
446         Reviewed by Youenn Fablet.
447
448         Also stop using NetworkBlobRegistry::singleton.
449         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
450         We now have to resolve all blob file references while we still have a
451         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
452         using the singleton after we have passed everything to the loading code, but it works the same
453         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
454         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
455         which extensions to revoke.
456
457         * platform/network/BlobRegistryImpl.h:
458         * platform/network/FormData.cpp:
459         (WebCore::appendBlobResolved):
460         (WebCore::FormData::resolveBlobReferences):
461         * platform/network/FormData.h:
462         * platform/network/cf/FormDataStreamCFNet.cpp:
463         (WebCore::createHTTPBodyCFReadStream):
464         * platform/network/curl/CurlFormDataStream.cpp:
465         (WebCore::CurlFormDataStream::CurlFormDataStream):
466
467 2019-02-05  Truitt Savell  <tsavell@apple.com>
468
469         Unreviewed, rolling out r240984.
470
471         Revision casued two API timeouts
472
473         Reverted changeset:
474
475         "Stop using blobRegistry in NetworkProcess"
476         https://bugs.webkit.org/show_bug.cgi?id=194027
477         https://trac.webkit.org/changeset/240984
478
479 2019-02-05  Keith Rollin  <krollin@apple.com>
480
481         Enable the automatic checking and regenerations of .xcfilelists during builds
482         https://bugs.webkit.org/show_bug.cgi?id=194124
483         <rdar://problem/47721277>
484
485         Reviewed by Tim Horton.
486
487         Bug 193790 add a facility for checking -- during build time -- that
488         any needed .xcfilelist files are up-to-date and for updating them if
489         they are not. This facility was initially opt-in by setting
490         WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
491         the process seemed robust. Its now time to enable this facility and
492         make it opt-out. If there is a need to disable this facility, set and
493         export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
494         running `make` or `build-webkit`, or before running Xcode from the
495         command line.
496
497         Additionally, remove the step that generates a list of source files
498         going into the UnifiedSources build step. It's only necessarily to
499         specify Sources.txt and SourcesCocoa.txt as inputs.
500
501         No new tests since there should be no observable behavior difference.
502
503         * UnifiedSources-input.xcfilelist: Removed.
504         * WebCore.xcodeproj/project.pbxproj:
505
506 2019-02-05  Keith Rollin  <krollin@apple.com>
507
508         Update .xcfilelist files
509         https://bugs.webkit.org/show_bug.cgi?id=194121
510         <rdar://problem/47720863>
511
512         Reviewed by Tim Horton.
513
514         Preparatory to enabling the facility for automatically updating the
515         .xcfilelist files, check in a freshly-updated set so that not everyone
516         runs up against having to regenerate them themselves.
517
518         No new tests since there should be no observable behavior difference.
519
520         * DerivedSources-input.xcfilelist:
521         * DerivedSources-output.xcfilelist:
522
523 2019-02-05  Alex Christensen  <achristensen@webkit.org>
524
525         Stop using blobRegistry in NetworkProcess
526         https://bugs.webkit.org/show_bug.cgi?id=194027
527
528         Reviewed by Youenn Fablet.
529
530         Also stop using NetworkBlobRegistry::singleton.
531         Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
532         We now have to resolve all blob file references while we still have a
533         NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
534         using the singleton after we have passed everything to the loading code, but it works the same
535         as it did before.  We must consume the sandbox extension from the BlobRegistryImpl before using
536         the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
537         which extensions to revoke.
538
539         * platform/network/BlobRegistryImpl.h:
540         * platform/network/FormData.cpp:
541         (WebCore::appendBlobResolved):
542         (WebCore::FormData::resolveBlobReferences):
543         * platform/network/FormData.h:
544         * platform/network/cf/FormDataStreamCFNet.cpp:
545         (WebCore::createHTTPBodyCFReadStream):
546         * platform/network/curl/CurlFormDataStream.cpp:
547         (WebCore::CurlFormDataStream::CurlFormDataStream):
548
549 2019-02-05  Ryan Haddad  <ryanhaddad@apple.com>
550
551         Unreviewed, rolling out r240742.
552
553         Causes crashes on iOS simulator.
554
555         Reverted changeset:
556
557         "[iOS] Keyups for non-modifier keys identified as "Dead" when
558         not focused in a content-editable element"
559         https://bugs.webkit.org/show_bug.cgi?id=192824
560         https://trac.webkit.org/changeset/240742
561
562 2019-02-05  Zalan Bujtas  <zalan@apple.com>
563
564         [LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
565         https://bugs.webkit.org/show_bug.cgi?id=194269
566
567         Reviewed by Antti Koivisto.
568
569         In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
570         These property values are input to collectInlineContent's inline item detaching logic.
571
572         * layout/inlineformatting/InlineFormattingContext.cpp:
573         (WebCore::Layout::nextInPreOrder):
574         (WebCore::Layout::InlineFormattingContext::layout const):
575         (WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
576         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
577         * layout/inlineformatting/InlineFormattingContext.h:
578         * layout/layouttree/LayoutBox.h: ran out bits. 
579
580 2019-02-05  Antoine Quint  <graouts@apple.com>
581
582         REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
583         https://bugs.webkit.org/show_bug.cgi?id=194284
584         <rdar://problem/47774298>
585
586         Reviewed by Antti Koivisto.
587
588         The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
589         which is an EventTargetSet (typedef’d to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
590         whereas elements with a touch-action property aren’t. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
591         the latter being called from Style::TreeResolver::resolveElement().
592
593         * dom/Document.cpp:
594         (WebCore::Document::updateTouchActionElements):
595         * dom/Document.h:
596         (WebCore::Document::touchActionElements const):
597
598 2019-02-05  Benjamin Poulain  <benjamin@webkit.org>
599
600         Hit testing functions optimizations
601         https://bugs.webkit.org/show_bug.cgi?id=194073
602         <rdar://problem/47692312>
603
604         Reviewed by Zalan Bujtas.
605
606         This patch implements some easy optimizations that speed up
607         hit testing without changing the algorithms.
608
609         * page/FrameViewLayoutContext.h:
610         The code for:
611             view().frameView().layoutContext().isPaintOffsetCacheEnabled()
612         followed by:
613             view().frameView().layoutContext().layoutState()
614         was loading all the intermediate values twice and calling layoutState()
615         twice.
616
617         By marking the function as pure, Clang can CSE the whole thing and
618         remove the duplicated code.
619
620         * platform/graphics/LayoutRect.h:
621         (WebCore::LayoutRect::isInfinite const):
622         That one is pretty funny.
623
624         Since LayoutRect::isInfinite() was implemented before operator==() is
625         declared, the compiler was falling back to the implicit convertion to FloatRect()
626         before doing any comparison.
627
628         This explains a bunch of the convertions to float when using LayoutRect.
629
630         * rendering/RenderBox.cpp:
631         (WebCore::RenderBox::mapLocalToContainer const):
632         Just reoder to make the register nice and clean for the optimization described above.
633
634 2019-02-04  Yusuke Suzuki  <ysuzuki@apple.com>
635
636         [JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
637         https://bugs.webkit.org/show_bug.cgi?id=193993
638
639         Reviewed by Keith Miller.
640
641         * bindings/scripts/CodeGeneratorJS.pm:
642         (GenerateHeader):
643         * bridge/runtime_method.h:
644
645 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
646
647         Move some macOS/iOS scrolling code into the scrolling/cocoa directory
648         https://bugs.webkit.org/show_bug.cgi?id=194245
649
650         Reviewed by Zalan Bujtas.
651
652         ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
653         directory.
654
655         Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).
656
657         Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.
658
659         * SourcesCocoa.txt:
660         * WebCore.xcodeproj/project.pbxproj:
661         * page/scrolling/ScrollingThread.cpp:
662         (WebCore::ScrollingThread::initializeRunLoop):
663         (WebCore::ScrollingThread::wakeUpRunLoop):
664         (WebCore::ScrollingThread::threadRunLoopSourceCallback):
665         * page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
666         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
667         * page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
668         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
669         * page/scrolling/mac/ScrollingThreadMac.mm:
670         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
671         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
672
673 2019-02-04  Ms2ger  <Ms2ger@igalia.com>
674
675         [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
676         https://bugs.webkit.org/show_bug.cgi?id=174816
677
678         Reviewed by Michael Catanzaro.
679
680         Tests: enabled fast/url/user-visible/.
681
682         * testing/Internals.cpp:
683         (WebCore::Internals::userVisibleString): Enable method on all platforms.
684
685 2019-02-04  Fujii Hironori  <Hironori.Fujii@sony.com>
686
687         [curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
688         https://bugs.webkit.org/show_bug.cgi?id=190895
689
690         Reviewed by Ross Kirsling.
691
692         An assertion was failing in CurlRequest::invokeDidReceiveResponse
693         because DidReceiveResponse was already dispatched. This condition
694         was met if CurlRequestScheduler::completeTransfer is called while
695         waiting for the reply for the first DidReceiveResponse.
696
697         No new tests, covered by existing tests.
698
699         * platform/network/curl/CurlRequest.h:
700         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
701         Return true if m_didNotifyResponse is false disregard to
702         m_didReturnFromNotify.
703
704 2019-02-04  Said Abou-Hallawa  <said@apple.com>
705
706         [CG] Enable setAdditionalSupportedImageTypes for WK1
707         https://bugs.webkit.org/show_bug.cgi?id=194190
708
709         Reviewed by Tim Horton.
710
711         Move the function webCoreStringVectorFromNSStringArray from WebKit to
712         WebCore so it can be used by both WebKit and WebKitLegacy.
713
714         * platform/mac/StringUtilities.h:
715         * platform/mac/StringUtilities.mm:
716         (WebCore::webCoreStringVectorFromNSStringArray):
717
718 2019-02-04  Justin Fan  <justin_fan@apple.com>
719
720         [Web GPU] Code clean-up for RenderPipeline backend
721         https://bugs.webkit.org/show_bug.cgi?id=194238
722
723         Reviewed by Dean Jackson.
724
725         Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for 
726         the input state's descriptor arrays.
727
728         Covered by existing tests; no change in behavior.
729
730         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
731         (WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
732         (WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.
733
734 2019-02-04  Benjamin Poulain  <benjamin@webkit.org>
735
736         Use deferrable timer to restart the Responsiveness Timer on each wheel event
737         https://bugs.webkit.org/show_bug.cgi?id=194135
738         <rdar://problem/47724099>
739
740         Reviewed by Simon Fraser.
741
742         The original DeferrableOneShotTimer was not really deferrable.
743         What it allows is to restart the count down from scratch after
744         firing.
745
746         For this optimization, I want to keep the correct timing but avoid
747         starting a real timer every time.
748
749         I renamed DeferrableOneShotTimer to ResettableOneShotTimer and
750         created a real DeferrableOneShotTimer that support deadlines.
751
752         * css/CSSImageGeneratorValue.cpp:
753         * html/HTMLPlugInImageElement.h:
754         * loader/cache/CachedResource.h:
755         * platform/Timer.cpp:
756         (WebCore::DeferrableOneShotTimer::startOneShot):
757         (WebCore::DeferrableOneShotTimer::fired):
758         * platform/Timer.h:
759         (WebCore::TimerBase::nextFireTime const):
760         (WebCore::ResettableOneShotTimer::ResettableOneShotTimer):
761         (WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
762         (WebCore::DeferrableOneShotTimer::stop):
763         (WebCore::DeferrableOneShotTimer::restart): Deleted.
764         * platform/graphics/ca/TileController.h:
765         * platform/graphics/cg/SubimageCacheWithTimer.h:
766
767 2019-02-04  Antoine Quint  <graouts@apple.com>
768
769         Use constants for pointer types
770         https://bugs.webkit.org/show_bug.cgi?id=194232
771
772         Reviewed by Dean Jackson.
773
774         We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a
775         pointer event using JavaScript, but we can at least used string constants for the ones created internally.
776
777         * dom/PointerEvent.cpp:
778         (WebCore::PointerEvent::mousePointerType):
779         (WebCore::PointerEvent::penPointerType):
780         (WebCore::PointerEvent::touchPointerType):
781         * dom/PointerEvent.h:
782         * dom/ios/PointerEventIOS.cpp:
783
784 2019-02-04  Zalan Bujtas  <zalan@apple.com>
785
786         [First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account.
787         https://bugs.webkit.org/show_bug.cgi?id=194168
788
789         Reviewed by Simon Fraser.
790
791         First paint should not be blocked by async or deferred scripts.
792
793         * page/FrameView.cpp:
794         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
795
796 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
797
798         Async overflow scroll with border-radius renders incorrectly
799         https://bugs.webkit.org/show_bug.cgi?id=194205
800         <rdar://problem/47771668>
801
802         Reviewed by Zalan Bujtas.
803
804         When an element has composited overflow:scroll and border-radius, we need to make a layer
805         to clip to the inside of the border radius if necessary.
806
807         Existing code simply turned off needsDescendantsClippingLayer for composited scrolling
808         layers, but now we check to see if the inner border is rounded. If we have both a m_childContainmentLayer
809         and scrolling layers, we need to adjust the location of the scrolling layers (which are parented
810         in m_childContainmentLayer).
811
812         Also fix offsetFromRenderer for these layers; it's positive for layers inset from the top left
813         of the border box.
814
815         Tests: compositing/clipping/border-radius-async-overflow-clipping-layer.html
816                compositing/clipping/border-radius-async-overflow-non-stacking.html
817                compositing/clipping/border-radius-async-overflow-stacking.html
818
819         * rendering/RenderLayerBacking.cpp:
820         (WebCore::RenderLayerBacking::updateConfiguration):
821         (WebCore::RenderLayerBacking::updateGeometry):
822         (WebCore::RenderLayerBacking::updateChildClippingStrategy): Layout is always up-to-date now, so remove the comment.
823
824 2019-02-04  Simon Fraser  <simon.fraser@apple.com>
825
826         PageOverlayController's layers should be created lazily
827         https://bugs.webkit.org/show_bug.cgi?id=194199
828
829         Reviewed by Tim Horton.
830
831         Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
832         and use them to only parent the overlay-hosting layers when necessary.
833
834         For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
835         simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
836         which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
837         compositing updates that parents the layerWithDocumentOverlays().
838
839         View overlays are added to the layer tree via the DrawingArea. When we go between having
840         none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
841         on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
842         compositing flush (this has to be done manually because view overlay layers are outside the
843         subtree managed by RenderLayerCompositor).
844         
845         Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
846         there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
847         overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
848         having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
849
850         * loader/EmptyClients.h:
851         * page/ChromeClient.h:
852         * page/FrameView.cpp:
853         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
854         because there may be nothing else that does.
855         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
856         * page/Page.cpp:
857         (WebCore::Page::installedPageOverlaysChanged):
858         * page/Page.h:
859         * page/PageOverlayController.cpp:
860         (WebCore::PageOverlayController::hasDocumentOverlays const):
861         (WebCore::PageOverlayController::hasViewOverlays const):
862         (WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
863         might as well be the one to call through the ChromeClient.
864         (WebCore::PageOverlayController::detachViewOverlayLayers):
865         (WebCore::PageOverlayController::installPageOverlay):
866         (WebCore::PageOverlayController::uninstallPageOverlay):
867         * page/PageOverlayController.h:
868         * rendering/RenderLayerCompositor.cpp:
869         (WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
870         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
871         (WebCore::RenderLayerCompositor::attachRootLayer):
872         (WebCore::RenderLayerCompositor::detachRootLayer):
873
874 2019-02-04  Eric Liang  <ericliang@apple.com>
875
876         When performing Increment or Decrement on sliders, check to see if the slider is disabled.
877         https://bugs.webkit.org/show_bug.cgi?id=173497
878
879         Reviewed by Chris Fleizach.
880
881         Test: accessibility/set-value-not-work-for-disabled-sliders.html
882
883         * accessibility/AccessibilityNodeObject.cpp:
884         (WebCore::AccessibilityNodeObject::alterSliderValue):
885
886 2019-02-04  Sihui Liu  <sihui_liu@apple.com>
887
888         IndexedDB: leak WebIDBConnectionToServer in layout tests
889         https://bugs.webkit.org/show_bug.cgi?id=193688
890         <rdar://problem/47353263>
891
892         Reviewed by Geoffrey Garen.
893
894         Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.
895
896         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
897         (WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
898         * Modules/indexeddb/client/IDBConnectionToServer.h:
899         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
900
901 2019-02-04  Youenn Fablet  <youenn@apple.com>
902
903         Make sure to remove the device observer in AVVideoCaptureSource
904         https://bugs.webkit.org/show_bug.cgi?id=194181
905         <rdar://problem/47739247>
906
907         Reviewed by Eric Carlson.
908
909         Make sure to remove the device observer when the observer is destroyed.
910         To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.
911
912         Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.
913
914         Covered by manual test.
915
916        * platform/mediastream/mac/AVVideoCaptureSource.h:
917         * platform/mediastream/mac/AVVideoCaptureSource.mm:
918         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
919         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
920         (WebCore::AVVideoCaptureSource::initializeSession):
921         (WebCore::AVVideoCaptureSource::clearSession):
922         (WebCore::AVVideoCaptureSource::stopProducingData):
923         (WebCore::AVVideoCaptureSource::setupSession):
924
925 2019-02-04  Antoine Quint  <graouts@apple.com>
926
927         Use a dedicated type instead of int32_t for pointer identifiers
928         https://bugs.webkit.org/show_bug.cgi?id=194217
929
930         Reviewed by Antti Koivisto.
931
932         * WebCore.xcodeproj/project.pbxproj:
933         * dom/PointerEvent.h:
934         * dom/PointerID.h: Added.
935         * page/PointerCaptureController.cpp:
936         (WebCore::PointerCaptureController::setPointerCapture):
937         (WebCore::PointerCaptureController::releasePointerCapture):
938         (WebCore::PointerCaptureController::hasPointerCapture):
939         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
940         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier):
941         (WebCore::PointerCaptureController::cancelPointer):
942         * page/PointerCaptureController.h:
943
944 2019-02-04  Wenson Hsieh  <wenson_hsieh@apple.com>
945
946         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
947         Followup to https://bugs.webkit.org/show_bug.cgi?id=193758
948
949         Reviewed by Daniel Bates.
950
951         Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in
952         behavior.
953
954         * editing/EditingBehavior.h:
955         (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const):
956         * html/HTMLInputElement.cpp:
957         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
958
959 2019-02-04  Zalan Bujtas  <zalan@apple.com>
960
961         [LFC][IFC] Make InlineFormattingContext::collectInlineContent non-recursive.
962         https://bugs.webkit.org/show_bug.cgi?id=194210
963
964         Reviewed by Antti Koivisto.
965
966         Use iterative algorithm to collect inline content (and add breaking rules).
967         This is in preparation for fixing the inline preferred width computation.  
968
969         * layout/Verification.cpp:
970         (WebCore::Layout::resolveForRelativePositionIfNeeded):
971         * layout/inlineformatting/InlineFormattingContext.cpp:
972         (WebCore::Layout::addDetachingRules):
973         (WebCore::Layout::createAndAppendInlineItem):
974         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
975         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Deleted.
976         * layout/inlineformatting/InlineFormattingContext.h:
977
978 2019-02-04  Michael Catanzaro  <mcatanzaro@igalia.com>
979
980         Unreviewed, fix unused variable warnings introduced in r240912
981         https://bugs.webkit.org/show_bug.cgi?id=194198
982         <rdar://problem/47776051>
983
984         * page/FrameView.cpp:
985         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
986         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
987
988 2019-02-04  Frederic Wang  <fwang@igalia.com>
989
990         [css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow
991         https://bugs.webkit.org/show_bug.cgi?id=191816
992
993         Reviewed by Wenson Hsieh.
994
995         This patch fixes a bug that prevents children of a scroll container to create snap positions
996         when they have non-visible overflow. This happens because for such a child, the function
997         RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the
998         scroll container. To address that issue, we introduce a new
999         RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that
1000         a real RenderBox ancestor is returned.
1001
1002         Test: css3/scroll-snap/scroll-snap-children-with-overflow.html
1003
1004         * page/scrolling/AxisScrollSnapOffsets.cpp:
1005         (WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping()
1006         so that we don't skip children with non-visible overflow.
1007         * rendering/RenderLayerModelObject.cpp:
1008         (WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls
1009         enclosingBox().
1010         * rendering/RenderObject.cpp:
1011         (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return
1012         the scrollable container of the enclosing box. If it is actually the render object itself
1013         then start the search from the parent box instead.
1014         * rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping(). 
1015
1016 2019-02-04  Antti Koivisto  <antti@apple.com>
1017
1018         Rename GraphicsLayer and PlatformCALayer scrolling layer type enum values to be less ambiguous
1019         https://bugs.webkit.org/show_bug.cgi?id=194215
1020
1021         Reviewed by Frédéric Wang.
1022
1023         GraphicsLayer::Type::Scrolling -> GraphicsLayer::Type::ScrollContainer
1024         PlatformCALayer::LayerTypeScrollingLayer -> PlatformCALayer::LayerTypeScrollContainerLayer
1025
1026         * platform/graphics/GraphicsLayer.cpp:
1027         (WebCore::GraphicsLayer::supportsLayerType):
1028         * platform/graphics/GraphicsLayer.h:
1029         * platform/graphics/ca/GraphicsLayerCA.cpp:
1030         (WebCore::GraphicsLayer::supportsLayerType):
1031         (WebCore::GraphicsLayerCA::initialize):
1032         * platform/graphics/ca/PlatformCALayer.cpp:
1033         (WebCore::operator<<):
1034         * platform/graphics/ca/PlatformCALayer.h:
1035         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1036         (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
1037         (WebCore::PlatformCALayerCocoa::commonInit):
1038         * rendering/RenderLayerBacking.cpp:
1039         (WebCore::RenderLayerBacking::updateScrollingLayers):
1040         * rendering/RenderLayerCompositor.cpp:
1041         (WebCore::RenderLayerCompositor::ensureRootLayer):
1042
1043 2019-02-03  Antti Koivisto  <antti@apple.com>
1044
1045         [iOS] Tiles not created in large scrollable iframes
1046         https://bugs.webkit.org/show_bug.cgi?id=193665
1047
1048         Reviewed by Simon Fraser.
1049
1050         We are not syncing scroll position back to the graphics layer tree correctly.
1051
1052         Test by Frédéric Wang.
1053
1054         * page/scrolling/AsyncScrollingCoordinator.cpp:
1055         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1056         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1057         (WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
1058
1059         Factor setting and syncing scrolling layer positions into a function.
1060         Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
1061
1062         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
1063         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1064         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
1065         * page/scrolling/AsyncScrollingCoordinator.h:
1066         * page/scrolling/ScrollingCoordinator.cpp:
1067         (WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
1068         (WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
1069         (WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
1070         * page/scrolling/ScrollingCoordinator.h:
1071         * rendering/RenderLayerCompositor.cpp:
1072
1073         Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
1074         Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
1075
1076         (WebCore::RenderLayerCompositor::~RenderLayerCompositor):
1077         (WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
1078         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
1079         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1080         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1081         (WebCore::RenderLayerCompositor::updateScrollLayerPosition):
1082         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1083         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
1084         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
1085         (WebCore::RenderLayerCompositor::updateLayerForHeader):
1086         (WebCore::RenderLayerCompositor::updateLayerForFooter):
1087         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1088         (WebCore::RenderLayerCompositor::ensureRootLayer):
1089         (WebCore::RenderLayerCompositor::destroyRootLayer):
1090         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1091         * rendering/RenderLayerCompositor.h:
1092
1093 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
1094
1095         Make setNeedsLayout on the root more explicitly about triggering its side-effects
1096         https://bugs.webkit.org/show_bug.cgi?id=194198
1097
1098         Reviewed by Antti Koivisto.
1099
1100         Calling setNeedsLayout() on the FrameView or RenderView is an odd concept; the render tree
1101         generally manages its own dirty state.
1102
1103         Most callers of setNeedsLayout() on the root are really trying to trigger the side-effects
1104         of layout, like compositing updates, which are required when view configuration state, like
1105         headers, footers and transparency, change. These dependencies are currently implicit and
1106         poorly defined.
1107
1108         Renaming "setNeedsLayout" on FrameView is a step towards being more explicit about pure
1109         rendering updates, vs updates of downstream data strutures like compositing. It's now called
1110         setNeedsLayoutAfterViewConfigurationChange(). In addition, expose
1111         setNeedsCompositingConfigurationUpdate() and setNeedsCompositingGeometryUpdate() so callers
1112         can trigger the appropriate types of compositing updates on the root layer.
1113
1114         In addition, FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange() schedules a
1115         layout. Withtout this, some callers would dirty the RenderView's layout but rely on some
1116         other trigger to make the layout happen.
1117
1118         This cleanup was prompted by noticing that FrameView::setHeaderHeight() dirtied layout
1119         but never scheduled it, making banner insertion in MiniBrowser unreliable.
1120
1121         This patch also removes the aliasing of headerHeight/footerHeight between Page and
1122         FrameView. Banners are a property of Page, so FrameView fetches the banner heights
1123         from Page.
1124
1125         * page/FrameView.cpp:
1126         (WebCore::FrameView::headerHeight const):
1127         (WebCore::FrameView::footerHeight const):
1128         (WebCore::FrameView::availableContentSizeChanged):
1129         (WebCore::FrameView::setNeedsLayoutAfterViewConfigurationChange):
1130         (WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
1131         (WebCore::FrameView::setNeedsCompositingGeometryUpdate):
1132         (WebCore::FrameView::scheduleSelectionUpdate):
1133         (WebCore::FrameView::setTransparent):
1134         (WebCore::FrameView::setBaseBackgroundColor):
1135         (WebCore::FrameView::setAutoSizeFixedMinimumHeight):
1136         (WebCore::FrameView::enableAutoSizeMode):
1137         (WebCore::FrameView::setHeaderHeight): Deleted.
1138         (WebCore::FrameView::setFooterHeight): Deleted.
1139         (WebCore::FrameView::setNeedsLayout): Deleted.
1140         * page/FrameView.h:
1141         * page/FrameViewLayoutContext.cpp:
1142         (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
1143         (WebCore::FrameViewLayoutContext::setNeedsLayout): Deleted.
1144         * page/FrameViewLayoutContext.h:
1145         * page/Page.cpp:
1146         (WebCore::Page::setPageScaleFactor):
1147         (WebCore::Page::setHeaderHeight):
1148         (WebCore::Page::setFooterHeight):
1149         (WebCore::Page::addHeaderWithHeight): Deleted.
1150         (WebCore::Page::addFooterWithHeight): Deleted.
1151         * page/Page.h:
1152         * rendering/RenderLayerCompositor.cpp:
1153         (WebCore::RenderLayerCompositor::updateBacking):
1154         * testing/Internals.cpp:
1155         (WebCore::Internals::resetToConsistentState):
1156         (WebCore::Internals::setHeaderHeight):
1157         (WebCore::Internals::setFooterHeight):
1158
1159 2019-02-03  John Wilander  <wilander@apple.com>
1160
1161         Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
1162         https://bugs.webkit.org/show_bug.cgi?id=194104
1163         <rdar://problem/47649991>
1164
1165         Reviewed by Chris Dumez, Daniel Bates, and Darin Adler.
1166
1167         Test: http/tests/adClickAttribution/anchor-tag-attributes-validation.html
1168
1169         This patch adds parsing and validation of the two new Ad Click Attribution
1170         attributes in anchor elements: adcampaignid and addestination. The data is
1171         not yet forwarded into the loader.
1172
1173         * html/HTMLAnchorElement.cpp:
1174         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
1175         (WebCore::HTMLAnchorElement::handleClick):
1176             Now calls HTMLAnchorElement::parseAdClickAttribution().
1177         * html/HTMLAnchorElement.h:
1178         * loader/AdClickAttribution.h:
1179             Made WebCore::AdClickAttribution copyable since it's needed to have it be
1180             WTF::Optional. Also made AdClickAttribution::MaxEntropy public. Changed
1181             numeric types from unsigned short to uint32_t.
1182         (WebCore::AdClickAttribution::Campaign::isValid const):
1183         (WebCore::AdClickAttribution::Conversion::isValid const):
1184
1185 2019-02-03  Ryosuke Niwa  <rniwa@webkit.org>
1186
1187         Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
1188         https://bugs.webkit.org/show_bug.cgi?id=194189
1189
1190         Reviewed by Geoffrey Garen.
1191
1192         Introduced PolicyCheckIdentifier to pair each navigation policy check request with a decision,
1193         and deployed it in PolicyChecker. The identifier is passed from WebContent process to UI process
1194         in WebKit2, and passed it back with the policy decision.
1195
1196         Because PolicyCheckIdentifier embeds the process identifier from which a navigation policy is checked,
1197         we would be able to detect when UI process had sent the decision to a wrong WebContent process.
1198
1199         This patch also adds release assertions to make sure history().provisionalItem() is set whenever
1200         we're requesting a navigation policy check.
1201
1202         These code changes should either:
1203         1. Fix crashes in FrameLoader::continueLoadAfterNavigationPolicy where isBackForwardLoadType would
1204            return true yet history().provisionalItem() is null.
1205         2. Detect a bug that UI process can send a navigation policy decision to a wrong WebContent process.
1206         3. Rule out the possibility that (2) exists.
1207
1208         * loader/DocumentLoader.cpp:
1209         (WebCore::DocumentLoader::willSendRequest):
1210         (WebCore::DocumentLoader::responseReceived):
1211         * loader/EmptyClients.cpp:
1212         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1213         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
1214         * loader/EmptyFrameLoaderClient.h:
1215         * loader/FrameLoader.cpp:
1216         (WebCore::FrameLoader::checkContentPolicy):
1217         (WebCore::FrameLoader::loadURL):
1218         (WebCore::FrameLoader::load):
1219         (WebCore::FrameLoader::loadWithDocumentLoader):
1220         (WebCore::FrameLoader::loadPostRequest):
1221         * loader/FrameLoader.h:
1222         * loader/FrameLoaderClient.h:
1223         * loader/FrameLoaderTypes.h:
1224         (WebCore::PolicyCheckIdentifier): Added.
1225         (WebCore::PolicyCheckIdentifier::operator== const): Added.
1226         (WebCore::PolicyCheckIdentifier::PolicyCheckIdentifier): Added.
1227         (WebCore::PolicyCheckIdentifier::encode const): Added.
1228         (WebCore::PolicyCheckIdentifier::decode): Added.
1229         * loader/PolicyChecker.cpp:
1230         (WebCore::PolicyCheckIdentifier::generate):
1231         (WebCore::PolicyCheckIdentifier::isValidFor): Returns true if the identifer matches. Also release asserts
1232         that the process ID is same, and that m_check is always not zero (meaning it's a generated value).
1233         The failure of these release assertions would indicate that there is a bug in UI process, which results in
1234         a policy decision response being sent to a wrong Web process.
1235         (WebCore::PolicyChecker::checkNavigationPolicy): Exit early if isValidFor fails.
1236         (WebCore::PolicyChecker::checkNewWindowPolicy):
1237
1238 2019-02-03  Antti Koivisto  <antti@apple.com>
1239
1240         Don't include ScrollCoordinator.h from Element.h
1241         https://bugs.webkit.org/show_bug.cgi?id=194206
1242
1243         Reviewed by Daniel Bates.
1244
1245         * dom/Element.h:
1246
1247 2019-02-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1248
1249         Unable to move selection into editable roots with 0 height
1250         https://bugs.webkit.org/show_bug.cgi?id=194143
1251         <rdar://problem/47767284>
1252
1253         Reviewed by Ryosuke Niwa.
1254
1255         Currently, positions inside editable elements of height 0 are not considered to be candidates when
1256         canonicalizing a position to its visible counterpart. This prevents us from moving the selection into these
1257         editable roots at all. To fix this, we relax this constraint by allowing positions anchored by root editable
1258         elements to be candidates.
1259
1260         Test: editing/selection/insert-text-in-empty-content-editable.html
1261
1262         * dom/Position.cpp:
1263         (WebCore::Position::isCandidate const):
1264
1265 2019-02-03  Simon Fraser  <simon.fraser@apple.com>
1266
1267         Tidyup of Pagination and FrameView m_mediaType initialization
1268         https://bugs.webkit.org/show_bug.cgi?id=194203
1269
1270         Reviewed by Darin Adler.
1271
1272         Fix post-commit feedback on lines around code changed in r240901.
1273
1274         * page/FrameView.cpp:
1275         (WebCore::FrameView::FrameView):
1276         * page/FrameView.h:
1277         * rendering/Pagination.h:
1278         (WebCore::Pagination::operator!= const):
1279
1280 2019-02-03  Megan Gardner  <megan_gardner@apple.com>
1281
1282         Turn on Smart Paste
1283         https://bugs.webkit.org/show_bug.cgi?id=193786
1284
1285         Reviewed by Ryosuke Niwa.
1286
1287         Turned on a modified tests:
1288         LayoutTests/editing/pasteboard/smart-paste-001.html
1289         LayoutTests/editing/pasteboard/smart-paste-002.html
1290         LayoutTests/editing/pasteboard/smart-paste-003.html
1291         LayoutTests/editing/pasteboard/smart-paste-004.html
1292         LayoutTests/editing/pasteboard/smart-paste-005.html
1293         LayoutTests/editing/pasteboard/smart-paste-006.html
1294         LayoutTests/editing/pasteboard/smart-paste-007.html
1295         LayoutTests/editing/pasteboard/smart-paste-008.html
1296
1297         * platform/ios/PasteboardIOS.mm:
1298         (WebCore::Pasteboard::canSmartReplace):
1299         Turn on smart replace.
1300
1301 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
1302
1303         Tidy up data memebers of FrameView and related classes to shrink class sizes
1304         https://bugs.webkit.org/show_bug.cgi?id=194197
1305
1306         Reviewed by Zalan Bujtas.
1307
1308         Make various enums 8-bit. Re-order data members of FrameView, FrameViewLayoutContext, Widget
1309         and ScrollView to optimize padding.
1310
1311         Use more data member initializers.
1312
1313         This shrinks FrameView from 1168 (144 padding bytes) to 1096 (96 padding bytes).
1314
1315         * dom/Element.h:
1316         * page/FrameView.cpp:
1317         (WebCore::FrameView::FrameView):
1318         * page/FrameView.h:
1319         * page/FrameViewLayoutContext.h:
1320         * platform/ScrollTypes.h:
1321         * platform/ScrollView.h: Data members should come after member functions.
1322         * platform/Widget.h:
1323         * rendering/Pagination.h:
1324         (WebCore::Pagination::Pagination): Deleted.
1325
1326 2019-02-02  Simon Fraser  <simon.fraser@apple.com>
1327
1328         Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
1329         https://bugs.webkit.org/show_bug.cgi?id=194194
1330
1331         Rubber-stampted by Antti Koivisto.
1332
1333         Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
1334         for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.
1335
1336         * rendering/RenderLayerBacking.cpp:
1337         (WebCore::RenderLayerBacking::updateDebugIndicators):
1338         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
1339         (WebCore::RenderLayerBacking::updateGeometry):
1340         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
1341         (WebCore::RenderLayerBacking::updateAfterDescendants):
1342         (WebCore::RenderLayerBacking::updateInternalHierarchy):
1343         (WebCore::RenderLayerBacking::updateDrawsContent):
1344         (WebCore::RenderLayerBacking::updateScrollingLayers):
1345         * rendering/RenderLayerBacking.h:
1346         * rendering/RenderLayerCompositor.cpp:
1347         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1348         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1349         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
1350         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
1351         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
1352         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
1353
1354 2019-02-02  Justin Fan  <justin_fan@apple.com>
1355
1356         [Web GPU] Fix GPURenderPassEncoder::setVertexBuffers and allow overlapping indices with GPUBindGroups
1357         https://bugs.webkit.org/show_bug.cgi?id=194125
1358
1359         Reviewed by Myles C. Maxfield.
1360
1361         GPURenderPassEncoder::setVertexBuffers is now actually written to set all buffers provided. In addition,
1362         shift vertex input buffer indices so that any resource bindings can bind vertex buffer resources to the same indices. 
1363
1364         Existing tests cover setVertexBuffers. Updated buffer-resource-triangles to assign bind groups and vertex buffers to the same index.
1365
1366         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Added.
1367         (WebCore::WHLSL::Metal::calculateVertexBufferIndex): Simple shifting function for vertex input buffer indices.
1368         * Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Added.
1369         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
1370         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Limit maximum bind group indices to 0 to 3.
1371         * Modules/webgpu/WebGPURenderPassEncoder.cpp: 
1372         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Limit vertex input indices to 0 to 15.
1373         * Modules/webgpu/WebGPURenderPassEncoder.h: Move IDL/bindings bug note to IDL file.
1374         * Modules/webgpu/WebGPURenderPassEncoder.idl: Ditto.
1375         * platform/graphics/gpu/GPULimits.h: Added. Home for Web GPU limits constants shared between files.
1376         * platform/graphics/gpu/GPURenderPassEncoder.h: Change IDL/bindings bug workaround to unsigned long long to prevent narrowing compared to spec.
1377         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
1378         (WebCore::GPURenderPassEncoder::setVertexBuffers): Now properly calls Metal's setVertexBuffers. 
1379         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
1380         (WebCore::setInputStateForPipelineDescriptor): Fix validation checks for vertex attribute numbers and vertex buffer indices. 
1381
1382         Add symbols to project:
1383         * Sources.txt:
1384         * WebCore.xcodeproj/project.pbxproj:
1385
1386 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
1387
1388         Async overflow scroll is jumpy on macOS if the main thread is busy
1389         https://bugs.webkit.org/show_bug.cgi?id=194184
1390         <rdar://problem/47758655>
1391
1392         Reviewed by Antti Koivisto.
1393
1394         This change extends to macOS some existing overflow-scroll functionality for iOS.
1395         When an async scroll is in process in the scroll thread (or UI process), we periodically
1396         message back to the web process main thread with scroll position updates. These
1397         can trigger post-scroll compositing updates, but we need to ensure that this update
1398         doesn't clobber the scroll position of the native layers, which would trigger
1399         stutters.
1400
1401         To do this we have the notion of a scroll position "sync" (ScrollingLayerPositionAction::Sync) which
1402         pokes the new value into the GraphicsLayer (hence making visible rect computations work), but doesn't
1403         propagate it to the platform layer. This patch wires up syncs for macOS during async overflow scrolling,
1404         coming out of AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll().
1405
1406         In RenderLayerBacking, m_scrollingContentsLayer is renamed to m_scrolledContentsLayer, and I added
1407         updateScrollOffset() and setLocationOfScrolledContents() to handle the set vs. sync, and to keep
1408         the iOS vs macOS differences in one function. This allows for more code sharing in RenderLayerBacking::updateGeometry().
1409
1410         There's a confusing bit in the m_childClippingMaskLayer code (trac.webkit.org/178029) where the setOffsetFromRenderer()
1411         just looks wrong; it should match m_scrollingLayer. This code is never hit for Cocoa, which never has m_childClippingMaskLayer.
1412
1413         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1414         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Logging
1415         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Logging
1416         * rendering/RenderLayer.cpp:
1417         (WebCore::RenderLayer::RenderLayer):
1418         (WebCore::RenderLayer::scrollTo):
1419         * rendering/RenderLayer.h: Rename m_requiresScrollBoundsOriginUpdate to m_requiresScrollPositionReconciliation
1420         and make it available on all platforms. Just reorder m_adjustForIOSCaretWhenScrolling to reduce #ifdef nesting confusion.
1421         * rendering/RenderLayerBacking.cpp:
1422         (WebCore::RenderLayerBacking::updateDebugIndicators):
1423         (WebCore::RenderLayerBacking::destroyGraphicsLayers):
1424         (WebCore::RenderLayerBacking::updateGeometry):
1425         (WebCore::RenderLayerBacking::setLocationOfScrolledContents):
1426         (WebCore::RenderLayerBacking::updateScrollOffset):
1427         (WebCore::RenderLayerBacking::updateDrawsContent):
1428         (WebCore::RenderLayerBacking::updateScrollingLayers):
1429         (WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
1430         (WebCore::RenderLayerBacking::parentForSublayers const):
1431         (WebCore::RenderLayerBacking::setContentsNeedDisplay):
1432         (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
1433         (WebCore::RenderLayerBacking::paintContents):
1434         (WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
1435         * rendering/RenderLayerBacking.h:
1436
1437 2019-02-02  Zalan Bujtas  <zalan@apple.com>
1438
1439         [LFC] Initialize ICB's style with fixed width/height.
1440         https://bugs.webkit.org/show_bug.cgi?id=194188
1441
1442         Reviewed by Antti Koivisto.
1443
1444         Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
1445         in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).
1446
1447         * layout/LayoutState.cpp:
1448         (WebCore::Layout::LayoutState::LayoutState):
1449         * layout/LayoutState.h:
1450         * layout/layouttree/LayoutTreeBuilder.cpp:
1451         (WebCore::Layout::TreeBuilder::createLayoutTree):
1452
1453 2019-02-02  Zalan Bujtas  <zalan@apple.com>
1454
1455         [LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
1456         https://bugs.webkit.org/show_bug.cgi?id=194185
1457
1458         Reviewed by Antti Koivisto.
1459
1460         If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.
1461
1462         Test: fast/block/block-only/absolute-position-left-right-margin.html
1463
1464         * layout/FormattingContextGeometry.cpp:
1465         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1466
1467 2018-12-16  Darin Adler  <darin@apple.com>
1468
1469         Convert additional String::format clients to alternative approaches
1470         https://bugs.webkit.org/show_bug.cgi?id=192746
1471
1472         Reviewed by Alexey Proskuryakov.
1473
1474         This round of conversions covers less-trivial cases such as floating
1475         point numerals and hexadecimal. Not yet taking on pointer serialization
1476         ("%p") or padding with spaces of zero digits, so call sites using those
1477         have been left untouched.
1478
1479         In some cases these new idioms are a bit clumsy, and we could follow up
1480         with additional convenience functions to make them more elegant.
1481
1482         * Modules/indexeddb/IDBKeyData.cpp:
1483         (WebCore::IDBKeyData::loggingString const): Use more ASCIILiteral and
1484         more appendLiteral for efficiency. Use upperNibbleToLowercaseASCIIHexDigit,
1485         lowerNibbleToLowercaseASCIIHexDigit, and also makeString and FormattedNumber.
1486
1487         * css/MediaQueryEvaluator.cpp:
1488         (WebCore::aspectRatioValueAsString): Use makeString and FormattedNumber.
1489         Doing it this way makes it a little clearer that we have an unpleasant
1490         use of fixed 6-digit precision here.
1491
1492         * html/FTPDirectoryDocument.cpp:
1493         (WebCore::processFilesizeString): Use makeString and FormattedNumber.
1494         * html/track/VTTCue.cpp:
1495         (WebCore::VTTCueBox::applyCSSProperties): Ditto.
1496         * page/CaptionUserPreferencesMediaAF.cpp:
1497         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const): Ditto.
1498         * page/History.cpp:
1499         (WebCore::History::stateObjectAdded): Ditto.
1500         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1501         (WebCore::formatByteNumber): Ditto.
1502         (WebCore::gcTimerString): Use String::number.
1503         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and FormattedNumber.
1504
1505         * page/scrolling/AxisScrollSnapOffsets.cpp:
1506         (WebCore::snapOffsetsToString): Removed some unnecessary copying in the for loop,
1507         use appendLiteral, and use appendFixedWidthNumber.
1508         (WebCore::snapOffsetRangesToString): Ditto.
1509         (WebCore::snapPortOrAreaToString): Use makeString and FormattedNumber.
1510
1511         * platform/animation/TimingFunction.cpp:
1512         (WebCore::TimingFunction::cssText const): Use makeString.
1513
1514         * platform/cocoa/KeyEventCocoa.mm:
1515         (WebCore::keyIdentifierForCharCode): Use makeString and the ASCIIHexDigit
1516         functions.
1517         * platform/graphics/Color.cpp:
1518         (WebCore::Color::nameForRenderTreeAsText const): Ditto.
1519
1520         * platform/mock/MockRealtimeVideoSource.cpp:
1521         (WebCore::MockRealtimeVideoSource::drawText): Use makeString and FormattedNumber.
1522
1523         * platform/text/PlatformLocale.cpp:
1524         (WebCore::DateTimeStringBuilder::visitField): Use String::numberToStringFixedWidth.
1525
1526 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
1527
1528         Remove the unused layerForScrolling()
1529         https://bugs.webkit.org/show_bug.cgi?id=194180
1530
1531         Reviewed by Zalan Bujtas.
1532
1533         Remove ScrollableArea::layerForScrolling() and derivations. This was unused.
1534
1535         * page/FrameView.cpp:
1536         (WebCore::FrameView::layerForScrolling const): Deleted.
1537         * page/FrameView.h:
1538         * page/scrolling/ScrollingCoordinator.cpp:
1539         (WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): Deleted.
1540         * page/scrolling/ScrollingCoordinator.h:
1541         * platform/ScrollableArea.h:
1542         (WebCore::ScrollableArea::layerForScrolling const): Deleted.
1543         * rendering/RenderLayer.cpp:
1544         (WebCore::RenderLayer::calculateClipRects const):
1545         * rendering/RenderLayer.h:
1546
1547 2019-02-01  Zalan Bujtas  <zalan@apple.com>
1548
1549         [LFC] Fix statically positioned replaced out-of-flow horizontal geometry
1550         https://bugs.webkit.org/show_bug.cgi?id=194163
1551
1552         Reviewed by Simon Fraser.
1553
1554         Fix a typo.
1555
1556         * layout/FormattingContextGeometry.cpp:
1557         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1558
1559 2019-02-01  Chris Dumez  <cdumez@apple.com>
1560
1561         REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
1562         https://bugs.webkit.org/show_bug.cgi?id=193740
1563         <rdar://problem/47527267>
1564
1565         Reviewed by Alex Christensen.
1566
1567         * loader/DocumentLoader.cpp:
1568         (WebCore::DocumentLoader::willSendRequest):
1569         (WebCore::DocumentLoader::continueAfterContentPolicy):
1570         * loader/FrameLoader.cpp:
1571         (WebCore::FrameLoader::loadURL):
1572         (WebCore::FrameLoader::loadWithDocumentLoader):
1573         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1574         * loader/FrameLoader.h:
1575         * loader/FrameLoaderTypes.h:
1576         * loader/PolicyChecker.cpp:
1577         (WebCore::PolicyChecker::checkNavigationPolicy):
1578         (WebCore::PolicyChecker::checkNewWindowPolicy):
1579         * loader/PolicyChecker.h:
1580
1581 2019-02-01  Antoine Quint  <graouts@apple.com>
1582
1583         Dispatch pointercancel events when content is panned or zoomed on iOS
1584         https://bugs.webkit.org/show_bug.cgi?id=193962
1585         <rdar://problem/47629134>
1586
1587         Reviewed by Dean Jackson.
1588
1589         Expose two new methods on PointerCaptureController so that, given a pointer id, it can be established whether this pointer
1590         has been cancelled, which is important because a cancelled pointer should no longer dispatch any further pointer events, and
1591         to cancel a pointer.
1592
1593         Tests: pointerevents/ios/touch-action-pointercancel-pan-x.html
1594                pointerevents/ios/touch-action-pointercancel-pan-y.html
1595                pointerevents/ios/touch-action-pointercancel-pinch-zoom.html
1596
1597         * WebCore.xcodeproj/project.pbxproj: Make PointerCaptureController.h Private so that it can be imported from WebKit.
1598         * dom/PointerEvent.h: Remove an unnecessary #if ENABLE(POINTER_EVENTS) since the entire file is already contained in one.
1599         Then we add a new create() method that takes an event type, a pointer id and a pointer type (touch vs. pen) that we use
1600         to create pointercancel events in PointerCaptureController::cancelPointer().
1601         * page/Page.cpp:
1602         (WebCore::Page::Page): Pass the Page as a parameter when creating the PointerCaptureController.
1603         * page/PointerCaptureController.cpp:
1604         (WebCore::PointerCaptureController::PointerCaptureController): Add a Page reference to the constructor since we'll need
1605         the page to access its main frame's EventHandler to perform hit testing in case we do not have a capture target override
1606         in cancelPointer().
1607         (WebCore::PointerCaptureController::releasePointerCapture): Drive-by, remove the the implicit parameter since on iOS we
1608         don't need to differentiate. We'll bring this back for the macOS work.
1609         (WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): New method we'll use when dispatching pointer
1610         events to identify whether a pointer id has already been cancelled which will allow for _not_ dispatching any further
1611         pointer events for this pointer id.
1612         (WebCore::PointerCaptureController::pointerEventWillBeDispatched): Keep track of the pointer type so we can preserve it
1613         when dispatching pointercancel events for a given pointer id.
1614         (WebCore::PointerCaptureController::cancelPointer): Dispatch a pointercancel for the provided pointer id, using the capture
1615         target override as the event's target, if there is one, and otherwise hit-testing at the provided location to figure out
1616         what the target should be.
1617         * page/PointerCaptureController.h: Switch the target overrides from Element* to RefPtr<Element> to ensure it may not be
1618         deleted while we still need them. Existing code already ensures these get set to nullptr.
1619
1620 2019-02-01  Jer Noble  <jer.noble@apple.com>
1621
1622         Make the WebKit default for media source based on the WebCore default.
1623         https://bugs.webkit.org/show_bug.cgi?id=194172
1624
1625         Reviewed by Eric Carlson.
1626
1627         * page/SettingsBase.h:
1628
1629 2019-02-01  Joseph Pecoraro  <pecoraro@apple.com>
1630
1631         Web Inspector: Memory timeline starts from zero when both CPU and Memory timeline are enabled
1632         https://bugs.webkit.org/show_bug.cgi?id=194111
1633         <rdar://problem/47714555>
1634
1635         Rubber-stamped by Devin Rousso.
1636
1637         * page/ResourceUsageThread.cpp:
1638         (WebCore::ResourceUsageThread::waitUntilObservers):
1639         (WebCore::ResourceUsageThread::threadBody):
1640         Wait a short period of time before the first listener registers
1641         and we start sampling. This will allow multiple listeners to
1642         register, each that wants different data.
1643
1644 2019-02-01  Antti Koivisto  <antti@apple.com>
1645
1646         Don't use base layer() as the scroll layer in scrolling tree.
1647         https://bugs.webkit.org/show_bug.cgi?id=194160
1648
1649         Reviewed by Simon Fraser.
1650
1651         Maintain scrollContainerLayer() and scrolledContentsLayer() separately in ScrollingTreeScrollingNode.
1652
1653         * page/scrolling/AsyncScrollingCoordinator.cpp:
1654         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1655         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
1656         * page/scrolling/AsyncScrollingCoordinator.h:
1657         * page/scrolling/ScrollingCoordinator.h:
1658         (WebCore::ScrollingCoordinator::setNodeLayers):
1659
1660         Turn the long layer parameter list into a struct.
1661
1662         * page/scrolling/ScrollingStateNode.cpp:
1663         (WebCore::ScrollingStateNode::ScrollingStateNode):
1664         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
1665         (WebCore::ScrollingStateNode::setLayer):
1666         * page/scrolling/ScrollingStateNode.h:
1667         * page/scrolling/ScrollingStateScrollingNode.cpp:
1668         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
1669         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
1670         (WebCore::ScrollingStateScrollingNode::setScrollContainerLayer):
1671         (WebCore::ScrollingStateScrollingNode::dumpProperties const):
1672         * page/scrolling/ScrollingStateScrollingNode.h:
1673         (WebCore::ScrollingStateScrollingNode::scrollContainerLayer const):
1674         * page/scrolling/ScrollingTree.cpp:
1675         (WebCore::ScrollingTree::commitTreeState):
1676         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1677         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1678         * page/scrolling/ScrollingTreeScrollingNode.h:
1679         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const):
1680         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const):
1681         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1682         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1683         (WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
1684         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition const):
1685         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
1686         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
1687         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1688         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
1689         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1690         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1691         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
1692         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
1693         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const):
1694         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1695         (WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
1696         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1697         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1698         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
1699         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
1700         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1701         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1702         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
1703         * rendering/RenderLayerCompositor.cpp:
1704         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
1705         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
1706         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
1707         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
1708
1709 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
1710
1711         REGRESSION (r240698): fast/scrolling/sticky-to-fixed.html can cause a crash
1712         https://bugs.webkit.org/show_bug.cgi?id=194134
1713         rdar://problem/47721210
1714
1715         Reviewed by Daniel Bates.
1716
1717         fast/scrolling/sticky-to-fixed.html changes the scrolling node type, which causes
1718         scrollingCoordinator->insertNode() to return a different ScrollingNodeID to the one
1719         passed in. We have to handle this, removing the node for the nodeID and unregistering
1720         the layer with the old nodeID.
1721
1722         * rendering/RenderLayerCompositor.cpp:
1723         (WebCore::RenderLayerCompositor::attachScrollingNode):
1724
1725 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1726
1727         REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE
1728         https://bugs.webkit.org/show_bug.cgi?id=194008
1729
1730         Reviewed by Žan Doberšek.
1731
1732         We need to replace control characters with zero width space too.
1733
1734         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
1735         (WebCore::GlyphPage::fill):
1736         * platform/text/CharacterProperties.h:
1737         (WebCore::isControlCharacter):
1738
1739 2019-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1740
1741         ComplexText: Test fast/text/word-space-nbsp.html fails when using complex text path
1742         https://bugs.webkit.org/show_bug.cgi?id=193279
1743
1744         Reviewed by Michael Catanzaro.
1745
1746         The fix applied in r135884 to WidthIterator should also be applied to ComplexTextController.
1747
1748         * platform/graphics/ComplexTextController.cpp:
1749         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1750
1751 2019-02-01  Zalan Bujtas  <zalan@apple.com>
1752
1753         [LFC] Adjust replaced element's intrinsic ratio
1754         https://bugs.webkit.org/show_bug.cgi?id=194154
1755
1756         Reviewed by Antti Koivisto.
1757
1758         Decouple image and iframe replaced types and set intrinsic ratio accordingly.
1759
1760         * layout/layouttree/LayoutBox.cpp:
1761         (WebCore::Layout::Box::Box):
1762         * layout/layouttree/LayoutBox.h:
1763         (WebCore::Layout::Box::isReplaced const):
1764         (WebCore::Layout::Box::isIFrame const):
1765         (WebCore::Layout::Box::isImage const):
1766         * layout/layouttree/LayoutReplaced.cpp:
1767         (WebCore::Layout::Replaced::hasIntrinsicRatio const):
1768         (WebCore::Layout::Replaced::intrinsicRatio const):
1769         (WebCore::Layout::Replaced::hasAspectRatio const):
1770         * layout/layouttree/LayoutReplaced.h:
1771         * layout/layouttree/LayoutTreeBuilder.cpp:
1772         (WebCore::Layout::TreeBuilder::createSubTree):
1773
1774 2019-02-01  Zalan Bujtas  <zalan@apple.com>
1775
1776         [LFC] Set intrinsic size on Layout::Replaced
1777         https://bugs.webkit.org/show_bug.cgi?id=194139
1778
1779         Reviewed by Antti Koivisto.
1780
1781         Eventually Layout::Replaced will track intrinsic size internally until then let's query the RenderReplaced. 
1782
1783         * layout/layouttree/LayoutBox.h:
1784         (WebCore::Layout::Box::replaced):
1785         * layout/layouttree/LayoutReplaced.cpp:
1786         (WebCore::Layout::Replaced::hasIntrinsicWidth const):
1787         (WebCore::Layout::Replaced::hasIntrinsicHeight const):
1788         (WebCore::Layout::Replaced::intrinsicWidth const):
1789         (WebCore::Layout::Replaced::intrinsicHeight const):
1790         * layout/layouttree/LayoutReplaced.h:
1791         (WebCore::Layout::Replaced::setIntrinsicSize):
1792         (WebCore::Layout::Replaced::setIntrinsicRatio):
1793         * layout/layouttree/LayoutTreeBuilder.cpp:
1794         (WebCore::Layout::TreeBuilder::createSubTree):
1795         * rendering/RenderReplaced.h:
1796
1797 2019-02-01  Claudio Saavedra  <csaavedra@igalia.com>
1798
1799         Race-condition during scrolling thread creation
1800         https://bugs.webkit.org/show_bug.cgi?id=194016
1801
1802         Reviewed by Saam Barati.
1803
1804         There is a threading issue during the initialization
1805         of the scrolling thread caused by createThreadIfNeeded
1806         locking only on the creation of the thread but not on
1807         the initialization of the main loop, making it possible
1808         for a thread to try to spin the main loop before it's
1809         created.
1810
1811         Fix this by unconditionally waiting on the main loop
1812         being created. This makes it necessary to always hold
1813         the lock, even when the thread is already created.
1814
1815         * page/scrolling/ScrollingThread.cpp:
1816         (WebCore::ScrollingThread::createThreadIfNeeded):
1817
1818 2019-02-01  Simon Fraser  <simon.fraser@apple.com>
1819
1820         Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
1821         https://bugs.webkit.org/show_bug.cgi?id=194126
1822
1823         Reviewed by Frédéric Wang.
1824         
1825         Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
1826         and fix callers.
1827
1828         * page/FrameView.cpp:
1829         (WebCore::FrameView::scrollingNodeID const):
1830         (WebCore::FrameView::scrollLayerID const): Deleted.
1831         * page/FrameView.h:
1832         * page/scrolling/AsyncScrollingCoordinator.cpp:
1833         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1834         (WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
1835         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
1836         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1837         (WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
1838         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1839         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1840         (WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
1841         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
1842         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
1843         (WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
1844         (WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
1845         * page/scrolling/ScrollingCoordinatorTypes.h:
1846         * platform/ScrollTypes.h:
1847         * platform/ScrollableArea.h:
1848         (WebCore::ScrollableArea::scrollingNodeID const):
1849         (WebCore::ScrollableArea::scrollLayerID const): Deleted.
1850         * rendering/RenderLayerCompositor.cpp:
1851         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1852         (WebCore::RenderLayerCompositor::detachRootLayer):
1853
1854 2019-01-31  Myles C. Maxfield  <mmaxfield@apple.com>
1855
1856         [WHLSL] Expressions can't be copyable
1857         https://bugs.webkit.org/show_bug.cgi?id=194116
1858
1859         Reviewed by Keith Rollin.
1860
1861         Expressions have UniqueRef members, which can't be copied. Describe this constraint explicitly rather than implicitly.
1862
1863         No new tests because there is no behavior change.
1864
1865         * Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
1866         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
1867
1868 2019-01-31  Takashi Komori  <Takashi.Komori@sony.com>
1869
1870         [Curl] Remove unnecessary member from NetworkStorageSession.
1871         https://bugs.webkit.org/show_bug.cgi?id=194137
1872
1873         Reviewed by Don Olmstead.
1874
1875         No new tests since there is no behavior change.
1876
1877         * platform/network/NetworkStorageSession.h:
1878         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1879         (WebCore::NetworkStorageSession::NetworkStorageSession):
1880         (WebCore::NetworkStorageSession::context const): Deleted.
1881
1882 2019-01-31  Jer Noble  <jer.noble@apple.com>
1883
1884         NSInvalidArgumentException in [WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]
1885         https://bugs.webkit.org/show_bug.cgi?id=194123
1886         <rdar://problem/47721094>
1887
1888         Reviewed by Eric Carlson.
1889
1890         According to crash logs, AVSampleBufferDisplayLayer.error can go from an NSError* to nil; when such a change is KVO'd,
1891         the NSKeyValueChangeNewKey is a NSNull. Detect this state and bail out early.
1892
1893         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1894         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
1895
1896 2019-01-31  Jer Noble  <jer.noble@apple.com>
1897
1898         [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt
1899         https://bugs.webkit.org/show_bug.cgi?id=194114
1900
1901         Reviewed by Eric Carlson.
1902
1903         The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key
1904         requests to the AVContentKeySession.
1905
1906         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1907         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1908
1909 2019-01-31  Megan Gardner  <megan_gardner@apple.com>
1910
1911         Don't insert spaces at the beginning of a newline when using smart-copy-paste
1912         https://bugs.webkit.org/show_bug.cgi?id=194070
1913
1914         Reviewed by Tim Horton.
1915
1916         If our inserted content end is at the beginning of a paragraph, do not insert a space.
1917         Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.
1918
1919         Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html
1920
1921         * editing/ReplaceSelectionCommand.cpp:
1922         (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
1923
1924 2019-01-31  Justin Fan  <justin_fan@apple.com>
1925
1926         [WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
1927         https://bugs.webkit.org/show_bug.cgi?id=194120
1928
1929         Unreviewed build fix. 
1930
1931         No new tests; no change in behavior.
1932
1933         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
1934         (WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
1935
1936 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
1937
1938         Basic scrollability for async overflow scrolling on macOS
1939         https://bugs.webkit.org/show_bug.cgi?id=194093
1940
1941         Reviewed by Antti Koivisto.
1942
1943         Give a ScrollingTreeOverflowScrollingNodeMac a ScrollingTreeScrollingNodeDelegateMac and have it keep track
1944         of its layers so basic scrolling works for async overflow scroll.
1945
1946         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
1947         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
1948         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
1949         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
1950         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
1951         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
1952         (WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
1953         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
1954         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
1955         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1956         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
1957         * rendering/RenderLayerBacking.cpp:
1958         (WebCore::RenderLayerBacking::updateScrollingLayers):
1959
1960 2019-01-31  Simon Fraser  <simon.fraser@apple.com>
1961
1962         Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling
1963         https://bugs.webkit.org/show_bug.cgi?id=194080
1964
1965         Reviewed by Antti Koivisto.
1966
1967         To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate
1968         for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate.
1969
1970         Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding
1971         and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and
1972         implements ScrollControllerClient.
1973
1974         ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch
1975         will add one to ScrollingTreeOverflowScrollingNodeMac.
1976
1977         No behavior change.
1978
1979         * SourcesCocoa.txt:
1980         * WebCore.xcodeproj/project.pbxproj:
1981         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1982         (WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted.
1983         (WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
1984         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1985         (WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const):
1986         * page/scrolling/ScrollingTreeNode.cpp:
1987         (WebCore::ScrollingTreeNode::isRootNode const):
1988         * page/scrolling/ScrollingTreeNode.h:
1989         * page/scrolling/ScrollingTreeScrollingNode.cpp:
1990         (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
1991         (WebCore::ScrollingTreeScrollingNode::scrollBy):
1992         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints):
1993         * page/scrolling/ScrollingTreeScrollingNode.h:
1994         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const):
1995         * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
1996         * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
1997         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const):
1998         (WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const):
1999         (WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const):
2000         (WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const):
2001         (WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const):
2002         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const):
2003         (WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const):
2004         (WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const):
2005         (WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const):
2006         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2007         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2008         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2009         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2010         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2011         (WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const):
2012         (WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const):
2013         (WebCore::newGestureIsStarting): Deleted.
2014         (WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
2015         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted.
2016         (WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted.
2017         (WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted.
2018         (WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted.
2019         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted.
2020         (WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted.
2021         (WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted.
2022         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted.
2023         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted.
2024         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
2025         (WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted.
2026         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted.
2027         (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted.
2028         (WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted.
2029         (WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted.
2030         (WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted.
2031         (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted.
2032         (WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted.
2033         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted.
2034         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted.
2035         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h.
2036         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added.
2037         (WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac):
2038         (WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints):
2039         (WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis):
2040         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const):
2041         (WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const):
2042         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
2043         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const):
2044         (WebCore::newGestureIsStarting):
2045         (WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
2046         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching):
2047         (WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching):
2048         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
2049         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
2050         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally):
2051         (WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically):
2052         (WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection):
2053         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy):
2054         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
2055         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer):
2056         (WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
2057         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
2058         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
2059         (WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const):
2060         (WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer):
2061         (WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer):
2062         (WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const):
2063         (WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):
2064         (WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
2065         (WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
2066
2067 2019-01-31  Jer Noble  <jer.noble@apple.com>
2068
2069         [Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
2070         https://bugs.webkit.org/show_bug.cgi?id=194099
2071         <rdar://problem/47271323>
2072
2073         Reviewed by Eric Carlson.
2074
2075         When a different client requests the PiP window, the PiP framework will call -pipDidClose: without
2076         first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where
2077         the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two
2078         WebViews will constantly try to steal PiP from one another, ad infinitum.
2079
2080         When receiving a notification that the PiP window closed when our internal state tells us that the
2081         close was not requested, notify the client that PiP mode was exited, allowing them to set their
2082         expected state to a correct and sane value.
2083
2084         * platform/mac/VideoFullscreenInterfaceMac.mm:
2085         (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2086
2087 2019-01-31  Keith Rollin  <krollin@apple.com>
2088
2089         WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete
2090         https://bugs.webkit.org/show_bug.cgi?id=194055
2091         <rdar://problem/47684570>
2092
2093         Reviewed by Myles C. Maxfield.
2094
2095         WebCore::WHLSL::AST::Expression has a deleted copy constructor.
2096         EnumerationMemberLiteral, a subclass, has a default copy constructor.
2097         Some compilers may complain that the latter's c'tor can't access the
2098         former's, because it doesn't exist. Fix this by marking Expression's
2099         c'tor as default.
2100
2101         No new tests since there should be no observable behavior difference.
2102
2103         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2104
2105 2019-01-31  Alex Christensen  <achristensen@webkit.org>
2106
2107         Revert r238819 which is unneeded and caused a performance regression.
2108         https://bugs.webkit.org/show_bug.cgi?id=192272
2109         <rdar://problem/46664625>
2110
2111         * loader/EmptyFrameLoaderClient.h:
2112         * loader/FrameLoader.cpp:
2113         (WebCore::FrameLoader::prepareForLoadStart):
2114         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2115         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
2116         * loader/FrameLoader.h:
2117         * loader/FrameLoaderClient.h:
2118
2119 2019-01-31  Justin Fan  <justin_fan@apple.com>
2120
2121         [WebGPU] WebGPUAdapterDescriptor -> GPURequestAdapterOptions and take powerPreference into account
2122         https://bugs.webkit.org/show_bug.cgi?id=194068
2123         <rdar://problem/47680215>
2124
2125         Reviewed by Dean Jackson.
2126         
2127         Per the Web GPU IDL, WebGPUAdapterDescriptor is now known as GPURequestAdapterOptions and is optional.
2128         In addition, Web GPU now actually attempts to return an integrated GPU when a low-power adapter is requested.
2129
2130         Test: adapter-options.html
2131
2132         * Modules/webgpu/GPURequestAdapterOptions.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.idl.
2133         * Modules/webgpu/WebGPU.cpp:
2134         (WebCore::WebGPU::requestAdapter const):
2135         * Modules/webgpu/WebGPU.h:
2136         * Modules/webgpu/WebGPU.idl:
2137         * Modules/webgpu/WebGPUAdapter.cpp:
2138         (WebCore::WebGPUAdapter::create):
2139         (WebCore::WebGPUAdapter::WebGPUAdapter):
2140         * Modules/webgpu/WebGPUAdapter.h:
2141         (WebCore::WebGPUAdapter::options const):
2142         * Modules/webgpu/WebGPUDevice.cpp:
2143         (WebCore::WebGPUDevice::create):
2144         * platform/graphics/gpu/GPUDevice.h:
2145         * platform/graphics/gpu/GPURequestAdapterOptions.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.h.
2146         * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
2147         (WebCore::GPUDevice::create):
2148
2149 2019-01-31  Jiewen Tan  <jiewen_tan@apple.com>
2150
2151         Formalize WebKitAdditions mechanism of LoadOptimizer
2152         https://bugs.webkit.org/show_bug.cgi?id=193886
2153         <rdar://problem/47696809>
2154
2155         Reviewed by Brent Fulgham.
2156
2157         Covered by existing tests.
2158
2159         * platform/network/ResourceRequestBase.h:
2160         Export isolatedCopy().
2161
2162 2019-01-31  Jer Noble  <jer.noble@apple.com>
2163
2164         [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
2165         https://bugs.webkit.org/show_bug.cgi?id=193988
2166
2167         Reviewed by Jon Lee.
2168
2169         Modern EME is writing SecureStop data as a file at the same path as the
2170         directory used by Legacy EME; meaning, when Modern EME attempts to write
2171         to that file, it will fail because a directory exists at the same path.
2172
2173         Add a migration step to take care of those instances where Modern EME Secure
2174         Stop data was already written to disk, and move that previously written data
2175         to the correct file path.
2176
2177         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2178         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2179         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
2180         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
2181         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2182         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
2183         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2184         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2185
2186 2019-01-31  Antti Koivisto  <antti@apple.com>
2187
2188         Call the frame main contents layer "rootContentsLayer" consistently.
2189         https://bugs.webkit.org/show_bug.cgi?id=194089
2190
2191         Reviewed by Simon Fraser.
2192
2193         This is currently called "rootContentLayer" in the compositor and "scrolledContentsLayer" in the scrolling tree.
2194         We want to reserve term "scrolledContentsLayer" to mean the direct child layer of the  scroll container layer
2195         without any positioning oddities (which this isn't).
2196
2197         * page/scrolling/AsyncScrollingCoordinator.cpp:
2198         (WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
2199         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2200         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2201
2202         Set the rootContentsLayer for frame. It is only used by the Mac frame scrolling code.
2203
2204         * page/scrolling/AsyncScrollingCoordinator.h:
2205         * page/scrolling/ScrollingCoordinator.cpp:
2206         (WebCore::ScrollingCoordinator::rootContentsLayerForFrameView):
2207         (WebCore::ScrollingCoordinator::rootContentLayerForFrameView): Deleted.
2208         * page/scrolling/ScrollingCoordinator.h:
2209         (WebCore::ScrollingCoordinator::setNodeLayers):
2210         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2211         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2212         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2213         (WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer):
2214         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
2215         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2216
2217         Introduce rootContentLayer for frames only.
2218
2219         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2220         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2221         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
2222         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2223
2224         Switch to using rootContentsLayer.
2225
2226         * rendering/RenderLayerCompositor.cpp:
2227         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2228         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2229         (WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
2230         (WebCore::RenderLayerCompositor::layerTreeAsText):
2231         (WebCore::RenderLayerCompositor::rootGraphicsLayer const):
2232         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2233         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
2234         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
2235         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2236         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2237         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2238         (WebCore::RenderLayerCompositor::ensureRootLayer):
2239         (WebCore::RenderLayerCompositor::destroyRootLayer):
2240         (WebCore::RenderLayerCompositor::attachRootLayer):
2241         (WebCore::RenderLayerCompositor::detachRootLayer):
2242         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
2243         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2244
2245         Pass rootContentsLayer separately for frames only.
2246         Pass null as frame scrolledContentsLayer until these are rearranged (it is not used).
2247
2248         * rendering/RenderLayerCompositor.h:
2249
2250 2019-01-31  Keith Rollin  <krollin@apple.com>
2251
2252         GCGamepad is deprecated
2253         https://bugs.webkit.org/show_bug.cgi?id=194056
2254         <rdar://problem/47685010>
2255
2256         Reviewed by Brady Eidson.
2257
2258         GCGamepad is deprecated, resulting in compiler warnings. Address this
2259         for now by employing ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
2260
2261         No new tests since there should be no observable behavior difference.
2262
2263         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2264         (WebCore::GameControllerGamepad::setupAsGamepad):
2265
2266 2019-01-31  Darin Adler  <darin@apple.com>
2267
2268         Simplify and streamline code that creates an appropriate document based on MIME type
2269         https://bugs.webkit.org/show_bug.cgi?id=193756
2270
2271         Reviewed by Chris Dumez.
2272
2273         * dom/DOMImplementation.cpp:
2274         (WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
2275         than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
2276         instead of Image::supportsType. Rearranged checks so that all the combinations that
2277         that take precedence over plug-ins are checked first, fixing some unimportant edge
2278         cases where the plug-in database is initialized and doesn't need to be. Straightened
2279         out the logic for various special types so that the checks are more independent from
2280         each other and hence easier to understand.
2281
2282 2019-01-31  Alicia Boya García  <aboya@igalia.com>
2283
2284         [MSE][GStreamer] Unreviewed debug build fix, obsolete assert
2285
2286         Since m_playerPrivate is now a reference, it no longer has a default
2287         cast to bool. But there is also no longer a need to assert it's non
2288         null, so just remove the assert.
2289
2290         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2291         (WebCore::MediaSourceClientGStreamerMSE::append):
2292
2293 2019-01-31  Alicia Boya García  <aboya@igalia.com>
2294
2295         [MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
2296         https://bugs.webkit.org/show_bug.cgi?id=194091
2297
2298         Reviewed by Xabier Rodriguez-Calvar.
2299
2300         Since the pointer is initialized with the class, it's never null and
2301         never changes, it's preferrable to use a reference instead of a
2302         pointer.
2303
2304         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2305         (WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
2306         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
2307         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
2308         (WebCore::MediaSourceClientGStreamerMSE::abort):
2309         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
2310         (WebCore::MediaSourceClientGStreamerMSE::append):
2311         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
2312         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
2313         (WebCore::MediaSourceClientGStreamerMSE::flush):
2314         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
2315         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
2316         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
2317         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2318
2319 2019-01-31  Alexander Mikhaylenko  <exalm7659@gmail.com>
2320
2321         [GTK] Momentum scrolling stops abruptly before websites end
2322         https://bugs.webkit.org/show_bug.cgi?id=193350
2323
2324         Reviewed by Carlos Garcia Campos.
2325
2326         Don't immediately set velocity to 0 when position reaches upper or bottom limit.
2327         Instead, set it to the overshot distance, so that position exactly matches upper
2328         or lower limit on the next frame, and then clamp velocity to 0 using the existing
2329         mechanism.
2330
2331         * platform/ScrollAnimationKinetic.cpp:
2332         (WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
2333
2334 2019-01-31  Michael Catanzaro  <mcatanzaro@igalia.com>
2335
2336         Unreviewed, fix incorrect string format
2337         https://bugs.webkit.org/show_bug.cgi?id=193907
2338         <rdar://problem/47604080>
2339
2340         * page/scrolling/ScrollingTree.cpp:
2341         (WebCore::ScrollingTree::commitTreeState):
2342
2343 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
2344
2345         [Mac] Implement basic hit testing in the scrolling tree
2346         https://bugs.webkit.org/show_bug.cgi?id=172917
2347         <rdar://problem/34215516>
2348
2349         Reviewed by Antti Koivisto.
2350
2351         First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch
2352         by Frédéric Wang.
2353
2354         First we pipe the "async scrolling enabled" setting through to the ScrollingTree via
2355         the root node (like the other settings; weird, but that's how it's done). For now,
2356         we hit test in the scrolling tree if either async overflow or frame scrolling are enabled
2357         (it's hard to deal with one without the other).
2358
2359         Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing.
2360         Two helper functions exist to simplify coordinate conversion: parentToLocalPoint()
2361         and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes
2362         hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need
2363         to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions
2364         to do these point mappings.
2365
2366         handleWheelEvent() is changed to return a ScrollingEventResult.
2367
2368         Latching is not correct with this change when async frame scrolling is enabled. That needs
2369         to be fixed separately.
2370
2371         No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the
2372         scrolling tree, rather than doing eventSender stuff everywhere.
2373
2374         * page/scrolling/AsyncScrollingCoordinator.cpp:
2375         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2376         (WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const):
2377         * page/scrolling/AsyncScrollingCoordinator.h:
2378         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2379         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2380         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
2381         (WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled):
2382         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2383         * page/scrolling/ScrollingTree.cpp:
2384         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2385         (WebCore::ScrollingTree::handleWheelEvent):
2386         (WebCore::ScrollingTree::commitTreeState):
2387         (WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
2388         * page/scrolling/ScrollingTree.h:
2389         (WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const):
2390         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2391         (WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const):
2392         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2393         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2394         (WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const):
2395         (WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
2396         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2397         * page/scrolling/ScrollingTreeNode.cpp:
2398         (WebCore::ScrollingTreeNode::scrollingNodeForPoint const):
2399         * page/scrolling/ScrollingTreeNode.h:
2400         (WebCore::ScrollingTreeNode::children const):
2401         (WebCore::ScrollingTreeNode::parentToLocalPoint const):
2402         (WebCore::ScrollingTreeNode::localToContentsPoint const):
2403         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2404         (WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
2405         (WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const):
2406         (WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
2407         (WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const):
2408         * page/scrolling/ScrollingTreeScrollingNode.h:
2409         * page/scrolling/ThreadedScrollingTree.cpp:
2410         (WebCore::ThreadedScrollingTree::handleWheelEvent):
2411         * page/scrolling/ThreadedScrollingTree.h:
2412         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2413         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2414         (WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent):
2415         * page/scrolling/ios/ScrollingTreeIOS.h:
2416         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2417         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2418         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2419         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2420
2421 2019-01-31  Alicia Boya García  <aboya@igalia.com>
2422
2423         [MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods
2424         https://bugs.webkit.org/show_bug.cgi?id=194067
2425
2426         Reviewed by Xabier Rodriguez-Calvar.
2427
2428         A couple methods in AppendPipeline were returning GstFlowReturn
2429         despite there being no codepath (sans assertions) where values other
2430         than GST_FLOW_OK are returned.
2431
2432         Therefore, it makes sense to just make these methods return void.
2433
2434         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2435         (WebCore::AppendPipeline::pushNewBuffer):
2436         (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
2437         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2438         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2439         (WebCore::MediaSourceClientGStreamerMSE::append):
2440         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2441         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2442         (WebCore::SourceBufferPrivateGStreamer::append):
2443
2444 2019-01-31  Alicia Boya García  <aboya@igalia.com>
2445
2446         [MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
2447         https://bugs.webkit.org/show_bug.cgi?id=194069
2448
2449         Reviewed by Xabier Rodriguez-Calvar.
2450
2451         m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
2452         creation well until its destruction.
2453
2454         The only case that could make a NULL m_playerPrivate is
2455         clearPlayerPrivate() but that method is not used anymore.
2456
2457         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2458         (WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
2459         (WebCore::MediaSourceClientGStreamerMSE::durationChanged):
2460         (WebCore::MediaSourceClientGStreamerMSE::abort):
2461         (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
2462         (WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
2463         (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
2464         (WebCore::MediaSourceClientGStreamerMSE::flush):
2465         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
2466         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
2467         (WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
2468         (WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
2469         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2470
2471 2019-01-31  Thibault Saunier  <tsaunier@igalia.com>
2472
2473         [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
2474         https://bugs.webkit.org/show_bug.cgi?id=194087
2475
2476         Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
2477         meaning that it makes sense that when any of the downstream pad is returning flushing, you should
2478         return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
2479         *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
2480         source element task to PAUSED (because downstream returned flushing) on a branch that was not
2481         flushing!
2482
2483         Reviewed by Philippe Normand.
2484
2485         This is a theorical race we can't really cover with tests.
2486
2487         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2488         (WebCore::webkitMediaStreamSrcChain):
2489
2490 2019-01-31  Zalan Bujtas  <zalan@apple.com>
2491
2492         [LFC] Margin before/after/start/end initial value is 0 and not auto.
2493         https://bugs.webkit.org/show_bug.cgi?id=194090
2494
2495         Reviewed by Antti Koivisto.
2496
2497         Don't treat it like auto.
2498
2499         * layout/FormattingContextGeometry.cpp:
2500         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2501         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2502
2503 2019-01-31  Zalan Bujtas  <zalan@apple.com>
2504
2505         [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
2506         https://bugs.webkit.org/show_bug.cgi?id=194074
2507
2508         Reviewed by Antti Koivisto.
2509
2510         Check the used margin variables whether we already computed start/end values.
2511
2512         Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
2513
2514         * layout/FormattingContextGeometry.cpp:
2515         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2516
2517 2019-01-31  Zalan Bujtas  <zalan@apple.com>
2518
2519         [LFC][BFC] Add support for block level replaced box.
2520         https://bugs.webkit.org/show_bug.cgi?id=194071
2521
2522         Reviewed by Antti Koivisto.
2523
2524         * layout/layouttree/LayoutBox.cpp:
2525         (WebCore::Layout::Box::Box):
2526         * layout/layouttree/LayoutBox.h:
2527         * layout/layouttree/LayoutTreeBuilder.cpp:
2528         (WebCore::Layout::TreeBuilder::createSubTree):
2529         (WebCore::Layout::outputLayoutBox):
2530
2531 2019-01-31  Chris Fleizach  <cfleizach@apple.com>
2532
2533         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
2534         https://bugs.webkit.org/show_bug.cgi?id=189094
2535         <rdar://problem/43853526>
2536
2537         Reviewed by Zalan Bujtas.
2538
2539         Protect against access to objects and cache's that can be removed while an object is still in memory.
2540
2541         Unskipped flaky tests on mac-wk2.
2542
2543         * accessibility/mac/AXObjectCacheMac.mm:
2544         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2545         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2546         (textMarkerForVisiblePosition):
2547         (textMarkerRangeFromVisiblePositions):
2548
2549 2019-01-30  Chris Dumez  <cdumez@apple.com>
2550
2551         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
2552         https://bugs.webkit.org/show_bug.cgi?id=194023
2553         <rdar://problem/47417981>
2554
2555         Reviewed by Geoffrey Garen.
2556
2557         The issue was caused by the 'isTopSite' flag not getting properly set on the network request
2558         in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
2559         not getting its same-site lax cookies.
2560
2561         The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
2562         bypassing this method entirely when continuing a load in a new process after a swap. This was
2563         intentional as the network request is normally already fully populated by the previous process
2564         and we do not want the new process to modify the request in any way (e.g. we would not want to
2565         add a Origin header back after it was removed by the previous process). However, in case of a
2566         History navigation, we do not actually pass a request along from one process to another. Instead,
2567         we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
2568         In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
2569         we are technically continuing a load in a new process.
2570
2571         We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
2572         continuing a load with a request and not when we're continuing a load with a HistoryItem.
2573
2574         Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
2575
2576         * loader/FrameLoader.cpp:
2577         (WebCore::FrameLoader::load):
2578         (WebCore::FrameLoader::loadWithDocumentLoader):
2579         (WebCore::FrameLoader::addExtraFieldsToRequest):
2580         (WebCore::FrameLoader::loadDifferentDocumentItem):
2581         * loader/FrameLoader.h:
2582         (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
2583
2584 2019-01-30  Justin Fan  <justin_fan@apple.com>
2585
2586         [WebGPU] Support GPUDepthStencilStateDescriptor
2587         https://bugs.webkit.org/show_bug.cgi?id=194048
2588         <rdar://problem/46289645>
2589
2590         Reviewed by Dean Jackson.
2591
2592         Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
2593
2594         Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect 
2595         without a depth texture attached.
2596
2597         New interface files added:
2598         * Modules/webgpu/GPUCompareFunction.idl:
2599         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
2600         * platform/graphics/gpu/GPUCompareFunction.h:
2601         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
2602
2603         Modifications:
2604         * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
2605         (WebCore::WebGPUDevice::createRenderPipeline const):
2606         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
2607         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
2608         * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
2609         (WebCore::GPURenderPipeline::depthStencilState const): Getter.
2610         (WebCore::GPURenderPipeline::platformRenderPipeline const):
2611         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
2612         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
2613         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
2614         (WebCore::GPURenderPassEncoder::setPipeline):
2615         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
2616         (WebCore::validateAndConvertDepthCompareFunctionToMtl):
2617         (WebCore::tryCreateMtlDepthStencilState):
2618         (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
2619         (WebCore::GPURenderPipeline::create):
2620         (WebCore::GPURenderPipeline::GPURenderPipeline):
2621
2622         Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
2623         * CMakeLists.txt:
2624         * DerivedSources.make:
2625         * Sources.txt:
2626         * WebCore.xcodeproj/project.pbxproj:
2627
2628         * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
2629
2630 2019-01-30  Jer Noble  <jer.noble@apple.com>
2631
2632         [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
2633         https://bugs.webkit.org/show_bug.cgi?id=193984
2634
2635         Reviewed by Eric Carlson.
2636
2637         MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
2638         KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
2639         after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
2640         completion handler is called.
2641
2642         Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
2643         changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
2644
2645         * Modules/encryptedmedia/MediaKeySession.cpp:
2646         (WebCore::MediaKeySession::sessionIdChanged):
2647         * Modules/encryptedmedia/MediaKeySession.h:
2648         * platform/encryptedmedia/CDMInstanceSession.h:
2649         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2650         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
2651         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
2652
2653 2019-01-30  Keith Rollin  <krollin@apple.com>
2654
2655         FloatWithRect has invalid and inaccessible default constructor
2656         https://bugs.webkit.org/show_bug.cgi?id=194057
2657         <rdar://problem/47685211>
2658
2659         Reviewed by Zalan Bujtas.
2660
2661         FloatWithRect has a default constructor declared as 'default'. This
2662         constructor is invalid because FloatWithRect has a data member that's
2663         a reference that will not get initialized with this constructor. Since
2664         it's invalid, and since it's private and not accessed by anything,
2665         remove this constructor.
2666
2667         No new tests since there should be no observable behavior difference.
2668
2669         * rendering/line/LineLayoutState.h:
2670
2671 2019-01-30  Daniel Bates  <dabates@apple.com>
2672
2673         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
2674         https://bugs.webkit.org/show_bug.cgi?id=192824
2675         <rdar://problem/47100332>
2676
2677         Reviewed by Wenson Hsieh.
2678
2679         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
2680         now that hardware key events to non-editable elements use the same code path as for editable elements. 
2681
2682         * platform/ios/KeyEventIOS.mm:
2683         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
2684         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
2685         (WebCore::isFunctionKey): Ditto.
2686         * platform/ios/WebEvent.mm:
2687         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
2688         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
2689
2690 2019-01-30  Jer Noble  <jer.noble@apple.com>
2691
2692         Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
2693         https://bugs.webkit.org/show_bug.cgi?id=194063
2694
2695         Reviewed by Jon Lee.
2696
2697         * DerivedSources.make:
2698
2699 2019-01-30  Youenn Fablet  <youenn@apple.com>
2700
2701         Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
2702         https://bugs.webkit.org/show_bug.cgi?id=193747
2703         <rdar://problem/47498196>
2704
2705         Reviewed by Chris Dumez.
2706
2707         Make ServiceWorkerJob be no longer ref counted.
2708         Instead its lifetime is fully controlled by ServiceWorkerContainer.
2709
2710         Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
2711         This allows to ensure that these jobs do not stay forever.
2712         Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
2713
2714         Before the patch, unsetPendingActivity was only called for successful jobs finishing.
2715         In case of failing loads, ServiceWorkerContainer would leak.
2716         Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
2717         a pending activity in the job map next to the job.
2718
2719         When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
2720         This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
2721
2722         Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
2723         Update type of exception to be SecurityError when load fails due to AccessControl.
2724
2725         Covered by existing tests.
2726
2727         * workers/service/ServiceWorkerContainer.cpp:
2728         (WebCore::ServiceWorkerContainer::addRegistration):
2729         (WebCore::ServiceWorkerContainer::removeRegistration):
2730         (WebCore::ServiceWorkerContainer::updateRegistration):
2731         (WebCore::ServiceWorkerContainer::scheduleJob):
2732         (WebCore::ServiceWorkerContainer::jobFailedWithException):
2733         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
2734         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
2735         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
2736         (WebCore::ServiceWorkerContainer::jobDidFinish):
2737         (WebCore::ServiceWorkerContainer::stop):
2738         (WebCore::ServiceWorkerContainer::job):
2739         * workers/service/ServiceWorkerContainer.h:
2740         * workers/service/ServiceWorkerJob.cpp:
2741         (WebCore::ServiceWorkerJob::failedWithException):
2742         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
2743         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
2744         (WebCore::ServiceWorkerJob::startScriptFetch):
2745         (WebCore::ServiceWorkerJob::didReceiveResponse):
2746         (WebCore::ServiceWorkerJob::notifyFinished):
2747         (WebCore::ServiceWorkerJob::cancelPendingLoad):
2748         * workers/service/ServiceWorkerJob.h:
2749         (WebCore::ServiceWorkerJob::hasPromise const):
2750         (WebCore::ServiceWorkerJob::takePromise):
2751         * workers/service/ServiceWorkerJobClient.h:
2752         * workers/service/server/SWServerJobQueue.cpp:
2753         (WebCore::SWServerJobQueue::scriptFetchFinished):
2754
2755 2019-01-30  Dean Jackson  <dino@apple.com>
2756
2757         PointerEvents - tiltX and tiltY are reversed
2758         https://bugs.webkit.org/show_bug.cgi?id=194032
2759         <rdar://problem/47674184>
2760
2761         Reviewed by Jon Lee.
2762
2763         I got tiltX and tiltY the wrong way around.
2764
2765         * dom/ios/PointerEventIOS.cpp: Flip the values.
2766
2767 2019-01-30  Zalan Bujtas  <zalan@apple.com>
2768
2769         [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
2770         https://bugs.webkit.org/show_bug.cgi?id=194001
2771
2772         Reviewed by Antti Koivisto.
2773
2774         Skip to the next position manually. This is exactly what we do in simple line layout.
2775
2776         * layout/inlineformatting/InlineRunProvider.cpp:
2777         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
2778
2779 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
2780
2781         Add some basic geometry information to the scrolling tree
2782         https://bugs.webkit.org/show_bug.cgi?id=194002
2783         rdar://problem/47656294
2784
2785         Reviewed by Antti Koivisto.
2786
2787         To allow hit-testing in the scrolling tree, store a parent-relative scrollable
2788         rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
2789         of the scrollable area, and whose origin is relative to the parent scrolling tree node.
2790         
2791         Frame hosting nodes need this rect because they take care of the geometry offset between
2792         an iframe and its scrolling tree ancestor in the parent document.
2793         
2794         Based on a patch by Frédéric Wang in bug 172917.
2795
2796         * page/scrolling/AsyncScrollingCoordinator.cpp:
2797         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
2798         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
2799         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
2800         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
2801         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
2802         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
2803         * page/scrolling/ScrollingStateFrameHostingNode.h:
2804         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
2805         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
2806         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
2807         * page/scrolling/ScrollingTreeFrameHostingNode.h:
2808         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
2809         * rendering/RenderLayer.h:
2810         * rendering/RenderLayerBacking.cpp:
2811         (WebCore::RenderLayerBacking::updateScrollingLayers):
2812         * rendering/RenderLayerCompositor.cpp:
2813         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
2814         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
2815         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
2816         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2817         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2818         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
2819         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
2820         * rendering/RenderLayerCompositor.h:
2821
2822 2019-01-30  Zalan Bujtas  <zalan@apple.com>
2823
2824         [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
2825         https://bugs.webkit.org/show_bug.cgi?id=194020
2826
2827         Reviewed by Antti Koivisto.
2828
2829         Check the used margin variables whether we already computed before/after values.
2830
2831         Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
2832
2833         * layout/FormattingContextGeometry.cpp:
2834         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2835
2836 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
2837
2838         AX: Support color well on iOS
2839         https://bugs.webkit.org/show_bug.cgi?id=194010
2840
2841         Reviewed by Joanmarie Diggs.
2842
2843         Test: accessibility/ios-simulator/color-well.html
2844
2845         Add support for color well on iOS.
2846
2847         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2848         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
2849         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2850         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
2851         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
2852         * en.lproj/Localizable.strings:
2853         * platform/LocalizedStrings.cpp:
2854         (WebCore::AXColorWellText):
2855         * platform/LocalizedStrings.h:
2856
2857 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
2858
2859         AX: Role=switch not returning correct accessibilityValue
2860         https://bugs.webkit.org/show_bug.cgi?id=194006
2861
2862         Reviewed by Joanmarie Diggs.
2863
2864         Return the toggle state of a role=switch element.        
2865
2866         Test: accessibility/ios-simulator/role-switch.html
2867
2868         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2869         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2870
2871 2019-01-29  Rob Buis  <rbuis@igalia.com>
2872
2873         Align with Fetch on data: URLs
2874         https://bugs.webkit.org/show_bug.cgi?id=182325
2875
2876         Reviewed by Alex Christensen.
2877
2878         Implement most remaining steps for data: URL processing [1].
2879         Serialization is still to be implemented.
2880
2881         To make the code in DataURLDecoder::parseMediaType more efficient,
2882         refactor ParsedContentType so that validation and parsing is done
2883         in one pass.
2884
2885         Test: web-platform-tests/fetch/data-urls/processing.any.js
2886
2887         [1] https://fetch.spec.whatwg.org/#data-urls
2888
2889         * Modules/encryptedmedia/CDM.cpp:
2890         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
2891         * platform/network/DataURLDecoder.cpp:
2892         (WebCore::DataURLDecoder::parseMediaType):
2893         (WebCore::DataURLDecoder::DecodeTask::process):
2894         * platform/network/MIMEHeader.cpp:
2895         (WebCore::MIMEHeader::parseHeader):
2896         * platform/network/ParsedContentType.cpp:
2897         (WebCore::containsNewline):
2898         (WebCore::ParsedContentType::parseContentType):
2899         (WebCore::ParsedContentType::create):
2900         (WebCore::isValidContentType):
2901         (WebCore::ParsedContentType::ParsedContentType):
2902         (WebCore::DummyParsedContentType::setContentType const): Deleted.
2903         (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
2904         (WebCore::parseContentType): Deleted.
2905         * platform/network/ParsedContentType.h:
2906
2907 2019-01-29  Eric Carlson  <eric.carlson@apple.com>
2908
2909         [MSE] add more source buffer logging
2910         https://bugs.webkit.org/show_bug.cgi?id=193995
2911         <rdar://problem/47650399>
2912
2913         Reviewed by Jon Lee.
2914
2915         No new tests, no functional change.
2916
2917         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2918         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
2919         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
2920         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
2921         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2922         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
2923         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
2924
2925 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
2926
2927         Add nodes to the scrolling tree in z-index order.
2928         https://bugs.webkit.org/show_bug.cgi?id=192529
2929         <rdar://problem/47402708>
2930
2931         Reviewed by Dean Jackson.
2932
2933         We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
2934         This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
2935         walks to find them.
2936
2937         With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
2938         tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
2939         (which makes it so that the scrolling tree correctly reflects layer z-order).
2940
2941         The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
2942         nodes in their parent document.
2943
2944         There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
2945         was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
2946         to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
2947
2948         updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
2949         and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
2950
2951         Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
2952                scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
2953
2954         * page/scrolling/ScrollingStateTree.cpp:
2955         (WebCore::ScrollingStateTree::insertNode):
2956         * page/scrolling/ScrollingTreeNode.cpp:
2957         (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
2958         * platform/Logging.cpp:
2959         (WebCore::initializeLogChannelsIfNecessary):
2960         * rendering/RenderLayer.cpp:
2961         (WebCore::RenderLayer::setParent):
2962         (WebCore::RenderLayer::calculateClipRects const):
2963         * rendering/RenderLayerBacking.cpp:
2964         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2965         (WebCore::RenderLayerBacking::willBeDestroyed):
2966         (WebCore::RenderLayerBacking::updateGeometry):
2967         (WebCore::RenderLayerBacking::updateBackgroundLayer):
2968         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
2969         * rendering/RenderLayerBacking.h:
2970         * rendering/RenderLayerCompositor.cpp:
2971         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2972         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
2973         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2974         (WebCore::frameHostingNodeForFrame):
2975         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2976         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2977         (WebCore::RenderLayerCompositor::updateBacking):
2978         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
2979         (WebCore::RenderLayerCompositor::setIsInWindow):
2980         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
2981         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2982         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2983         (WebCore::RenderLayerCompositor::attachScrollingNode):
2984         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
2985         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
2986         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
2987         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
2988         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2989         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2990         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2991         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
2992         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
2993         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
2994         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
2995         (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
2996         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
2997         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
2998         (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
2999         (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
3000         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
3001         (WebCore::canCoordinateScrollingForLayer): Deleted.
3002         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
3003         (WebCore::enclosingScrollingNodeID): Deleted.
3004         (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
3005         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
3006         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
3007         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
3008         * rendering/RenderLayerCompositor.h:
3009
3010 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
3011
3012         Make sure we have a frame before trying to access its loader 
3013         https://bugs.webkit.org/show_bug.cgi?id=193985
3014         <rdar://problem/47618239>
3015
3016         Reviewed by Ryosuke Niwa.
3017
3018         * loader/ResourceLoadObserver.cpp:
3019         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3020
3021 2019-01-29  Andy Estes  <aestes@apple.com>
3022
3023         Try to fix the watchOS build.
3024
3025         * dom/Element.cpp:
3026
3027 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
3028
3029         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
3030         https://bugs.webkit.org/show_bug.cgi?id=193907
3031         rdar://problem/47604080
3032
3033         Reviewed by Frédéric Wang.
3034
3035         Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
3036         state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
3037         show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
3038         commit would re-create the tree node, but the state node would only have a subset of the
3039         change flags set, so the new tree node would fail to get all of the state (for example, it
3040         would be missing layers and scrolling geometry).
3041
3042         Fix by ensuring that when we reparent state node subtrees, we set all the change flags
3043         so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
3044         Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
3045         set the right change flags.
3046
3047         This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
3048         information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
3049         as we encounter them in the tree walk.
3050         
3051         Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
3052
3053         Test: compositing/geometry/composited-frame-contents.html
3054
3055         * page/scrolling/ScrollingStateFixedNode.cpp:
3056         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
3057         * page/scrolling/ScrollingStateFixedNode.h:
3058         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3059         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
3060         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3061         * page/scrolling/ScrollingStateNode.cpp:
3062         (WebCore::ScrollingStateNode::setPropertyChanged):
3063         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
3064         * page/scrolling/ScrollingStateNode.h:
3065         (WebCore::ScrollingStateNode::setPropertyChangedBit):
3066         * page/scrolling/ScrollingStateScrollingNode.cpp:
3067         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
3068         * page/scrolling/ScrollingStateScrollingNode.h:
3069         * page/scrolling/ScrollingStateStickyNode.cpp:
3070         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
3071         * page/scrolling/ScrollingStateStickyNode.h:
3072         * page/scrolling/ScrollingStateTree.cpp:
3073         (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
3074         if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
3075         other nodeID which can result in type confusion later.
3076         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
3077         (WebCore::ScrollingStateTree::commit):
3078         (WebCore::ScrollingStateTree::willRemoveNode):
3079         (WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
3080         * page/scrolling/ScrollingStateTree.h:
3081         (WebCore::ScrollingStateTree::removedNodes const): Deleted.
3082         * page/scrolling/ScrollingTree.cpp:
3083         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
3084         (WebCore::ScrollingTree::commitTreeState):
3085         (WebCore::ScrollingTree::updateTreeFromStateNode):
3086         (WebCore::ScrollingTree::latchedNode):
3087         (WebCore::ScrollingTree::setLatchedNode):
3088         (WebCore::ScrollingTree::clearLatchedNode):
3089         (WebCore::ScrollingTree::scrollingTreeAsText):
3090         (WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
3091         * page/scrolling/ScrollingTree.h:
3092         (WebCore::ScrollingTree::hasLatchedNode const):
3093         * rendering/RenderLayerCompositor.cpp:
3094         (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
3095         setting its position doesn't offset it relative to the center.
3096
3097 2019-01-29  Justin Fan  <justin_fan@apple.com>
3098
3099         [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
3100         https://bugs.webkit.org/show_bug.cgi?id=193926
3101         <rdar://problem/47327648>
3102
3103         Reviewed by Myles C. Maxfield.
3104
3105         Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
3106
3107         Test: webgpu/vertex-buffer-triangle-strip.html
3108
3109         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: 
3110         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
3111         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
3112         (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
3113         (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
3114
3115 2019-01-29  Keith Rollin  <krollin@apple.com>
3116
3117         Add .xcfilelists to Run Script build phases
3118         https://bugs.webkit.org/show_bug.cgi?id=193792
3119         <rdar://problem/47201785>
3120
3121         Reviewed by Alex Christensen.
3122
3123         As part of supporting XCBuild, update the necessary Run Script build
3124         phases in their Xcode projects to refer to their associated
3125         .xcfilelist files.
3126
3127         Note that the addition of these files bumps the Xcode project version
3128         number to something that's Xcode 10 compatible. This change means that
3129         older versions of the Xcode IDE can't read these projects. Nor can it
3130         fully load workspaces that refer to these projects (the updated
3131         projects are shown as non-expandable placeholders). `xcodebuild` can
3132         still build these projects; it's just that the IDE can't open them.
3133
3134         Make special accommodations for incorporating .xcfilelists from
3135         WebKitAdditions.
3136
3137         No new tests since there should be no observable behavior difference.
3138
3139         * Configurations/Base.xcconfig:
3140         * Configurations/DebugRelease.xcconfig:
3141         * WebCore.xcodeproj/project.pbxproj:
3142
3143 2019-01-29  John Wilander  <wilander@apple.com>
3144
3145         Add data abstraction and validation for Ad Click Attribution
3146         https://bugs.webkit.org/show_bug.cgi?id=193916
3147         <rdar://problem/47603481>
3148
3149         Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
3150
3151         New API tests added.
3152
3153         Ad click attribution has two steps. First, the storage of an ad
3154         campaign ID for a click that takes the user to a destination
3155         site. Second, a conversion on the destination site that can be
3156         attributed to the ad click.
3157
3158         This patch adds a class that represents a request for ad click
3159         attribution. Validation makes sure that the bits of entropy
3160         reported through this mechanism is limited.
3161
3162         This feature is experimental and off by default.
3163
3164         * Sources.txt:
3165             Added loader/AdClickAttribution.cpp.
3166         * WebCore.xcodeproj/project.pbxproj:
3167         * loader/AdClickAttribution.cpp: Added.
3168         (WebCore::AdClickAttribution::isValid const):
3169         (WebCore::AdClickAttribution::setConversion):
3170         (WebCore::AdClickAttribution::url const):
3171         (WebCore::AdClickAttribution::referrer const):
3172         * loader/AdClickAttribution.h: Added.
3173         (WebCore::AdClickAttribution::Campaign::Campaign):
3174         (WebCore::AdClickAttribution::Campaign::isValid const):
3175         (WebCore::AdClickAttribution::Source::Source):
3176         (WebCore::AdClickAttribution::Destination::Destination):
3177         (WebCore::AdClickAttribution::Priority::Priority):
3178         (WebCore::AdClickAttribution::Conversion::Conversion):
3179         (WebCore::AdClickAttribution::Conversion::isValid const):
3180         (WebCore::AdClickAttribution::AdClickAttribution):
3181         (WebCore::AdClickAttribution::earliestTimeToSend const):
3182         * loader/DocumentLoader.cpp:
3183             Added missing #include "RuntimeEnabledFeatures.h".
3184
3185 2019-01-29  Zalan Bujtas  <zalan@apple.com>
3186
3187         [MathML] Move enum class ScriptType to MathMLScriptsElement.
3188         https://bugs.webkit.org/show_bug.cgi?id=193969
3189
3190         Reviewed by Antti Koivisto.
3191
3192         * mathml/MathMLScriptsElement.cpp:
3193         (WebCore::scriptTypeOf):
3194         * mathml/MathMLScriptsElement.h:
3195         * rendering/mathml/RenderMathMLScripts.cpp:
3196         (WebCore::RenderMathMLScripts::scriptType const):
3197         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
3198         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
3199         (WebCore::RenderMathMLScripts::verticalMetrics):
3200         (WebCore::RenderMathMLScripts::layoutBlock):
3201         * rendering/mathml/RenderMathMLScripts.h:
3202         * rendering/mathml/RenderMathMLUnderOver.cpp:
3203         (WebCore::RenderMathMLUnderOver::isValid const):
3204         (WebCore::RenderMathMLUnderOver::under const):
3205         (WebCore::RenderMathMLUnderOver::over const):
3206         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
3207         (WebCore::RenderMathMLUnderOver::hasAccent const):
3208         (WebCore::RenderMathMLUnderOver::layoutBlock):
3209
3210 2019-01-29  Chris Dumez  <cdumez@apple.com>
3211
3212         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
3213         https://bugs.webkit.org/show_bug.cgi?id=193848
3214
3215         Reviewed by Youenn Fablet.
3216
3217         * dom/Document.cpp:
3218         * dom/MessageChannel.cpp:
3219         (WebCore::MessageChannel::MessageChannel):
3220         * dom/ScriptExecutionContext.cpp:
3221         (WebCore::ScriptExecutionContext::contextIdentifier const):
3222         * history/HistoryItem.cpp:
3223         (WebCore::HistoryItem::HistoryItem):
3224         * loader/DocumentLoader.cpp:
3225         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
3226         * page/DOMWindow.cpp:
3227         (WebCore::DOMWindow::DOMWindow):
3228         * platform/Process.cpp:
3229         (WebCore::Process::identifier):
3230         * workers/service/ServiceWorkerJobData.cpp:
3231         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
3232         * workers/service/server/RegistrationDatabase.cpp:
3233         (WebCore::RegistrationDatabase::importRecords):
3234         * workers/service/server/SWServer.cpp:
3235         (WebCore::SWServer::Connection::Connection):
3236         (WebCore::SWServer::updateWorker):
3237         * workers/service/server/SWServerRegistration.cpp:
3238         (WebCore::generateServiceWorkerRegistrationIdentifier):
3239         * workers/service/server/SWServerToContextConnection.cpp:
3240         (WebCore::generateServerToContextConnectionIdentifier):
3241
3242
3243 2019-01-29  Alex Christensen  <achristensen@webkit.org>
3244
3245         Use lambdas instead of member pointer functions for TransactionOperationImpl
3246         https://bugs.webkit.org/show_bug.cgi?id=193933
3247
3248         Reviewed by Tim Horton.
3249
3250         No change in behavior.  This just makes it easier to add new parameters to these functions in a straightforward manner.
3251
3252         * Modules/indexeddb/IDBObjectStore.cpp:
3253         (WebCore::IDBObjectStore::putOrAdd):
3254         * Modules/indexeddb/IDBTransaction.cpp:
3255         (WebCore::IDBTransaction::internalAbort):
3256         (WebCore::IDBTransaction::commit):
3257         (WebCore::IDBTransaction::createObjectStore):
3258         (WebCore::IDBTransaction::renameObjectStore):
3259         (WebCore::IDBTransaction::createIndex):
3260         (WebCore::IDBTransaction::renameIndex):
3261         (WebCore::IDBTransaction::doRequestOpenCursor):
3262         (WebCore::IDBTransaction::iterateCursor):
3263         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
3264         (WebCore::IDBTransaction::requestGetAllIndexRecords):
3265         (WebCore::IDBTransaction::requestGetRecord):
3266         (WebCore::IDBTransaction::requestIndexRecord):
3267         (WebCore::IDBTransaction::requestCount):
3268         (WebCore::IDBTransaction::requestDeleteRecord):
3269         (WebCore::IDBTransaction::requestClearObjectStore):
3270         (WebCore::IDBTransaction::requestPutOrAdd):
3271         (WebCore::IDBTransaction::deleteObjectStore):
3272         (WebCore::IDBTransaction::deleteIndex):
3273         * Modules/indexeddb/IDBTransaction.h:
3274         * Modules/indexeddb/client/TransactionOperation.h:
3275         (WebCore::IDBClient::TransactionOperation::doComplete):
3276         (WebCore::IDBClient::createTransactionOperation): Deleted.
3277
3278 2019-01-29  Zalan Bujtas  <zalan@apple.com>
3279
3280         [LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
3281         https://bugs.webkit.org/show_bug.cgi?id=193964
3282
3283         Reviewed by Antti Koivisto.
3284
3285         * layout/blockformatting/BlockMarginCollapse.cpp:
3286         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
3287
3288 2019-01-29  Zalan Bujtas  <zalan@apple.com>
3289
3290         [LFC][BFC] Do not ignore next sibling box while laying out BFC.
3291         https://bugs.webkit.org/show_bug.cgi?id=193954
3292
3293         Reviewed by Antti Koivisto.
3294
3295         When a block box has no child (<img style="display: block">), we should not ignore the next sibling (move the container check to the function to keep layout logic simple)
3296         Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins.
3297
3298         * layout/blockformatting/BlockFormattingContext.cpp:
3299         (WebCore::Layout::BlockFormattingContext::layout const):
3300         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
3301         * layout/blockformatting/BlockFormattingContext.h:
3302         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3303         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3304
3305 2019-01-29  Zalan Bujtas  <zalan@apple.com>
3306
3307         [LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough
3308         https://bugs.webkit.org/show_bug.cgi?id=193948
3309
3310         Reviewed by Antti Koivisto.
3311
3312         This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight().
3313
3314         * layout/blockformatting/BlockMarginCollapse.cpp:
3315         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
3316
3317 2019-01-29  Zalan Bujtas  <zalan@apple.com>
3318
3319         [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after.
3320         https://bugs.webkit.org/show_bug.cgi?id=193952
3321
3322         Reviewed by Antti Koivisto.
3323
3324         * layout/blockformatting/BlockMarginCollapse.cpp:
3325         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
3326
3327 2019-01-29  Frederic Wang  <fwang@igalia.com>
3328
3329         Allow scrolling tree nodes to exist in a detached state
3330         https://bugs.webkit.org/show_bug.cgi?id=193754
3331
3332         Unreviewed build warning fix.
3333
3334         * page/scrolling/ScrollingStateTree.cpp:
3335         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove
3336         unused variable.
3337
3338 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
3339
3340         User agent string override for navigator.userAgent should be site specific quirks
3341         https://bugs.webkit.org/show_bug.cgi?id=193950
3342
3343         Reviewed by Brent Fulgham.
3344
3345         In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
3346         we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
3347         without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
3348         had been disabled or not.
3349
3350         * loader/DocumentLoader.h:
3351         (WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
3352         (WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
3353         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
3354         (WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
3355         * loader/FrameLoader.cpp:
3356         (WebCore::FrameLoader::userAgentForJavaScript const):
3357
3358 2019-01-28  Devin Rousso  <drousso@apple.com>
3359
3360         Web Inspector: provide a way to edit page WebRTC settings on a remote target
3361         https://bugs.webkit.org/show_bug.cgi?id=193863
3362         <rdar://problem/47572764>
3363
3364         Reviewed by Joseph Pecoraro.
3365
3366         Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
3367               inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
3368
3369         * inspector/agents/InspectorPageAgent.cpp:
3370
3371         * page/Settings.yaml:
3372         * page/SettingsBase.h:
3373         * page/SettingsBase.cpp:
3374         (SettingsBase::iceCandidateFilteringEnabledChanged): Added.
3375         (SettingsBase::mockCaptureDevicesEnabledChanged): Added.
3376         * Scripts/GenerateSettings.rb:
3377         * Scripts/SettingsTemplates/Settings.cpp.erb:
3378         Add page-level settings for WebRTC preferences.
3379
3380         * Modules/mediastream/UserMediaController.cpp:
3381         (WebCore::UserMediaController::canCallGetUserMedia):
3382
3383         * testing/InternalSettings.cpp:
3384         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
3385
3386         * testing/Internals.h:
3387         * testing/Internals.cpp:
3388         (WebCore::Internals::Internals):
3389         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
3390         (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
3391
3392         * page/DeprecatedGlobalSettings.h:
3393         * page/DeprecatedGlobalSettings.cpp:
3394         (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
3395         (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
3396         (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
3397         (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
3398
3399 2019-01-28  Jer Noble  <jer.noble@apple.com>
3400
3401         webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
3402         https://bugs.webkit.org/show_bug.cgi?id=193923
3403         <rdar://problem/45956595>
3404
3405         Reviewed by Eric Carlson.
3406
3407         The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
3408         and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
3409         setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
3410
3411         * html/HTMLMediaElement.cpp:
3412         (WebCore::HTMLMediaElement::clearMediaPlayer):
3413         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
3414         (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
3415         (WebCore::HTMLMediaElement::dispatchEvent):
3416         * html/HTMLMediaElement.h:
3417
3418 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
3419
3420         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
3421         https://bugs.webkit.org/show_bug.cgi?id=193941
3422
3423         Reviewed by Alex Christensen.
3424
3425         * css/CSSBasicShapes.cpp:
3426         * css/CSSPrimitiveValue.cpp:
3427         * css/parser/CSSParser.cpp:
3428         * css/parser/CSSParserSelector.cpp:
3429         * css/parser/CSSPropertyParser.cpp:
3430         * dom/Document.cpp:
3431         * dom/EventListenerMap.cpp:
3432         * dom/EventTarget.cpp:
3433         * editing/Editor.cpp:
3434         * html/HTMLElement.cpp:
3435         * html/HTMLFontElement.cpp:
3436         * html/parser/HTMLTokenizer.cpp:
3437         * html/track/TrackBase.cpp:
3438         * loader/FTPDirectoryParser.cpp:
3439         * loader/TextResourceDecoder.cpp:
3440         * loader/cache/CachedResource.cpp:
3441         * page/ContextMenuController.cpp:
3442         * page/Navigator.cpp:
3443         * platform/Length.cpp:
3444         * platform/cocoa/KeyEventCocoa.mm:
3445         * platform/graphics/FontCascade.cpp:
3446         * platform/graphics/WidthIterator.cpp:
3447         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3448         * platform/ios/KeyEventIOS.mm:
3449         * platform/mac/KeyEventMac.mm:
3450         * platform/network/HTTPParsers.cpp:
3451         * platform/text/TextCodecUTF8.cpp:
3452         * platform/text/TextEncodingRegistry.cpp:
3453         * platform/win/KeyEventWin.cpp:
3454         * rendering/BidiRun.cpp:
3455         * rendering/FloatingObjects.cpp:
3456         * rendering/RenderBlock.cpp:
3457         * rendering/RenderListMarker.cpp:
3458         * rendering/RenderText.cpp:
3459
3460 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
3461
3462         [Win] WebCore/platform/Process.h is conflicting with process.h
3463         https://bugs.webkit.org/show_bug.cgi?id=193944
3464
3465         Reviewed by Ross Kirsling.
3466
3467         Windows has process.h. Rename Process.h to ProcessIdentifier.h.
3468
3469         No new tests because there is no behavior change.
3470
3471         * Sources.txt:
3472         * UnifiedSources-input.xcfilelist:
3473         * WebCore.xcodeproj/project.pbxproj:
3474         * dom/MessagePortIdentifier.h:
3475         * dom/messageports/MessagePortChannel.h:
3476         * dom/messageports/MessagePortChannelProvider.h:
3477         * dom/messageports/MessagePortChannelRegistry.h:
3478         * history/BackForwardItemIdentifier.h:
3479         * page/GlobalWindowIdentifier.h:
3480         * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
3481         (WebCore::Process::setIdentifier):
3482         (WebCore::Process::identifier):
3483         * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
3484
3485 2019-01-28  Antoine Quint  <graouts@apple.com>
3486
3487         Implement capture for Pointer Events on iOS
3488         https://bugs.webkit.org/show_bug.cgi?id=193917
3489         <rdar://problem/47605689>
3490
3491         Reviewed by Dean Jackson.
3492
3493         We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
3494         to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
3495         and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
3496         releasePointerCapture().
3497
3498         Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
3499                pointerevents/ios/pointer-events-implicit-capture-release-exception.html
3500                pointerevents/ios/pointer-events-implicit-capture-release.html
3501                pointerevents/ios/pointer-events-implicit-capture.html
3502                pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
3503
3504         * Sources.txt:
3505         * WebCore.xcodeproj/project.pbxproj:
3506         * dom/Element.cpp:
3507         (WebCore::Element::setPointerCapture):
3508         (WebCore::Element::releasePointerCapture):
3509         (WebCore::Element::hasPointerCapture):
3510         * dom/Element.h:
3511         * dom/Element.idl:
3512         * dom/EventNames.h:
3513         * dom/PointerEvent.h:
3514         * page/Page.cpp:
3515         (WebCore::Page::Page):
3516         * page/Page.h:
3517         (WebCore::Page::pointerCaptureController const):
3518         * page/PointerCaptureController.cpp: Added.
3519         (WebCore::PointerCaptureController::PointerCaptureController):
3520         (WebCore::PointerCaptureController::setPointerCapture):
3521         (WebCore::PointerCaptureController::releasePointerCapture):
3522         (WebCore::PointerCaptureController::hasPointerCapture):
3523         (WebCore::PointerCaptureController::pointerLockWasApplied):
3524         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
3525         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
3526         (WebCore::PointerCaptureController::pointerEventWasDispatched):
3527         (WebCore::PointerCaptureController::processPendingPointerCapture):
3528         * page/PointerCaptureController.h: Added.
3529         * page/PointerLockController.cpp:
3530         (WebCore::PointerLockController::requestPointerLock):
3531         * page/PointerLockController.h:
3532
3533 2019-01-28  Andy Estes  <aestes@apple.com>
3534
3535         [watchOS] Enable Parental Controls content filtering
3536         https://bugs.webkit.org/show_bug.cgi?id=193939
3537         <rdar://problem/46641912>
3538
3539         Reviewed by Ryosuke Niwa.
3540
3541         * Configurations/FeatureDefines.xcconfig:
3542
3543 2019-01-28  Dean Jackson  <dino@apple.com>
3544
3545         Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
3546         https://bugs.webkit.org/show_bug.cgi?id=193945
3547         <rdar://problem/47618922>
3548
3549         Reviewed by Antoine Quint.
3550
3551         Calculate the pressure, tiltX and tiltY values for incoming
3552         Pointer Events, which have values when the PlatformTouchEvent
3553         originated from a stylus.
3554
3555         Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
3556
3557         * dom/PointerEvent.h: Default to "mouse".
3558         * dom/ios/PointerEventIOS.cpp: Calculate the values.
3559
3560 2019-01-28  Timothy Hatcher  <timothy@apple.com>
3561
3562         Make it easier for non-Apple ports to enable dark mode CSS support.
3563         https://bugs.webkit.org/show_bug.cgi?id=193882
3564
3565         Reviewed by Megan Gardner.
3566
3567         * page/FrameView.cpp:
3568         (WebCore::FrameView::updateBackgroundRecursively): Limit use of system
3569         background color to the Mac platform.
3570         * rendering/RenderTheme.cpp:
3571         (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
3572         (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
3573         (WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
3574         * rendering/RenderTheme.h:
3575         (WebCore::RenderTheme::colorCache const): Deleted.
3576         * rendering/RenderThemeMac.h:
3577         * rendering/RenderThemeMac.mm:
3578         (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
3579         (WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
3580         (WebCore::RenderThemeMac::colorCache const): Deleted.
3581
3582 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
3583
3584         svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
3585         https://bugs.webkit.org/show_bug.cgi?id=193930
3586
3587         Reviewed by Tim Horton.
3588
3589         ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
3590         before iterating, since iteration mutates the array.
3591
3592         Tested by ASan tests.
3593
3594         * page/scrolling/ScrollingStateNode.h:
3595         (WebCore::ScrollingStateNode::takeChildren):
3596         * page/scrolling/ScrollingStateTree.cpp:
3597         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
3598
3599 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
3600
3601         css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
3602         https://bugs.webkit.org/show_bug.cgi?id=193925
3603
3604         Reviewed by Tim Horton.
3605
3606         Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
3607         tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
3608         node if it's the node being unparented or destroyed.
3609
3610         Tested by existing tests.
3611
3612         * page/scrolling/ScrollingStateTree.cpp:
3613         (WebCore::ScrollingStateTree::unparentNode):
3614         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
3615
3616 2019-01-28  Daniel Bates  <dabates@apple.com>
3617
3618         [iOS] Make Window virtual key code computation match Mac
3619         https://bugs.webkit.org/show_bug.cgi?id=193452
3620
3621         Reviewed by Ryosuke Niwa.
3622
3623         Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
3624         web compatibility. On Mac, we prefer to compute the  Windows virtual key code from the input
3625         strings of the key event and use the key event's keycode as a last resort.
3626
3627         Test: fast/events/ios/key-events-meta-alt-combinations.html
3628
3629         * platform/ios/PlatformEventFactoryIOS.h:
3630         * platform/ios/PlatformEventFactoryIOS.mm:
3631         (WebCore::isKeypadEvent): Added.
3632         (WebCore::windowsKeyCodeForKeyEvent): Added.
3633         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
3634         WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
3635
3636 2019-01-28  Antoine Quint  <graouts@apple.com>
3637
3638         Limit user-agent interactions based on the touch-action property on iOS
3639         https://bugs.webkit.org/show_bug.cgi?id=193447
3640
3641         Unreviewed build fix.
3642
3643         * dom/Element.cpp:
3644         (WebCore::parentCrossingFrameBoundaries):
3645
3646 2019-01-28  Eric Carlson  <eric.carlson@apple.com>
3647
3648         AVStreamSession isn't always available, make a HAVE compile flag for it
3649         https://bugs.webkit.org/show_bug.cgi?id=193889
3650         <rdar://problem/47452863>
3651
3652         Reviewed by Jer Noble.
3653
3654         No new tests, no functional change.
3655
3656         * page/Settings.yaml:
3657         * page/SettingsBase.cpp:
3658         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
3659         * page/SettingsBase.h:
3660         * page/cocoa/SettingsBaseCocoa.mm:
3661         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
3662         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
3663         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
3664         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
3665         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3666
3667         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3668         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3669         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
3670         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3671
3672         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
3673         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3674         
3675         Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
3676
3677         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
3678         -> isEqualToString.
3679         (WebCore::sourceBufferMap):
3680         (WebCore::nextMapID):
3681         (WebCore::bufferWasConsumedCallback):
3682         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
3683         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
3684         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
3685         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
3686         (WebCore::SourceBufferPrivateAVFObjC::append):
3687         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
3688         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
3689         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
3690         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
3691         (-[WebBufferConsumedContext initWithParent:]): Deleted.
3692         (-[WebBufferConsumedContext parent]): Deleted.
3693
3694 2019-01-28  Rob Buis  <rbuis@igalia.com>
3695
3696         Update MIME type parser
3697         https://bugs.webkit.org/show_bug.cgi?id=180526
3698
3699         Reviewed by Frédéric Wang.
3700
3701         I overlooked step 11.9.3 [1], for Mimesniff we should not
3702         bail out on missing subtype, but keep trying. Note
3703         that Rfc2045 does require bailing out, as before.
3704
3705         Test: ParsedContentType unittest
3706
3707         [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
3708
3709         * platform/network/ParsedContentType.cpp:
3710         (WebCore::parseToken):
3711         (WebCore::parseContentType):
3712
3713 2019-01-28  Michael Catanzaro  <mcatanzaro@igalia.com>
3714
3715         Unreviewed follow-up to r240557, restore a call to makeString
3716         https://bugs.webkit.org/show_bug.cgi?id=192742
3717         <rdar://problem/46757369>
3718
3719         It works if we add this #include that was missing. I got confused by the error messages and
3720         missed that there were two similarly-named headers.
3721
3722         * rendering/RenderLayerCompositor.cpp:
3723         (WebCore::RenderLayerCompositor::logLayerInfo):
3724
3725 2019-01-28  Oriol Brufau  <obrufau@igalia.com>
3726
3727         [css-logical] Reject unitless length quirk in 'inset' shorthand
3728         https://bugs.webkit.org/show_bug.cgi?id=193773
3729
3730         Reviewed by Manuel Rego Casasnovas.
3731
3732         Even though its longhands ('top', 'right', 'bottom', 'left') accept the
3733         unitless length quirk, the 'inset' shorthand is a new CSS property and
3734         should reject it. This was resolved by the CSS WG in
3735         https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
3736
3737         Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
3738                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
3739                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
3740                imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
3741                imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
3742                imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
3743
3744         * css/parser/CSSPropertyParser.cpp:
3745         (WebCore::CSSPropertyParser::parseSingleValue):
3746
3747 2019-01-28  Zalan Bujtas  <zalan@apple.com>
3748
3749         [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
3750         https://bugs.webkit.org/show_bug.cgi?id=193896
3751
3752         Reviewed by Antti Koivisto.
3753
3754         This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
3755
3756         1. Collapsed quirk margin values are ignored on quirk containers
3757
3758             <body>
3759               <p> p elements have 1em vertical (top/bottom) quirk margin
3760             </body>
3761
3762             In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
3763             Used vertical margin values on the <body> are top: 8px bottom: 8px.
3764
3765         2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
3766
3767             <body>
3768               <div style="margin-top: 1px">
3769                 <p> p elements have 1em vertical (top/bottom) quirk margin
3770               </div>
3771             </body>
3772
3773             When <p>'s vertical margin collapses with the parent <div>,
3774             - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
3775             - the collapsed after value stays 1qem quirk value.
3776
3777             When <div> collapses with <body>
3778             - the collapsed before value becomes 16px (max(16px, 8px))
3779             - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
3780             Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
3781
3782         * layout/MarginTypes.h:
3783         (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
3784         * layout/blockformatting/BlockFormattingContext.h:
3785         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3786         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
3787         (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
3788         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
3789         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
3790         * layout/blockformatting/BlockMarginCollapse.cpp:
3791         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
3792         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
3793         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
3794         (WebCore::Layout::computedPositiveAndNegativeMargin):
3795         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
3796         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
3797
3798 2019-01-28  Zalan Bujtas  <zalan@apple.com>
3799
3800         [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
3801         https://bugs.webkit.org/show_bug.cgi?id=193872
3802
3803         Reviewed by Antti Koivisto.
3804
3805         This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin(). 
3806
3807         * layout/blockformatting/BlockFormattingContext.cpp:
3808         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3809
3810 2019-01-28  cathie chen  <cathiechen@igalia.com>
3811
3812         Add missing #include in ScrollingTreeFrameScrollingNode.cpp
3813         https://bugs.webkit.org/show_bug.cgi?id=193905
3814
3815         Reviewed by Frédéric Wang.
3816
3817         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
3818         #include "ScrollingStateFrameScrollingNode.h"
3819
3820 2019-01-28  Zalan Bujtas  <zalan@apple.com>
3821
3822         [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
3823         https://bugs.webkit.org/show_bug.cgi?id=193894
3824
3825         Reviewed by Antti Koivisto.
3826
3827         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3828         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
3829
3830 2019-01-28  Antoine Quint  <graouts@apple.com>
3831
3832         Limit user-agent interactions based on the touch-action property on iOS
3833         https://bugs.webkit.org/show_bug.cgi?id=193447
3834         <rdar://problem/47283874>
3835
3836         Reviewed by Antti Koivisto and Simon Fraser.
3837
3838         We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
3839         or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
3840         a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
3841         the bounds of each of those elements to send it up to the UI process along with touch regions. Computing the list of allowed touch
3842         actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
3843         crossing any frame boundary towards the top-level document's root node.
3844
3845         Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
3846                pointerevents/ios/touch-action-none-on-iframe.html
3847                pointerevents/ios/touch-action-none-on-parent.html
3848                pointerevents/ios/touch-action-none.html
3849                pointerevents/ios/touch-action-pan-x-pan-y.html
3850                pointerevents/ios/touch-action-pan-x.html
3851                pointerevents/ios/touch-action-pan-y.html
3852                pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
3853                pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
3854
3855         * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
3856         * dom/Document.cpp:
3857         (WebCore::Document::invalidateRenderingDependentRegions):
3858         (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
3859         list of elements with a non-auto touch-action property.
3860         (WebCore::Document::absoluteEventRegionForNode):
3861         (WebCore::Document::absoluteRegionForEventTargets):
3862         (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
3863         exist yet and update it to add the given element if it contains a non-auto touch-action, or remove it if it doesn't. If the contents
3864         of that list changed as a result, the scrolling coordinator is informed.
3865         * dom/Document.h:
3866         (WebCore::Document:: const):
3867         * dom/Element.cpp:
3868         (WebCore::parentCrossingFrameBoundaries):
3869         (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
3870         specified on this element and all of its hierarchy, crossing frame boundary.
3871         (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
3872         for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
3873         touch actions.
3874         * dom/Element.h:
3875         * page/scrolling/ScrollingCoordinator.cpp:
3876         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
3877         throughout the provided frame and all of its subframes.
3878         * page/scrolling/ScrollingCoordinator.h:
3879         (WebCore::ScrollableAreaParameters::operator== const): Deleted.
3880         * page/scrolling/ScrollingCoordinatorTypes.h: Added.
3881         (WebCore::ScrollableAreaParameters::operator== const):
3882         * page/scrolling/ScrollingTree.cpp:
3883         (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
3884         now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
3885         account for overlap and nesting.
3886         * page/scrolling/ScrollingTree.h:
3887         * page/scrolling/ScrollingTreeNode.h:
3888         * platform/EventTrackingRegions.cpp:
3889         (WebCore::operator==):
3890         * platform/EventTrackingRegions.h:
3891         (WebCore::operator!=):
3892         * style/StyleTreeResolver.cpp:
3893         (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
3894
3895 2019-01-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3896
3897         Unreviewed, fix WPE/GTK debug builds after r240557
3898         https://bugs.webkit.org/show_bug.cgi?id=192742
3899         <rdar://problem/46757369>
3900
3901         Also fix an improper format string that was recently added in a different commit.
3902
3903         * rendering/RenderLayerCompositor.cpp:
3904         (WebCore::RenderLayerCompositor::logLayerInfo):
3905         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
3906
3907 2018-12-15  Darin Adler  <darin@apple.com>
3908
3909         Replace many uses of String::format with more type-safe alternatives
3910         https://bugs.webkit.org/show_bug.cgi?id=192742
3911
3912         Reviewed by Mark Lam.
3913
3914         A while back, String::format was more efficient than string concatenation,
3915         but that is no longer true, and we should prefer String::number, makeString,
3916         or concatenation with the "+" operator to String::format for new code.
3917
3918         This is not as good for programmers who are fond of printf formatting
3919         style, and in some cases it's a little harder to read the strings
3920         interspersed with variables rather than a format string, but it's better
3921         in a few ways:
3922
3923         - more efficient (I didn't measure the difference, but it's definitely
3924           slower to use String::Format which calls vsnprintf twice than to use
3925           the WTF code)
3926         - works in a type-safe way without a need to use a format specifier such
3927           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
3928           subtle differences between platforms
3929         - allows us to use StringView in some cases to sidestep the need to
3930           allocate temporary WTF::String objects
3931         - does not require converting each WTF::String to a C string, allowing
3932           us to remove many cases of ".utf8().data()" and similar expressions,
3933           eliminating the allocation of temporary WTF::CString objects
3934
3935         This patch covers a batch of easiest-to-convert call sites.
3936         Later patches will allow us to deprecate or remove String::format.
3937
3938         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3939         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
3940         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3941         (WebCore::IDBCursorInfo::loggingString const): Ditto.
3942         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
3943         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
3944         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
3945         (WebCore::IDBGetRecordData::loggingString const): Ditto.
3946         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
3947         (WebCore::IDBIndexInfo::loggingString const): Ditto.
3948         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
3949         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
3950         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
3951         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
3952         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
3953         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3954         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
3955         * Modules/webdatabase/Database.cpp:
3956         (WebCore::formatErrorMessage): Ditto.
3957         * Modules/webdatabase/SQLError.h:
3958         (WebCore::SQLError::create): Ditto.
3959
3960         * bindings/scripts/CodeGeneratorJS.pm:
3961         (GenerateImplementation): Use makeString.
3962
3963         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3964         * bindings/scripts/test/JS/JSMapLike.cpp:
3965         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
3966         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3967         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
3968         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
3969         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
3970         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3971         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3972         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
3973         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3974         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3975         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3976         * bindings/scripts/test/JS/JSTestException.cpp:
3977         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3978         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3979         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
3980         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
3981         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
3982         * bindings/scripts/test/JS/JSTestInterface.cpp:
3983         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
3984         * bindings/scripts/test/JS/JSTestIterable.cpp:
3985         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3986         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
3987         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
3988         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
3989         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3990         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
3991         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
3992         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
3993         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
3994         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
3995         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
3996         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
3997         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
3998         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
3999         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
4000         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
4001         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
4002         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
4003         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
4004         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
4005         * bindings/scripts/test/JS/JSTestNode.cpp:
4006         * bindings/scripts/test/JS/JSTestObj.cpp:
4007         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
4008         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
4009         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
4010         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
4011         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
4012         * bindings/scripts/test/JS/JSTestSerialization.cpp:
4013         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
4014         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
4015         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
4016         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
4017         * bindings/scripts/test/JS/JSTestStringifier.cpp:
4018         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
4019         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
4020         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
4021         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
4022         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
4023         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
4024         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
4025         Updated expected results.
4026 :
4027         * css/parser/CSSPropertyParserHelpers.cpp:
4028         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
4029         and makeString.
4030
4031         * html/HTMLSelectElement.cpp:
4032         (WebCore::HTMLSelectElement::setLength): Use makeString.
4033         * html/ImageDocument.cpp:
4034         (WebCore::ImageDocument::imageUpdated): Ditto.
4035         * html/parser/XSSAuditor.cpp:
4036         (WebCore::XSSAuditor::init): Ditto.
4037         * inspector/InspectorFrontendClientLocal.cpp:
4038         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
4039         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
4040         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
4041         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
4042         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
4043         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
4044         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
4045         * page/MemoryRelease.cpp:
4046         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
4047
4048         * page/cocoa/ResourceUsageOverlayCocoa.mm:
4049         (WebCore::formatByteNumber): Use String::number.
4050         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
4051
4052         * page/cocoa/ResourceUsageThreadCocoa.mm:
4053         (WebCore::logFootprintComparison): Use makeString.
4054         * platform/animation/TimingFunction.cpp:
4055         (WebCore::TimingFunction::cssText const): Ditto.
4056
4057         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
4058         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.