8169133bcd45f480a0238c03e39ce0d93b6c2f51
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-31  Zalan Bujtas  <zalan@apple.com>
2
3         [LFC] Margin before/after/start/end initial value is 0 and not auto.
4         https://bugs.webkit.org/show_bug.cgi?id=194090
5
6         Reviewed by Antti Koivisto.
7
8         Don't treat it like auto.
9
10         * layout/FormattingContextGeometry.cpp:
11         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
12         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
13
14 2019-01-31  Zalan Bujtas  <zalan@apple.com>
15
16         [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
17         https://bugs.webkit.org/show_bug.cgi?id=194074
18
19         Reviewed by Antti Koivisto.
20
21         Check the used margin variables whether we already computed start/end values.
22
23         Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
24
25         * layout/FormattingContextGeometry.cpp:
26         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
27
28 2019-01-31  Zalan Bujtas  <zalan@apple.com>
29
30         [LFC][BFC] Add support for block level replaced box.
31         https://bugs.webkit.org/show_bug.cgi?id=194071
32
33         Reviewed by Antti Koivisto.
34
35         * layout/layouttree/LayoutBox.cpp:
36         (WebCore::Layout::Box::Box):
37         * layout/layouttree/LayoutBox.h:
38         * layout/layouttree/LayoutTreeBuilder.cpp:
39         (WebCore::Layout::TreeBuilder::createSubTree):
40         (WebCore::Layout::outputLayoutBox):
41
42 2019-01-31  Chris Fleizach  <cfleizach@apple.com>
43
44         ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
45         https://bugs.webkit.org/show_bug.cgi?id=189094
46         <rdar://problem/43853526>
47
48         Reviewed by Zalan Bujtas.
49
50         Protect against access to objects and cache's that can be removed while an object is still in memory.
51
52         Unskipped flaky tests on mac-wk2.
53
54         * accessibility/mac/AXObjectCacheMac.mm:
55         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
56         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
57         (textMarkerForVisiblePosition):
58         (textMarkerRangeFromVisiblePositions):
59
60 2019-01-30  Chris Dumez  <cdumez@apple.com>
61
62         Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
63         https://bugs.webkit.org/show_bug.cgi?id=194023
64         <rdar://problem/47417981>
65
66         Reviewed by Geoffrey Garen.
67
68         The issue was caused by the 'isTopSite' flag not getting properly set on the network request
69         in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
70         not getting its same-site lax cookies.
71
72         The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
73         bypassing this method entirely when continuing a load in a new process after a swap. This was
74         intentional as the network request is normally already fully populated by the previous process
75         and we do not want the new process to modify the request in any way (e.g. we would not want to
76         add a Origin header back after it was removed by the previous process). However, in case of a
77         History navigation, we do not actually pass a request along from one process to another. Instead,
78         we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
79         In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
80         we are technically continuing a load in a new process.
81
82         We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
83         continuing a load with a request and not when we're continuing a load with a HistoryItem.
84
85         Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
86
87         * loader/FrameLoader.cpp:
88         (WebCore::FrameLoader::load):
89         (WebCore::FrameLoader::loadWithDocumentLoader):
90         (WebCore::FrameLoader::addExtraFieldsToRequest):
91         (WebCore::FrameLoader::loadDifferentDocumentItem):
92         * loader/FrameLoader.h:
93         (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
94
95 2019-01-30  Justin Fan  <justin_fan@apple.com>
96
97         [WebGPU] Support GPUDepthStencilStateDescriptor
98         https://bugs.webkit.org/show_bug.cgi?id=194048
99         <rdar://problem/46289645>
100
101         Reviewed by Dean Jackson.
102
103         Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
104
105         Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect 
106         without a depth texture attached.
107
108         New interface files added:
109         * Modules/webgpu/GPUCompareFunction.idl:
110         * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
111         * platform/graphics/gpu/GPUCompareFunction.h:
112         * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
113
114         Modifications:
115         * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
116         (WebCore::WebGPUDevice::createRenderPipeline const):
117         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
118         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
119         * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
120         (WebCore::GPURenderPipeline::depthStencilState const): Getter.
121         (WebCore::GPURenderPipeline::platformRenderPipeline const):
122         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
123         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
124         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
125         (WebCore::GPURenderPassEncoder::setPipeline):
126         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
127         (WebCore::validateAndConvertDepthCompareFunctionToMtl):
128         (WebCore::tryCreateMtlDepthStencilState):
129         (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
130         (WebCore::GPURenderPipeline::create):
131         (WebCore::GPURenderPipeline::GPURenderPipeline):
132
133         Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
134         * CMakeLists.txt:
135         * DerivedSources.make:
136         * Sources.txt:
137         * WebCore.xcodeproj/project.pbxproj:
138
139         * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
140
141 2019-01-30  Jer Noble  <jer.noble@apple.com>
142
143         [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
144         https://bugs.webkit.org/show_bug.cgi?id=193984
145
146         Reviewed by Eric Carlson.
147
148         MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
149         KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
150         after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
151         completion handler is called.
152
153         Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
154         changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
155
156         * Modules/encryptedmedia/MediaKeySession.cpp:
157         (WebCore::MediaKeySession::sessionIdChanged):
158         * Modules/encryptedmedia/MediaKeySession.h:
159         * platform/encryptedmedia/CDMInstanceSession.h:
160         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
161         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
162         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
163
164 2019-01-30  Keith Rollin  <krollin@apple.com>
165
166         FloatWithRect has invalid and inaccessible default constructor
167         https://bugs.webkit.org/show_bug.cgi?id=194057
168         <rdar://problem/47685211>
169
170         Reviewed by Zalan Bujtas.
171
172         FloatWithRect has a default constructor declared as 'default'. This
173         constructor is invalid because FloatWithRect has a data member that's
174         a reference that will not get initialized with this constructor. Since
175         it's invalid, and since it's private and not accessed by anything,
176         remove this constructor.
177
178         No new tests since there should be no observable behavior difference.
179
180         * rendering/line/LineLayoutState.h:
181
182 2019-01-30  Daniel Bates  <dabates@apple.com>
183
184         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
185         https://bugs.webkit.org/show_bug.cgi?id=192824
186         <rdar://problem/47100332>
187
188         Reviewed by Wenson Hsieh.
189
190         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
191         now that hardware key events to non-editable elements use the same code path as for editable elements. 
192
193         * platform/ios/KeyEventIOS.mm:
194         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
195         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
196         (WebCore::isFunctionKey): Ditto.
197         * platform/ios/WebEvent.mm:
198         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
199         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
200
201 2019-01-30  Jer Noble  <jer.noble@apple.com>
202
203         Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
204         https://bugs.webkit.org/show_bug.cgi?id=194063
205
206         Reviewed by Jon Lee.
207
208         * DerivedSources.make:
209
210 2019-01-30  Youenn Fablet  <youenn@apple.com>
211
212         Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
213         https://bugs.webkit.org/show_bug.cgi?id=193747
214         <rdar://problem/47498196>
215
216         Reviewed by Chris Dumez.
217
218         Make ServiceWorkerJob be no longer ref counted.
219         Instead its lifetime is fully controlled by ServiceWorkerContainer.
220
221         Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
222         This allows to ensure that these jobs do not stay forever.
223         Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
224
225         Before the patch, unsetPendingActivity was only called for successful jobs finishing.
226         In case of failing loads, ServiceWorkerContainer would leak.
227         Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
228         a pending activity in the job map next to the job.
229
230         When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
231         This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
232
233         Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
234         Update type of exception to be SecurityError when load fails due to AccessControl.
235
236         Covered by existing tests.
237
238         * workers/service/ServiceWorkerContainer.cpp:
239         (WebCore::ServiceWorkerContainer::addRegistration):
240         (WebCore::ServiceWorkerContainer::removeRegistration):
241         (WebCore::ServiceWorkerContainer::updateRegistration):
242         (WebCore::ServiceWorkerContainer::scheduleJob):
243         (WebCore::ServiceWorkerContainer::jobFailedWithException):
244         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
245         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
246         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
247         (WebCore::ServiceWorkerContainer::jobDidFinish):
248         (WebCore::ServiceWorkerContainer::stop):
249         (WebCore::ServiceWorkerContainer::job):
250         * workers/service/ServiceWorkerContainer.h:
251         * workers/service/ServiceWorkerJob.cpp:
252         (WebCore::ServiceWorkerJob::failedWithException):
253         (WebCore::ServiceWorkerJob::resolvedWithRegistration):
254         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
255         (WebCore::ServiceWorkerJob::startScriptFetch):
256         (WebCore::ServiceWorkerJob::didReceiveResponse):
257         (WebCore::ServiceWorkerJob::notifyFinished):
258         (WebCore::ServiceWorkerJob::cancelPendingLoad):
259         * workers/service/ServiceWorkerJob.h:
260         (WebCore::ServiceWorkerJob::hasPromise const):
261         (WebCore::ServiceWorkerJob::takePromise):
262         * workers/service/ServiceWorkerJobClient.h:
263         * workers/service/server/SWServerJobQueue.cpp:
264         (WebCore::SWServerJobQueue::scriptFetchFinished):
265
266 2019-01-30  Dean Jackson  <dino@apple.com>
267
268         PointerEvents - tiltX and tiltY are reversed
269         https://bugs.webkit.org/show_bug.cgi?id=194032
270         <rdar://problem/47674184>
271
272         Reviewed by Jon Lee.
273
274         I got tiltX and tiltY the wrong way around.
275
276         * dom/ios/PointerEventIOS.cpp: Flip the values.
277
278 2019-01-30  Zalan Bujtas  <zalan@apple.com>
279
280         [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
281         https://bugs.webkit.org/show_bug.cgi?id=194001
282
283         Reviewed by Antti Koivisto.
284
285         Skip to the next position manually. This is exactly what we do in simple line layout.
286
287         * layout/inlineformatting/InlineRunProvider.cpp:
288         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
289
290 2019-01-30  Simon Fraser  <simon.fraser@apple.com>
291
292         Add some basic geometry information to the scrolling tree
293         https://bugs.webkit.org/show_bug.cgi?id=194002
294         rdar://problem/47656294
295
296         Reviewed by Antti Koivisto.
297
298         To allow hit-testing in the scrolling tree, store a parent-relative scrollable
299         rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
300         of the scrollable area, and whose origin is relative to the parent scrolling tree node.
301         
302         Frame hosting nodes need this rect because they take care of the geometry offset between
303         an iframe and its scrolling tree ancestor in the parent document.
304         
305         Based on a patch by Frédéric Wang in bug 172917.
306
307         * page/scrolling/AsyncScrollingCoordinator.cpp:
308         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
309         * page/scrolling/ScrollingStateFrameHostingNode.cpp:
310         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
311         (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
312         (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
313         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
314         * page/scrolling/ScrollingStateFrameHostingNode.h:
315         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
316         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
317         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
318         * page/scrolling/ScrollingTreeFrameHostingNode.h:
319         (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
320         * rendering/RenderLayer.h:
321         * rendering/RenderLayerBacking.cpp:
322         (WebCore::RenderLayerBacking::updateScrollingLayers):
323         * rendering/RenderLayerCompositor.cpp:
324         (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
325         (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
326         (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
327         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
328         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
329         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
330         (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
331         * rendering/RenderLayerCompositor.h:
332
333 2019-01-30  Zalan Bujtas  <zalan@apple.com>
334
335         [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
336         https://bugs.webkit.org/show_bug.cgi?id=194020
337
338         Reviewed by Antti Koivisto.
339
340         Check the used margin variables whether we already computed before/after values.
341
342         Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
343
344         * layout/FormattingContextGeometry.cpp:
345         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
346
347 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
348
349         AX: Support color well on iOS
350         https://bugs.webkit.org/show_bug.cgi?id=194010
351
352         Reviewed by Joanmarie Diggs.
353
354         Test: accessibility/ios-simulator/color-well.html
355
356         Add support for color well on iOS.
357
358         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
359         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
360         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
361         (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
362         (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
363         * en.lproj/Localizable.strings:
364         * platform/LocalizedStrings.cpp:
365         (WebCore::AXColorWellText):
366         * platform/LocalizedStrings.h:
367
368 2019-01-30  Chris Fleizach  <cfleizach@apple.com>
369
370         AX: Role=switch not returning correct accessibilityValue
371         https://bugs.webkit.org/show_bug.cgi?id=194006
372
373         Reviewed by Joanmarie Diggs.
374
375         Return the toggle state of a role=switch element.        
376
377         Test: accessibility/ios-simulator/role-switch.html
378
379         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
380         (-[WebAccessibilityObjectWrapper accessibilityValue]):
381
382 2019-01-29  Rob Buis  <rbuis@igalia.com>
383
384         Align with Fetch on data: URLs
385         https://bugs.webkit.org/show_bug.cgi?id=182325
386
387         Reviewed by Alex Christensen.
388
389         Implement most remaining steps for data: URL processing [1].
390         Serialization is still to be implemented.
391
392         To make the code in DataURLDecoder::parseMediaType more efficient,
393         refactor ParsedContentType so that validation and parsing is done
394         in one pass.
395
396         Test: web-platform-tests/fetch/data-urls/processing.any.js
397
398         [1] https://fetch.spec.whatwg.org/#data-urls
399
400         * Modules/encryptedmedia/CDM.cpp:
401         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
402         * platform/network/DataURLDecoder.cpp:
403         (WebCore::DataURLDecoder::parseMediaType):
404         (WebCore::DataURLDecoder::DecodeTask::process):
405         * platform/network/MIMEHeader.cpp:
406         (WebCore::MIMEHeader::parseHeader):
407         * platform/network/ParsedContentType.cpp:
408         (WebCore::containsNewline):
409         (WebCore::ParsedContentType::parseContentType):
410         (WebCore::ParsedContentType::create):
411         (WebCore::isValidContentType):
412         (WebCore::ParsedContentType::ParsedContentType):
413         (WebCore::DummyParsedContentType::setContentType const): Deleted.
414         (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
415         (WebCore::parseContentType): Deleted.
416         * platform/network/ParsedContentType.h:
417
418 2019-01-29  Eric Carlson  <eric.carlson@apple.com>
419
420         [MSE] add more source buffer logging
421         https://bugs.webkit.org/show_bug.cgi?id=193995
422         <rdar://problem/47650399>
423
424         Reviewed by Jon Lee.
425
426         No new tests, no functional change.
427
428         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
429         (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
430         (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
431         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
432         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
433         (WebCore::SourceBufferPrivateAVFObjC::willSeek):
434         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
435
436 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
437
438         Add nodes to the scrolling tree in z-index order.
439         https://bugs.webkit.org/show_bug.cgi?id=192529
440         <rdar://problem/47402708>
441
442         Reviewed by Dean Jackson.
443
444         We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
445         This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
446         walks to find them.
447
448         With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
449         tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
450         (which makes it so that the scrolling tree correctly reflects layer z-order).
451
452         The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
453         nodes in their parent document.
454
455         There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
456         was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
457         to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
458
459         updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
460         and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
461
462         Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
463                scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
464
465         * page/scrolling/ScrollingStateTree.cpp:
466         (WebCore::ScrollingStateTree::insertNode):
467         * page/scrolling/ScrollingTreeNode.cpp:
468         (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
469         * platform/Logging.cpp:
470         (WebCore::initializeLogChannelsIfNecessary):
471         * rendering/RenderLayer.cpp:
472         (WebCore::RenderLayer::setParent):
473         (WebCore::RenderLayer::calculateClipRects const):
474         * rendering/RenderLayerBacking.cpp:
475         (WebCore::RenderLayerBacking::~RenderLayerBacking):
476         (WebCore::RenderLayerBacking::willBeDestroyed):
477         (WebCore::RenderLayerBacking::updateGeometry):
478         (WebCore::RenderLayerBacking::updateBackgroundLayer):
479         (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
480         * rendering/RenderLayerBacking.h:
481         * rendering/RenderLayerCompositor.cpp:
482         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
483         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
484         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
485         (WebCore::frameHostingNodeForFrame):
486         (WebCore::RenderLayerCompositor::updateCompositingLayers):
487         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
488         (WebCore::RenderLayerCompositor::updateBacking):
489         (WebCore::RenderLayerCompositor::layerWillBeRemoved):
490         (WebCore::RenderLayerCompositor::setIsInWindow):
491         (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
492         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
493         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
494         (WebCore::RenderLayerCompositor::attachScrollingNode):
495         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
496         (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
497         (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
498         (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
499         (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
500         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
501         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
502         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
503         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
504         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
505         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
506         (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
507         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
508         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
509         (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
510         (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
511         (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
512         (WebCore::canCoordinateScrollingForLayer): Deleted.
513         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
514         (WebCore::enclosingScrollingNodeID): Deleted.
515         (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
516         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
517         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
518         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
519         * rendering/RenderLayerCompositor.h:
520
521 2019-01-29  Brent Fulgham  <bfulgham@apple.com>
522
523         Make sure we have a frame before trying to access its loader 
524         https://bugs.webkit.org/show_bug.cgi?id=193985
525         <rdar://problem/47618239>
526
527         Reviewed by Ryosuke Niwa.
528
529         * loader/ResourceLoadObserver.cpp:
530         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
531
532 2019-01-29  Andy Estes  <aestes@apple.com>
533
534         Try to fix the watchOS build.
535
536         * dom/Element.cpp:
537
538 2019-01-29  Simon Fraser  <simon.fraser@apple.com>
539
540         REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
541         https://bugs.webkit.org/show_bug.cgi?id=193907
542         rdar://problem/47604080
543
544         Reviewed by Frédéric Wang.
545
546         Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
547         state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
548         show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
549         commit would re-create the tree node, but the state node would only have a subset of the
550         change flags set, so the new tree node would fail to get all of the state (for example, it
551         would be missing layers and scrolling geometry).
552
553         Fix by ensuring that when we reparent state node subtrees, we set all the change flags
554         so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
555         Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
556         set the right change flags.
557
558         This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
559         information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
560         as we encounter them in the tree walk.
561         
562         Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
563
564         Test: compositing/geometry/composited-frame-contents.html
565
566         * page/scrolling/ScrollingStateFixedNode.cpp:
567         (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
568         * page/scrolling/ScrollingStateFixedNode.h:
569         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
570         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
571         * page/scrolling/ScrollingStateFrameScrollingNode.h:
572         * page/scrolling/ScrollingStateNode.cpp:
573         (WebCore::ScrollingStateNode::setPropertyChanged):
574         (WebCore::ScrollingStateNode::setAllPropertiesChanged):
575         * page/scrolling/ScrollingStateNode.h:
576         (WebCore::ScrollingStateNode::setPropertyChangedBit):
577         * page/scrolling/ScrollingStateScrollingNode.cpp:
578         (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
579         * page/scrolling/ScrollingStateScrollingNode.h:
580         * page/scrolling/ScrollingStateStickyNode.cpp:
581         (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
582         * page/scrolling/ScrollingStateStickyNode.h:
583         * page/scrolling/ScrollingStateTree.cpp:
584         (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
585         if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
586         other nodeID which can result in type confusion later.
587         (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
588         (WebCore::ScrollingStateTree::commit):
589         (WebCore::ScrollingStateTree::willRemoveNode):
590         (WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
591         * page/scrolling/ScrollingStateTree.h:
592         (WebCore::ScrollingStateTree::removedNodes const): Deleted.
593         * page/scrolling/ScrollingTree.cpp:
594         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
595         (WebCore::ScrollingTree::commitTreeState):
596         (WebCore::ScrollingTree::updateTreeFromStateNode):
597         (WebCore::ScrollingTree::latchedNode):
598         (WebCore::ScrollingTree::setLatchedNode):
599         (WebCore::ScrollingTree::clearLatchedNode):
600         (WebCore::ScrollingTree::scrollingTreeAsText):
601         (WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
602         * page/scrolling/ScrollingTree.h:
603         (WebCore::ScrollingTree::hasLatchedNode const):
604         * rendering/RenderLayerCompositor.cpp:
605         (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
606         setting its position doesn't offset it relative to the center.
607
608 2019-01-29  Justin Fan  <justin_fan@apple.com>
609
610         [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
611         https://bugs.webkit.org/show_bug.cgi?id=193926
612         <rdar://problem/47327648>
613
614         Reviewed by Myles C. Maxfield.
615
616         Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
617
618         Test: webgpu/vertex-buffer-triangle-strip.html
619
620         * Modules/webgpu/WebGPUVertexInputDescriptor.idl: 
621         * platform/graphics/gpu/GPUVertexInputDescriptor.h:
622         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
623         (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
624         (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
625
626 2019-01-29  Keith Rollin  <krollin@apple.com>
627
628         Add .xcfilelists to Run Script build phases
629         https://bugs.webkit.org/show_bug.cgi?id=193792
630         <rdar://problem/47201785>
631
632         Reviewed by Alex Christensen.
633
634         As part of supporting XCBuild, update the necessary Run Script build
635         phases in their Xcode projects to refer to their associated
636         .xcfilelist files.
637
638         Note that the addition of these files bumps the Xcode project version
639         number to something that's Xcode 10 compatible. This change means that
640         older versions of the Xcode IDE can't read these projects. Nor can it
641         fully load workspaces that refer to these projects (the updated
642         projects are shown as non-expandable placeholders). `xcodebuild` can
643         still build these projects; it's just that the IDE can't open them.
644
645         Make special accommodations for incorporating .xcfilelists from
646         WebKitAdditions.
647
648         No new tests since there should be no observable behavior difference.
649
650         * Configurations/Base.xcconfig:
651         * Configurations/DebugRelease.xcconfig:
652         * WebCore.xcodeproj/project.pbxproj:
653
654 2019-01-29  John Wilander  <wilander@apple.com>
655
656         Add data abstraction and validation for Ad Click Attribution
657         https://bugs.webkit.org/show_bug.cgi?id=193916
658         <rdar://problem/47603481>
659
660         Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
661
662         New API tests added.
663
664         Ad click attribution has two steps. First, the storage of an ad
665         campaign ID for a click that takes the user to a destination
666         site. Second, a conversion on the destination site that can be
667         attributed to the ad click.
668
669         This patch adds a class that represents a request for ad click
670         attribution. Validation makes sure that the bits of entropy
671         reported through this mechanism is limited.
672
673         This feature is experimental and off by default.
674
675         * Sources.txt:
676             Added loader/AdClickAttribution.cpp.
677         * WebCore.xcodeproj/project.pbxproj:
678         * loader/AdClickAttribution.cpp: Added.
679         (WebCore::AdClickAttribution::isValid const):
680         (WebCore::AdClickAttribution::setConversion):
681         (WebCore::AdClickAttribution::url const):
682         (WebCore::AdClickAttribution::referrer const):
683         * loader/AdClickAttribution.h: Added.
684         (WebCore::AdClickAttribution::Campaign::Campaign):
685         (WebCore::AdClickAttribution::Campaign::isValid const):
686         (WebCore::AdClickAttribution::Source::Source):
687         (WebCore::AdClickAttribution::Destination::Destination):
688         (WebCore::AdClickAttribution::Priority::Priority):
689         (WebCore::AdClickAttribution::Conversion::Conversion):
690         (WebCore::AdClickAttribution::Conversion::isValid const):
691         (WebCore::AdClickAttribution::AdClickAttribution):
692         (WebCore::AdClickAttribution::earliestTimeToSend const):
693         * loader/DocumentLoader.cpp:
694             Added missing #include "RuntimeEnabledFeatures.h".
695
696 2019-01-29  Zalan Bujtas  <zalan@apple.com>
697
698         [MathML] Move enum class ScriptType to MathMLScriptsElement.
699         https://bugs.webkit.org/show_bug.cgi?id=193969
700
701         Reviewed by Antti Koivisto.
702
703         * mathml/MathMLScriptsElement.cpp:
704         (WebCore::scriptTypeOf):
705         * mathml/MathMLScriptsElement.h:
706         * rendering/mathml/RenderMathMLScripts.cpp:
707         (WebCore::RenderMathMLScripts::scriptType const):
708         (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
709         (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
710         (WebCore::RenderMathMLScripts::verticalMetrics):
711         (WebCore::RenderMathMLScripts::layoutBlock):
712         * rendering/mathml/RenderMathMLScripts.h:
713         * rendering/mathml/RenderMathMLUnderOver.cpp:
714         (WebCore::RenderMathMLUnderOver::isValid const):
715         (WebCore::RenderMathMLUnderOver::under const):
716         (WebCore::RenderMathMLUnderOver::over const):
717         (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
718         (WebCore::RenderMathMLUnderOver::hasAccent const):
719         (WebCore::RenderMathMLUnderOver::layoutBlock):
720
721 2019-01-29  Chris Dumez  <cdumez@apple.com>
722
723         Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
724         https://bugs.webkit.org/show_bug.cgi?id=193848
725
726         Reviewed by Youenn Fablet.
727
728         * dom/Document.cpp:
729         * dom/MessageChannel.cpp:
730         (WebCore::MessageChannel::MessageChannel):
731         * dom/ScriptExecutionContext.cpp:
732         (WebCore::ScriptExecutionContext::contextIdentifier const):
733         * history/HistoryItem.cpp:
734         (WebCore::HistoryItem::HistoryItem):
735         * loader/DocumentLoader.cpp:
736         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
737         * page/DOMWindow.cpp:
738         (WebCore::DOMWindow::DOMWindow):
739         * platform/Process.cpp:
740         (WebCore::Process::identifier):
741         * workers/service/ServiceWorkerJobData.cpp:
742         (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
743         * workers/service/server/RegistrationDatabase.cpp:
744         (WebCore::RegistrationDatabase::importRecords):
745         * workers/service/server/SWServer.cpp:
746         (WebCore::SWServer::Connection::Connection):
747         (WebCore::SWServer::updateWorker):
748         * workers/service/server/SWServerRegistration.cpp:
749         (WebCore::generateServiceWorkerRegistrationIdentifier):
750         * workers/service/server/SWServerToContextConnection.cpp:
751         (WebCore::generateServerToContextConnectionIdentifier):
752
753
754 2019-01-29  Alex Christensen  <achristensen@webkit.org>
755
756         Use lambdas instead of member pointer functions for TransactionOperationImpl
757         https://bugs.webkit.org/show_bug.cgi?id=193933
758
759         Reviewed by Tim Horton.
760
761         No change in behavior.  This just makes it easier to add new parameters to these functions in a straightforward manner.
762
763         * Modules/indexeddb/IDBObjectStore.cpp:
764         (WebCore::IDBObjectStore::putOrAdd):
765         * Modules/indexeddb/IDBTransaction.cpp:
766         (WebCore::IDBTransaction::internalAbort):
767         (WebCore::IDBTransaction::commit):
768         (WebCore::IDBTransaction::createObjectStore):
769         (WebCore::IDBTransaction::renameObjectStore):
770         (WebCore::IDBTransaction::createIndex):
771         (WebCore::IDBTransaction::renameIndex):
772         (WebCore::IDBTransaction::doRequestOpenCursor):
773         (WebCore::IDBTransaction::iterateCursor):
774         (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
775         (WebCore::IDBTransaction::requestGetAllIndexRecords):
776         (WebCore::IDBTransaction::requestGetRecord):
777         (WebCore::IDBTransaction::requestIndexRecord):
778         (WebCore::IDBTransaction::requestCount):
779         (WebCore::IDBTransaction::requestDeleteRecord):
780         (WebCore::IDBTransaction::requestClearObjectStore):
781         (WebCore::IDBTransaction::requestPutOrAdd):
782         (WebCore::IDBTransaction::deleteObjectStore):
783         (WebCore::IDBTransaction::deleteIndex):
784         * Modules/indexeddb/IDBTransaction.h:
785         * Modules/indexeddb/client/TransactionOperation.h:
786         (WebCore::IDBClient::TransactionOperation::doComplete):
787         (WebCore::IDBClient::createTransactionOperation): Deleted.
788
789 2019-01-29  Zalan Bujtas  <zalan@apple.com>
790
791         [LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
792         https://bugs.webkit.org/show_bug.cgi?id=193964
793
794         Reviewed by Antti Koivisto.
795
796         * layout/blockformatting/BlockMarginCollapse.cpp:
797         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
798
799 2019-01-29  Zalan Bujtas  <zalan@apple.com>
800
801         [LFC][BFC] Do not ignore next sibling box while laying out BFC.
802         https://bugs.webkit.org/show_bug.cgi?id=193954
803
804         Reviewed by Antti Koivisto.
805
806         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)
807         Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins.
808
809         * layout/blockformatting/BlockFormattingContext.cpp:
810         (WebCore::Layout::BlockFormattingContext::layout const):
811         (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
812         * layout/blockformatting/BlockFormattingContext.h:
813         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
814         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
815
816 2019-01-29  Zalan Bujtas  <zalan@apple.com>
817
818         [LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough
819         https://bugs.webkit.org/show_bug.cgi?id=193948
820
821         Reviewed by Antti Koivisto.
822
823         This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight().
824
825         * layout/blockformatting/BlockMarginCollapse.cpp:
826         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
827
828 2019-01-29  Zalan Bujtas  <zalan@apple.com>
829
830         [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after.
831         https://bugs.webkit.org/show_bug.cgi?id=193952
832
833         Reviewed by Antti Koivisto.
834
835         * layout/blockformatting/BlockMarginCollapse.cpp:
836         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
837
838 2019-01-29  Frederic Wang  <fwang@igalia.com>
839
840         Allow scrolling tree nodes to exist in a detached state
841         https://bugs.webkit.org/show_bug.cgi?id=193754
842
843         Unreviewed build warning fix.
844
845         * page/scrolling/ScrollingStateTree.cpp:
846         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove
847         unused variable.
848
849 2019-01-28  Ryosuke Niwa  <rniwa@webkit.org>
850
851         User agent string override for navigator.userAgent should be site specific quirks
852         https://bugs.webkit.org/show_bug.cgi?id=193950
853
854         Reviewed by Brent Fulgham.
855
856         In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
857         we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
858         without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
859         had been disabled or not.
860
861         * loader/DocumentLoader.h:
862         (WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
863         (WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
864         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
865         (WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
866         * loader/FrameLoader.cpp:
867         (WebCore::FrameLoader::userAgentForJavaScript const):
868
869 2019-01-28  Devin Rousso  <drousso@apple.com>
870
871         Web Inspector: provide a way to edit page WebRTC settings on a remote target
872         https://bugs.webkit.org/show_bug.cgi?id=193863
873         <rdar://problem/47572764>
874
875         Reviewed by Joseph Pecoraro.
876
877         Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
878               inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
879
880         * inspector/agents/InspectorPageAgent.cpp:
881
882         * page/Settings.yaml:
883         * page/SettingsBase.h:
884         * page/SettingsBase.cpp:
885         (SettingsBase::iceCandidateFilteringEnabledChanged): Added.
886         (SettingsBase::mockCaptureDevicesEnabledChanged): Added.
887         * Scripts/GenerateSettings.rb:
888         * Scripts/SettingsTemplates/Settings.cpp.erb:
889         Add page-level settings for WebRTC preferences.
890
891         * Modules/mediastream/UserMediaController.cpp:
892         (WebCore::UserMediaController::canCallGetUserMedia):
893
894         * testing/InternalSettings.cpp:
895         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
896
897         * testing/Internals.h:
898         * testing/Internals.cpp:
899         (WebCore::Internals::Internals):
900         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
901         (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
902
903         * page/DeprecatedGlobalSettings.h:
904         * page/DeprecatedGlobalSettings.cpp:
905         (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
906         (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
907         (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
908         (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
909
910 2019-01-28  Jer Noble  <jer.noble@apple.com>
911
912         webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
913         https://bugs.webkit.org/show_bug.cgi?id=193923
914         <rdar://problem/45956595>
915
916         Reviewed by Eric Carlson.
917
918         The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
919         and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
920         setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
921
922         * html/HTMLMediaElement.cpp:
923         (WebCore::HTMLMediaElement::clearMediaPlayer):
924         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
925         (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
926         (WebCore::HTMLMediaElement::dispatchEvent):
927         * html/HTMLMediaElement.h:
928
929 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
930
931         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
932         https://bugs.webkit.org/show_bug.cgi?id=193941
933
934         Reviewed by Alex Christensen.
935
936         * css/CSSBasicShapes.cpp:
937         * css/CSSPrimitiveValue.cpp:
938         * css/parser/CSSParser.cpp:
939         * css/parser/CSSParserSelector.cpp:
940         * css/parser/CSSPropertyParser.cpp:
941         * dom/Document.cpp:
942         * dom/EventListenerMap.cpp:
943         * dom/EventTarget.cpp:
944         * editing/Editor.cpp:
945         * html/HTMLElement.cpp:
946         * html/HTMLFontElement.cpp:
947         * html/parser/HTMLTokenizer.cpp:
948         * html/track/TrackBase.cpp:
949         * loader/FTPDirectoryParser.cpp:
950         * loader/TextResourceDecoder.cpp:
951         * loader/cache/CachedResource.cpp:
952         * page/ContextMenuController.cpp:
953         * page/Navigator.cpp:
954         * platform/Length.cpp:
955         * platform/cocoa/KeyEventCocoa.mm:
956         * platform/graphics/FontCascade.cpp:
957         * platform/graphics/WidthIterator.cpp:
958         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
959         * platform/ios/KeyEventIOS.mm:
960         * platform/mac/KeyEventMac.mm:
961         * platform/network/HTTPParsers.cpp:
962         * platform/text/TextCodecUTF8.cpp:
963         * platform/text/TextEncodingRegistry.cpp:
964         * platform/win/KeyEventWin.cpp:
965         * rendering/BidiRun.cpp:
966         * rendering/FloatingObjects.cpp:
967         * rendering/RenderBlock.cpp:
968         * rendering/RenderListMarker.cpp:
969         * rendering/RenderText.cpp:
970
971 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
972
973         [Win] WebCore/platform/Process.h is conflicting with process.h
974         https://bugs.webkit.org/show_bug.cgi?id=193944
975
976         Reviewed by Ross Kirsling.
977
978         Windows has process.h. Rename Process.h to ProcessIdentifier.h.
979
980         No new tests because there is no behavior change.
981
982         * Sources.txt:
983         * UnifiedSources-input.xcfilelist:
984         * WebCore.xcodeproj/project.pbxproj:
985         * dom/MessagePortIdentifier.h:
986         * dom/messageports/MessagePortChannel.h:
987         * dom/messageports/MessagePortChannelProvider.h:
988         * dom/messageports/MessagePortChannelRegistry.h:
989         * history/BackForwardItemIdentifier.h:
990         * page/GlobalWindowIdentifier.h:
991         * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
992         (WebCore::Process::setIdentifier):
993         (WebCore::Process::identifier):
994         * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
995
996 2019-01-28  Antoine Quint  <graouts@apple.com>
997
998         Implement capture for Pointer Events on iOS
999         https://bugs.webkit.org/show_bug.cgi?id=193917
1000         <rdar://problem/47605689>
1001
1002         Reviewed by Dean Jackson.
1003
1004         We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
1005         to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
1006         and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
1007         releasePointerCapture().
1008
1009         Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
1010                pointerevents/ios/pointer-events-implicit-capture-release-exception.html
1011                pointerevents/ios/pointer-events-implicit-capture-release.html
1012                pointerevents/ios/pointer-events-implicit-capture.html
1013                pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
1014
1015         * Sources.txt:
1016         * WebCore.xcodeproj/project.pbxproj:
1017         * dom/Element.cpp:
1018         (WebCore::Element::setPointerCapture):
1019         (WebCore::Element::releasePointerCapture):
1020         (WebCore::Element::hasPointerCapture):
1021         * dom/Element.h:
1022         * dom/Element.idl:
1023         * dom/EventNames.h:
1024         * dom/PointerEvent.h:
1025         * page/Page.cpp:
1026         (WebCore::Page::Page):
1027         * page/Page.h:
1028         (WebCore::Page::pointerCaptureController const):
1029         * page/PointerCaptureController.cpp: Added.
1030         (WebCore::PointerCaptureController::PointerCaptureController):
1031         (WebCore::PointerCaptureController::setPointerCapture):
1032         (WebCore::PointerCaptureController::releasePointerCapture):
1033         (WebCore::PointerCaptureController::hasPointerCapture):
1034         (WebCore::PointerCaptureController::pointerLockWasApplied):
1035         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
1036         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
1037         (WebCore::PointerCaptureController::pointerEventWasDispatched):
1038         (WebCore::PointerCaptureController::processPendingPointerCapture):
1039         * page/PointerCaptureController.h: Added.
1040         * page/PointerLockController.cpp:
1041         (WebCore::PointerLockController::requestPointerLock):
1042         * page/PointerLockController.h:
1043
1044 2019-01-28  Andy Estes  <aestes@apple.com>
1045
1046         [watchOS] Enable Parental Controls content filtering
1047         https://bugs.webkit.org/show_bug.cgi?id=193939
1048         <rdar://problem/46641912>
1049
1050         Reviewed by Ryosuke Niwa.
1051
1052         * Configurations/FeatureDefines.xcconfig:
1053
1054 2019-01-28  Dean Jackson  <dino@apple.com>
1055
1056         Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
1057         https://bugs.webkit.org/show_bug.cgi?id=193945
1058         <rdar://problem/47618922>
1059
1060         Reviewed by Antoine Quint.
1061
1062         Calculate the pressure, tiltX and tiltY values for incoming
1063         Pointer Events, which have values when the PlatformTouchEvent
1064         originated from a stylus.
1065
1066         Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
1067
1068         * dom/PointerEvent.h: Default to "mouse".
1069         * dom/ios/PointerEventIOS.cpp: Calculate the values.
1070
1071 2019-01-28  Timothy Hatcher  <timothy@apple.com>
1072
1073         Make it easier for non-Apple ports to enable dark mode CSS support.
1074         https://bugs.webkit.org/show_bug.cgi?id=193882
1075
1076         Reviewed by Megan Gardner.
1077
1078         * page/FrameView.cpp:
1079         (WebCore::FrameView::updateBackgroundRecursively): Limit use of system
1080         background color to the Mac platform.
1081         * rendering/RenderTheme.cpp:
1082         (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
1083         (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
1084         (WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
1085         * rendering/RenderTheme.h:
1086         (WebCore::RenderTheme::colorCache const): Deleted.
1087         * rendering/RenderThemeMac.h:
1088         * rendering/RenderThemeMac.mm:
1089         (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
1090         (WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
1091         (WebCore::RenderThemeMac::colorCache const): Deleted.
1092
1093 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
1094
1095         svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
1096         https://bugs.webkit.org/show_bug.cgi?id=193930
1097
1098         Reviewed by Tim Horton.
1099
1100         ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
1101         before iterating, since iteration mutates the array.
1102
1103         Tested by ASan tests.
1104
1105         * page/scrolling/ScrollingStateNode.h:
1106         (WebCore::ScrollingStateNode::takeChildren):
1107         * page/scrolling/ScrollingStateTree.cpp:
1108         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1109
1110 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
1111
1112         css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
1113         https://bugs.webkit.org/show_bug.cgi?id=193925
1114
1115         Reviewed by Tim Horton.
1116
1117         Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
1118         tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
1119         node if it's the node being unparented or destroyed.
1120
1121         Tested by existing tests.
1122
1123         * page/scrolling/ScrollingStateTree.cpp:
1124         (WebCore::ScrollingStateTree::unparentNode):
1125         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1126
1127 2019-01-28  Daniel Bates  <dabates@apple.com>
1128
1129         [iOS] Make Window virtual key code computation match Mac
1130         https://bugs.webkit.org/show_bug.cgi?id=193452
1131
1132         Reviewed by Ryosuke Niwa.
1133
1134         Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
1135         web compatibility. On Mac, we prefer to compute the  Windows virtual key code from the input
1136         strings of the key event and use the key event's keycode as a last resort.
1137
1138         Test: fast/events/ios/key-events-meta-alt-combinations.html
1139
1140         * platform/ios/PlatformEventFactoryIOS.h:
1141         * platform/ios/PlatformEventFactoryIOS.mm:
1142         (WebCore::isKeypadEvent): Added.
1143         (WebCore::windowsKeyCodeForKeyEvent): Added.
1144         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
1145         WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
1146
1147 2019-01-28  Antoine Quint  <graouts@apple.com>
1148
1149         Limit user-agent interactions based on the touch-action property on iOS
1150         https://bugs.webkit.org/show_bug.cgi?id=193447
1151
1152         Unreviewed build fix.
1153
1154         * dom/Element.cpp:
1155         (WebCore::parentCrossingFrameBoundaries):
1156
1157 2019-01-28  Eric Carlson  <eric.carlson@apple.com>
1158
1159         AVStreamSession isn't always available, make a HAVE compile flag for it
1160         https://bugs.webkit.org/show_bug.cgi?id=193889
1161         <rdar://problem/47452863>
1162
1163         Reviewed by Jer Noble.
1164
1165         No new tests, no functional change.
1166
1167         * page/Settings.yaml:
1168         * page/SettingsBase.cpp:
1169         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
1170         * page/SettingsBase.h:
1171         * page/cocoa/SettingsBaseCocoa.mm:
1172         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
1173         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1174         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
1175         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1176         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1177
1178         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1179         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1180         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
1181         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1182
1183         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1184         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1185         
1186         Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
1187
1188         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
1189         -> isEqualToString.
1190         (WebCore::sourceBufferMap):
1191         (WebCore::nextMapID):
1192         (WebCore::bufferWasConsumedCallback):
1193         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1194         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1195         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
1196         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1197         (WebCore::SourceBufferPrivateAVFObjC::append):
1198         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
1199         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
1200         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1201         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
1202         (-[WebBufferConsumedContext initWithParent:]): Deleted.
1203         (-[WebBufferConsumedContext parent]): Deleted.
1204
1205 2019-01-28  Rob Buis  <rbuis@igalia.com>
1206
1207         Update MIME type parser
1208         https://bugs.webkit.org/show_bug.cgi?id=180526
1209
1210         Reviewed by Frédéric Wang.
1211
1212         I overlooked step 11.9.3 [1], for Mimesniff we should not
1213         bail out on missing subtype, but keep trying. Note
1214         that Rfc2045 does require bailing out, as before.
1215
1216         Test: ParsedContentType unittest
1217
1218         [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
1219
1220         * platform/network/ParsedContentType.cpp:
1221         (WebCore::parseToken):
1222         (WebCore::parseContentType):
1223
1224 2019-01-28  Michael Catanzaro  <mcatanzaro@igalia.com>
1225
1226         Unreviewed follow-up to r240557, restore a call to makeString
1227         https://bugs.webkit.org/show_bug.cgi?id=192742
1228         <rdar://problem/46757369>
1229
1230         It works if we add this #include that was missing. I got confused by the error messages and
1231         missed that there were two similarly-named headers.
1232
1233         * rendering/RenderLayerCompositor.cpp:
1234         (WebCore::RenderLayerCompositor::logLayerInfo):
1235
1236 2019-01-28  Oriol Brufau  <obrufau@igalia.com>
1237
1238         [css-logical] Reject unitless length quirk in 'inset' shorthand
1239         https://bugs.webkit.org/show_bug.cgi?id=193773
1240
1241         Reviewed by Manuel Rego Casasnovas.
1242
1243         Even though its longhands ('top', 'right', 'bottom', 'left') accept the
1244         unitless length quirk, the 'inset' shorthand is a new CSS property and
1245         should reject it. This was resolved by the CSS WG in
1246         https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
1247
1248         Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
1249                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
1250                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
1251                imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
1252                imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
1253                imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
1254
1255         * css/parser/CSSPropertyParser.cpp:
1256         (WebCore::CSSPropertyParser::parseSingleValue):
1257
1258 2019-01-28  Zalan Bujtas  <zalan@apple.com>
1259
1260         [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
1261         https://bugs.webkit.org/show_bug.cgi?id=193896
1262
1263         Reviewed by Antti Koivisto.
1264
1265         This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
1266
1267         1. Collapsed quirk margin values are ignored on quirk containers
1268
1269             <body>
1270               <p> p elements have 1em vertical (top/bottom) quirk margin
1271             </body>
1272
1273             In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
1274             Used vertical margin values on the <body> are top: 8px bottom: 8px.
1275
1276         2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
1277
1278             <body>
1279               <div style="margin-top: 1px">
1280                 <p> p elements have 1em vertical (top/bottom) quirk margin
1281               </div>
1282             </body>
1283
1284             When <p>'s vertical margin collapses with the parent <div>,
1285             - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
1286             - the collapsed after value stays 1qem quirk value.
1287
1288             When <div> collapses with <body>
1289             - the collapsed before value becomes 16px (max(16px, 8px))
1290             - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
1291             Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
1292
1293         * layout/MarginTypes.h:
1294         (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
1295         * layout/blockformatting/BlockFormattingContext.h:
1296         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1297         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
1298         (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
1299         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
1300         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
1301         * layout/blockformatting/BlockMarginCollapse.cpp:
1302         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1303         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1304         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1305         (WebCore::Layout::computedPositiveAndNegativeMargin):
1306         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1307         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1308
1309 2019-01-28  Zalan Bujtas  <zalan@apple.com>
1310
1311         [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
1312         https://bugs.webkit.org/show_bug.cgi?id=193872
1313
1314         Reviewed by Antti Koivisto.
1315
1316         This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin(). 
1317
1318         * layout/blockformatting/BlockFormattingContext.cpp:
1319         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1320
1321 2019-01-28  cathie chen  <cathiechen@igalia.com>
1322
1323         Add missing #include in ScrollingTreeFrameScrollingNode.cpp
1324         https://bugs.webkit.org/show_bug.cgi?id=193905
1325
1326         Reviewed by Frédéric Wang.
1327
1328         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
1329         #include "ScrollingStateFrameScrollingNode.h"
1330
1331 2019-01-28  Zalan Bujtas  <zalan@apple.com>
1332
1333         [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
1334         https://bugs.webkit.org/show_bug.cgi?id=193894
1335
1336         Reviewed by Antti Koivisto.
1337
1338         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1339         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1340
1341 2019-01-28  Antoine Quint  <graouts@apple.com>
1342
1343         Limit user-agent interactions based on the touch-action property on iOS
1344         https://bugs.webkit.org/show_bug.cgi?id=193447
1345         <rdar://problem/47283874>
1346
1347         Reviewed by Antti Koivisto and Simon Fraser.
1348
1349         We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
1350         or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
1351         a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
1352         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
1353         actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
1354         crossing any frame boundary towards the top-level document's root node.
1355
1356         Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
1357                pointerevents/ios/touch-action-none-on-iframe.html
1358                pointerevents/ios/touch-action-none-on-parent.html
1359                pointerevents/ios/touch-action-none.html
1360                pointerevents/ios/touch-action-pan-x-pan-y.html
1361                pointerevents/ios/touch-action-pan-x.html
1362                pointerevents/ios/touch-action-pan-y.html
1363                pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
1364                pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
1365
1366         * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
1367         * dom/Document.cpp:
1368         (WebCore::Document::invalidateRenderingDependentRegions):
1369         (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
1370         list of elements with a non-auto touch-action property.
1371         (WebCore::Document::absoluteEventRegionForNode):
1372         (WebCore::Document::absoluteRegionForEventTargets):
1373         (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
1374         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
1375         of that list changed as a result, the scrolling coordinator is informed.
1376         * dom/Document.h:
1377         (WebCore::Document:: const):
1378         * dom/Element.cpp:
1379         (WebCore::parentCrossingFrameBoundaries):
1380         (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
1381         specified on this element and all of its hierarchy, crossing frame boundary.
1382         (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
1383         for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
1384         touch actions.
1385         * dom/Element.h:
1386         * page/scrolling/ScrollingCoordinator.cpp:
1387         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
1388         throughout the provided frame and all of its subframes.
1389         * page/scrolling/ScrollingCoordinator.h:
1390         (WebCore::ScrollableAreaParameters::operator== const): Deleted.
1391         * page/scrolling/ScrollingCoordinatorTypes.h: Added.
1392         (WebCore::ScrollableAreaParameters::operator== const):
1393         * page/scrolling/ScrollingTree.cpp:
1394         (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
1395         now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
1396         account for overlap and nesting.
1397         * page/scrolling/ScrollingTree.h:
1398         * page/scrolling/ScrollingTreeNode.h:
1399         * platform/EventTrackingRegions.cpp:
1400         (WebCore::operator==):
1401         * platform/EventTrackingRegions.h:
1402         (WebCore::operator!=):
1403         * style/StyleTreeResolver.cpp:
1404         (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
1405
1406 2019-01-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1407
1408         Unreviewed, fix WPE/GTK debug builds after r240557
1409         https://bugs.webkit.org/show_bug.cgi?id=192742
1410         <rdar://problem/46757369>
1411
1412         Also fix an improper format string that was recently added in a different commit.
1413
1414         * rendering/RenderLayerCompositor.cpp:
1415         (WebCore::RenderLayerCompositor::logLayerInfo):
1416         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1417
1418 2018-12-15  Darin Adler  <darin@apple.com>
1419
1420         Replace many uses of String::format with more type-safe alternatives
1421         https://bugs.webkit.org/show_bug.cgi?id=192742
1422
1423         Reviewed by Mark Lam.
1424
1425         A while back, String::format was more efficient than string concatenation,
1426         but that is no longer true, and we should prefer String::number, makeString,
1427         or concatenation with the "+" operator to String::format for new code.
1428
1429         This is not as good for programmers who are fond of printf formatting
1430         style, and in some cases it's a little harder to read the strings
1431         interspersed with variables rather than a format string, but it's better
1432         in a few ways:
1433
1434         - more efficient (I didn't measure the difference, but it's definitely
1435           slower to use String::Format which calls vsnprintf twice than to use
1436           the WTF code)
1437         - works in a type-safe way without a need to use a format specifier such
1438           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
1439           subtle differences between platforms
1440         - allows us to use StringView in some cases to sidestep the need to
1441           allocate temporary WTF::String objects
1442         - does not require converting each WTF::String to a C string, allowing
1443           us to remove many cases of ".utf8().data()" and similar expressions,
1444           eliminating the allocation of temporary WTF::CString objects
1445
1446         This patch covers a batch of easiest-to-convert call sites.
1447         Later patches will allow us to deprecate or remove String::format.
1448
1449         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1450         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
1451         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1452         (WebCore::IDBCursorInfo::loggingString const): Ditto.
1453         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
1454         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
1455         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
1456         (WebCore::IDBGetRecordData::loggingString const): Ditto.
1457         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
1458         (WebCore::IDBIndexInfo::loggingString const): Ditto.
1459         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
1460         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
1461         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
1462         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1463         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
1464         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1465         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
1466         * Modules/webdatabase/Database.cpp:
1467         (WebCore::formatErrorMessage): Ditto.
1468         * Modules/webdatabase/SQLError.h:
1469         (WebCore::SQLError::create): Ditto.
1470
1471         * bindings/scripts/CodeGeneratorJS.pm:
1472         (GenerateImplementation): Use makeString.
1473
1474         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1475         * bindings/scripts/test/JS/JSMapLike.cpp:
1476         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1477         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1478         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1479         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1480         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1481         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1482         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1483         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1484         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1485         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1486         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1487         * bindings/scripts/test/JS/JSTestException.cpp:
1488         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1489         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1490         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1491         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1492         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1493         * bindings/scripts/test/JS/JSTestInterface.cpp:
1494         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1495         * bindings/scripts/test/JS/JSTestIterable.cpp:
1496         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1497         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1498         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1499         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1500         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1501         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1502         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1503         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1504         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1505         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1506         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1507         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1508         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1509         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1510         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1511         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1512         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1513         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1514         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1515         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1516         * bindings/scripts/test/JS/JSTestNode.cpp:
1517         * bindings/scripts/test/JS/JSTestObj.cpp:
1518         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1519         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1520         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1521         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1522         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1523         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1524         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1525         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1526         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1527         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1528         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1529         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1530         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1531         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1532         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1533         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1534         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1535         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1536         Updated expected results.
1537 :
1538         * css/parser/CSSPropertyParserHelpers.cpp:
1539         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
1540         and makeString.
1541
1542         * html/HTMLSelectElement.cpp:
1543         (WebCore::HTMLSelectElement::setLength): Use makeString.
1544         * html/ImageDocument.cpp:
1545         (WebCore::ImageDocument::imageUpdated): Ditto.
1546         * html/parser/XSSAuditor.cpp:
1547         (WebCore::XSSAuditor::init): Ditto.
1548         * inspector/InspectorFrontendClientLocal.cpp:
1549         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
1550         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
1551         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
1552         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
1553         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
1554         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
1555         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
1556         * page/MemoryRelease.cpp:
1557         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
1558
1559         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1560         (WebCore::formatByteNumber): Use String::number.
1561         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
1562
1563         * page/cocoa/ResourceUsageThreadCocoa.mm:
1564         (WebCore::logFootprintComparison): Use makeString.
1565         * platform/animation/TimingFunction.cpp:
1566         (WebCore::TimingFunction::cssText const): Ditto.
1567
1568         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1569         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
1570         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
1571         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
1572
1573         * platform/graphics/ca/GraphicsLayerCA.cpp:
1574         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
1575         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
1576         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
1577         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
1578         * platform/mock/MockRealtimeVideoSource.cpp:
1579         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1580
1581         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
1582
1583         * platform/network/ParsedContentRange.cpp:
1584         (WebCore::ParsedContentRange::headerValue const): Use makeString.
1585
1586         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
1587         compiler conditionals and reorganized the start/stop of namespaces.
1588         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
1589
1590         * platform/sql/SQLiteDatabase.cpp:
1591         (WebCore::unauthorizedSQLFunction): Use makeString.
1592         * rendering/RenderLayerCompositor.cpp:
1593         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1594         * workers/service/server/RegistrationDatabase.cpp:
1595         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
1596         (WebCore::RegistrationDatabase::importRecords): Ditto.
1597
1598 2019-01-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1599
1600         Remove a couple of PLATFORM defines intended for watchOS
1601         https://bugs.webkit.org/show_bug.cgi?id=193888
1602
1603         Reviewed by Alexey Proskuryakov.
1604
1605         Remove the use of !PLATFORM(WATCH), since this is true on every platform.
1606
1607         * editing/cocoa/DictionaryLookup.mm:
1608
1609 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
1610
1611         Use a load optimizer for some sites
1612         https://bugs.webkit.org/show_bug.cgi?id=193881
1613         <rdar://problem/46325455>
1614
1615         Reviewed by Brent Fulgham.
1616
1617         Expose FormData::flatten to be used by the load optimizer.
1618
1619         * WebCore.xcodeproj/project.pbxproj:
1620         * platform/network/FormData.h:
1621
1622 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
1623
1624         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
1625         https://bugs.webkit.org/show_bug.cgi?id=193879
1626
1627         Reviewed by Antti Koivisto.
1628
1629         Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
1630         This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
1631         makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
1632         updates of the scrolling tree node in an iframe.
1633         
1634         To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
1635         nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
1636         simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
1637         connect GraphicsLayers together.
1638         
1639         RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
1640
1641         Tested by existing tests.
1642
1643         * page/FrameView.h:
1644         * rendering/RenderLayer.cpp:
1645         (WebCore::outputPaintOrderTreeRecursive):
1646         * rendering/RenderLayerBacking.cpp:
1647         (WebCore::RenderLayerBacking::updateConfiguration):
1648         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1649         * rendering/RenderLayerCompositor.cpp:
1650         (WebCore::frameContentsRenderView):
1651         (WebCore::RenderLayerCompositor::frameContentsCompositor):
1652         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1653         (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
1654         (WebCore::RenderLayerCompositor::detachRootLayer):
1655         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1656         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1657         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
1658         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1659         (WebCore::RenderLayerCompositor::attachScrollingNode):
1660         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
1661         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1662         * rendering/RenderLayerCompositor.h:
1663         * testing/Internals.cpp:
1664         (WebCore::Internals::scrollingStateTreeAsText const):
1665
1666 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
1667
1668         AX: Introduce a static accessibility tree
1669         https://bugs.webkit.org/show_bug.cgi?id=193348
1670         <rdar://problem/47203295>
1671
1672         Reviewed by Ryosuke Niwa.
1673
1674         In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which 
1675         could be accessed on a different thread by assistive technologies.
1676         That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the 
1677         "live" AccessibilityObjects (which interact with both DOM and Render trees).
1678         These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree 
1679         representation and able to be read from anywhere.
1680         Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared 
1681         with AccessibilityObject.
1682         This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
1683
1684         * CMakeLists.txt:
1685         * Configurations/FeatureDefines.xcconfig:
1686         * Sources.txt:
1687         * WebCore.xcodeproj/project.pbxproj:
1688         * accessibility/AXObjectCache.cpp:
1689         (WebCore::AXObjectCache::remove):
1690         (WebCore::AXObjectCache::createIsolatedAccessibilityTree):
1691         (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
1692         * accessibility/AXObjectCache.h:
1693         * accessibility/AccessibilityObject.h:
1694         * accessibility/AccessibilityObjectInterface.h: Added.
1695         * accessibility/isolatedtree: Added.
1696         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
1697         (WebCore::AXIsolatedTree::treeCache):
1698         (WebCore::AXIsolatedTree::AXIsolatedTree):
1699         (WebCore::AXIsolatedTree::create):
1700         (WebCore::AXIsolatedTree::treeForID):
1701         (WebCore::AXIsolatedTree::treeForPageID):
1702         (WebCore::AXIsolatedTree::nodeForID const):
1703         (WebCore::AXIsolatedTree::rootNode):
1704         (WebCore::AXIsolatedTree::removeNode):
1705         (WebCore::AXIsolatedTree::appendNodeChanges):
1706         (WebCore::AXIsolatedTree::applyPendingChanges):
1707         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
1708         (WebCore::AXIsolatedTree::treeIdentifier const):
1709         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
1710             To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
1711             we may copy an existing node and replace specific values.
1712         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
1713         (WebCore::AXIsolatedTreeNode::create):
1714         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
1715         (WebCore::AXIsolatedTreeNode::setProperty):
1716         (WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
1717         (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
1718         (WebCore::AXIsolatedTreeNode::boolAttributeValue const):
1719         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
1720         (WebCore::AXIsolatedTreeNode::intAttributeValue const):
1721         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
1722         * accessibility/mac/AXObjectCacheMac.mm:
1723         (WebCore::AXObjectCache::associateIsolatedTreeNode):
1724         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1725         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1726         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
1727         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
1728         (-[WebAccessibilityObjectWrapperBase detach]):
1729         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1730         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
1731         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
1732         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1733         (-[WebAccessibilityObjectWrapper role]):
1734         (-[WebAccessibilityObjectWrapper subrole]):
1735         (-[WebAccessibilityObjectWrapper roleDescription]):
1736         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1737         * dom/Document.cpp:
1738         (WebCore::Document::pageID const):
1739         * dom/Document.h:
1740
1741 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
1742
1743         Allow scrolling tree nodes to exist in a detached state
1744         https://bugs.webkit.org/show_bug.cgi?id=193754
1745
1746         Reviewed by Zalan Bujtas.
1747
1748         One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
1749         is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
1750         in a connected state; attachToStateTree() required a non-zero parent for any node that was not
1751         the root.
1752
1753         This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
1754         the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
1755         can be attached. This is a significant difference from compositing, where a subframe can create
1756         GraphicsLayers which don't have to be parented right away, and actually get parented later via
1757         a compositing update in the parent frame.
1758
1759         We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
1760         connection (anything else is too confusing). So we need to be able to instantiate scrolling
1761         tree nodes in a disconnected state, and attach them later.
1762
1763         To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
1764         Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
1765         the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
1766         by m_stateNodeMap, so it's possible to find them and set state on them.
1767
1768         Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
1769         is really an implementation detail.
1770
1771         This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
1772         in m_orphanedSubframeNodes; now the unparenting is controlled by the client.
1773
1774         Currently no code creates unparented nodes so there is no behavior change.
1775
1776         * dom/Document.cpp:
1777         (WebCore::Document::setPageCacheState):
1778         * page/scrolling/AsyncScrollingCoordinator.cpp:
1779         (WebCore::AsyncScrollingCoordinator::createNode):
1780         (WebCore::AsyncScrollingCoordinator::insertNode):
1781         (WebCore::AsyncScrollingCoordinator::unparentNode):
1782         (WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
1783         (WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
1784         (WebCore::AsyncScrollingCoordinator::clearAllNodes):
1785         (WebCore::AsyncScrollingCoordinator::parentOfNode const):
1786         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
1787         (WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
1788         (WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
1789         (WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
1790         * page/scrolling/AsyncScrollingCoordinator.h:
1791         * page/scrolling/ScrollingCoordinator.h:
1792         (WebCore::ScrollingCoordinator::handleWheelEvent):
1793         (WebCore::ScrollingCoordinator::createNode):
1794         (WebCore::ScrollingCoordinator::insertNode):
1795         (WebCore::ScrollingCoordinator::unparentNode):
1796         (WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
1797         (WebCore::ScrollingCoordinator::detachAndDestroySubtree):
1798         (WebCore::ScrollingCoordinator::clearAllNodes):
1799         (WebCore::ScrollingCoordinator::parentOfNode const):
1800         (WebCore::ScrollingCoordinator::childrenOfNode const):
1801         (WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
1802         (WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
1803         (WebCore::ScrollingCoordinator::clearStateTree): Deleted.
1804         * page/scrolling/ScrollingStateNode.cpp:
1805         (WebCore::ScrollingStateNode::removeFromParent):
1806         (WebCore::ScrollingStateNode::removeChild):
1807         * page/scrolling/ScrollingStateNode.h:
1808         * page/scrolling/ScrollingStateTree.cpp:
1809         (WebCore::ScrollingStateTree::ScrollingStateTree):
1810         (WebCore::ScrollingStateTree::createUnparentedNode):
1811         (WebCore::ScrollingStateTree::insertNode):
1812         (WebCore::ScrollingStateTree::unparentNode):
1813         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1814         (WebCore::ScrollingStateTree::detachAndDestroySubtree):
1815         (WebCore::ScrollingStateTree::clear):
1816         (WebCore::ScrollingStateTree::commit):
1817         (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
1818         (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
1819         (showScrollingStateTree):
1820         (WebCore::ScrollingStateTree::attachNode): Deleted.
1821         (WebCore::ScrollingStateTree::detachNode): Deleted.
1822         * page/scrolling/ScrollingStateTree.h:
1823         (WebCore::ScrollingStateTree::nodeCount const):
1824         * rendering/RenderLayerBacking.cpp:
1825         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1826         * rendering/RenderLayerCompositor.cpp:
1827         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1828         (WebCore::RenderLayerCompositor::attachScrollingNode):
1829
1830 2019-01-26  Devin Rousso  <drousso@apple.com>
1831
1832         Web Inspector: provide a way to edit the user agent of a remote target
1833         https://bugs.webkit.org/show_bug.cgi?id=193862
1834         <rdar://problem/47359292>
1835
1836         Reviewed by Joseph Pecoraro.
1837
1838         Test: inspector/page/overrideUserAgent.html
1839
1840         * loader/FrameLoader.cpp:
1841         (WebCore::FrameLoader::userAgent const):
1842         (WebCore::FrameLoader::userAgentForJavaScript const):
1843
1844         * inspector/InspectorInstrumentation.h:
1845         (WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
1846         * inspector/InspectorInstrumentation.cpp:
1847         (WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.
1848
1849         * inspector/agents/InspectorPageAgent.h:
1850         * inspector/agents/InspectorPageAgent.cpp:
1851         (WebCore::InspectorPageAgent::disable):
1852         (WebCore::InspectorPageAgent::overrideUserAgent): Added.
1853         (WebCore::InspectorPageAgent::applyUserAgentOverride): Added.
1854
1855 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1856
1857         [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
1858         https://bugs.webkit.org/show_bug.cgi?id=193867
1859
1860         Reviewed by Antti Koivisto.
1861
1862         The initial content top/bottom value is the border top + padding top.
1863
1864         This is only a problem when the box has float children only. While computing the height using the bottom-most float,
1865         we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
1866         has (top)border/padding.
1867
1868         Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html
1869
1870         * layout/FormattingContextGeometry.cpp:
1871         (WebCore::Layout::contentHeightForFormattingContextRoot):
1872
1873 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1874
1875         [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
1876         https://bugs.webkit.org/show_bug.cgi?id=193865
1877
1878         Reviewed by Antti Koivisto.
1879
1880         Height computation ->
1881         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
1882         // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
1883         // margin does not collapse with the element's bottom margin
1884
1885         <div style="border: 1px solid green">
1886           <div style="margin-top: 100px;"></div>
1887         </div>
1888
1889         When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
1890         the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored. 
1891
1892         Test: fast/block/margin-collapse/collapsed-through-child-simple.html
1893
1894         * layout/MarginTypes.h:
1895         (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
1896         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1897         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1898         * layout/displaytree/DisplayBox.h:
1899         (WebCore::Display::Box::hasCollapsedThroughMargin const):
1900
1901 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1902
1903         [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
1904         https://bugs.webkit.org/show_bug.cgi?id=193864
1905
1906         Reviewed by Antti Koivisto.
1907
1908         * layout/blockformatting/BlockMarginCollapse.cpp:
1909         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
1910         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1911
1912 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1913
1914         [LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
1915         https://bugs.webkit.org/show_bug.cgi?id=193855
1916
1917         Reviewed by Antti Koivisto.
1918
1919         Use iterative algorithm to find next/previous siblings.
1920
1921         * layout/layouttree/LayoutBox.cpp:
1922         (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
1923
1924 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
1925
1926         Need a mechanism to override navigator.userAgent
1927         https://bugs.webkit.org/show_bug.cgi?id=193762
1928         <rdar://problem/47504939>
1929
1930         Reviewed by Brent Fulgham.
1931
1932         Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
1933
1934         * loader/DocumentLoader.h:
1935         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
1936         (WebCore::DocumentLoader::customJavaScriptUserAgent const):
1937         * loader/FrameLoader.cpp:
1938         (WebCore::FrameLoader::userAgentForJavaScript const):
1939         * loader/FrameLoader.h:
1940         * page/Navigator.cpp:
1941         (WebCore::Navigator::userAgent const):
1942
1943 2019-01-25  Devin Rousso  <drousso@apple.com>
1944
1945         Web Inspector: provide a way to edit page settings on a remote target
1946         https://bugs.webkit.org/show_bug.cgi?id=193813
1947         <rdar://problem/47359510>
1948
1949         Reviewed by Joseph Pecoraro.
1950
1951         Test: inspector/page/overrideSetting.html
1952
1953         * page/Settings.yaml:
1954         * Scripts/GenerateSettings.rb:
1955         * Scripts/SettingsTemplates/Settings.cpp.erb:
1956         * Scripts/SettingsTemplates/Settings.h.erb:
1957         Add support for an `inspectorOverride` boolean value for each setting that will take
1958         precedence over the actual `Setting`'s value when set.
1959
1960         * inspector/agents/InspectorPageAgent.h:
1961         * inspector/agents/InspectorPageAgent.cpp:
1962         (WebCore::InspectorPageAgent::disable):
1963         (WebCore::InspectorPageAgent::overrideSetting): Added.
1964
1965         * inspector/InspectorFrontendHost.idl:
1966         * inspector/InspectorFrontendHost.h:
1967         * inspector/InspectorFrontendHost.cpp:
1968         (WebCore::InspectorFrontendHost::isRemote const): Added.
1969         * inspector/InspectorFrontendClient.h:
1970         (WebCore::InspectorFrontendClient::isRemote const): Added.
1971         * inspector/InspectorFrontendClientLocal.h:
1972         (WebCore::InspectorFrontendClientLocal::isRemote const): Added.
1973
1974 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1975
1976         Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
1977         https://bugs.webkit.org/show_bug.cgi?id=193843
1978
1979         Reviewed by Zalan Bujtas.
1980
1981         * dom/Document.cpp:
1982         (WebCore::Document::updateMainArticleElementAfterLayout):
1983
1984         This function currently does a bit of wasted work after every layout, on clients that don't listen to the
1985         "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
1986         don't bother keeping the main article element up to date in this scenario by bailing from
1987         FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
1988         rendered text milestone.
1989
1990         * page/FrameView.cpp:
1991         (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
1992
1993 2019-01-25  Jer Noble  <jer.noble@apple.com>
1994
1995         <video> elements not in the DOM should be allowed to AirPlay
1996         https://bugs.webkit.org/show_bug.cgi?id=193837
1997         <rdar://42559491>
1998
1999         Reviewed by Eric Carlson.
2000
2001         Test: media/airplay-allows-buffering.html
2002
2003         Some websites will switch between <video> elements backed by MSE to one backed by
2004         a media file in order to implement an AirPlay control. But when a <video> element is
2005         removed from the DOM and paused, further buffering is blocked. For some ports (namely
2006         Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
2007         elements who have been asked to play wirelessly, but whose wireless playback has not
2008         started yet.
2009
2010         * html/MediaElementSession.cpp:
2011         (WebCore::MediaElementSession::dataBufferingPermitted const):
2012         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2013
2014 2019-01-25  Keith Rollin  <krollin@apple.com>
2015
2016         Update Xcode projects with "Check .xcfilelists" build phase
2017         https://bugs.webkit.org/show_bug.cgi?id=193790
2018         <rdar://problem/47201374>
2019
2020         Reviewed by Alex Christensen.
2021
2022         Support for XCBuild includes specifying inputs and outputs to various
2023         Run Script build phases. These inputs and outputs are specified as
2024         .xcfilelist files. Once created, these .xcfilelist files need to be
2025         kept up-to-date. In order to check that they are up-to-date or not,
2026         add an Xcode build step that invokes an external script that performs
2027         the checking. If the .xcfilelists are found to be out-of-date, update
2028         them, halt the build, and instruct the developer to restart the build
2029         with up-to-date files.
2030
2031         At this time, the checking and regenerating is performed only if the
2032         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
2033         who want to use this facility can set this variable and test out the
2034         checking/regenerating. Once it seems like there are no egregious
2035         issues that upset a developer's workflow, we'll unconditionally enable
2036         this facility.
2037
2038         No new tests since there should be no observable behavior difference.
2039
2040         * Scripts/check-xcfilelists.sh: Added.
2041         * WebCore.xcodeproj/project.pbxproj:
2042
2043 2019-01-25  Joseph Pecoraro  <pecoraro@apple.com>
2044
2045         Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
2046         https://bugs.webkit.org/show_bug.cgi?id=193796
2047         <rdar://problem/47532910>
2048
2049         Reviewed by Devin Rousso.
2050
2051         * page/ResourceUsageData.h:
2052         * inspector/agents/InspectorCPUProfilerAgent.cpp:
2053         (WebCore::InspectorCPUProfilerAgent::collectSample):
2054         Show the CPU usage without debugger threads in the Web Inspector's timeline.
2055
2056         * page/ResourceUsageThread.h:
2057         * page/cocoa/ResourceUsageThreadCocoa.mm:
2058         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
2059         For OS(DARWIN) ports, when starting to observe resource usage,
2060         we grab the mach_port_t of SamplingProfiler on the main thread
2061         in a thread safe way. For our purposes (Web Inspector timelines),
2062         this will be good enough to identify the SamplingProfiler thread
2063         during timeline recording. The SamplingProfiler thread won't change
2064         during a timeline recording and recording start/stops will never
2065         miss the SamplingProfiler changing.
2066
2067         (WebCore::filterThreads):
2068         (WebCore::threadSendRights):
2069         (WebCore::threadSendRightsExcludingDebuggerThreads):
2070         (WebCore::cpuUsage):
2071         (WebCore::ResourceUsageThread::platformCollectCPUData):
2072         Calculate CPU usage twice, the second time excluding some threads.
2073
2074         * page/linux/ResourceUsageThreadLinux.cpp:
2075         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
2076         (WebCore::ResourceUsageThread::platformCollectCPUData):
2077         Stubs for linux ports.
2078
2079 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2080
2081         Remove FrameView::m_significantRenderedTextMilestonePending
2082         https://bugs.webkit.org/show_bug.cgi?id=193842
2083
2084         Reviewed by Wenson Hsieh.
2085
2086         Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
2087         We can actually stop doing it right when the text content is above the threshold (regardless of whether all the conditions are met for the milestone).
2088         This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
2089
2090         * page/FrameView.cpp:
2091         (WebCore::FrameView::resetLayoutMilestones):
2092         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
2093         (WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
2094         (WebCore::FrameView::qualifiesAsSignificantRenderedText const):
2095         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2096         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
2097         * page/FrameView.h:
2098
2099 2019-01-25  Keith Rollin  <krollin@apple.com>
2100
2101         Update Xcode projects with "Apply Configuration to XCFileLists" build target
2102         https://bugs.webkit.org/show_bug.cgi?id=193781
2103         <rdar://problem/47201153>
2104
2105         Reviewed by Alex Christensen.
2106
2107         Part of generating the .xcfilelists used as part of adopting XCBuild
2108         includes running `make DerivedSources.make` from a standalone script.
2109         It’s important for this invocation to have the same environment as
2110         when the actual build invokes `make DerivedSources.make`. If the
2111         environments are different, then the two invocations will provide
2112         different results. In order to get the same environment in the
2113         standalone script, have the script launch xcodebuild targeting the
2114         "Apply Configuration to XCFileLists" build target, which will then
2115         re-invoke our standalone script. The script is now running again, this
2116         time in an environment with all workspace, project, target, xcconfig
2117         and other environment variables established.
2118
2119         The "Apply Configuration to XCFileLists" build target accomplishes
2120         this task via a small embedded shell script that consists only of:
2121
2122             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
2123
2124         The process that invokes "Apply Configuration to XCFileLists" first
2125         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
2126         evaluated and exports it into the shell environment. When xcodebuild
2127         is invoked, it inherits the value of this variable and can `eval` the
2128         contents of that variable. Our external standalone script can then set
2129         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
2130         of command-line parameters needed to restart itself in the appropriate
2131         state.
2132
2133         No new tests since there should be no observable behavior difference.
2134
2135         * WebCore.xcodeproj/project.pbxproj:
2136
2137 2019-01-25  Keith Rollin  <krollin@apple.com>
2138
2139         Update WebKitAdditions.xcconfig with correct order of variable definitions
2140         https://bugs.webkit.org/show_bug.cgi?id=193793
2141         <rdar://problem/47532439>
2142
2143         Reviewed by Alex Christensen.
2144
2145         XCBuild changes the way xcconfig variables are evaluated. In short,
2146         all config file assignments are now considered in part of the
2147         evaluation. When using the new build system and an .xcconfig file
2148         contains multiple assignments of the same build setting:
2149
2150         - Later assignments using $(inherited) will inherit from earlier
2151           assignments in the xcconfig file.
2152         - Later assignments not using $(inherited) will take precedence over
2153           earlier assignments. An assignment to a more general setting will
2154           mask an earlier assignment to a less general setting. For example,
2155           an assignment without a condition ('FOO = bar') will completely mask
2156           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
2157
2158         This affects some of our .xcconfig files, in that sometimes platform-
2159         or sdk-specific definitions appear before the general definitions.
2160         Under the new evaluations rules, the general definitions alway take
2161         effect because they always overwrite the more-specific definitions. The
2162         solution is to swap the order, so that the general definitions are
2163         established first, and then conditionally overwritten by the
2164         more-specific definitions.
2165
2166         No new tests since there should be no observable behavior difference.
2167
2168         * Configurations/Base.xcconfig:
2169         * Configurations/Version.xcconfig:
2170
2171 2019-01-25  Keith Rollin  <krollin@apple.com>
2172
2173         Update existing .xcfilelists
2174         https://bugs.webkit.org/show_bug.cgi?id=193791
2175         <rdar://problem/47201706>
2176
2177         Reviewed by Alex Christensen.
2178
2179         Many .xcfilelist files were added in r238824 in order to support
2180         XCBuild. Update these with recent changes to the set of build files
2181         and with the current generate-xcfilelist script.
2182
2183         No new tests since there should be no observable behavior difference.
2184
2185         * DerivedSources-input.xcfilelist:
2186         * DerivedSources-output.xcfilelist:
2187         * UnifiedSources-input.xcfilelist:
2188         * UnifiedSources-output.xcfilelist:
2189
2190 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
2191
2192         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2193         https://bugs.webkit.org/show_bug.cgi?id=193297
2194         <rdar://problem/47158841>
2195
2196         Reviewed by Alex Christensen.
2197
2198         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
2199
2200         * Modules/websockets/WebSocket.cpp:
2201         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
2202         * loader/ResourceLoadObserver.cpp:
2203         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
2204         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
2205         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
2206         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
2207         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2208         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2209
2210 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2211
2212         Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
2213         https://bugs.webkit.org/show_bug.cgi?id=193835
2214
2215         Reviewed by Simon Fraser.
2216
2217         Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
2218         By calling it from incrementVisually*() and setting the m_isVisuallyNonEmpty flag to true early does not have any impact on when the milestone is fired.
2219         The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
2220         However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
2221         Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
2222
2223         This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
2224
2225         * page/FrameView.cpp:
2226         (WebCore::FrameView::resetLayoutMilestones):
2227         (WebCore::FrameView::loadProgressingStatusChanged):
2228         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
2229         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2230         (WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
2231         * page/FrameView.h:
2232         (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
2233
2234 2019-01-25  David Kilzer  <ddkilzer@apple.com>
2235
2236         Move soft-linking of Lookup.framework out of LookupSPI.h
2237         <https://webkit.org/b/193815>
2238
2239         Reviewed by Tim Horton.
2240
2241         * editing/cocoa/DictionaryLookup.mm:
2242         - Remove unused header.
2243
2244         * editing/mac/DictionaryLookupLegacy.mm:
2245         (WebCore::tokenRange):
2246         (WebCore::showPopupOrCreateAnimationController):
2247         (WebCore::DictionaryLookup::hidePopup):
2248         - Move soft-linking to LookupSoftLink.{h,mm}.
2249
2250         * platform/ios/ValidationBubbleIOS.mm:
2251         (WebCore::ValidationBubble::show):
2252         - Update for changes to UIKitSoftLink.{h,mm} now that
2253           UIAccessibilityAnnouncementNotification is using
2254           SOFT_LINK_CONSTANT*().
2255
2256 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2257
2258         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
2259         https://bugs.webkit.org/show_bug.cgi?id=193829
2260
2261         Reviewed by Tim Horton.
2262
2263         No change in behavior.
2264
2265         * page/EventHandler.h:
2266         * page/ios/EventHandlerIOS.mm:
2267         (WebCore::EventHandler::tryToBeginDragAtPoint):
2268         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
2269         * platform/ios/WebItemProviderPasteboard.mm:
2270         (linkTemporaryItemProviderFilesToDropStagingDirectory):
2271
2272 2019-01-25  Jon Davis  <jond@apple.com>
2273
2274         Updated feature status for several features 
2275         https://bugs.webkit.org/show_bug.cgi?id=193794
2276
2277         Reviewed by Joseph Pecoraro.
2278         
2279         Updated feature status for the following: CSS Font Display,
2280         CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
2281         File and Directory Entries API, MediaStream Recording API,
2282         Readable Streams, Subresource Integrity, Visual Viewport API,
2283         and Web Audio.
2284
2285         * features.json:
2286
2287 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2288
2289         Need a way for JavaScript (or bundle) code to participate in undo
2290         https://bugs.webkit.org/show_bug.cgi?id=190009
2291         <rdar://problem/44807048>
2292
2293         Reviewed by Ryosuke Niwa.
2294
2295         Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
2296
2297         Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
2298                editing/undo-manager/undo-manager-add-item.html
2299                editing/undo-manager/undo-manager-delete-stale-undo-items.html
2300                editing/undo-manager/undo-manager-item-labels.html
2301                editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
2302
2303         * editing/CompositeEditCommand.h:
2304         * editing/CustomUndoStep.cpp:
2305         (WebCore::CustomUndoStep::didRemoveFromUndoManager):
2306
2307         Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
2308         the UndoItem, removing it from its UndoManager.
2309
2310         * editing/CustomUndoStep.h:
2311         * editing/Editor.cpp:
2312         (WebCore::Editor::registerCustomUndoStep):
2313
2314         Add a helper method to register a CustomUndoStep as a platform undoable step.
2315
2316         * editing/Editor.h:
2317         * editing/UndoStep.h:
2318         * page/UndoItem.h:
2319         (WebCore::UndoItem::undoManager const):
2320         * page/UndoManager.cpp:
2321         (WebCore::UndoManager::addItem):
2322
2323         Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
2324
2325         * page/UndoManager.h:
2326         * page/UndoManager.idl:
2327
2328         Mark addItem() as capable of throwing exceptions.
2329
2330 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2331
2332         [LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
2333         https://bugs.webkit.org/show_bug.cgi?id=193824
2334
2335         Reviewed by Antti Koivisto.
2336
2337         When clear property is set and floats are present, we have to estimate and set the box's vertical position during
2338         static positioning to be able to properly layout its subtree.
2339
2340         <div style="float: left; width: 100px; height: 100px;"></div>
2341         <div style="clear: left;">
2342           <div style="float: left; width: 100px; height: 100px;"></div>
2343         </div>
2344
2345         In the above example since the second float's parent clears the first float, the second float is positioned below
2346         the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
2347
2348         * layout/blockformatting/BlockFormattingContext.cpp:
2349         (WebCore::Layout::BlockFormattingContext::layout const):
2350         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2351         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2352         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
2353         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
2354         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2355         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
2356         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
2357         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
2358         * layout/blockformatting/BlockFormattingContext.h:
2359         * layout/blockformatting/BlockMarginCollapse.cpp:
2360         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2361         * layout/displaytree/DisplayBox.h:
2362
2363 2019-01-25  Zalan Bujtas  <zalan@apple.com>
2364
2365         [LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
2366         https://bugs.webkit.org/show_bug.cgi?id=193812
2367
2368         Reviewed by Antti Koivisto.
2369
2370         Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
2371
2372         * layout/blockformatting/BlockFormattingContext.cpp:
2373         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2374         * layout/blockformatting/BlockFormattingContext.h:
2375         * layout/blockformatting/BlockMarginCollapse.cpp:
2376         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
2377         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2378         * page/FrameViewLayoutContext.cpp:
2379         (WebCore::layoutUsingFormattingContext):
2380
2381 2019-01-25  Antoine Quint  <graouts@apple.com>
2382
2383         Use ENABLE_POINTER_EVENTS for the touch-action property
2384         https://bugs.webkit.org/show_bug.cgi?id=193819
2385
2386         Reviewed by Antti Koivisto.
2387
2388         Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
2389         Pointer Events specification of which the touch-action property is a part.
2390
2391         * css/CSSComputedStyleDeclaration.cpp:
2392         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2393         * css/CSSPrimitiveValueMappings.h:
2394         * css/CSSProperties.json:
2395         * css/CSSValueKeywords.in:
2396         * css/StyleBuilderConverter.h:
2397         * css/parser/CSSPropertyParser.cpp:
2398         (WebCore::CSSPropertyParser::parseSingleValue):
2399         * dom/Element.cpp:
2400         (WebCore::Element::allowsDoubleTapGesture const):
2401         * platform/TouchAction.h:
2402         * rendering/style/RenderStyle.h:
2403         * rendering/style/StyleRareNonInheritedData.cpp:
2404         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2405         (WebCore::StyleRareNonInheritedData::operator== const):
2406         * rendering/style/StyleRareNonInheritedData.h:
2407
2408 2019-01-24  Zalan Bujtas  <zalan@apple.com>
2409
2410         [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
2411         https://bugs.webkit.org/show_bug.cgi?id=193807
2412
2413         Reviewed by Simon Fraser.
2414
2415         Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
2416
2417         * layout/blockformatting/BlockFormattingContext.cpp:
2418         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2419         * layout/blockformatting/BlockFormattingContext.h:
2420         * layout/blockformatting/BlockMarginCollapse.cpp:
2421         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
2422         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
2423
2424 2019-01-24  Joseph Pecoraro  <pecoraro@apple.com>
2425
2426         Web Inspector: CPU Usage Timeline
2427         https://bugs.webkit.org/show_bug.cgi?id=193730
2428         <rdar://problem/46797201>
2429
2430         Reviewed by Devin Rousso.
2431
2432         Test: inspector/cpu-profiler/tracking.html
2433
2434         * Sources.txt:
2435         * UnifiedSources-input.xcfilelist:
2436         * WebCore.xcodeproj/project.pbxproj:
2437         New files.
2438
2439         * inspector/InspectorController.cpp:
2440         (WebCore::InspectorController::createLazyAgents):
2441         * inspector/InstrumentingAgents.cpp:
2442         (WebCore::InstrumentingAgents::reset):
2443         * inspector/InstrumentingAgents.h:
2444         (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
2445         (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
2446         Create and track the CPUProfilerAgent.
2447
2448         * inspector/agents/InspectorTimelineAgent.cpp:
2449         (WebCore::InspectorTimelineAgent::toggleInstruments):
2450         (WebCore::InspectorTimelineAgent::toggleCPUInstrument):
2451         Handle backend auto-start of the CPU instrument / timeline.
2452
2453         * inspector/agents/InspectorCPUProfilerAgent.h:
2454         * inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
2455         (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
2456         (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
2457         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
2458         (WebCore::InspectorCPUProfilerAgent::startTracking):
2459         (WebCore::InspectorCPUProfilerAgent::stopTracking):
2460         (WebCore::InspectorCPUProfilerAgent::collectSample):
2461         CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
2462
2463         * inspector/agents/InspectorTimelineAgent.h:
2464         * inspector/agents/InspectorMemoryAgent.cpp:
2465         (WebCore::InspectorMemoryAgent::startTracking):
2466         (WebCore::InspectorMemoryAgent::collectSample):
2467         Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
2468
2469         * page/ResourceUsageData.h:
2470         * page/ResourceUsageThread.cpp:
2471         (WebCore::ResourceUsageThread::addObserver):
2472         (WebCore::ResourceUsageThread::removeObserver):
2473         (WebCore::ResourceUsageThread::notifyObservers):
2474         (WebCore::ResourceUsageThread::recomputeCollectionMode):
2475         (WebCore::ResourceUsageThread::threadBody):
2476         * page/ResourceUsageThread.h:
2477         * page/cocoa/ResourceUsageOverlayCocoa.mm:
2478         (WebCore::ResourceUsageOverlay::platformInitialize):
2479         * page/cocoa/ResourceUsageThreadCocoa.mm:
2480         (WebCore::ResourceUsageThread::platformCollectCPUData):
2481         (WebCore::ResourceUsageThread::platformCollectMemoryData):
2482         (WebCore::ResourceUsageThread::platformThreadBody): Deleted.
2483         * page/linux/ResourceUsageOverlayLinux.cpp:
2484         (WebCore::ResourceUsageOverlay::platformInitialize):
2485         * page/linux/ResourceUsageThreadLinux.cpp:
2486         (WebCore::ResourceUsageThread::platformCollectCPUData):
2487         (WebCore::ResourceUsageThread::platformCollectMemoryData):
2488         (WebCore::ResourceUsageThread::platformThreadBody):
2489         Give each observer their own collection mode. The ResourceUsageThread
2490         will then collect data that is the union of all of the active observers.
2491         This allows collecting CPU and Memory data separately, reducing the cost
2492         of each when gathered individually.
2493
2494 2019-01-24  Charles Vazac  <cvazac@akamai.com>
2495
2496         Implement PerformanceObserver.supportedEntryTypes
2497         https://bugs.webkit.org/show_bug.cgi?id=193428
2498
2499         PerformanceObserver.supportedEntryTypes should return an array of
2500         entryTypes that can be observed per specification
2501         https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
2502
2503         Reviewed by Joseph Pecoraro.
2504
2505         This is covered by web-platform-tests
2506         LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
2507
2508         * page/PerformanceObserver.cpp:
2509         (WebCore::PerformanceObserver::supportedEntryTypes):
2510         * page/PerformanceObserver.h:
2511         * page/PerformanceObserver.idl:
2512
2513 2019-01-24  Truitt Savell  <tsavell@apple.com>
2514
2515         Unreviewed, rolling out r240446.
2516
2517         Casued 5 API failures
2518
2519         Reverted changeset:
2520
2521         "Activate the WebResourceLoadStatisticsStore in the
2522         NetworkProcess and deactivate it in the UIProcess."
2523         https://bugs.webkit.org/show_bug.cgi?id=193297
2524         https://trac.webkit.org/changeset/240446
2525
2526 2019-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2527
2528         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
2529         https://bugs.webkit.org/show_bug.cgi?id=193758
2530         <rdar://problem/43614978>
2531
2532         Reviewed by Tim Horton.
2533
2534         CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
2535         (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
2536         a helper method to select all the text inside of a text form control, called `selectInput`, which normally
2537         invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
2538         setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
2539         the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
2540
2541         This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
2542         reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
2543
2544         1.  Roll out this ancient demo hack, in favor of standardized behavior.
2545         2.  Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
2546             want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
2547             achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
2548             selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
2549             input, but everywhere else, it selects all the text in the input element.
2550
2551         This causes 6 existing layout tests to begin passing on iOS.
2552
2553         * html/HTMLInputElement.cpp:
2554         (WebCore::HTMLInputElement::updateFocusAppearance):
2555         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
2556         * html/HTMLInputElement.h:
2557         * html/HTMLTextFormControlElement.cpp:
2558         (WebCore::HTMLTextFormControlElement::select):
2559
2560 2019-01-24  Jer Noble  <jer.noble@apple.com>
2561
2562         Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
2563         https://bugs.webkit.org/show_bug.cgi?id=193778
2564
2565         Reviewed by Jon Lee.
2566
2567         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2568         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2569
2570 2019-01-24  Zalan Bujtas  <zalan@apple.com>
2571
2572         DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
2573         https://bugs.webkit.org/show_bug.cgi?id=193741
2574         <rdar://problem/47135030>
2575
2576         Reviewed by Antti Koivisto and Simon Fraser.
2577
2578         fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
2579             1. the received data is not "contentful" yet
2580             2. and we are expecting some more (loading is not complete yet)
2581             3. but no layout is initiated anymore
2582         nothing triggers the milestone firing.
2583
2584         This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
2585
2586         * page/FrameView.cpp:
2587         (WebCore::FrameView::FrameView):
2588         (WebCore::FrameView::loadProgressingStatusChanged):
2589
2590 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
2591
2592         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2593         https://bugs.webkit.org/show_bug.cgi?id=193297
2594         <rdar://problem/47158841>
2595
2596         Reviewed by Alex Christensen.
2597
2598         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
2599
2600         * Modules/websockets/WebSocket.cpp:
2601         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
2602         * loader/ResourceLoadObserver.cpp:
2603         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
2604         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
2605         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
2606         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
2607         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2608         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2609
2610 2019-01-24  John Wilander  <wilander@apple.com>
2611
2612         Add Ad Click Attribution as an internal/experimental feature
2613         https://bugs.webkit.org/show_bug.cgi?id=193685
2614         <rdar://problem/47450399>
2615
2616         Reviewed by Brent Fulgham.
2617
2618         Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
2619
2620         * html/HTMLAnchorElement.h:
2621         * html/HTMLAnchorElement.idl:
2622         * html/HTMLAttributeNames.in:
2623             Addeed two new experimental attributes:
2624             - adcampaignid: Ad campaign ID.
2625             - addestination: Ad link destination site.
2626         * page/RuntimeEnabledFeatures.h:
2627         (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
2628         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
2629         * page/Settings.yaml:
2630
2631 2019-01-24  Youenn Fablet  <youenn@apple.com>
2632
2633         Use MonotonicTime in WorkerRunLoop
2634         https://bugs.webkit.org/show_bug.cgi?id=193417
2635
2636         Reviewed by Saam Barati.
2637
2638         Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
2639         Ditto for WorkerRunLoop.
2640         No easy way to test the change which should not be easily observable.
2641
2642         * workers/WorkerRunLoop.cpp:
2643         (WebCore::WorkerRunLoop::runInMode):
2644
2645 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
2646
2647         Move FileSystem to WTF
2648         https://bugs.webkit.org/show_bug.cgi?id=193602
2649
2650         Reviewed by Yusuke Suzuki.
2651
2652         * Modules/encryptedmedia/CDM.cpp:
2653         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2654         * Modules/entriesapi/DOMFileSystem.cpp:
2655         * Modules/entriesapi/FileSystemEntry.cpp:
2656         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2657         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2658         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2659         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2660         * Modules/webdatabase/DatabaseTracker.cpp:
2661         * Modules/webdatabase/OriginLock.cpp:
2662         * Modules/webdatabase/OriginLock.h:
2663         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
2664         * PlatformMac.cmake:
2665         * PlatformPlayStation.cmake:
2666         * PlatformWin.cmake:
2667         * Sources.txt:
2668         * SourcesCocoa.txt:
2669         * WebCore.xcodeproj/project.pbxproj:
2670         * bindings/js/GCController.cpp:
2671         * dom/DataTransferItem.cpp:
2672         * editing/cocoa/WebContentReaderCocoa.mm:
2673         * fileapi/File.cpp:
2674         * fileapi/FileCocoa.mm:
2675         * html/FileInputType.cpp:
2676         * html/FileListCreator.cpp:
2677         * loader/appcache/ApplicationCacheHost.cpp:
2678         * loader/appcache/ApplicationCacheStorage.cpp:
2679         * page/Page.cpp:
2680         * page/SecurityOrigin.cpp:
2681         * page/SecurityOriginData.cpp:
2682         * platform/FileHandle.h:
2683         * platform/FileStream.cpp:
2684         * platform/FileStream.h:
2685         * platform/SharedBuffer.h:
2686         * platform/SourcesGLib.txt:
2687         * platform/cocoa/FileMonitorCocoa.mm:
2688         * platform/glib/FileMonitorGLib.cpp:
2689         * platform/glib/SharedBufferGlib.cpp:
2690         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2691         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2692         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2693         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2694         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2695         * platform/ios/QuickLook.mm:
2696         * platform/ios/WebItemProviderPasteboard.mm:
2697         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2698         * platform/network/BlobDataFileReference.cpp:
2699         * platform/network/BlobRegistryImpl.cpp:
2700         * platform/network/BlobResourceHandle.cpp:
2701         * platform/network/FormData.cpp:
2702         * platform/network/cf/FormDataStreamCFNet.cpp:
2703         * platform/network/cocoa/ResourceRequestCocoa.mm:
2704         * platform/network/curl/CookieJarDB.cpp:
2705         * platform/network/curl/CurlCacheEntry.h:
2706         * platform/network/curl/CurlCacheManager.cpp:
2707         * platform/network/curl/CurlFormDataStream.h:
2708         * platform/network/curl/CurlRequest.h:
2709         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2710         * platform/network/curl/ResourceHandleCurl.cpp:
2711         * platform/network/mac/BlobDataFileReferenceMac.mm:
2712         * platform/network/soup/ResourceHandleSoup.cpp:
2713         * platform/network/soup/SoupNetworkSession.cpp:
2714         * platform/posix/SharedBufferPOSIX.cpp:
2715         * platform/sql/SQLiteFileSystem.cpp:
2716         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2717         * platform/win/SearchPopupMenuDB.cpp:
2718         * rendering/RenderTheme.cpp:
2719         * rendering/RenderThemeGtk.cpp:
2720         * rendering/RenderThemeWin.cpp:
2721         * workers/service/server/RegistrationDatabase.cpp:
2722
2723 2019-01-24  Zalan Bujtas  <zalan@apple.com>
2724
2725         [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
2726         https://bugs.webkit.org/show_bug.cgi?id=193768
2727
2728         Reviewed by Antti Koivisto.
2729
2730         When it comes to the actual used values it does not really matter, only from correctness point of view.
2731         (This patch also moves some checks to their correct place.)
2732
2733         * layout/blockformatting/BlockMarginCollapse.cpp:
2734         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2735         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2736         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2737         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
2738         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
2739         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2740
2741 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
2742
2743         Add "frame hosting" nodes to the scrolling tree
2744         https://bugs.webkit.org/show_bug.cgi?id=193753
2745
2746         Reviewed by Antti Koivisto.
2747
2748         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
2749         require the iframe's scrolling node to get reparented in a new ancestor, which requires
2750         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
2751
2752         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
2753         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
2754         to provide a consistent parent node for the subframe's scrolling node.
2755
2756         This patch adds the node types, but does not instantiate them yet.
2757
2758         * Sources.txt:
2759         * WebCore.xcodeproj/project.pbxproj:
2760         * page/scrolling/ScrollingCoordinator.cpp:
2761         (WebCore::operator<<):
2762         * page/scrolling/ScrollingCoordinator.h:
2763         * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
2764         (WebCore::ScrollingStateFrameHostingNode::create):
2765         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
2766         (WebCore::ScrollingStateFrameHostingNode::clone):
2767         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
2768         * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
2769         * page/scrolling/ScrollingStateNode.h:
2770         (WebCore::ScrollingStateNode::isFrameHostingNode const):
2771         * page/scrolling/ScrollingStateTree.cpp:
2772         (WebCore::ScrollingStateTree::createNode):
2773         * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
2774         (WebCore::ScrollingTreeFrameHostingNode::create):
2775         (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
2776         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
2777         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
2778         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
2779         * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
2780         * page/scrolling/ScrollingTreeNode.h:
2781         (WebCore::ScrollingTreeNode::isFrameHostingNode const):
2782         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2783         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
2784         * page/scrolling/mac/ScrollingTreeMac.cpp:
2785         (ScrollingTreeMac::createScrollingTreeNode):
2786         * rendering/RenderLayerBacking.cpp:
2787         (WebCore::RenderLayerBacking::~RenderLayerBacking):
2788         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2789         (WebCore::operator<<):
2790         * rendering/RenderLayerBacking.h:
2791         * rendering/RenderLayerCompositor.cpp:
2792         (WebCore::scrollCoordinationRoleForNodeType):
2793         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
2794         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2795         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2796         * rendering/RenderLayerCompositor.h:
2797
2798 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
2799
2800         [iOS] Enable media element volume on iPad
2801         https://bugs.webkit.org/show_bug.cgi?id=193745
2802         <rdar://problem/47452297>
2803
2804         Reviewed by Jer Noble.
2805
2806         * html/HTMLMediaElement.cpp:
2807         (WebCore::HTMLMediaElement::setVolume):
2808         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
2809         (WebCore::HTMLMediaElement::updateVolume):
2810
2811         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2812         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
2813
2814 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2815
2816         [GTK][WPE] Support JPEG 2000 images
2817         https://bugs.webkit.org/show_bug.cgi?id=186272
2818
2819         Reviewed by Žan Doberšek.
2820
2821         Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
2822         supported.
2823
2824         * platform/ImageDecoders.cmake:
2825         * platform/MIMETypeRegistry.cpp:
2826         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2827         * platform/image-decoders/ScalableImageDecoder.cpp:
2828         (WebCore::ScalableImageDecoder::create):
2829         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
2830         (WebCore::syccToRGB):
2831         (WebCore::sycc444ToRGB):
2832         (WebCore::sycc422ToRGB):
2833         (WebCore::sycc420ToRGB):
2834         (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
2835         (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
2836         (WebCore::JPEG2000ImageDecoder::decode):
2837         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
2838
2839 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
2840
2841         Change some RenderLayerCompositor functions to use references
2842         https://bugs.webkit.org/show_bug.cgi?id=193760
2843
2844         Reviewed by Zalan Bujtas.
2845
2846         RenderWidget* -> RenderWidget&
2847
2848         * rendering/RenderLayerBacking.cpp:
2849         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
2850         (WebCore::RenderLayerBacking::updateConfiguration):
2851         * rendering/RenderLayerCompositor.cpp:
2852         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2853         (WebCore::RenderLayerCompositor::updateBacking):
2854         (WebCore::RenderLayerCompositor::frameContentsCompositor):
2855         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2856         * rendering/RenderLayerCompositor.h:
2857
2858 2019-01-23  Benjamin Poulain  <benjamin@webkit.org>
2859
2860         <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
2861         https://bugs.webkit.org/show_bug.cgi?id=193742
2862
2863         Reviewed by Eric Carlson.
2864
2865         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2866         The original bug was fixed, see radar: rdar://problem/27686430
2867
2868 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
2869
2870         Clean up IndexedDB files between tests
2871         https://bugs.webkit.org/show_bug.cgi?id=192796
2872         <rdar://problem/46824999>
2873
2874         Reviewed by Geoffrey Garen.
2875
2876         We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
2877
2878         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2879         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2880         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2881
2882 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
2883
2884         Add CSS Logical spec to features.json
2885         https://bugs.webkit.org/show_bug.cgi?id=193717
2886
2887         Reviewed by Manuel Rego Casasnovas.
2888
2889         * features.json:
2890
2891 2019-01-22  Conrad Shultz  <conrad_shultz@apple.com>
2892
2893         Clean up USE(WEB_THREAD)
2894         https://bugs.webkit.org/show_bug.cgi?id=193698
2895
2896         Rubber-stamped by Tim Horton.
2897
2898         * page/CaptionUserPreferencesMediaAF.cpp:
2899         (WebCore::userCaptionPreferencesChangedNotificationCallback):
2900         * platform/cf/MainThreadSharedTimerCF.cpp:
2901         (WebCore::applicationDidBecomeActive):
2902         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2903         (WebCore::dispatchToMainThread):
2904         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
2905         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
2906         * platform/ios/LegacyTileCache.mm:
2907         (WebCore::LegacyTileCache::layoutTiles):
2908         (WebCore::LegacyTileCache::setTilingMode):
2909         * platform/ios/WebCoreMotionManager.mm:
2910         (-[WebCoreMotionManager sendAccelerometerData:]):
2911         (-[WebCoreMotionManager sendMotionData:withHeading:]):
2912         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2913         (VideoFullscreenControllerContext::requestUpdateInlineRect):
2914         (VideoFullscreenControllerContext::requestVideoContentLayer):
2915         (VideoFullscreenControllerContext::returnVideoContentLayer):
2916         (VideoFullscreenControllerContext::didSetupFullscreen):
2917         (VideoFullscreenControllerContext::willExitFullscreen):
2918         (VideoFullscreenControllerContext::didExitFullscreen):
2919         (VideoFullscreenControllerContext::didCleanupFullscreen):
2920         (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
2921         (VideoFullscreenControllerContext::requestFullscreenMode):
2922         (VideoFullscreenControllerContext::setVideoLayerFrame):
2923         (VideoFullscreenControllerContext::setVideoLayerGravity):
2924         (VideoFullscreenControllerContext::fullscreenModeChanged):
2925         (VideoFullscreenControllerContext::play):
2926         (VideoFullscreenControllerContext::pause):
2927         (VideoFullscreenControllerContext::togglePlayState):
2928         (VideoFullscreenControllerContext::toggleMuted):
2929         (VideoFullscreenControllerContext::setMuted):
2930         (VideoFullscreenControllerContext::setVolume):
2931         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
2932         (VideoFullscreenControllerContext::beginScrubbing):
2933         (VideoFullscreenControllerContext::endScrubbing):
2934         (VideoFullscreenControllerContext::seekToTime):
2935         (VideoFullscreenControllerContext::fastSeek):
2936         (VideoFullscreenControllerContext::beginScanningForward):
2937         (VideoFullscreenControllerContext::beginScanningBackward):
2938         (VideoFullscreenControllerContext::endScanning):
2939         (VideoFullscreenControllerContext::selectAudioMediaOption):
2940         (VideoFullscreenControllerContext::selectLegibleMediaOption):
2941         (VideoFullscreenControllerContext::duration const):
2942         (VideoFullscreenControllerContext::currentTime const):
2943         (VideoFullscreenControllerContext::bufferedTime const):
2944         (VideoFullscreenControllerContext::isPlaying const):
2945         (VideoFullscreenControllerContext::playbackRate const):
2946         (VideoFullscreenControllerContext::seekableRanges const):
2947         (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
2948         (VideoFullscreenControllerContext::liveUpdateInterval const):
2949         (VideoFullscreenControllerContext::canPlayFastReverse const):
2950         (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
2951         (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
2952         (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
2953         (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
2954         (VideoFullscreenControllerContext::externalPlaybackEnabled const):
2955         (VideoFullscreenControllerContext::externalPlaybackTargetType const):
2956         (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
2957         (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
2958         (VideoFullscreenControllerContext::setUpFullscreen):
2959         (VideoFullscreenControllerContext::exitFullscreen):
2960         (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
2961         (-[WebVideoFullscreenController enterFullscreen:mode:]):
2962         (-[WebVideoFullscreenController exitFullscreen]):
2963         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
2964         * platform/ios/wak/WAKWindow.mm:
2965         (-[WAKWindow setVisible:]):
2966         (-[WAKWindow setScreenScale:]):
2967         (-[WAKWindow sendEvent:]):
2968         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
2969         * platform/network/ios/NetworkStateNotifierIOS.mm:
2970         (WebCore::NetworkStateNotifier::startObserving):
2971         * rendering/RenderThemeIOS.mm:
2972         (WebCore::contentSizeCategoryDidChange):
2973
2974 2019-01-23  David Kilzer  <ddkilzer@apple.com>
2975
2976         REGRESSION (r240292): Attempt to fix WinCairo build
2977
2978         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2979         (WebCore::handleCookieHeaders): Remove argument to
2980         NetworkingContext::storageSession().
2981
2982 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2983
2984         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
2985         https://bugs.webkit.org/show_bug.cgi?id=193706
2986         <rdar://problem/44807048>
2987
2988         Reviewed by Ryosuke Niwa.
2989
2990         Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
2991         label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
2992         undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
2993         label simultaneously. There should be no change in behavior.
2994
2995         * editing/CompositeEditCommand.cpp:
2996         (WebCore::EditCommandComposition::label const):
2997         * editing/CompositeEditCommand.h:
2998         * editing/CustomUndoStep.cpp:
2999         (WebCore::CustomUndoStep::label const):
3000         * editing/CustomUndoStep.h:
3001         * editing/EditAction.cpp:
3002         (WebCore::undoRedoLabel):
3003         (WebCore::nameForUndoRedo): Deleted.
3004         * editing/EditAction.h:
3005
3006         Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
3007         WebKitLegacy.
3008
3009         * editing/UndoStep.h:
3010
3011         Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
3012         localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
3013
3014 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
3015
3016         [SOUP] Clean up NetworkStorageSession
3017         https://bugs.webkit.org/show_bug.cgi?id=193707
3018
3019         Reviewed by Carlos Garcia Campos.
3020
3021         A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
3022         complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
3023         know the session has always already been created. The soupNetworkSession getter can now
3024         return a reference rather than a pointer, because it will never be NULL except after it has
3025         been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
3026         before process termination after nothing else is using it. Cookie jar syncing can also go
3027         away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
3028         use its cookie jar.
3029
3030         * platform/network/NetworkStorageSession.h:
3031         (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
3032         * platform/network/soup/DNSResolveQueueSoup.cpp:
3033         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
3034         (WebCore::DNSResolveQueueSoup::platformResolve):
3035         (WebCore::DNSResolveQueueSoup::resolve):
3036         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3037         (WebCore::NetworkStorageSession::NetworkStorageSession):
3038         (WebCore::NetworkStorageSession::~NetworkStorageSession):
3039         (WebCore::NetworkStorageSession::soupNetworkSession const):
3040         (WebCore::NetworkStorageSession::clearSoupNetworkSession):
3041         (WebCore::NetworkStorageSession::cookieStorage const):
3042         (WebCore::NetworkStorageSession::setCookieStorage):
3043         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
3044         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
3045         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
3046         (WebCore::SocketStreamHandleImpl::create):
3047
3048 2019-01-23  Zalan Bujtas  <zalan@apple.com>
3049
3050         [LFC][BFC] computeStaticPosition should include estimated computation as well.
3051         https://bugs.webkit.org/show_bug.cgi?id=193719
3052
3053         Reviewed by Antti Koivisto.
3054
3055         Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
3056         It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
3057         the containing block's width).
3058         This is also in preparation for moving 'clear' positioning to computeStaticPosition.
3059
3060         * layout/blockformatting/BlockFormattingContext.cpp:
3061         (WebCore::Layout::BlockFormattingContext::layout const):
3062         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3063         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3064         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
3065         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
3066         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
3067         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
3068         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3069         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3070         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3071         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
3072         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
3073         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
3074         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
3075         * layout/blockformatting/BlockFormattingContext.h:
3076         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3077         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3078         * layout/blockformatting/BlockMarginCollapse.cpp:
3079         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
3080
3081 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
3082
3083         Compositing updates need to reparent scrolling tree nodes with a changed ancestor
3084         https://bugs.webkit.org/show_bug.cgi?id=193699
3085
3086         Reviewed by Frédéric Wang.
3087
3088         Now that compositing updates are incremental and may not do a full layer walk,
3089         we need to ensure that when a scrolling tree node is removed, we traverse to all
3090         descendant layers whose scrolling tree nodes refer to the removed node as their parent.
3091
3092         To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
3093         ensures that the updateBackingAndHierarchy part of the compositing update traverses
3094         layers with the bit set.
3095
3096         Adjust the compositing logging to make the legend easier to read.
3097
3098         Tests: scrollingcoordinator/reparent-across-compositing-layers.html
3099                scrollingcoordinator/reparent-with-layer-removal.html
3100
3101         * page/scrolling/AsyncScrollingCoordinator.cpp:
3102         (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
3103         * page/scrolling/AsyncScrollingCoordinator.h:
3104         * page/scrolling/ScrollingCoordinator.h:
3105         (WebCore::ScrollingCoordinator::childrenOfNode const):
3106         * rendering/RenderLayer.cpp:
3107         (WebCore::outputPaintOrderTreeLegend):
3108         (WebCore::outputPaintOrderTreeRecursive):
3109         * rendering/RenderLayer.h:
3110         * rendering/RenderLayerCompositor.cpp:
3111         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3112         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3113
3114 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
3115
3116         [css-logical] Implement flow-relative inset properties
3117         https://bugs.webkit.org/show_bug.cgi?id=189441
3118
3119         Reviewed by Dean Jackson.
3120
3121         Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
3122         'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
3123         behind the CSSLogicalEnabled runtime flag.
3124
3125         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
3126                webexposed/css-properties-behind-flags.html
3127
3128         * css/CSSComputedStyleDeclaration.cpp:
3129         (WebCore::isLayoutDependent):
3130         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3131         * css/CSSProperties.json:
3132         * css/CSSProperty.cpp:
3133         (WebCore::CSSProperty::resolveDirectionAwareProperty):
3134         (WebCore::CSSProperty::isDirectionAwareProperty):
3135         * css/StyleProperties.cpp:
3136         (WebCore::StyleProperties::getPropertyValue const):
3137         (WebCore::StyleProperties::asText const):
3138         * css/parser/CSSParserFastPaths.cpp:
3139         (WebCore::isSimpleLengthPropertyID):
3140         * css/parser/CSSPropertyParser.cpp:
3141         (WebCore::CSSPropertyParser::parseSingleValue):
3142         (WebCore::CSSPropertyParser::parseShorthand):
3143
3144 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
3145
3146         [css-grid] Properly handle static positions of abspos inside grid items
3147         https://bugs.webkit.org/show_bug.cgi?id=193657
3148
3149         Reviewed by Javier Fernandez.
3150
3151         Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
3152         Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
3153         and only if it's needed (not for abspos descentants in their static position).
3154         Add logicalOffsetForChild that finds the value to be set by the functions above.
3155         Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
3156
3157         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
3158                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
3159                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
3160                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
3161                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
3162                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
3163                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
3164                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
3165                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
3166                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
3167                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
3168                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
3169                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
3170                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
3171                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
3172                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
3173                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
3174                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
3175                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
3176                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
3177                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
3178                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
3179                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
3180                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
3181                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
3182                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
3183                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
3184                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
3185                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
3186                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
3187                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
3188                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
3189
3190         * rendering/RenderGrid.cpp:
3191         (WebCore::RenderGrid::layoutGridItems):
3192         (WebCore::RenderGrid::layoutPositionedObject):
3193         (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
3194         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
3195         (WebCore::RenderGrid::setLogicalPositionForChild const):
3196         (WebCore::RenderGrid::setLogicalOffsetForChild const):
3197         (WebCore::RenderGrid::logicalOffsetForChild const):
3198         * rendering/RenderGrid.h:
3199
3200 2019-01-23  Rob Buis  <rbuis@igalia.com>
3201
3202         Update MIME type parser
3203         https://bugs.webkit.org/show_bug.cgi?id=180526
3204
3205         Reviewed by Frédéric Wang.
3206
3207         Add an enum to allow two modes of MIME type parsing, one mode
3208         to keep supporting RFC2045 as before, and one mode to support
3209         the updated MIME parser from mimesniff [1]. Mimesniff support
3210         brings the following changes:
3211         - allows parameter names without matching =value.
3212         - skips whitespace after subtype, parameter value and before
3213           parameter name.
3214         - lower cases MIME type and parameter name.
3215         - parameter names parsed before are discarded.
3216
3217         The old mode is still used by CDM.cpp and MIMEHeader.cpp.
3218
3219         [1] https://mimesniff.spec.whatwg.org/
3220
3221         * Modules/encryptedmedia/CDM.cpp:
3222         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
3223         * platform/network/MIMEHeader.cpp:
3224         (WebCore::MIMEHeader::parseHeader):
3225         * platform/network/ParsedContentType.cpp:
3226         (WebCore::DummyParsedContentType::setContentType const):
3227         (WebCore::DummyParsedContentType::setContentTypeParameter const):
3228         (WebCore::isQuotedStringTokenCharacter):
3229         (WebCore::isTokenCharacter):
3230         (WebCore::parseToken):
3231         (WebCore::containsNonTokenCharacters):
3232         (WebCore::parseQuotedString):
3233         (WebCore::isNotForwardSlash):
3234         (WebCore::isNotSemicolon):
3235         (WebCore::isNotSemicolonOrEqualSign):
3236         (WebCore::parseContentType):
3237         (WebCore::isValidContentType):
3238         (WebCore::ParsedContentType::ParsedContentType):
3239         (WebCore::ParsedContentType::setContentType):
3240         (WebCore::isNonTokenCharacter):
3241         (WebCore::isNonQuotedStringTokenCharacter):
3242         (WebCore::ParsedContentType::setContentTypeParameter):
3243         * platform/network/ParsedContentType.h:
3244
3245         Test: web-platform-tests/xhr/overridemimetype-blob.html
3246
3247 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3248
3249         Introduce CustomUndoStep.h and CustomUndoStep.cpp
3250         https://bugs.webkit.org/show_bug.cgi?id=193704
3251         <rdar://problem/44807048>
3252
3253         Reviewed by Ryosuke Niwa.
3254
3255         This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
3256         class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
3257
3258         No change in behavior.
3259
3260         * Sources.txt:
3261         * WebCore.xcodeproj/project.pbxproj:
3262         * editing/CustomUndoStep.cpp:
3263         (WebCore::CustomUndoStep::CustomUndoStep):
3264
3265         Subclass UndoStep.
3266
3267         (WebCore::CustomUndoStep::unapply):
3268         (WebCore::CustomUndoStep::reapply):
3269
3270         If possible, invoke the UndoItem's undo and redo handlers.
3271
3272         (WebCore::CustomUndoStep::isValid const):
3273         * editing/CustomUndoStep.h:
3274         * editing/EditingStyle.cpp:
3275         * editing/InsertEditableImageCommand.cpp:
3276         (WebCore::InsertEditableImageCommand::doApply):
3277
3278         Unified build fixes.
3279
3280         * page/UndoItem.h:
3281
3282 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
3283
3284         Adding a child to a ScrollingStateNode needs to trigger a tree state commit
3285         https://bugs.webkit.org/show_bug.cgi?id=193682
3286
3287         Reviewed by Zalan Bujtas.
3288
3289         Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
3290         need to trigger scrolling tree updates, and currently do not.
3291
3292         Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
3293         this flag when committing the scrolling tree because we always eagerly traverse children, but
3294         we could use it to optimize later. The important part is that we use it to trigger a tree update.
3295         
3296         Can't test via z-reordering until webkit.org/b/192529 is fixed.
3297
3298         Tests: scrollingcoordinator/gain-scrolling-node-parent.html
3299                scrollingcoordinator/lose-scrolling-node-parent.html
3300
3301         * page/scrolling/ScrollingStateNode.cpp:
3302         (WebCore::ScrollingStateNode::appendChild):
3303         (WebCore::ScrollingStateNode::insertChild):
3304         (WebCore::ScrollingStateNode::removeChildAtIndex):
3305         * page/scrolling/ScrollingStateNode.h:
3306         * page/scrolling/ScrollingStateTree.cpp:
3307         (WebCore::ScrollingStateTree::attachNode):
3308
3309 2019-01-22  Devin Rousso  <drousso@apple.com>
3310
3311         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
3312         https://bugs.webkit.org/show_bug.cgi?id=116191
3313         <rdar://problem/13905910>
3314
3315         Reviewed by Joseph Pecoraro.
3316
3317         Test inspector/timeline/line-column.html
3318
3319         * bindings/js/ScriptController.cpp:
3320         (WebCore::ScriptController::evaluateInWorld):
3321         (WebCore::ScriptController::evaluateModule):
3322
3323         * bindings/js/JSExecStateInstrumentation.h:
3324         (WebCore::JSExecState::instrumentFunctionInternal):
3325
3326         * inspector/InspectorInstrumentation.h:
3327         (WebCore::InspectorInstrumentation::willCallFunction):
3328         (WebCore::InspectorInstrumentation::willEvaluateScript):
3329         * inspector/InspectorInstrumentation.cpp:
3330         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
3331         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
3332
3333         * inspector/agents/InspectorTimelineAgent.h:
3334         * inspector/agents/InspectorTimelineAgent.cpp:
3335         (WebCore::InspectorTimelineAgent::willCallFunction):
3336         (WebCore::InspectorTimelineAgent::willEvaluateScript):
3337
3338         * inspector/TimelineRecordFactory.h:
3339         * inspector/TimelineRecordFactory.cpp:
3340         (WebCore::TimelineRecordFactory::createFunctionCallData):
3341         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
3342
3343         * bindings/js/ScriptSourceCode.h:
3344         (WebCore::ScriptSourceCode::startColumn const): Added.
3345
3346 2019-01-22  Devin Rousso  <drousso@apple.com>
3347
3348         Web Inspector: expose Audit and Recording versions to the frontend
3349         https://bugs.webkit.org/show_bug.cgi?id=193262
3350         <rdar://problem/47130684>
3351
3352         Reviewed by Joseph Pecoraro.
3353
3354         Tests: inspector/audit/version.html
3355                inspector/recording/version.html
3356
3357         * inspector/agents/InspectorCanvasAgent.cpp:
3358         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3359
3360 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
3361
3362         Add some bindings-related bookkeeping to UndoManager and UndoItem
3363         https://bugs.webkit.org/show_bug.cgi?id=193111
3364         <rdar://problem/44807048>
3365
3366         Reviewed by Ryosuke Niwa.
3367
3368         This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
3369         UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
3370         properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).
3371
3372         No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
3373         will write a test to verify that the undo and redo JavaScript functions survive garbage collection.
3374
3375         * Sources.txt:
3376         * WebCore.xcodeproj/project.pbxproj:
3377         * bindings/js/JSUndoItemCustom.cpp:
3378         (WebCore::JSUndoItem::visitAdditionalChildren):
3379
3380         Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
3381         for these functions are not garbage collected underneath the item.
3382
3383         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
3384
3385         Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
3386         This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
3387         `UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
3388         UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
3389         script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
3390         to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).
3391
3392         * dom/Document.cpp:
3393         (WebCore::Document::prepareForDestruction):
3394
3395         Invalidate all undo items when the document is about to go away.
3396
3397         * page/UndoItem.cpp:
3398         (WebCore::UndoItem::setUndoManager):
3399         (WebCore::UndoItem::invalidate):
3400         (WebCore::UndoItem::isValid const):
3401
3402         Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
3403         UndoManager, and is thus associated with a document.
3404
3405         (WebCore::UndoItem::document const):
3406         * page/UndoItem.h:
3407         * page/UndoItem.idl:
3408         * page/UndoManager.cpp:
3409         (WebCore::UndoManager::UndoManager):
3410         (WebCore::UndoManager::addItem):
3411
3412         Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
3413         be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
3414         (this latter behavior is yet to be implemented).
3415
3416         (WebCore::UndoManager::removeItem):
3417         (WebCore::UndoManager::removeAllItems):
3418         * page/UndoManager.h:
3419         (WebCore::UndoManager::UndoManager): Deleted.
3420         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3421
3422         Unified build fix.
3423
3424 2019-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
3425
3426         [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
3427         https://bugs.webkit.org/show_bug.cgi?id=193664
3428
3429         Reviewed by Brent Fulgham.
3430
3431         WinCairo WebKitTestRunner always crash on openning test cases of
3432         HTMLMeterElement.
3433
3434         If GraphicsContext::getWindowsContext retruned null HDC,
3435         LocalWindowsContext shouldn't release the null HDC.
3436
3437         Covered by existing tests.
3438
3439         * platform/graphics/win/LocalWindowsContext.h:
3440         (WebCore::LocalWindowsContext::~LocalWindowsContext):
3441         Release m_hdc only if it isn't null.
3442
3443 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3444
3445         Unreviewed, fix -Wsign-compare warning
3446         https://bugs.webkit.org/show_bug.cgi?id=188697
3447         <rdar://problem/46105624>
3448
3449         * css/StyleProperties.cpp:
3450         (WebCore::StyleProperties::asText const):
3451
3452 2019-01-22  Devin Rousso  <drousso@apple.com>
3453
3454         Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
3455         https://bugs.webkit.org/show_bug.cgi?id=193227
3456         <rdar://problem/46787862>
3457
3458         Reviewed by Joseph Pecoraro.
3459
3460         Test: inspector/audit/run-accessibility.html
3461
3462         * inspector/InspectorAuditAccessibilityObject.idl:
3463         * inspector/InspectorAuditAccessibilityObject.h:
3464         * inspector/InspectorAuditAccessibilityObject.cpp:
3465         (WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
3466
3467 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
3468
3469         Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
3470         https://bugs.webkit.org/show_bug.cgi?id=193692
3471
3472         Reviewed by Zalan Bujtas.
3473
3474         Remove the iOS-specific renderName() implementation.
3475
3476         * rendering/RenderIFrame.h:
3477
3478 2019-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
3479
3480         Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
3481         https://bugs.webkit.org/show_bug.cgi?id=193647
3482
3483         Reviewed by Simon Fraser.
3484
3485         Changing a style attribute of an SVGELement needs to call invalidateInstances().
3486
3487         Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
3488
3489         * svg/SVGElement.cpp:
3490         (WebCore::SVGElement::attributeChanged):
3491
3492 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3493
3494         Fix more builds.
3495
3496         * platform/network/curl/CurlResourceHandleDelegate.cpp:
3497         (WebCore::handleCookieHeaders):
3498         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
3499
3500 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3501
3502         Fix some builds after r240292
3503         https://bugs.webkit.org/show_bug.cgi?id=193580
3504
3505         * platform/network/curl/ResourceHandleCurl.cpp:
3506         (WebCore::ResourceHandle::createCurlRequest):
3507         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3508         (WebCore::ResourceHandle::receivedCredential):
3509         (WebCore::ResourceHandle::getCredential):
3510
3511 2019-01-22  Alex Christensen  <achristensen@webkit.org>
3512
3513         Move NetworkStorageSession ownership to NetworkProcess
3514         https://bugs.webkit.org/show_bug.cgi?id=193580
3515
3516         Reviewed by Geoff Garen.
3517
3518         NetworkStorageSessions used to be owned by a process-global map living in WebCore.
3519         This patch moves the ownership to the WebKit/WebKitLegacy layer.
3520         In WebKitLegacy they are still owned by a process-global map for compatibility.
3521         In WebKit they are owned by a map owned by the NetworkProcess object.
3522         There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
3523         1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
3524         of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
3525         so this code was removed with no change in behavior.
3526         2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
3527         into a static method that does the same thing.  We should audit these calls and decide if we really want them.
3528         3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
3529         storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.
3530
3531         * platform/network/CredentialStorage.h:
3532         * platform/network/NetworkStorageSession.cpp:
3533         (WebCore::NetworkStorageSession::processMayUseCookieAPI):
3534         (WebCore::NetworkStorageSession::globalSessionMap): Deleted.
3535         (WebCore::NetworkStorageSession::storageSession): Deleted.
3536         (WebCore::NetworkStorageSession::destroySession): Deleted.
3537         (WebCore::NetworkStorageSession::forEach): Deleted.
3538         * platform/network/NetworkStorageSession.h:
3539         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3540         (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
3541         (WebCore::createCFStorageSessionForIdentifier): Deleted.
3542         (WebCore::defaultNetworkStorageSession): Deleted.
3543         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
3544         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
3545         (WebCore::NetworkStorageSession::ensureSession): Deleted.
3546         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
3547         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
3548         * platform/network/cocoa/CookieStorageObserver.h:
3549         * platform/network/curl/NetworkStorageSessionCurl.cpp:
3550         (WebCore::defaultSession): Deleted.
3551         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
3552         (WebCore::NetworkStorageSession::ensureSession): Deleted.
3553         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
3554         * platform/network/soup/NetworkStorageSessionSoup.cpp:
3555         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
3556         (WebCore::defaultSession): Deleted.
3557         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
3558         (WebCore::NetworkStorageSession::ensureSession): Deleted.
3559         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
3560
3561 2019-01-22  Devin Rousso  <drousso@apple.com>
3562
3563         Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
3564         https://bugs.webkit.org/show_bug.cgi?id=193225
3565         <rdar://problem/46799956>
3566
3567         Reviewed by Joseph Pecoraro.
3568
3569         Test: inspector/audit/run-accessibility.html
3570
3571         * inspector/InspectorAuditAccessibilityObject.idl:
3572         * inspector/InspectorAuditAccessibilityObject.h:
3573         * inspector/InspectorAuditAccessibilityObject.cpp:
3574         (WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
3575         (WebCore::addChildren): Added.
3576         (WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
3577         (WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
3578         (WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
3579         (WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
3580         (WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
3581         (WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
3582         (WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
3583
3584 2019-01-22  David Kilzer  <ddkilzer@apple.com>
3585
3586         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
3587         <https://webkit.org/b/193654>
3588         <rdar://problem/47430290>
3589
3590         Reviewed by Alex Christensen.
3591
3592         - Moves QuickLookSoftLink.{h,mm} to PAL.
3593         - Adds soft-link to 3 classes to consolidate QuickLook.framework
3594           soft-linking.
3595         - Updates existing source to work with above changes.
3596
3597         * SourcesCocoa.txt:
3598         * UnifiedSources-input.xcfilelist:
3599         * WebCore.xcodeproj/project.pbxproj:
3600         - Remove QuickLookSoftLink.{h,mm} due to move to PAL.
3601
3602         * platform/ios/QuickLook.mm:
3603         (WebCore::QLPreviewGetSupportedMIMETypesSet):
3604         (WebCore::registerQLPreviewConverterIfNeeded):
3605         - Update for QuickLookSoftLink.{h,mm} move to PAL.
3606
3607         * platform/network/ios/PreviewConverter.mm:
3608         (WebCore::optionsWithPassword):
3609         (WebCore::PreviewConverter::PreviewConverter):
3610         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
3611
3612         * platform/network/ios/WebCoreURLResponseIOS.mm:
3613         (WebCore::adjustMIMETypeIfNecessary):
3614         - Update for QuickLookSoftLink.{h,mm} move to PAL.
3615
3616 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
3617
3618         Fix the position of layers nested inside of composited overflow-scroll
3619         https://bugs.webkit.org/show_bug.cgi?id=193642
3620
3621         Reviewed by Antti Koivisto and Sam Weinig.
3622
3623         Remove an iOS #ifdef so that layers inside composited overflow gets the correct
3624         positions on macOS too.
3625
3626         Test: compositing/geometry/fixed-inside-overflow-scroll.html
3627
3628         * rendering/RenderLayerBacking.cpp:
3629         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
3630
3631 2019-01-22  Claudio Saavedra  <csaavedra@igalia.com>
3632
3633         [GTK] Build fix for Ubuntu LTS 16.04
3634         https://bugs.webkit.org/show_bug.cgi?id=193672
3635
3636         Unreviewed build fix.
3637
3638         * html/canvas/CanvasStyle.h: Add default copy constructor for
3639         CMYKAColor struct.
3640
3641 2019-01-22  David Kilzer  <ddkilzer@apple.com>
3642
3643         Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
3644         <https://webkit.org/b/193673>
3645         <rdar://problem/47448241>
3646
3647         Reviewed by Dean Jackson.
3648
3649         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3650         (WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
3651
3652 2019-01-22  Zalan Bujtas  <zalan@apple.com>
3653
3654         [LFC][Floats] Decouple clearance computation and margin collapsing reset.
3655         https://bugs.webkit.org/show_bug.cgi?id=193670
3656
3657         Reviewed by Antti Koivisto.
3658
3659         Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
3660         This is also in preparation for adding clear to static position.
3661
3662         * layout/FormattingContext.cpp:
3663         (WebCore::Layout::FormattingContext::mapTopToAncestor):
3664         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
3665         * layout/FormattingContext.h:
3666         * layout/blockformatting/BlockFormattingContext.cpp:
3667         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3668         * layout/floats/FloatingContext.cpp:
3669         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3670         * layout/floats/FloatingContext.h:
3671
3672 2019-01-22  Frederic Wang  <fwang@igalia.com>
3673
3674         Minor refactoring of the scrolling code
3675         https://bugs.webkit.org/show_bug.cgi?id=192398
3676
3677         Unreviewed build fix.
3678
3679         * page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
3680
3681 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
3682
3683         [css-logical] Implement flow-relative margin, padding and border shorthands
3684         https://bugs.webkit.org/show_bug.cgi?id=188697
3685
3686         Reviewed by Simon Fraser and Antti Koivisto.
3687
3688         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
3689                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
3690                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
3691                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
3692                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
3693                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
3694                webexposed/css-properties-behind-flags.html
3695
3696         * css/CSSComputedStyleDeclaration.cpp:
3697         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3698         Allow the new properties to serialize their computed value.
3699
3700         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
3701         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
3702         * css/CSSComputedStyleDeclaration.h:
3703         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
3704         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
3705         shorthands.
3706
3707         * css/CSSProperties.json:
3708         Add the new properties behind the CSSLogicalEnabled runtime flag.
3709
3710         * css/CSSStyleDeclaration.cpp:
3711         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
3712         Prevent CSS properties disabled behind a runtime flag from being exposed in
3713         style declarations.
3714
3715         * css/StyleProperties.cpp:
3716         (WebCore::StyleProperties::getPropertyValue const):
3717         Allow the new properties to serialize their specified value.
3718
3719         (WebCore::StyleProperties::get2Values const):
3720         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
3721
3722         (WebCore::StyleProperties::borderPropertyValue const):
3723         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
3724         corresponding to width, style and color.
3725
3726         (WebCore::MutableStyleProperties::setProperty):
3727         Prevent CSS properties disabled behind a runtime flag from being set a value.
3728
3729         (WebCore::StyleProperties::asText const):
3730         Allow the new properties to be serialized in cssText.
3731         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
3732         and serialize the longhands instead. Note that there could be another shorthand
3733         available which is enabled, but a proper solution would require bug 190496.
3734
3735         * css/StyleProperties.h:
3736         Update declarations of borderPropertyValue and get2Values.
3737
3738         * css/makeprop.pl:
3739         (addProperty):
3740         Add isEnabledCSSProperty function for checking that a CSS property is not
3741         disabled behind a runtime flag.
3742
3743         * css/parser/CSSPropertyParser.cpp:
3744         (WebCore::cssPropertyID):
3745         Prevent CSS properties disabled behind a runtime flag from being exposed in
3746         computed styles.
3747
3748         (WebCore::CSSPropertyParser::addProperty):
3749         Prevent CSS properties disabled behind a runtime flag from being set a value.
3750
3751         (WebCore::CSSPropertyParser::consumeBorder):
3752         Change consumeBorder to provide the caller with the parsed values instead of
3753         setting properties. Then the caller can decide to which properties the values
3754         should be set, and whether border-image should be reset or not.
3755
3756         (WebCore::CSSPropertyParser::consume2ValueShorthand):
3757         (WebCore::CSSPropertyParser::consume4ValueShorthand):
3758         Rename consume4Values to consume4ValueShorthand, and add analogous
3759         consume2ValueShorthand for parsing shorthands with two longhands.
3760
3761         (WebCore::CSSPropertyParser::parseShorthand):
3762         Allow the new properties to be parsed.
3763
3764         * css/parser/CSSPropertyParser.h:
3765         Update declarations of consumeBorder, consume2ValueShorthand and
3766         consume4ValueShorthand.
3767
3768         * inspector/agents/InspectorCSSAgent.cpp:
3769         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
3770         Prevent CSS properties disabled behind a runtime flag from being exposed in
3771         the CSS inspector tool.
3772
3773         * page/RuntimeEnabledFeatures.h:
3774         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
3775         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
3776         Add the CSSLogicalEnabled runtime flag.
3777
3778 2019-01-21  Antti Koivisto  <antti@apple.com>
3779
3780         [iOS] Handle hit testing for subframes
3781         https://bugs.webkit.org/show_bug.cgi?id=192303
3782
3783         Reviewed by Frédéric Wang.
3784
3785         Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
3786         controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
3787
3788         Test by Frederic Wang.
3789
3790         Test: fast/scrolling/ios/hit-testing-iframe.html
3791
3792         * platform/ScrollView.cpp:
3793         (WebCore::ScrollView::managesScrollbars const):
3794
3795         Add a function that tells if the scrollview should deal with scrollbars at all
3796         This is always false on iOS and not connected to delegatesScrolling bit.
3797
3798         (WebCore::ScrollView::updateScrollbars):
3799         * platform/ScrollView.h:
3800         * rendering/RenderLayerCompositor.cpp:
3801         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
3802
3803 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
3804
3805         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
3806         https://bugs.webkit.org/show_bug.cgi?id=193556
3807         <rdar://problem/47368501>
3808
3809         Reviewed by Alex Christensen.
3810
3811         This patch adds a new observer callback used to message the NetworkProcess when
3812         user interaction events are received. This is needed when the ResourceLoadStatistics
3813         data is not being managed by the UIProcess.
3814
3815         Tested by existing ResourceLoadStatistics and storageAccess tests.
3816
3817         * loader/ResourceLoadObserver.cpp:
3818         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
3819         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3820         * loader/ResourceLoadObserver.h:
3821         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3822         (WebCore::NetworkStorageSession::setCookiesFromDOM):
3823
3824 2019-01-21  Zalan Bujtas  <zalan@apple.com>
3825
3826         [LFC][Floats] Take float top position into account when computing containing block height.
3827         https://bugs.webkit.org/show_bug.cgi?id=193655
3828
3829         Reviewed by Antti Koivisto.
3830
3831         When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
3832         However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
3833         computing the containing block's height. Let's take the relevant floats into account as well.
3834
3835         Test: fast/block/float/float-first-child-and-clear-sibling.html
3836
3837         * layout/FormattingContextGeometry.cpp:
3838         (WebCore::Layout::contentHeightForFormattingContextRoot):
3839         * layout/floats/FloatingContext.cpp:
3840         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3841         * layout/floats/FloatingState.cpp:
3842         (WebCore::Layout::FloatingState::top const):
3843         * layout/floats/FloatingState.h:
3844
3845 2019-01-21  David Kilzer  <ddkilzer@apple.com>
3846
3847         REGRESSION (r240237): Revert changes to WebCore Xcode project
3848
3849         * WebCore.xcodeproj/project.pbxproj: Revert changes that were
3850         fixed in r240135.  Darin's patch must have been made prior to
3851         r240135.
3852
3853 2019-01-21  David Kilzer  <ddkilzer@apple.com>
3854
3855         REGRESSION (r240201): Add a POINTER_EVENTS feature flag
3856         https://bugs.webkit.org/show_bug.cgi?id=193577
3857         <rdar://problem/47408511>
3858
3859         * dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
3860         to fix tvOS & watchOS builds.
3861
3862 2019-01-15  Darin Adler  <darin@apple.com>
3863
3864         Use references rather than pointers for register/unregister functions, and more
3865         https://bugs.webkit.org/show_bug.cgi?id=175028
3866
3867         Reviewed by Daniel Bates.
3868
3869         * Modules/applepay/ApplePaySession.cpp:
3870         (WebCore::ApplePaySession::begin): Pass a reference.
3871         (WebCore::ApplePaySession::completePayment): Ditto.
3872         (WebCore::ApplePaySession::didReachFinalState): Ditto.
3873         * Modules/cache/DOMCache.cpp:
3874         (WebCore::DOMCache::retrieveRecords): Ditto.
3875         (WebCore::DOMCache::batchDeleteOperation): Ditto.
3876         (WebCore::DOMCache::batchPutOperation): Ditto.
3877         * Modules/cache/DOMCacheStorage.cpp:
3878         (WebCore::DOMCacheStorage::match): Ditto.
3879         * Modules/fetch/FetchBodyOwner.cpp:
3880         (WebCore::FetchBodyOwner::loadBlob): Ditto.
3881         (WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
3882         * Modules/fetch/FetchBodySource.cpp:
3883         (WebCore::FetchBodySource::setActive): Ditto.
3884         (WebCore::FetchBodySource::setInactive): Ditto.
3885         * Modules/fetch/FetchResponse.cpp:
3886         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
3887         (WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
3888         * Modules/mediasource/MediaSource.cpp:
3889         (WebCore::MediaSource::addedToRegistry): Ditto.
3890         (WebCore::MediaSource::removedFromRegistry): Ditto.
3891         * Modules/mediastream/MediaStream.cpp:
3892         (WebCore::MediaStream::~MediaStream): Ditto.
3893         (WebCore::MediaStream::startProducingData): Ditto.
3894         * Modules/mediastream/MediaStreamTrack.cpp:
3895         (WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
3896         (WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
3897         * Modules/mediastream/RTCDataChannel.cpp:
3898         (WebCore::RTCDataChannel::create): Ditto.
3899         (WebCore::RTCDataChannel::close): Ditto.
3900         * Modules/mediastream/RTCPeerConnection.cpp:
3901         (WebCore::RTCPeerConnection::create): Use auto.
3902         * Modules/notifications/Notification.cpp:
3903         (WebCore::Notification::show): Pass a reference.
3904         (WebCore::Notification::finalize): Ditto.
3905         * Modules/webaudio/AudioBasicInspectorNode.cpp:
3906         (WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
3907
3908         * Modules/webaudio/AudioContext.cpp:
3909         (WebCore::AudioContext::constructCommon): Ditto.
3910         (WebCore::AudioContext::lazyInitialize): Ditto.
3911         (WebCore::AudioContext::clear): Ditto.
3912         (WebCore::AudioContext::uninitialize): Ditto.
3913         (WebCore::AudioContext::markForDeletion): Take a reference.
3914         (WebCore::AudioContext::addAutomaticPullNode): Ditto.
3915         (WebCore::AudioContext::removeAutomaticPullNode): Ditto.
3916         (WebCore::AudioContext::willBeginPlayback): Pass a reference.
3917         (WebCore::AudioContext::willPausePlayback): Ditto.
3918         * Modules/webaudio/AudioContext.h: Update above functions to take
3919         references rather than pointers.
3920
3921         * Modules/webaudio/AudioNode.cpp:
3922         (WebCore::AudioNode::finishDeref): Pass a reference.
3923         * Modules/websockets/WebSocket.cpp:
3924         (WebCore::WebSocket::connect): Ditto.
3925         (WebCore::WebSocket::stop): Ditto.
3926         (WebCore::WebSocket::didClose): Ditto.
3927
3928         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
3929
3930         * bindings/js/JSDOMWindowBase.cpp:
3931         (WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
3932         moduleLoader is now a reference.
3933         (WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
3934         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
3935         (WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
3936         (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
3937
3938         * dom/ActiveDOMObject.h:
3939         (WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
3940         (WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
3941
3942         * dom/CharacterData.cpp:
3943         (WebCore::CharacterData::setData): Pass a reference.
3944         (WebCore::CharacterData::insertData): Ditto.
3945         (WebCore::CharacterData::deleteData): Ditto.
3946         (WebCore::CharacterData::replaceData): Ditto.
3947
3948         * dom/Document.cpp:
3949         (WebCore::Document::getElementByAccessKey): Pass a reference.
3950         (WebCore::Document::buildAccessKeyMap): Take a reference.
3951         (WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
3952         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
3953         (WebCore::Document::addAudioProducer): Ditto.
3954         (WebCore::Document::removeAudioProducer): Ditto.
3955         (WebCore::Document::hoveredElementDidDetach): Ditto.
3956         (WebCore::Document::elementInActiveChainDidDetach): Ditto.
3957         (WebCore::Document::attachNodeIterator): Ditto.
3958         (WebCore::Document::detachNodeIterator): Ditto.
3959         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
3960         a reference.
3961         (WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
3962 &