1 2019-01-31 Thibault Saunier <tsaunier@igalia.com>
3 [GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
4 https://bugs.webkit.org/show_bug.cgi?id=194087
6 Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
7 meaning that it makes sense that when any of the downstream pad is returning flushing, you should
8 return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
9 *only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
10 source element task to PAUSED (because downstream returned flushing) on a branch that was not
13 Reviewed by Philippe Normand.
15 This is a theorical race we can't really cover with tests.
17 * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
18 (WebCore::webkitMediaStreamSrcChain):
20 2019-01-31 Zalan Bujtas <zalan@apple.com>
22 [LFC] Margin before/after/start/end initial value is 0 and not auto.
23 https://bugs.webkit.org/show_bug.cgi?id=194090
25 Reviewed by Antti Koivisto.
27 Don't treat it like auto.
29 * layout/FormattingContextGeometry.cpp:
30 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
31 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
33 2019-01-31 Zalan Bujtas <zalan@apple.com>
35 [LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
36 https://bugs.webkit.org/show_bug.cgi?id=194074
38 Reviewed by Antti Koivisto.
40 Check the used margin variables whether we already computed start/end values.
42 Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
44 * layout/FormattingContextGeometry.cpp:
45 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
47 2019-01-31 Zalan Bujtas <zalan@apple.com>
49 [LFC][BFC] Add support for block level replaced box.
50 https://bugs.webkit.org/show_bug.cgi?id=194071
52 Reviewed by Antti Koivisto.
54 * layout/layouttree/LayoutBox.cpp:
55 (WebCore::Layout::Box::Box):
56 * layout/layouttree/LayoutBox.h:
57 * layout/layouttree/LayoutTreeBuilder.cpp:
58 (WebCore::Layout::TreeBuilder::createSubTree):
59 (WebCore::Layout::outputLayoutBox):
61 2019-01-31 Chris Fleizach <cfleizach@apple.com>
63 ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
64 https://bugs.webkit.org/show_bug.cgi?id=189094
65 <rdar://problem/43853526>
67 Reviewed by Zalan Bujtas.
69 Protect against access to objects and cache's that can be removed while an object is still in memory.
71 Unskipped flaky tests on mac-wk2.
73 * accessibility/mac/AXObjectCacheMac.mm:
74 (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
75 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
76 (textMarkerForVisiblePosition):
77 (textMarkerRangeFromVisiblePositions):
79 2019-01-30 Chris Dumez <cdumez@apple.com>
81 Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
82 https://bugs.webkit.org/show_bug.cgi?id=194023
83 <rdar://problem/47417981>
85 Reviewed by Geoffrey Garen.
87 The issue was caused by the 'isTopSite' flag not getting properly set on the network request
88 in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
89 not getting its same-site lax cookies.
91 The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
92 bypassing this method entirely when continuing a load in a new process after a swap. This was
93 intentional as the network request is normally already fully populated by the previous process
94 and we do not want the new process to modify the request in any way (e.g. we would not want to
95 add a Origin header back after it was removed by the previous process). However, in case of a
96 History navigation, we do not actually pass a request along from one process to another. Instead,
97 we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
98 In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
99 we are technically continuing a load in a new process.
101 We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
102 continuing a load with a request and not when we're continuing a load with a HistoryItem.
104 Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
106 * loader/FrameLoader.cpp:
107 (WebCore::FrameLoader::load):
108 (WebCore::FrameLoader::loadWithDocumentLoader):
109 (WebCore::FrameLoader::addExtraFieldsToRequest):
110 (WebCore::FrameLoader::loadDifferentDocumentItem):
111 * loader/FrameLoader.h:
112 (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
114 2019-01-30 Justin Fan <justin_fan@apple.com>
116 [WebGPU] Support GPUDepthStencilStateDescriptor
117 https://bugs.webkit.org/show_bug.cgi?id=194048
118 <rdar://problem/46289645>
120 Reviewed by Dean Jackson.
122 Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
124 Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect
125 without a depth texture attached.
127 New interface files added:
128 * Modules/webgpu/GPUCompareFunction.idl:
129 * Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
130 * platform/graphics/gpu/GPUCompareFunction.h:
131 * platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
134 * Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
135 (WebCore::WebGPUDevice::createRenderPipeline const):
136 * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
137 * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
138 * platform/graphics/gpu/GPURenderPipeline.h: Ditto.
139 (WebCore::GPURenderPipeline::depthStencilState const): Getter.
140 (WebCore::GPURenderPipeline::platformRenderPipeline const):
141 * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
142 (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
143 * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
144 (WebCore::GPURenderPassEncoder::setPipeline):
145 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
146 (WebCore::validateAndConvertDepthCompareFunctionToMtl):
147 (WebCore::tryCreateMtlDepthStencilState):
148 (WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
149 (WebCore::GPURenderPipeline::create):
150 (WebCore::GPURenderPipeline::GPURenderPipeline):
152 Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
154 * DerivedSources.make:
156 * WebCore.xcodeproj/project.pbxproj:
158 * Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
160 2019-01-30 Jer Noble <jer.noble@apple.com>
162 [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
163 https://bugs.webkit.org/show_bug.cgi?id=193984
165 Reviewed by Eric Carlson.
167 MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
168 KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
169 after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
170 completion handler is called.
172 Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
173 changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
175 * Modules/encryptedmedia/MediaKeySession.cpp:
176 (WebCore::MediaKeySession::sessionIdChanged):
177 * Modules/encryptedmedia/MediaKeySession.h:
178 * platform/encryptedmedia/CDMInstanceSession.h:
179 * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
180 (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
181 (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
183 2019-01-30 Keith Rollin <krollin@apple.com>
185 FloatWithRect has invalid and inaccessible default constructor
186 https://bugs.webkit.org/show_bug.cgi?id=194057
187 <rdar://problem/47685211>
189 Reviewed by Zalan Bujtas.
191 FloatWithRect has a default constructor declared as 'default'. This
192 constructor is invalid because FloatWithRect has a data member that's
193 a reference that will not get initialized with this constructor. Since
194 it's invalid, and since it's private and not accessed by anything,
195 remove this constructor.
197 No new tests since there should be no observable behavior difference.
199 * rendering/line/LineLayoutState.h:
201 2019-01-30 Daniel Bates <dabates@apple.com>
203 [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
204 https://bugs.webkit.org/show_bug.cgi?id=192824
205 <rdar://problem/47100332>
207 Reviewed by Wenson Hsieh.
209 When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
210 now that hardware key events to non-editable elements use the same code path as for editable elements.
212 * platform/ios/KeyEventIOS.mm:
213 (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
214 !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
215 (WebCore::isFunctionKey): Ditto.
216 * platform/ios/WebEvent.mm:
217 (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
218 USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
220 2019-01-30 Jer Noble <jer.noble@apple.com>
222 Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
223 https://bugs.webkit.org/show_bug.cgi?id=194063
227 * DerivedSources.make:
229 2019-01-30 Youenn Fablet <youenn@apple.com>
231 Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
232 https://bugs.webkit.org/show_bug.cgi?id=193747
233 <rdar://problem/47498196>
235 Reviewed by Chris Dumez.
237 Make ServiceWorkerJob be no longer ref counted.
238 Instead its lifetime is fully controlled by ServiceWorkerContainer.
240 Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
241 This allows to ensure that these jobs do not stay forever.
242 Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
244 Before the patch, unsetPendingActivity was only called for successful jobs finishing.
245 In case of failing loads, ServiceWorkerContainer would leak.
246 Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
247 a pending activity in the job map next to the job.
249 When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
250 This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
252 Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
253 Update type of exception to be SecurityError when load fails due to AccessControl.
255 Covered by existing tests.
257 * workers/service/ServiceWorkerContainer.cpp:
258 (WebCore::ServiceWorkerContainer::addRegistration):
259 (WebCore::ServiceWorkerContainer::removeRegistration):
260 (WebCore::ServiceWorkerContainer::updateRegistration):
261 (WebCore::ServiceWorkerContainer::scheduleJob):
262 (WebCore::ServiceWorkerContainer::jobFailedWithException):
263 (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
264 (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
265 (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
266 (WebCore::ServiceWorkerContainer::jobDidFinish):
267 (WebCore::ServiceWorkerContainer::stop):
268 (WebCore::ServiceWorkerContainer::job):
269 * workers/service/ServiceWorkerContainer.h:
270 * workers/service/ServiceWorkerJob.cpp:
271 (WebCore::ServiceWorkerJob::failedWithException):
272 (WebCore::ServiceWorkerJob::resolvedWithRegistration):
273 (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
274 (WebCore::ServiceWorkerJob::startScriptFetch):
275 (WebCore::ServiceWorkerJob::didReceiveResponse):
276 (WebCore::ServiceWorkerJob::notifyFinished):
277 (WebCore::ServiceWorkerJob::cancelPendingLoad):
278 * workers/service/ServiceWorkerJob.h:
279 (WebCore::ServiceWorkerJob::hasPromise const):
280 (WebCore::ServiceWorkerJob::takePromise):
281 * workers/service/ServiceWorkerJobClient.h:
282 * workers/service/server/SWServerJobQueue.cpp:
283 (WebCore::SWServerJobQueue::scriptFetchFinished):
285 2019-01-30 Dean Jackson <dino@apple.com>
287 PointerEvents - tiltX and tiltY are reversed
288 https://bugs.webkit.org/show_bug.cgi?id=194032
289 <rdar://problem/47674184>
293 I got tiltX and tiltY the wrong way around.
295 * dom/ios/PointerEventIOS.cpp: Flip the values.
297 2019-01-30 Zalan Bujtas <zalan@apple.com>
299 [LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
300 https://bugs.webkit.org/show_bug.cgi?id=194001
302 Reviewed by Antti Koivisto.
304 Skip to the next position manually. This is exactly what we do in simple line layout.
306 * layout/inlineformatting/InlineRunProvider.cpp:
307 (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
309 2019-01-30 Simon Fraser <simon.fraser@apple.com>
311 Add some basic geometry information to the scrolling tree
312 https://bugs.webkit.org/show_bug.cgi?id=194002
313 rdar://problem/47656294
315 Reviewed by Antti Koivisto.
317 To allow hit-testing in the scrolling tree, store a parent-relative scrollable
318 rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
319 of the scrollable area, and whose origin is relative to the parent scrolling tree node.
321 Frame hosting nodes need this rect because they take care of the geometry offset between
322 an iframe and its scrolling tree ancestor in the parent document.
324 Based on a patch by Frédéric Wang in bug 172917.
326 * page/scrolling/AsyncScrollingCoordinator.cpp:
327 (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
328 * page/scrolling/ScrollingStateFrameHostingNode.cpp:
329 (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
330 (WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
331 (WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
332 (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
333 * page/scrolling/ScrollingStateFrameHostingNode.h:
334 * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
335 (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
336 (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
337 * page/scrolling/ScrollingTreeFrameHostingNode.h:
338 (WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
339 * rendering/RenderLayer.h:
340 * rendering/RenderLayerBacking.cpp:
341 (WebCore::RenderLayerBacking::updateScrollingLayers):
342 * rendering/RenderLayerCompositor.cpp:
343 (WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
344 (WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
345 (WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
346 (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
347 (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
348 (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
349 (WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
350 * rendering/RenderLayerCompositor.h:
352 2019-01-30 Zalan Bujtas <zalan@apple.com>
354 [LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
355 https://bugs.webkit.org/show_bug.cgi?id=194020
357 Reviewed by Antti Koivisto.
359 Check the used margin variables whether we already computed before/after values.
361 Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
363 * layout/FormattingContextGeometry.cpp:
364 (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
366 2019-01-30 Chris Fleizach <cfleizach@apple.com>
368 AX: Support color well on iOS
369 https://bugs.webkit.org/show_bug.cgi?id=194010
371 Reviewed by Joanmarie Diggs.
373 Test: accessibility/ios-simulator/color-well.html
375 Add support for color well on iOS.
377 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
378 (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
379 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
380 (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
381 (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
382 * en.lproj/Localizable.strings:
383 * platform/LocalizedStrings.cpp:
384 (WebCore::AXColorWellText):
385 * platform/LocalizedStrings.h:
387 2019-01-30 Chris Fleizach <cfleizach@apple.com>
389 AX: Role=switch not returning correct accessibilityValue
390 https://bugs.webkit.org/show_bug.cgi?id=194006
392 Reviewed by Joanmarie Diggs.
394 Return the toggle state of a role=switch element.
396 Test: accessibility/ios-simulator/role-switch.html
398 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
399 (-[WebAccessibilityObjectWrapper accessibilityValue]):
401 2019-01-29 Rob Buis <rbuis@igalia.com>
403 Align with Fetch on data: URLs
404 https://bugs.webkit.org/show_bug.cgi?id=182325
406 Reviewed by Alex Christensen.
408 Implement most remaining steps for data: URL processing [1].
409 Serialization is still to be implemented.
411 To make the code in DataURLDecoder::parseMediaType more efficient,
412 refactor ParsedContentType so that validation and parsing is done
415 Test: web-platform-tests/fetch/data-urls/processing.any.js
417 [1] https://fetch.spec.whatwg.org/#data-urls
419 * Modules/encryptedmedia/CDM.cpp:
420 (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
421 * platform/network/DataURLDecoder.cpp:
422 (WebCore::DataURLDecoder::parseMediaType):
423 (WebCore::DataURLDecoder::DecodeTask::process):
424 * platform/network/MIMEHeader.cpp:
425 (WebCore::MIMEHeader::parseHeader):
426 * platform/network/ParsedContentType.cpp:
427 (WebCore::containsNewline):
428 (WebCore::ParsedContentType::parseContentType):
429 (WebCore::ParsedContentType::create):
430 (WebCore::isValidContentType):
431 (WebCore::ParsedContentType::ParsedContentType):
432 (WebCore::DummyParsedContentType::setContentType const): Deleted.
433 (WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
434 (WebCore::parseContentType): Deleted.
435 * platform/network/ParsedContentType.h:
437 2019-01-29 Eric Carlson <eric.carlson@apple.com>
439 [MSE] add more source buffer logging
440 https://bugs.webkit.org/show_bug.cgi?id=193995
441 <rdar://problem/47650399>
445 No new tests, no functional change.
447 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
448 (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
449 (WebCore::SourceBufferPrivateAVFObjC::setReadyState):
450 (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
451 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
452 (WebCore::SourceBufferPrivateAVFObjC::willSeek):
453 (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
455 2019-01-29 Simon Fraser <simon.fraser@apple.com>
457 Add nodes to the scrolling tree in z-index order.
458 https://bugs.webkit.org/show_bug.cgi?id=192529
459 <rdar://problem/47402708>
461 Reviewed by Dean Jackson.
463 We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
464 This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
467 With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
468 tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
469 (which makes it so that the scrolling tree correctly reflects layer z-order).
471 The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
472 nodes in their parent document.
474 There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
475 was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
476 to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
478 updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
479 and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
481 Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
482 scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
484 * page/scrolling/ScrollingStateTree.cpp:
485 (WebCore::ScrollingStateTree::insertNode):
486 * page/scrolling/ScrollingTreeNode.cpp:
487 (WebCore::ScrollingTreeNode::~ScrollingTreeNode):
488 * platform/Logging.cpp:
489 (WebCore::initializeLogChannelsIfNecessary):
490 * rendering/RenderLayer.cpp:
491 (WebCore::RenderLayer::setParent):
492 (WebCore::RenderLayer::calculateClipRects const):
493 * rendering/RenderLayerBacking.cpp:
494 (WebCore::RenderLayerBacking::~RenderLayerBacking):
495 (WebCore::RenderLayerBacking::willBeDestroyed):
496 (WebCore::RenderLayerBacking::updateGeometry):
497 (WebCore::RenderLayerBacking::updateBackgroundLayer):
498 (WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
499 * rendering/RenderLayerBacking.h:
500 * rendering/RenderLayerCompositor.cpp:
501 (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
502 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
503 (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
504 (WebCore::frameHostingNodeForFrame):
505 (WebCore::RenderLayerCompositor::updateCompositingLayers):
506 (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
507 (WebCore::RenderLayerCompositor::updateBacking):
508 (WebCore::RenderLayerCompositor::layerWillBeRemoved):
509 (WebCore::RenderLayerCompositor::setIsInWindow):
510 (WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
511 (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
512 (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
513 (WebCore::RenderLayerCompositor::attachScrollingNode):
514 (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
515 (WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
516 (WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
517 (WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
518 (WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
519 (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
520 (WebCore::RenderLayerCompositor::didAddScrollingLayer):
521 (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
522 (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
523 (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
524 (WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
525 (WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
526 (WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
527 (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
528 (WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
529 (WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
530 (WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
531 (WebCore::canCoordinateScrollingForLayer): Deleted.
532 (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
533 (WebCore::enclosingScrollingNodeID): Deleted.
534 (WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
535 (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
536 (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
537 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
538 * rendering/RenderLayerCompositor.h:
540 2019-01-29 Brent Fulgham <bfulgham@apple.com>
542 Make sure we have a frame before trying to access its loader
543 https://bugs.webkit.org/show_bug.cgi?id=193985
544 <rdar://problem/47618239>
546 Reviewed by Ryosuke Niwa.
548 * loader/ResourceLoadObserver.cpp:
549 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
551 2019-01-29 Andy Estes <aestes@apple.com>
553 Try to fix the watchOS build.
557 2019-01-29 Simon Fraser <simon.fraser@apple.com>
559 REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
560 https://bugs.webkit.org/show_bug.cgi?id=193907
561 rdar://problem/47604080
563 Reviewed by Frédéric Wang.
565 Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
566 state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
567 show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
568 commit would re-create the tree node, but the state node would only have a subset of the
569 change flags set, so the new tree node would fail to get all of the state (for example, it
570 would be missing layers and scrolling geometry).
572 Fix by ensuring that when we reparent state node subtrees, we set all the change flags
573 so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
574 Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
575 set the right change flags.
577 This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
578 information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
579 as we encounter them in the tree walk.
581 Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
583 Test: compositing/geometry/composited-frame-contents.html
585 * page/scrolling/ScrollingStateFixedNode.cpp:
586 (WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
587 * page/scrolling/ScrollingStateFixedNode.h:
588 * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
589 (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
590 * page/scrolling/ScrollingStateFrameScrollingNode.h:
591 * page/scrolling/ScrollingStateNode.cpp:
592 (WebCore::ScrollingStateNode::setPropertyChanged):
593 (WebCore::ScrollingStateNode::setAllPropertiesChanged):
594 * page/scrolling/ScrollingStateNode.h:
595 (WebCore::ScrollingStateNode::setPropertyChangedBit):
596 * page/scrolling/ScrollingStateScrollingNode.cpp:
597 (WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
598 * page/scrolling/ScrollingStateScrollingNode.h:
599 * page/scrolling/ScrollingStateStickyNode.cpp:
600 (WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
601 * page/scrolling/ScrollingStateStickyNode.h:
602 * page/scrolling/ScrollingStateTree.cpp:
603 (WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
604 if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
605 other nodeID which can result in type confusion later.
606 (WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
607 (WebCore::ScrollingStateTree::commit):
608 (WebCore::ScrollingStateTree::willRemoveNode):
609 (WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
610 * page/scrolling/ScrollingStateTree.h:
611 (WebCore::ScrollingStateTree::removedNodes const): Deleted.
612 * page/scrolling/ScrollingTree.cpp:
613 (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
614 (WebCore::ScrollingTree::commitTreeState):
615 (WebCore::ScrollingTree::updateTreeFromStateNode):
616 (WebCore::ScrollingTree::latchedNode):
617 (WebCore::ScrollingTree::setLatchedNode):
618 (WebCore::ScrollingTree::clearLatchedNode):
619 (WebCore::ScrollingTree::scrollingTreeAsText):
620 (WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
621 * page/scrolling/ScrollingTree.h:
622 (WebCore::ScrollingTree::hasLatchedNode const):
623 * rendering/RenderLayerCompositor.cpp:
624 (WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
625 setting its position doesn't offset it relative to the center.
627 2019-01-29 Justin Fan <justin_fan@apple.com>
629 [WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
630 https://bugs.webkit.org/show_bug.cgi?id=193926
631 <rdar://problem/47327648>
633 Reviewed by Myles C. Maxfield.
635 Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
637 Test: webgpu/vertex-buffer-triangle-strip.html
639 * Modules/webgpu/WebGPUVertexInputDescriptor.idl:
640 * platform/graphics/gpu/GPUVertexInputDescriptor.h:
641 * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
642 (WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
643 (WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
645 2019-01-29 Keith Rollin <krollin@apple.com>
647 Add .xcfilelists to Run Script build phases
648 https://bugs.webkit.org/show_bug.cgi?id=193792
649 <rdar://problem/47201785>
651 Reviewed by Alex Christensen.
653 As part of supporting XCBuild, update the necessary Run Script build
654 phases in their Xcode projects to refer to their associated
657 Note that the addition of these files bumps the Xcode project version
658 number to something that's Xcode 10 compatible. This change means that
659 older versions of the Xcode IDE can't read these projects. Nor can it
660 fully load workspaces that refer to these projects (the updated
661 projects are shown as non-expandable placeholders). `xcodebuild` can
662 still build these projects; it's just that the IDE can't open them.
664 Make special accommodations for incorporating .xcfilelists from
667 No new tests since there should be no observable behavior difference.
669 * Configurations/Base.xcconfig:
670 * Configurations/DebugRelease.xcconfig:
671 * WebCore.xcodeproj/project.pbxproj:
673 2019-01-29 John Wilander <wilander@apple.com>
675 Add data abstraction and validation for Ad Click Attribution
676 https://bugs.webkit.org/show_bug.cgi?id=193916
677 <rdar://problem/47603481>
679 Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
683 Ad click attribution has two steps. First, the storage of an ad
684 campaign ID for a click that takes the user to a destination
685 site. Second, a conversion on the destination site that can be
686 attributed to the ad click.
688 This patch adds a class that represents a request for ad click
689 attribution. Validation makes sure that the bits of entropy
690 reported through this mechanism is limited.
692 This feature is experimental and off by default.
695 Added loader/AdClickAttribution.cpp.
696 * WebCore.xcodeproj/project.pbxproj:
697 * loader/AdClickAttribution.cpp: Added.
698 (WebCore::AdClickAttribution::isValid const):
699 (WebCore::AdClickAttribution::setConversion):
700 (WebCore::AdClickAttribution::url const):
701 (WebCore::AdClickAttribution::referrer const):
702 * loader/AdClickAttribution.h: Added.
703 (WebCore::AdClickAttribution::Campaign::Campaign):
704 (WebCore::AdClickAttribution::Campaign::isValid const):
705 (WebCore::AdClickAttribution::Source::Source):
706 (WebCore::AdClickAttribution::Destination::Destination):
707 (WebCore::AdClickAttribution::Priority::Priority):
708 (WebCore::AdClickAttribution::Conversion::Conversion):
709 (WebCore::AdClickAttribution::Conversion::isValid const):
710 (WebCore::AdClickAttribution::AdClickAttribution):
711 (WebCore::AdClickAttribution::earliestTimeToSend const):
712 * loader/DocumentLoader.cpp:
713 Added missing #include "RuntimeEnabledFeatures.h".
715 2019-01-29 Zalan Bujtas <zalan@apple.com>
717 [MathML] Move enum class ScriptType to MathMLScriptsElement.
718 https://bugs.webkit.org/show_bug.cgi?id=193969
720 Reviewed by Antti Koivisto.
722 * mathml/MathMLScriptsElement.cpp:
723 (WebCore::scriptTypeOf):
724 * mathml/MathMLScriptsElement.h:
725 * rendering/mathml/RenderMathMLScripts.cpp:
726 (WebCore::RenderMathMLScripts::scriptType const):
727 (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
728 (WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
729 (WebCore::RenderMathMLScripts::verticalMetrics):
730 (WebCore::RenderMathMLScripts::layoutBlock):
731 * rendering/mathml/RenderMathMLScripts.h:
732 * rendering/mathml/RenderMathMLUnderOver.cpp:
733 (WebCore::RenderMathMLUnderOver::isValid const):
734 (WebCore::RenderMathMLUnderOver::under const):
735 (WebCore::RenderMathMLUnderOver::over const):
736 (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
737 (WebCore::RenderMathMLUnderOver::hasAccent const):
738 (WebCore::RenderMathMLUnderOver::layoutBlock):
740 2019-01-29 Chris Dumez <cdumez@apple.com>
742 Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
743 https://bugs.webkit.org/show_bug.cgi?id=193848
745 Reviewed by Youenn Fablet.
748 * dom/MessageChannel.cpp:
749 (WebCore::MessageChannel::MessageChannel):
750 * dom/ScriptExecutionContext.cpp:
751 (WebCore::ScriptExecutionContext::contextIdentifier const):
752 * history/HistoryItem.cpp:
753 (WebCore::HistoryItem::HistoryItem):
754 * loader/DocumentLoader.cpp:
755 (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
756 * page/DOMWindow.cpp:
757 (WebCore::DOMWindow::DOMWindow):
758 * platform/Process.cpp:
759 (WebCore::Process::identifier):
760 * workers/service/ServiceWorkerJobData.cpp:
761 (WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
762 * workers/service/server/RegistrationDatabase.cpp:
763 (WebCore::RegistrationDatabase::importRecords):
764 * workers/service/server/SWServer.cpp:
765 (WebCore::SWServer::Connection::Connection):
766 (WebCore::SWServer::updateWorker):
767 * workers/service/server/SWServerRegistration.cpp:
768 (WebCore::generateServiceWorkerRegistrationIdentifier):
769 * workers/service/server/SWServerToContextConnection.cpp:
770 (WebCore::generateServerToContextConnectionIdentifier):
773 2019-01-29 Alex Christensen <achristensen@webkit.org>
775 Use lambdas instead of member pointer functions for TransactionOperationImpl
776 https://bugs.webkit.org/show_bug.cgi?id=193933
778 Reviewed by Tim Horton.
780 No change in behavior. This just makes it easier to add new parameters to these functions in a straightforward manner.
782 * Modules/indexeddb/IDBObjectStore.cpp:
783 (WebCore::IDBObjectStore::putOrAdd):
784 * Modules/indexeddb/IDBTransaction.cpp:
785 (WebCore::IDBTransaction::internalAbort):
786 (WebCore::IDBTransaction::commit):
787 (WebCore::IDBTransaction::createObjectStore):
788 (WebCore::IDBTransaction::renameObjectStore):
789 (WebCore::IDBTransaction::createIndex):
790 (WebCore::IDBTransaction::renameIndex):
791 (WebCore::IDBTransaction::doRequestOpenCursor):
792 (WebCore::IDBTransaction::iterateCursor):
793 (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
794 (WebCore::IDBTransaction::requestGetAllIndexRecords):
795 (WebCore::IDBTransaction::requestGetRecord):
796 (WebCore::IDBTransaction::requestIndexRecord):
797 (WebCore::IDBTransaction::requestCount):
798 (WebCore::IDBTransaction::requestDeleteRecord):
799 (WebCore::IDBTransaction::requestClearObjectStore):
800 (WebCore::IDBTransaction::requestPutOrAdd):
801 (WebCore::IDBTransaction::deleteObjectStore):
802 (WebCore::IDBTransaction::deleteIndex):
803 * Modules/indexeddb/IDBTransaction.h:
804 * Modules/indexeddb/client/TransactionOperation.h:
805 (WebCore::IDBClient::TransactionOperation::doComplete):
806 (WebCore::IDBClient::createTransactionOperation): Deleted.
808 2019-01-29 Zalan Bujtas <zalan@apple.com>
810 [LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
811 https://bugs.webkit.org/show_bug.cgi?id=193964
813 Reviewed by Antti Koivisto.
815 * layout/blockformatting/BlockMarginCollapse.cpp:
816 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
818 2019-01-29 Zalan Bujtas <zalan@apple.com>
820 [LFC][BFC] Do not ignore next sibling box while laying out BFC.
821 https://bugs.webkit.org/show_bug.cgi?id=193954
823 Reviewed by Antti Koivisto.
825 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)
826 Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins.
828 * layout/blockformatting/BlockFormattingContext.cpp:
829 (WebCore::Layout::BlockFormattingContext::layout const):
830 (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
831 * layout/blockformatting/BlockFormattingContext.h:
832 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
833 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
835 2019-01-29 Zalan Bujtas <zalan@apple.com>
837 [LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough
838 https://bugs.webkit.org/show_bug.cgi?id=193948
840 Reviewed by Antti Koivisto.
842 This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight().
844 * layout/blockformatting/BlockMarginCollapse.cpp:
845 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
847 2019-01-29 Zalan Bujtas <zalan@apple.com>
849 [LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after.
850 https://bugs.webkit.org/show_bug.cgi?id=193952
852 Reviewed by Antti Koivisto.
854 * layout/blockformatting/BlockMarginCollapse.cpp:
855 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
857 2019-01-29 Frederic Wang <fwang@igalia.com>
859 Allow scrolling tree nodes to exist in a detached state
860 https://bugs.webkit.org/show_bug.cgi?id=193754
862 Unreviewed build warning fix.
864 * page/scrolling/ScrollingStateTree.cpp:
865 (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove
868 2019-01-28 Ryosuke Niwa <rniwa@webkit.org>
870 User agent string override for navigator.userAgent should be site specific quirks
871 https://bugs.webkit.org/show_bug.cgi?id=193950
873 Reviewed by Brent Fulgham.
875 In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
876 we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
877 without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
878 had been disabled or not.
880 * loader/DocumentLoader.h:
881 (WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
882 (WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
883 (WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
884 (WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
885 * loader/FrameLoader.cpp:
886 (WebCore::FrameLoader::userAgentForJavaScript const):
888 2019-01-28 Devin Rousso <drousso@apple.com>
890 Web Inspector: provide a way to edit page WebRTC settings on a remote target
891 https://bugs.webkit.org/show_bug.cgi?id=193863
892 <rdar://problem/47572764>
894 Reviewed by Joseph Pecoraro.
896 Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
897 inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
899 * inspector/agents/InspectorPageAgent.cpp:
901 * page/Settings.yaml:
902 * page/SettingsBase.h:
903 * page/SettingsBase.cpp:
904 (SettingsBase::iceCandidateFilteringEnabledChanged): Added.
905 (SettingsBase::mockCaptureDevicesEnabledChanged): Added.
906 * Scripts/GenerateSettings.rb:
907 * Scripts/SettingsTemplates/Settings.cpp.erb:
908 Add page-level settings for WebRTC preferences.
910 * Modules/mediastream/UserMediaController.cpp:
911 (WebCore::UserMediaController::canCallGetUserMedia):
913 * testing/InternalSettings.cpp:
914 (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
916 * testing/Internals.h:
917 * testing/Internals.cpp:
918 (WebCore::Internals::Internals):
919 (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
920 (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
922 * page/DeprecatedGlobalSettings.h:
923 * page/DeprecatedGlobalSettings.cpp:
924 (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
925 (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
926 (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
927 (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
929 2019-01-28 Jer Noble <jer.noble@apple.com>
931 webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
932 https://bugs.webkit.org/show_bug.cgi?id=193923
933 <rdar://problem/45956595>
935 Reviewed by Eric Carlson.
937 The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
938 and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
939 setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
941 * html/HTMLMediaElement.cpp:
942 (WebCore::HTMLMediaElement::clearMediaPlayer):
943 (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
944 (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
945 (WebCore::HTMLMediaElement::dispatchEvent):
946 * html/HTMLMediaElement.h:
948 2019-01-28 Ross Kirsling <ross.kirsling@sony.com>
950 Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
951 https://bugs.webkit.org/show_bug.cgi?id=193941
953 Reviewed by Alex Christensen.
955 * css/CSSBasicShapes.cpp:
956 * css/CSSPrimitiveValue.cpp:
957 * css/parser/CSSParser.cpp:
958 * css/parser/CSSParserSelector.cpp:
959 * css/parser/CSSPropertyParser.cpp:
961 * dom/EventListenerMap.cpp:
962 * dom/EventTarget.cpp:
963 * editing/Editor.cpp:
964 * html/HTMLElement.cpp:
965 * html/HTMLFontElement.cpp:
966 * html/parser/HTMLTokenizer.cpp:
967 * html/track/TrackBase.cpp:
968 * loader/FTPDirectoryParser.cpp:
969 * loader/TextResourceDecoder.cpp:
970 * loader/cache/CachedResource.cpp:
971 * page/ContextMenuController.cpp:
972 * page/Navigator.cpp:
973 * platform/Length.cpp:
974 * platform/cocoa/KeyEventCocoa.mm:
975 * platform/graphics/FontCascade.cpp:
976 * platform/graphics/WidthIterator.cpp:
977 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
978 * platform/ios/KeyEventIOS.mm:
979 * platform/mac/KeyEventMac.mm:
980 * platform/network/HTTPParsers.cpp:
981 * platform/text/TextCodecUTF8.cpp:
982 * platform/text/TextEncodingRegistry.cpp:
983 * platform/win/KeyEventWin.cpp:
984 * rendering/BidiRun.cpp:
985 * rendering/FloatingObjects.cpp:
986 * rendering/RenderBlock.cpp:
987 * rendering/RenderListMarker.cpp:
988 * rendering/RenderText.cpp:
990 2019-01-28 Fujii Hironori <Hironori.Fujii@sony.com>
992 [Win] WebCore/platform/Process.h is conflicting with process.h
993 https://bugs.webkit.org/show_bug.cgi?id=193944
995 Reviewed by Ross Kirsling.
997 Windows has process.h. Rename Process.h to ProcessIdentifier.h.
999 No new tests because there is no behavior change.
1002 * UnifiedSources-input.xcfilelist:
1003 * WebCore.xcodeproj/project.pbxproj:
1004 * dom/MessagePortIdentifier.h:
1005 * dom/messageports/MessagePortChannel.h:
1006 * dom/messageports/MessagePortChannelProvider.h:
1007 * dom/messageports/MessagePortChannelRegistry.h:
1008 * history/BackForwardItemIdentifier.h:
1009 * page/GlobalWindowIdentifier.h:
1010 * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
1011 (WebCore::Process::setIdentifier):
1012 (WebCore::Process::identifier):
1013 * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
1015 2019-01-28 Antoine Quint <graouts@apple.com>
1017 Implement capture for Pointer Events on iOS
1018 https://bugs.webkit.org/show_bug.cgi?id=193917
1019 <rdar://problem/47605689>
1021 Reviewed by Dean Jackson.
1023 We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
1024 to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
1025 and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
1026 releasePointerCapture().
1028 Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
1029 pointerevents/ios/pointer-events-implicit-capture-release-exception.html
1030 pointerevents/ios/pointer-events-implicit-capture-release.html
1031 pointerevents/ios/pointer-events-implicit-capture.html
1032 pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
1035 * WebCore.xcodeproj/project.pbxproj:
1037 (WebCore::Element::setPointerCapture):
1038 (WebCore::Element::releasePointerCapture):
1039 (WebCore::Element::hasPointerCapture):
1043 * dom/PointerEvent.h:
1045 (WebCore::Page::Page):
1047 (WebCore::Page::pointerCaptureController const):
1048 * page/PointerCaptureController.cpp: Added.
1049 (WebCore::PointerCaptureController::PointerCaptureController):
1050 (WebCore::PointerCaptureController::setPointerCapture):
1051 (WebCore::PointerCaptureController::releasePointerCapture):
1052 (WebCore::PointerCaptureController::hasPointerCapture):
1053 (WebCore::PointerCaptureController::pointerLockWasApplied):
1054 (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
1055 (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
1056 (WebCore::PointerCaptureController::pointerEventWasDispatched):
1057 (WebCore::PointerCaptureController::processPendingPointerCapture):
1058 * page/PointerCaptureController.h: Added.
1059 * page/PointerLockController.cpp:
1060 (WebCore::PointerLockController::requestPointerLock):
1061 * page/PointerLockController.h:
1063 2019-01-28 Andy Estes <aestes@apple.com>
1065 [watchOS] Enable Parental Controls content filtering
1066 https://bugs.webkit.org/show_bug.cgi?id=193939
1067 <rdar://problem/46641912>
1069 Reviewed by Ryosuke Niwa.
1071 * Configurations/FeatureDefines.xcconfig:
1073 2019-01-28 Dean Jackson <dino@apple.com>
1075 Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
1076 https://bugs.webkit.org/show_bug.cgi?id=193945
1077 <rdar://problem/47618922>
1079 Reviewed by Antoine Quint.
1081 Calculate the pressure, tiltX and tiltY values for incoming
1082 Pointer Events, which have values when the PlatformTouchEvent
1083 originated from a stylus.
1085 Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
1087 * dom/PointerEvent.h: Default to "mouse".
1088 * dom/ios/PointerEventIOS.cpp: Calculate the values.
1090 2019-01-28 Timothy Hatcher <timothy@apple.com>
1092 Make it easier for non-Apple ports to enable dark mode CSS support.
1093 https://bugs.webkit.org/show_bug.cgi?id=193882
1095 Reviewed by Megan Gardner.
1097 * page/FrameView.cpp:
1098 (WebCore::FrameView::updateBackgroundRecursively): Limit use of system
1099 background color to the Mac platform.
1100 * rendering/RenderTheme.cpp:
1101 (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
1102 (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
1103 (WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
1104 * rendering/RenderTheme.h:
1105 (WebCore::RenderTheme::colorCache const): Deleted.
1106 * rendering/RenderThemeMac.h:
1107 * rendering/RenderThemeMac.mm:
1108 (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
1109 (WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
1110 (WebCore::RenderThemeMac::colorCache const): Deleted.
1112 2019-01-28 Simon Fraser <simon.fraser@apple.com>
1114 svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
1115 https://bugs.webkit.org/show_bug.cgi?id=193930
1117 Reviewed by Tim Horton.
1119 ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
1120 before iterating, since iteration mutates the array.
1122 Tested by ASan tests.
1124 * page/scrolling/ScrollingStateNode.h:
1125 (WebCore::ScrollingStateNode::takeChildren):
1126 * page/scrolling/ScrollingStateTree.cpp:
1127 (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1129 2019-01-28 Simon Fraser <simon.fraser@apple.com>
1131 css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
1132 https://bugs.webkit.org/show_bug.cgi?id=193925
1134 Reviewed by Tim Horton.
1136 Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
1137 tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
1138 node if it's the node being unparented or destroyed.
1140 Tested by existing tests.
1142 * page/scrolling/ScrollingStateTree.cpp:
1143 (WebCore::ScrollingStateTree::unparentNode):
1144 (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1146 2019-01-28 Daniel Bates <dabates@apple.com>
1148 [iOS] Make Window virtual key code computation match Mac
1149 https://bugs.webkit.org/show_bug.cgi?id=193452
1151 Reviewed by Ryosuke Niwa.
1153 Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
1154 web compatibility. On Mac, we prefer to compute the Windows virtual key code from the input
1155 strings of the key event and use the key event's keycode as a last resort.
1157 Test: fast/events/ios/key-events-meta-alt-combinations.html
1159 * platform/ios/PlatformEventFactoryIOS.h:
1160 * platform/ios/PlatformEventFactoryIOS.mm:
1161 (WebCore::isKeypadEvent): Added.
1162 (WebCore::windowsKeyCodeForKeyEvent): Added.
1163 (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
1164 WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
1166 2019-01-28 Antoine Quint <graouts@apple.com>
1168 Limit user-agent interactions based on the touch-action property on iOS
1169 https://bugs.webkit.org/show_bug.cgi?id=193447
1171 Unreviewed build fix.
1174 (WebCore::parentCrossingFrameBoundaries):
1176 2019-01-28 Eric Carlson <eric.carlson@apple.com>
1178 AVStreamSession isn't always available, make a HAVE compile flag for it
1179 https://bugs.webkit.org/show_bug.cgi?id=193889
1180 <rdar://problem/47452863>
1182 Reviewed by Jer Noble.
1184 No new tests, no functional change.
1186 * page/Settings.yaml:
1187 * page/SettingsBase.cpp:
1188 (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
1189 * page/SettingsBase.h:
1190 * page/cocoa/SettingsBaseCocoa.mm:
1191 (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
1192 * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1193 (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
1194 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1195 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1197 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1198 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1199 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
1200 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
1202 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
1203 * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1205 Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
1207 (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
1209 (WebCore::sourceBufferMap):
1210 (WebCore::nextMapID):
1211 (WebCore::bufferWasConsumedCallback):
1212 (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
1213 (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
1214 (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
1215 (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1216 (WebCore::SourceBufferPrivateAVFObjC::append):
1217 (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
1218 (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
1219 (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1220 (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
1221 (-[WebBufferConsumedContext initWithParent:]): Deleted.
1222 (-[WebBufferConsumedContext parent]): Deleted.
1224 2019-01-28 Rob Buis <rbuis@igalia.com>
1226 Update MIME type parser
1227 https://bugs.webkit.org/show_bug.cgi?id=180526
1229 Reviewed by Frédéric Wang.
1231 I overlooked step 11.9.3 [1], for Mimesniff we should not
1232 bail out on missing subtype, but keep trying. Note
1233 that Rfc2045 does require bailing out, as before.
1235 Test: ParsedContentType unittest
1237 [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
1239 * platform/network/ParsedContentType.cpp:
1240 (WebCore::parseToken):
1241 (WebCore::parseContentType):
1243 2019-01-28 Michael Catanzaro <mcatanzaro@igalia.com>
1245 Unreviewed follow-up to r240557, restore a call to makeString
1246 https://bugs.webkit.org/show_bug.cgi?id=192742
1247 <rdar://problem/46757369>
1249 It works if we add this #include that was missing. I got confused by the error messages and
1250 missed that there were two similarly-named headers.
1252 * rendering/RenderLayerCompositor.cpp:
1253 (WebCore::RenderLayerCompositor::logLayerInfo):
1255 2019-01-28 Oriol Brufau <obrufau@igalia.com>
1257 [css-logical] Reject unitless length quirk in 'inset' shorthand
1258 https://bugs.webkit.org/show_bug.cgi?id=193773
1260 Reviewed by Manuel Rego Casasnovas.
1262 Even though its longhands ('top', 'right', 'bottom', 'left') accept the
1263 unitless length quirk, the 'inset' shorthand is a new CSS property and
1264 should reject it. This was resolved by the CSS WG in
1265 https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
1267 Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
1268 imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
1269 imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
1270 imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
1271 imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
1272 imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
1274 * css/parser/CSSPropertyParser.cpp:
1275 (WebCore::CSSPropertyParser::parseSingleValue):
1277 2019-01-28 Zalan Bujtas <zalan@apple.com>
1279 [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
1280 https://bugs.webkit.org/show_bug.cgi?id=193896
1282 Reviewed by Antti Koivisto.
1284 This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
1286 1. Collapsed quirk margin values are ignored on quirk containers
1289 <p> p elements have 1em vertical (top/bottom) quirk margin
1292 In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
1293 Used vertical margin values on the <body> are top: 8px bottom: 8px.
1295 2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
1298 <div style="margin-top: 1px">
1299 <p> p elements have 1em vertical (top/bottom) quirk margin
1303 When <p>'s vertical margin collapses with the parent <div>,
1304 - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
1305 - the collapsed after value stays 1qem quirk value.
1307 When <div> collapses with <body>
1308 - the collapsed before value becomes 16px (max(16px, 8px))
1309 - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
1310 Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
1312 * layout/MarginTypes.h:
1313 (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
1314 * layout/blockformatting/BlockFormattingContext.h:
1315 * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1316 (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
1317 (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
1318 (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
1319 (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
1320 * layout/blockformatting/BlockMarginCollapse.cpp:
1321 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1322 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1323 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1324 (WebCore::Layout::computedPositiveAndNegativeMargin):
1325 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1326 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1328 2019-01-28 Zalan Bujtas <zalan@apple.com>
1330 [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
1331 https://bugs.webkit.org/show_bug.cgi?id=193872
1333 Reviewed by Antti Koivisto.
1335 This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin().
1337 * layout/blockformatting/BlockFormattingContext.cpp:
1338 (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1340 2019-01-28 cathie chen <cathiechen@igalia.com>
1342 Add missing #include in ScrollingTreeFrameScrollingNode.cpp
1343 https://bugs.webkit.org/show_bug.cgi?id=193905
1345 Reviewed by Frédéric Wang.
1347 * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
1348 #include "ScrollingStateFrameScrollingNode.h"
1350 2019-01-28 Zalan Bujtas <zalan@apple.com>
1352 [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
1353 https://bugs.webkit.org/show_bug.cgi?id=193894
1355 Reviewed by Antti Koivisto.
1357 * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1358 (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
1360 2019-01-28 Antoine Quint <graouts@apple.com>
1362 Limit user-agent interactions based on the touch-action property on iOS
1363 https://bugs.webkit.org/show_bug.cgi?id=193447
1364 <rdar://problem/47283874>
1366 Reviewed by Antti Koivisto and Simon Fraser.
1368 We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
1369 or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
1370 a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
1371 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
1372 actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
1373 crossing any frame boundary towards the top-level document's root node.
1375 Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
1376 pointerevents/ios/touch-action-none-on-iframe.html
1377 pointerevents/ios/touch-action-none-on-parent.html
1378 pointerevents/ios/touch-action-none.html
1379 pointerevents/ios/touch-action-pan-x-pan-y.html
1380 pointerevents/ios/touch-action-pan-x.html
1381 pointerevents/ios/touch-action-pan-y.html
1382 pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
1383 pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
1385 * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
1387 (WebCore::Document::invalidateRenderingDependentRegions):
1388 (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
1389 list of elements with a non-auto touch-action property.
1390 (WebCore::Document::absoluteEventRegionForNode):
1391 (WebCore::Document::absoluteRegionForEventTargets):
1392 (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
1393 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
1394 of that list changed as a result, the scrolling coordinator is informed.
1396 (WebCore::Document:: const):
1398 (WebCore::parentCrossingFrameBoundaries):
1399 (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
1400 specified on this element and all of its hierarchy, crossing frame boundary.
1401 (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
1402 for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
1405 * page/scrolling/ScrollingCoordinator.cpp:
1406 (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
1407 throughout the provided frame and all of its subframes.
1408 * page/scrolling/ScrollingCoordinator.h:
1409 (WebCore::ScrollableAreaParameters::operator== const): Deleted.
1410 * page/scrolling/ScrollingCoordinatorTypes.h: Added.
1411 (WebCore::ScrollableAreaParameters::operator== const):
1412 * page/scrolling/ScrollingTree.cpp:
1413 (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
1414 now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
1415 account for overlap and nesting.
1416 * page/scrolling/ScrollingTree.h:
1417 * page/scrolling/ScrollingTreeNode.h:
1418 * platform/EventTrackingRegions.cpp:
1419 (WebCore::operator==):
1420 * platform/EventTrackingRegions.h:
1421 (WebCore::operator!=):
1422 * style/StyleTreeResolver.cpp:
1423 (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
1425 2019-01-27 Michael Catanzaro <mcatanzaro@igalia.com>
1427 Unreviewed, fix WPE/GTK debug builds after r240557
1428 https://bugs.webkit.org/show_bug.cgi?id=192742
1429 <rdar://problem/46757369>
1431 Also fix an improper format string that was recently added in a different commit.
1433 * rendering/RenderLayerCompositor.cpp:
1434 (WebCore::RenderLayerCompositor::logLayerInfo):
1435 (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1437 2018-12-15 Darin Adler <darin@apple.com>
1439 Replace many uses of String::format with more type-safe alternatives
1440 https://bugs.webkit.org/show_bug.cgi?id=192742
1442 Reviewed by Mark Lam.
1444 A while back, String::format was more efficient than string concatenation,
1445 but that is no longer true, and we should prefer String::number, makeString,
1446 or concatenation with the "+" operator to String::format for new code.
1448 This is not as good for programmers who are fond of printf formatting
1449 style, and in some cases it's a little harder to read the strings
1450 interspersed with variables rather than a format string, but it's better
1453 - more efficient (I didn't measure the difference, but it's definitely
1454 slower to use String::Format which calls vsnprintf twice than to use
1456 - works in a type-safe way without a need to use a format specifier such
1457 as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
1458 subtle differences between platforms
1459 - allows us to use StringView in some cases to sidestep the need to
1460 allocate temporary WTF::String objects
1461 - does not require converting each WTF::String to a C string, allowing
1462 us to remove many cases of ".utf8().data()" and similar expressions,
1463 eliminating the allocation of temporary WTF::CString objects
1465 This patch covers a batch of easiest-to-convert call sites.
1466 Later patches will allow us to deprecate or remove String::format.
1468 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1469 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
1470 * Modules/indexeddb/shared/IDBCursorInfo.cpp:
1471 (WebCore::IDBCursorInfo::loggingString const): Ditto.
1472 * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
1473 (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
1474 * Modules/indexeddb/shared/IDBGetRecordData.cpp:
1475 (WebCore::IDBGetRecordData::loggingString const): Ditto.
1476 * Modules/indexeddb/shared/IDBIndexInfo.cpp:
1477 (WebCore::IDBIndexInfo::loggingString const): Ditto.
1478 (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
1479 * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
1480 (WebCore::IDBIterateCursorData::loggingString const): Ditto.
1481 * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1482 (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
1483 * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
1484 (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
1485 * Modules/webdatabase/Database.cpp:
1486 (WebCore::formatErrorMessage): Ditto.
1487 * Modules/webdatabase/SQLError.h:
1488 (WebCore::SQLError::create): Ditto.
1490 * bindings/scripts/CodeGeneratorJS.pm:
1491 (GenerateImplementation): Use makeString.
1493 * bindings/scripts/test/JS/JSInterfaceName.cpp:
1494 * bindings/scripts/test/JS/JSMapLike.cpp:
1495 * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1496 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1497 * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1498 * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1499 * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1500 * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1501 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1502 * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1503 * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1504 * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1505 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1506 * bindings/scripts/test/JS/JSTestException.cpp:
1507 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1508 * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1509 * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1510 * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1511 * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1512 * bindings/scripts/test/JS/JSTestInterface.cpp:
1513 * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1514 * bindings/scripts/test/JS/JSTestIterable.cpp:
1515 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1516 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1517 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1518 * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1519 * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1520 * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1521 * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1522 * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1523 * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1524 * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1525 * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1526 * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1527 * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1528 * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1529 * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1530 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1531 * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1532 * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1533 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1534 * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1535 * bindings/scripts/test/JS/JSTestNode.cpp:
1536 * bindings/scripts/test/JS/JSTestObj.cpp:
1537 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1538 * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1539 * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1540 * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1541 * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1542 * bindings/scripts/test/JS/JSTestSerialization.cpp:
1543 * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
1544 * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1545 * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1546 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1547 * bindings/scripts/test/JS/JSTestStringifier.cpp:
1548 * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1549 * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1550 * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1551 * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1552 * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1553 * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1554 * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1555 Updated expected results.
1557 * css/parser/CSSPropertyParserHelpers.cpp:
1558 (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
1561 * html/HTMLSelectElement.cpp:
1562 (WebCore::HTMLSelectElement::setLength): Use makeString.
1563 * html/ImageDocument.cpp:
1564 (WebCore::ImageDocument::imageUpdated): Ditto.
1565 * html/parser/XSSAuditor.cpp:
1566 (WebCore::XSSAuditor::init): Ditto.
1567 * inspector/InspectorFrontendClientLocal.cpp:
1568 (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
1569 (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
1570 (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
1571 (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
1572 (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
1573 * inspector/agents/InspectorCSSAgent.cpp: Ditto.
1574 * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
1575 * page/MemoryRelease.cpp:
1576 (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
1578 * page/cocoa/ResourceUsageOverlayCocoa.mm:
1579 (WebCore::formatByteNumber): Use String::number.
1580 (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
1582 * page/cocoa/ResourceUsageThreadCocoa.mm:
1583 (WebCore::logFootprintComparison): Use makeString.
1584 * platform/animation/TimingFunction.cpp:
1585 (WebCore::TimingFunction::cssText const): Ditto.
1587 * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1588 (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
1589 * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
1590 (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
1592 * platform/graphics/ca/GraphicsLayerCA.cpp:
1593 (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
1594 (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
1595 (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
1596 (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
1597 * platform/mock/MockRealtimeVideoSource.cpp:
1598 (WebCore::MockRealtimeVideoSource::drawText): Ditto.
1600 * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
1602 * platform/network/ParsedContentRange.cpp:
1603 (WebCore::ParsedContentRange::headerValue const): Use makeString.
1605 * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
1606 compiler conditionals and reorganized the start/stop of namespaces.
1607 (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
1609 * platform/sql/SQLiteDatabase.cpp:
1610 (WebCore::unauthorizedSQLFunction): Use makeString.
1611 * rendering/RenderLayerCompositor.cpp:
1612 (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
1613 * workers/service/server/RegistrationDatabase.cpp:
1614 (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
1615 (WebCore::RegistrationDatabase::importRecords): Ditto.
1617 2019-01-27 Wenson Hsieh <wenson_hsieh@apple.com>
1619 Remove a couple of PLATFORM defines intended for watchOS
1620 https://bugs.webkit.org/show_bug.cgi?id=193888
1622 Reviewed by Alexey Proskuryakov.
1624 Remove the use of !PLATFORM(WATCH), since this is true on every platform.
1626 * editing/cocoa/DictionaryLookup.mm:
1628 2019-01-27 Jiewen Tan <jiewen_tan@apple.com>
1630 Use a load optimizer for some sites
1631 https://bugs.webkit.org/show_bug.cgi?id=193881
1632 <rdar://problem/46325455>
1634 Reviewed by Brent Fulgham.
1636 Expose FormData::flatten to be used by the load optimizer.
1638 * WebCore.xcodeproj/project.pbxproj:
1639 * platform/network/FormData.h:
1641 2019-01-26 Simon Fraser <simon.fraser@apple.com>
1643 Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
1644 https://bugs.webkit.org/show_bug.cgi?id=193879
1646 Reviewed by Antti Koivisto.
1648 Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
1649 This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
1650 makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
1651 updates of the scrolling tree node in an iframe.
1653 To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
1654 nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
1655 simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
1656 connect GraphicsLayers together.
1658 RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
1660 Tested by existing tests.
1663 * rendering/RenderLayer.cpp:
1664 (WebCore::outputPaintOrderTreeRecursive):
1665 * rendering/RenderLayerBacking.cpp:
1666 (WebCore::RenderLayerBacking::updateConfiguration):
1667 (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1668 * rendering/RenderLayerCompositor.cpp:
1669 (WebCore::frameContentsRenderView):
1670 (WebCore::RenderLayerCompositor::frameContentsCompositor):
1671 (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1672 (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
1673 (WebCore::RenderLayerCompositor::detachRootLayer):
1674 (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1675 (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1676 (WebCore::scrollCoordinatedAncestorInParentOfFrame):
1677 (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1678 (WebCore::RenderLayerCompositor::attachScrollingNode):
1679 (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
1680 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1681 * rendering/RenderLayerCompositor.h:
1682 * testing/Internals.cpp:
1683 (WebCore::Internals::scrollingStateTreeAsText const):
1685 2019-01-27 Chris Fleizach <cfleizach@apple.com>
1687 AX: Introduce a static accessibility tree
1688 https://bugs.webkit.org/show_bug.cgi?id=193348
1689 <rdar://problem/47203295>
1691 Reviewed by Ryosuke Niwa.
1693 In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which
1694 could be accessed on a different thread by assistive technologies.
1695 That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the
1696 "live" AccessibilityObjects (which interact with both DOM and Render trees).
1697 These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree
1698 representation and able to be read from anywhere.
1699 Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared
1700 with AccessibilityObject.
1701 This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
1704 * Configurations/FeatureDefines.xcconfig:
1706 * WebCore.xcodeproj/project.pbxproj:
1707 * accessibility/AXObjectCache.cpp:
1708 (WebCore::AXObjectCache::remove):
1709 (WebCore::AXObjectCache::createIsolatedAccessibilityTree):
1710 (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
1711 * accessibility/AXObjectCache.h:
1712 * accessibility/AccessibilityObject.h:
1713 * accessibility/AccessibilityObjectInterface.h: Added.
1714 * accessibility/isolatedtree: Added.
1715 * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
1716 (WebCore::AXIsolatedTree::treeCache):
1717 (WebCore::AXIsolatedTree::AXIsolatedTree):
1718 (WebCore::AXIsolatedTree::create):
1719 (WebCore::AXIsolatedTree::treeForID):
1720 (WebCore::AXIsolatedTree::treeForPageID):
1721 (WebCore::AXIsolatedTree::nodeForID const):
1722 (WebCore::AXIsolatedTree::rootNode):
1723 (WebCore::AXIsolatedTree::removeNode):
1724 (WebCore::AXIsolatedTree::appendNodeChanges):
1725 (WebCore::AXIsolatedTree::applyPendingChanges):
1726 * accessibility/isolatedtree/AXIsolatedTree.h: Added.
1727 (WebCore::AXIsolatedTree::treeIdentifier const):
1728 * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
1729 To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
1730 we may copy an existing node and replace specific values.
1731 (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
1732 (WebCore::AXIsolatedTreeNode::create):
1733 (WebCore::AXIsolatedTreeNode::initializeAttributeData):
1734 (WebCore::AXIsolatedTreeNode::setProperty):
1735 (WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
1736 (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
1737 (WebCore::AXIsolatedTreeNode::boolAttributeValue const):
1738 (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
1739 (WebCore::AXIsolatedTreeNode::intAttributeValue const):
1740 * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
1741 * accessibility/mac/AXObjectCacheMac.mm:
1742 (WebCore::AXObjectCache::associateIsolatedTreeNode):
1743 * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1744 * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1745 (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
1746 (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
1747 (-[WebAccessibilityObjectWrapperBase detach]):
1748 (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1749 (-[WebAccessibilityObjectWrapperBase axBackingObject]):
1750 (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
1751 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1752 (-[WebAccessibilityObjectWrapper role]):
1753 (-[WebAccessibilityObjectWrapper subrole]):
1754 (-[WebAccessibilityObjectWrapper roleDescription]):
1755 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1757 (WebCore::Document::pageID const):
1760 2019-01-26 Simon Fraser <simon.fraser@apple.com>
1762 Allow scrolling tree nodes to exist in a detached state
1763 https://bugs.webkit.org/show_bug.cgi?id=193754
1765 Reviewed by Zalan Bujtas.
1767 One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
1768 is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
1769 in a connected state; attachToStateTree() required a non-zero parent for any node that was not
1772 This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
1773 the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
1774 can be attached. This is a significant difference from compositing, where a subframe can create
1775 GraphicsLayers which don't have to be parented right away, and actually get parented later via
1776 a compositing update in the parent frame.
1778 We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
1779 connection (anything else is too confusing). So we need to be able to instantiate scrolling
1780 tree nodes in a disconnected state, and attach them later.
1782 To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
1783 Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
1784 the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
1785 by m_stateNodeMap, so it's possible to find them and set state on them.
1787 Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
1788 is really an implementation detail.
1790 This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
1791 in m_orphanedSubframeNodes; now the unparenting is controlled by the client.
1793 Currently no code creates unparented nodes so there is no behavior change.
1796 (WebCore::Document::setPageCacheState):
1797 * page/scrolling/AsyncScrollingCoordinator.cpp:
1798 (WebCore::AsyncScrollingCoordinator::createNode):
1799 (WebCore::AsyncScrollingCoordinator::insertNode):
1800 (WebCore::AsyncScrollingCoordinator::unparentNode):
1801 (WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
1802 (WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
1803 (WebCore::AsyncScrollingCoordinator::clearAllNodes):
1804 (WebCore::AsyncScrollingCoordinator::parentOfNode const):
1805 (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
1806 (WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
1807 (WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
1808 (WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
1809 * page/scrolling/AsyncScrollingCoordinator.h:
1810 * page/scrolling/ScrollingCoordinator.h:
1811 (WebCore::ScrollingCoordinator::handleWheelEvent):
1812 (WebCore::ScrollingCoordinator::createNode):
1813 (WebCore::ScrollingCoordinator::insertNode):
1814 (WebCore::ScrollingCoordinator::unparentNode):
1815 (WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
1816 (WebCore::ScrollingCoordinator::detachAndDestroySubtree):
1817 (WebCore::ScrollingCoordinator::clearAllNodes):
1818 (WebCore::ScrollingCoordinator::parentOfNode const):
1819 (WebCore::ScrollingCoordinator::childrenOfNode const):
1820 (WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
1821 (WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
1822 (WebCore::ScrollingCoordinator::clearStateTree): Deleted.
1823 * page/scrolling/ScrollingStateNode.cpp:
1824 (WebCore::ScrollingStateNode::removeFromParent):
1825 (WebCore::ScrollingStateNode::removeChild):
1826 * page/scrolling/ScrollingStateNode.h:
1827 * page/scrolling/ScrollingStateTree.cpp:
1828 (WebCore::ScrollingStateTree::ScrollingStateTree):
1829 (WebCore::ScrollingStateTree::createUnparentedNode):
1830 (WebCore::ScrollingStateTree::insertNode):
1831 (WebCore::ScrollingStateTree::unparentNode):
1832 (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
1833 (WebCore::ScrollingStateTree::detachAndDestroySubtree):
1834 (WebCore::ScrollingStateTree::clear):
1835 (WebCore::ScrollingStateTree::commit):
1836 (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
1837 (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
1838 (showScrollingStateTree):
1839 (WebCore::ScrollingStateTree::attachNode): Deleted.
1840 (WebCore::ScrollingStateTree::detachNode): Deleted.
1841 * page/scrolling/ScrollingStateTree.h:
1842 (WebCore::ScrollingStateTree::nodeCount const):
1843 * rendering/RenderLayerBacking.cpp:
1844 (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1845 * rendering/RenderLayerCompositor.cpp:
1846 (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
1847 (WebCore::RenderLayerCompositor::attachScrollingNode):
1849 2019-01-26 Devin Rousso <drousso@apple.com>
1851 Web Inspector: provide a way to edit the user agent of a remote target
1852 https://bugs.webkit.org/show_bug.cgi?id=193862
1853 <rdar://problem/47359292>
1855 Reviewed by Joseph Pecoraro.
1857 Test: inspector/page/overrideUserAgent.html
1859 * loader/FrameLoader.cpp:
1860 (WebCore::FrameLoader::userAgent const):
1861 (WebCore::FrameLoader::userAgentForJavaScript const):
1863 * inspector/InspectorInstrumentation.h:
1864 (WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
1865 * inspector/InspectorInstrumentation.cpp:
1866 (WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.
1868 * inspector/agents/InspectorPageAgent.h:
1869 * inspector/agents/InspectorPageAgent.cpp:
1870 (WebCore::InspectorPageAgent::disable):
1871 (WebCore::InspectorPageAgent::overrideUserAgent): Added.
1872 (WebCore::InspectorPageAgent::applyUserAgentOverride): Added.
1874 2019-01-26 Zalan Bujtas <zalan@apple.com>
1876 [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
1877 https://bugs.webkit.org/show_bug.cgi?id=193867
1879 Reviewed by Antti Koivisto.
1881 The initial content top/bottom value is the border top + padding top.
1883 This is only a problem when the box has float children only. While computing the height using the bottom-most float,
1884 we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
1885 has (top)border/padding.
1887 Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html
1889 * layout/FormattingContextGeometry.cpp:
1890 (WebCore::Layout::contentHeightForFormattingContextRoot):
1892 2019-01-26 Zalan Bujtas <zalan@apple.com>
1894 [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
1895 https://bugs.webkit.org/show_bug.cgi?id=193865
1897 Reviewed by Antti Koivisto.
1899 Height computation ->
1900 // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
1901 // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
1902 // margin does not collapse with the element's bottom margin
1904 <div style="border: 1px solid green">
1905 <div style="margin-top: 100px;"></div>
1908 When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
1909 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.
1911 Test: fast/block/margin-collapse/collapsed-through-child-simple.html
1913 * layout/MarginTypes.h:
1914 (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
1915 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1916 (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1917 * layout/displaytree/DisplayBox.h:
1918 (WebCore::Display::Box::hasCollapsedThroughMargin const):
1920 2019-01-26 Zalan Bujtas <zalan@apple.com>
1922 [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
1923 https://bugs.webkit.org/show_bug.cgi?id=193864
1925 Reviewed by Antti Koivisto.
1927 * layout/blockformatting/BlockMarginCollapse.cpp:
1928 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
1929 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1931 2019-01-26 Zalan Bujtas <zalan@apple.com>
1933 [LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
1934 https://bugs.webkit.org/show_bug.cgi?id=193855
1936 Reviewed by Antti Koivisto.
1938 Use iterative algorithm to find next/previous siblings.
1940 * layout/layouttree/LayoutBox.cpp:
1941 (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
1943 2019-01-25 Ryosuke Niwa <rniwa@webkit.org>
1945 Need a mechanism to override navigator.userAgent
1946 https://bugs.webkit.org/show_bug.cgi?id=193762
1947 <rdar://problem/47504939>
1949 Reviewed by Brent Fulgham.
1951 Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
1953 * loader/DocumentLoader.h:
1954 (WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
1955 (WebCore::DocumentLoader::customJavaScriptUserAgent const):
1956 * loader/FrameLoader.cpp:
1957 (WebCore::FrameLoader::userAgentForJavaScript const):
1958 * loader/FrameLoader.h:
1959 * page/Navigator.cpp:
1960 (WebCore::Navigator::userAgent const):
1962 2019-01-25 Devin Rousso <drousso@apple.com>
1964 Web Inspector: provide a way to edit page settings on a remote target
1965 https://bugs.webkit.org/show_bug.cgi?id=193813
1966 <rdar://problem/47359510>
1968 Reviewed by Joseph Pecoraro.
1970 Test: inspector/page/overrideSetting.html
1972 * page/Settings.yaml:
1973 * Scripts/GenerateSettings.rb:
1974 * Scripts/SettingsTemplates/Settings.cpp.erb:
1975 * Scripts/SettingsTemplates/Settings.h.erb:
1976 Add support for an `inspectorOverride` boolean value for each setting that will take
1977 precedence over the actual `Setting`'s value when set.
1979 * inspector/agents/InspectorPageAgent.h:
1980 * inspector/agents/InspectorPageAgent.cpp:
1981 (WebCore::InspectorPageAgent::disable):
1982 (WebCore::InspectorPageAgent::overrideSetting): Added.
1984 * inspector/InspectorFrontendHost.idl:
1985 * inspector/InspectorFrontendHost.h:
1986 * inspector/InspectorFrontendHost.cpp:
1987 (WebCore::InspectorFrontendHost::isRemote const): Added.
1988 * inspector/InspectorFrontendClient.h:
1989 (WebCore::InspectorFrontendClient::isRemote const): Added.
1990 * inspector/InspectorFrontendClientLocal.h:
1991 (WebCore::InspectorFrontendClientLocal::isRemote const): Added.
1993 2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
1995 Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
1996 https://bugs.webkit.org/show_bug.cgi?id=193843
1998 Reviewed by Zalan Bujtas.
2001 (WebCore::Document::updateMainArticleElementAfterLayout):
2003 This function currently does a bit of wasted work after every layout, on clients that don't listen to the
2004 "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
2005 don't bother keeping the main article element up to date in this scenario by bailing from
2006 FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
2007 rendered text milestone.
2009 * page/FrameView.cpp:
2010 (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
2012 2019-01-25 Jer Noble <jer.noble@apple.com>
2014 <video> elements not in the DOM should be allowed to AirPlay
2015 https://bugs.webkit.org/show_bug.cgi?id=193837
2018 Reviewed by Eric Carlson.
2020 Test: media/airplay-allows-buffering.html
2022 Some websites will switch between <video> elements backed by MSE to one backed by
2023 a media file in order to implement an AirPlay control. But when a <video> element is
2024 removed from the DOM and paused, further buffering is blocked. For some ports (namely
2025 Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
2026 elements who have been asked to play wirelessly, but whose wireless playback has not
2029 * html/MediaElementSession.cpp:
2030 (WebCore::MediaElementSession::dataBufferingPermitted const):
2031 (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2033 2019-01-25 Keith Rollin <krollin@apple.com>
2035 Update Xcode projects with "Check .xcfilelists" build phase
2036 https://bugs.webkit.org/show_bug.cgi?id=193790
2037 <rdar://problem/47201374>
2039 Reviewed by Alex Christensen.
2041 Support for XCBuild includes specifying inputs and outputs to various
2042 Run Script build phases. These inputs and outputs are specified as
2043 .xcfilelist files. Once created, these .xcfilelist files need to be
2044 kept up-to-date. In order to check that they are up-to-date or not,
2045 add an Xcode build step that invokes an external script that performs
2046 the checking. If the .xcfilelists are found to be out-of-date, update
2047 them, halt the build, and instruct the developer to restart the build
2048 with up-to-date files.
2050 At this time, the checking and regenerating is performed only if the
2051 WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
2052 who want to use this facility can set this variable and test out the
2053 checking/regenerating. Once it seems like there are no egregious
2054 issues that upset a developer's workflow, we'll unconditionally enable
2057 No new tests since there should be no observable behavior difference.
2059 * Scripts/check-xcfilelists.sh: Added.
2060 * WebCore.xcodeproj/project.pbxproj:
2062 2019-01-25 Joseph Pecoraro <pecoraro@apple.com>
2064 Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
2065 https://bugs.webkit.org/show_bug.cgi?id=193796
2066 <rdar://problem/47532910>
2068 Reviewed by Devin Rousso.
2070 * page/ResourceUsageData.h:
2071 * inspector/agents/InspectorCPUProfilerAgent.cpp:
2072 (WebCore::InspectorCPUProfilerAgent::collectSample):
2073 Show the CPU usage without debugger threads in the Web Inspector's timeline.
2075 * page/ResourceUsageThread.h:
2076 * page/cocoa/ResourceUsageThreadCocoa.mm:
2077 (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
2078 For OS(DARWIN) ports, when starting to observe resource usage,
2079 we grab the mach_port_t of SamplingProfiler on the main thread
2080 in a thread safe way. For our purposes (Web Inspector timelines),
2081 this will be good enough to identify the SamplingProfiler thread
2082 during timeline recording. The SamplingProfiler thread won't change
2083 during a timeline recording and recording start/stops will never
2084 miss the SamplingProfiler changing.
2086 (WebCore::filterThreads):
2087 (WebCore::threadSendRights):
2088 (WebCore::threadSendRightsExcludingDebuggerThreads):
2089 (WebCore::cpuUsage):
2090 (WebCore::ResourceUsageThread::platformCollectCPUData):
2091 Calculate CPU usage twice, the second time excluding some threads.
2093 * page/linux/ResourceUsageThreadLinux.cpp:
2094 (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
2095 (WebCore::ResourceUsageThread::platformCollectCPUData):
2096 Stubs for linux ports.
2098 2019-01-25 Zalan Bujtas <zalan@apple.com>
2100 Remove FrameView::m_significantRenderedTextMilestonePending
2101 https://bugs.webkit.org/show_bug.cgi?id=193842
2103 Reviewed by Wenson Hsieh.
2105 Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
2106 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).
2107 This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
2109 * page/FrameView.cpp:
2110 (WebCore::FrameView::resetLayoutMilestones):
2111 (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
2112 (WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
2113 (WebCore::FrameView::qualifiesAsSignificantRenderedText const):
2114 (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2115 (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
2118 2019-01-25 Keith Rollin <krollin@apple.com>
2120 Update Xcode projects with "Apply Configuration to XCFileLists" build target
2121 https://bugs.webkit.org/show_bug.cgi?id=193781
2122 <rdar://problem/47201153>
2124 Reviewed by Alex Christensen.
2126 Part of generating the .xcfilelists used as part of adopting XCBuild
2127 includes running `make DerivedSources.make` from a standalone script.
2128 It’s important for this invocation to have the same environment as
2129 when the actual build invokes `make DerivedSources.make`. If the
2130 environments are different, then the two invocations will provide
2131 different results. In order to get the same environment in the
2132 standalone script, have the script launch xcodebuild targeting the
2133 "Apply Configuration to XCFileLists" build target, which will then
2134 re-invoke our standalone script. The script is now running again, this
2135 time in an environment with all workspace, project, target, xcconfig
2136 and other environment variables established.
2138 The "Apply Configuration to XCFileLists" build target accomplishes
2139 this task via a small embedded shell script that consists only of:
2141 eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
2143 The process that invokes "Apply Configuration to XCFileLists" first
2144 sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
2145 evaluated and exports it into the shell environment. When xcodebuild
2146 is invoked, it inherits the value of this variable and can `eval` the
2147 contents of that variable. Our external standalone script can then set
2148 WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
2149 of command-line parameters needed to restart itself in the appropriate
2152 No new tests since there should be no observable behavior difference.
2154 * WebCore.xcodeproj/project.pbxproj:
2156 2019-01-25 Keith Rollin <krollin@apple.com>
2158 Update WebKitAdditions.xcconfig with correct order of variable definitions
2159 https://bugs.webkit.org/show_bug.cgi?id=193793
2160 <rdar://problem/47532439>
2162 Reviewed by Alex Christensen.
2164 XCBuild changes the way xcconfig variables are evaluated. In short,
2165 all config file assignments are now considered in part of the
2166 evaluation. When using the new build system and an .xcconfig file
2167 contains multiple assignments of the same build setting:
2169 - Later assignments using $(inherited) will inherit from earlier
2170 assignments in the xcconfig file.
2171 - Later assignments not using $(inherited) will take precedence over
2172 earlier assignments. An assignment to a more general setting will
2173 mask an earlier assignment to a less general setting. For example,
2174 an assignment without a condition ('FOO = bar') will completely mask
2175 an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
2177 This affects some of our .xcconfig files, in that sometimes platform-
2178 or sdk-specific definitions appear before the general definitions.
2179 Under the new evaluations rules, the general definitions alway take
2180 effect because they always overwrite the more-specific definitions. The
2181 solution is to swap the order, so that the general definitions are
2182 established first, and then conditionally overwritten by the
2183 more-specific definitions.
2185 No new tests since there should be no observable behavior difference.
2187 * Configurations/Base.xcconfig:
2188 * Configurations/Version.xcconfig:
2190 2019-01-25 Keith Rollin <krollin@apple.com>
2192 Update existing .xcfilelists
2193 https://bugs.webkit.org/show_bug.cgi?id=193791
2194 <rdar://problem/47201706>
2196 Reviewed by Alex Christensen.
2198 Many .xcfilelist files were added in r238824 in order to support
2199 XCBuild. Update these with recent changes to the set of build files
2200 and with the current generate-xcfilelist script.
2202 No new tests since there should be no observable behavior difference.
2204 * DerivedSources-input.xcfilelist:
2205 * DerivedSources-output.xcfilelist:
2206 * UnifiedSources-input.xcfilelist:
2207 * UnifiedSources-output.xcfilelist:
2209 2019-01-25 Brent Fulgham <bfulgham@apple.com>
2211 Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2212 https://bugs.webkit.org/show_bug.cgi?id=193297
2213 <rdar://problem/47158841>
2215 Reviewed by Alex Christensen.
2217 Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
2219 * Modules/websockets/WebSocket.cpp:
2220 (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
2221 * loader/ResourceLoadObserver.cpp:
2222 (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
2223 (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
2224 (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
2225 (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
2226 (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2227 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2229 2019-01-25 Zalan Bujtas <zalan@apple.com>
2231 Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
2232 https://bugs.webkit.org/show_bug.cgi?id=193835
2234 Reviewed by Simon Fraser.
2236 Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
2237 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.
2238 The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
2239 However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
2240 Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
2242 This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
2244 * page/FrameView.cpp:
2245 (WebCore::FrameView::resetLayoutMilestones):
2246 (WebCore::FrameView::loadProgressingStatusChanged):
2247 (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
2248 (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
2249 (WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
2251 (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
2253 2019-01-25 David Kilzer <ddkilzer@apple.com>
2255 Move soft-linking of Lookup.framework out of LookupSPI.h
2256 <https://webkit.org/b/193815>
2258 Reviewed by Tim Horton.
2260 * editing/cocoa/DictionaryLookup.mm:
2261 - Remove unused header.
2263 * editing/mac/DictionaryLookupLegacy.mm:
2264 (WebCore::tokenRange):
2265 (WebCore::showPopupOrCreateAnimationController):
2266 (WebCore::DictionaryLookup::hidePopup):
2267 - Move soft-linking to LookupSoftLink.{h,mm}.
2269 * platform/ios/ValidationBubbleIOS.mm:
2270 (WebCore::ValidationBubble::show):
2271 - Update for changes to UIKitSoftLink.{h,mm} now that
2272 UIAccessibilityAnnouncementNotification is using
2273 SOFT_LINK_CONSTANT*().
2275 2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
2277 [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
2278 https://bugs.webkit.org/show_bug.cgi?id=193829
2280 Reviewed by Tim Horton.
2282 No change in behavior.
2284 * page/EventHandler.h:
2285 * page/ios/EventHandlerIOS.mm:
2286 (WebCore::EventHandler::tryToBeginDragAtPoint):
2287 (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
2288 * platform/ios/WebItemProviderPasteboard.mm:
2289 (linkTemporaryItemProviderFilesToDropStagingDirectory):
2291 2019-01-25 Jon Davis <jond@apple.com>
2293 Updated feature status for several features
2294 https://bugs.webkit.org/show_bug.cgi?id=193794
2296 Reviewed by Joseph Pecoraro.
2298 Updated feature status for the following: CSS Font Display,
2299 CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
2300 File and Directory Entries API, MediaStream Recording API,
2301 Readable Streams, Subresource Integrity, Visual Viewport API,
2306 2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
2308 Need a way for JavaScript (or bundle) code to participate in undo
2309 https://bugs.webkit.org/show_bug.cgi?id=190009
2310 <rdar://problem/44807048>
2312 Reviewed by Ryosuke Niwa.
2314 Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
2316 Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
2317 editing/undo-manager/undo-manager-add-item.html
2318 editing/undo-manager/undo-manager-delete-stale-undo-items.html
2319 editing/undo-manager/undo-manager-item-labels.html
2320 editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
2322 * editing/CompositeEditCommand.h:
2323 * editing/CustomUndoStep.cpp:
2324 (WebCore::CustomUndoStep::didRemoveFromUndoManager):
2326 Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
2327 the UndoItem, removing it from its UndoManager.
2329 * editing/CustomUndoStep.h:
2330 * editing/Editor.cpp:
2331 (WebCore::Editor::registerCustomUndoStep):
2333 Add a helper method to register a CustomUndoStep as a platform undoable step.
2336 * editing/UndoStep.h:
2338 (WebCore::UndoItem::undoManager const):
2339 * page/UndoManager.cpp:
2340 (WebCore::UndoManager::addItem):
2342 Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
2344 * page/UndoManager.h:
2345 * page/UndoManager.idl:
2347 Mark addItem() as capable of throwing exceptions.
2349 2019-01-25 Zalan Bujtas <zalan@apple.com>
2351 [LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
2352 https://bugs.webkit.org/show_bug.cgi?id=193824
2354 Reviewed by Antti Koivisto.
2356 When clear property is set and floats are present, we have to estimate and set the box's vertical position during
2357 static positioning to be able to properly layout its subtree.
2359 <div style="float: left; width: 100px; height: 100px;"></div>
2360 <div style="clear: left;">
2361 <div style="float: left; width: 100px; height: 100px;"></div>
2364 In the above example since the second float's parent clears the first float, the second float is positioned below
2365 the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
2367 * layout/blockformatting/BlockFormattingContext.cpp:
2368 (WebCore::Layout::BlockFormattingContext::layout const):
2369 (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2370 (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2371 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
2372 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
2373 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2374 (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
2375 (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
2376 (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
2377 * layout/blockformatting/BlockFormattingContext.h:
2378 * layout/blockformatting/BlockMarginCollapse.cpp:
2379 (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
2380 * layout/displaytree/DisplayBox.h:
2382 2019-01-25 Zalan Bujtas <zalan@apple.com>
2384 [LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
2385 https://bugs.webkit.org/show_bug.cgi?id=193812
2387 Reviewed by Antti Koivisto.
2389 Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
2391 * layout/blockformatting/BlockFormattingContext.cpp:
2392 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2393 * layout/blockformatting/BlockFormattingContext.h:
2394 * layout/blockformatting/BlockMarginCollapse.cpp:
2395 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
2396 (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2397 * page/FrameViewLayoutContext.cpp:
2398 (WebCore::layoutUsingFormattingContext):
2400 2019-01-25 Antoine Quint <graouts@apple.com>
2402 Use ENABLE_POINTER_EVENTS for the touch-action property
2403 https://bugs.webkit.org/show_bug.cgi?id=193819
2405 Reviewed by Antti Koivisto.
2407 Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
2408 Pointer Events specification of which the touch-action property is a part.
2410 * css/CSSComputedStyleDeclaration.cpp:
2411 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2412 * css/CSSPrimitiveValueMappings.h:
2413 * css/CSSProperties.json:
2414 * css/CSSValueKeywords.in:
2415 * css/StyleBuilderConverter.h:
2416 * css/parser/CSSPropertyParser.cpp:
2417 (WebCore::CSSPropertyParser::parseSingleValue):
2419 (WebCore::Element::allowsDoubleTapGesture const):
2420 * platform/TouchAction.h:
2421 * rendering/style/RenderStyle.h:
2422 * rendering/style/StyleRareNonInheritedData.cpp:
2423 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2424 (WebCore::StyleRareNonInheritedData::operator== const):
2425 * rendering/style/StyleRareNonInheritedData.h:
2427 2019-01-24 Zalan Bujtas <zalan@apple.com>
2429 [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
2430 https://bugs.webkit.org/show_bug.cgi?id=193807
2432 Reviewed by Simon Fraser.
2434 Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
2436 * layout/blockformatting/BlockFormattingContext.cpp:
2437 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2438 * layout/blockformatting/BlockFormattingContext.h:
2439 * layout/blockformatting/BlockMarginCollapse.cpp:
2440 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
2441 (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
2443 2019-01-24 Joseph Pecoraro <pecoraro@apple.com>
2445 Web Inspector: CPU Usage Timeline
2446 https://bugs.webkit.org/show_bug.cgi?id=193730
2447 <rdar://problem/46797201>
2449 Reviewed by Devin Rousso.
2451 Test: inspector/cpu-profiler/tracking.html
2454 * UnifiedSources-input.xcfilelist:
2455 * WebCore.xcodeproj/project.pbxproj:
2458 * inspector/InspectorController.cpp:
2459 (WebCore::InspectorController::createLazyAgents):
2460 * inspector/InstrumentingAgents.cpp:
2461 (WebCore::InstrumentingAgents::reset):
2462 * inspector/InstrumentingAgents.h:
2463 (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
2464 (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
2465 Create and track the CPUProfilerAgent.
2467 * inspector/agents/InspectorTimelineAgent.cpp:
2468 (WebCore::InspectorTimelineAgent::toggleInstruments):
2469 (WebCore::InspectorTimelineAgent::toggleCPUInstrument):
2470 Handle backend auto-start of the CPU instrument / timeline.
2472 * inspector/agents/InspectorCPUProfilerAgent.h:
2473 * inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
2474 (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
2475 (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
2476 (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
2477 (WebCore::InspectorCPUProfilerAgent::startTracking):
2478 (WebCore::InspectorCPUProfilerAgent::stopTracking):
2479 (WebCore::InspectorCPUProfilerAgent::collectSample):
2480 CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
2482 * inspector/agents/InspectorTimelineAgent.h:
2483 * inspector/agents/InspectorMemoryAgent.cpp:
2484 (WebCore::InspectorMemoryAgent::startTracking):
2485 (WebCore::InspectorMemoryAgent::collectSample):
2486 Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
2488 * page/ResourceUsageData.h:
2489 * page/ResourceUsageThread.cpp:
2490 (WebCore::ResourceUsageThread::addObserver):
2491 (WebCore::ResourceUsageThread::removeObserver):
2492 (WebCore::ResourceUsageThread::notifyObservers):
2493 (WebCore::ResourceUsageThread::recomputeCollectionMode):
2494 (WebCore::ResourceUsageThread::threadBody):
2495 * page/ResourceUsageThread.h:
2496 * page/cocoa/ResourceUsageOverlayCocoa.mm:
2497 (WebCore::ResourceUsageOverlay::platformInitialize):
2498 * page/cocoa/ResourceUsageThreadCocoa.mm:
2499 (WebCore::ResourceUsageThread::platformCollectCPUData):
2500 (WebCore::ResourceUsageThread::platformCollectMemoryData):
2501 (WebCore::ResourceUsageThread::platformThreadBody): Deleted.
2502 * page/linux/ResourceUsageOverlayLinux.cpp:
2503 (WebCore::ResourceUsageOverlay::platformInitialize):
2504 * page/linux/ResourceUsageThreadLinux.cpp:
2505 (WebCore::ResourceUsageThread::platformCollectCPUData):
2506 (WebCore::ResourceUsageThread::platformCollectMemoryData):
2507 (WebCore::ResourceUsageThread::platformThreadBody):
2508 Give each observer their own collection mode. The ResourceUsageThread
2509 will then collect data that is the union of all of the active observers.
2510 This allows collecting CPU and Memory data separately, reducing the cost
2511 of each when gathered individually.
2513 2019-01-24 Charles Vazac <cvazac@akamai.com>
2515 Implement PerformanceObserver.supportedEntryTypes
2516 https://bugs.webkit.org/show_bug.cgi?id=193428
2518 PerformanceObserver.supportedEntryTypes should return an array of
2519 entryTypes that can be observed per specification
2520 https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
2522 Reviewed by Joseph Pecoraro.
2524 This is covered by web-platform-tests
2525 LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
2527 * page/PerformanceObserver.cpp:
2528 (WebCore::PerformanceObserver::supportedEntryTypes):
2529 * page/PerformanceObserver.h:
2530 * page/PerformanceObserver.idl:
2532 2019-01-24 Truitt Savell <tsavell@apple.com>
2534 Unreviewed, rolling out r240446.
2536 Casued 5 API failures
2540 "Activate the WebResourceLoadStatisticsStore in the
2541 NetworkProcess and deactivate it in the UIProcess."
2542 https://bugs.webkit.org/show_bug.cgi?id=193297
2543 https://trac.webkit.org/changeset/240446
2545 2019-01-24 Wenson Hsieh <wenson_hsieh@apple.com>
2547 [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
2548 https://bugs.webkit.org/show_bug.cgi?id=193758
2549 <rdar://problem/43614978>
2551 Reviewed by Tim Horton.
2553 CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
2554 (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
2555 a helper method to select all the text inside of a text form control, called `selectInput`, which normally
2556 invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
2557 setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
2558 the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
2560 This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
2561 reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
2563 1. Roll out this ancient demo hack, in favor of standardized behavior.
2564 2. Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
2565 want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
2566 achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
2567 selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
2568 input, but everywhere else, it selects all the text in the input element.
2570 This causes 6 existing layout tests to begin passing on iOS.
2572 * html/HTMLInputElement.cpp:
2573 (WebCore::HTMLInputElement::updateFocusAppearance):
2574 (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
2575 * html/HTMLInputElement.h:
2576 * html/HTMLTextFormControlElement.cpp:
2577 (WebCore::HTMLTextFormControlElement::select):
2579 2019-01-24 Jer Noble <jer.noble@apple.com>
2581 Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
2582 https://bugs.webkit.org/show_bug.cgi?id=193778
2584 Reviewed by Jon Lee.
2586 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2587 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2589 2019-01-24 Zalan Bujtas <zalan@apple.com>
2591 DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
2592 https://bugs.webkit.org/show_bug.cgi?id=193741
2593 <rdar://problem/47135030>
2595 Reviewed by Antti Koivisto and Simon Fraser.
2597 fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
2598 1. the received data is not "contentful" yet
2599 2. and we are expecting some more (loading is not complete yet)
2600 3. but no layout is initiated anymore
2601 nothing triggers the milestone firing.
2603 This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
2605 * page/FrameView.cpp:
2606 (WebCore::FrameView::FrameView):
2607 (WebCore::FrameView::loadProgressingStatusChanged):
2609 2019-01-24 Brent Fulgham <bfulgham@apple.com>
2611 Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
2612 https://bugs.webkit.org/show_bug.cgi?id=193297
2613 <rdar://problem/47158841>
2615 Reviewed by Alex Christensen.
2617 Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
2619 * Modules/websockets/WebSocket.cpp:
2620 (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
2621 * loader/ResourceLoadObserver.cpp:
2622 (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
2623 (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
2624 (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
2625 (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
2626 (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
2627 (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2629 2019-01-24 John Wilander <wilander@apple.com>
2631 Add Ad Click Attribution as an internal/experimental feature
2632 https://bugs.webkit.org/show_bug.cgi?id=193685
2633 <rdar://problem/47450399>
2635 Reviewed by Brent Fulgham.
2637 Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
2639 * html/HTMLAnchorElement.h:
2640 * html/HTMLAnchorElement.idl:
2641 * html/HTMLAttributeNames.in:
2642 Addeed two new experimental attributes:
2643 - adcampaignid: Ad campaign ID.
2644 - addestination: Ad link destination site.
2645 * page/RuntimeEnabledFeatures.h:
2646 (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
2647 (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
2648 * page/Settings.yaml:
2650 2019-01-24 Youenn Fablet <youenn@apple.com>
2652 Use MonotonicTime in WorkerRunLoop
2653 https://bugs.webkit.org/show_bug.cgi?id=193417
2655 Reviewed by Saam Barati.
2657 Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
2658 Ditto for WorkerRunLoop.
2659 No easy way to test the change which should not be easily observable.
2661 * workers/WorkerRunLoop.cpp:
2662 (WebCore::WorkerRunLoop::runInMode):
2664 2019-01-24 Ross Kirsling <ross.kirsling@sony.com>
2666 Move FileSystem to WTF
2667 https://bugs.webkit.org/show_bug.cgi?id=193602
2669 Reviewed by Yusuke Suzuki.
2671 * Modules/encryptedmedia/CDM.cpp:
2672 * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2673 * Modules/entriesapi/DOMFileSystem.cpp:
2674 * Modules/entriesapi/FileSystemEntry.cpp:
2675 * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
2676 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2677 * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2678 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2679 * Modules/webdatabase/DatabaseTracker.cpp:
2680 * Modules/webdatabase/OriginLock.cpp:
2681 * Modules/webdatabase/OriginLock.h:
2682 * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
2683 * PlatformMac.cmake:
2684 * PlatformPlayStation.cmake:
2685 * PlatformWin.cmake:
2688 * WebCore.xcodeproj/project.pbxproj:
2689 * bindings/js/GCController.cpp:
2690 * dom/DataTransferItem.cpp:
2691 * editing/cocoa/WebContentReaderCocoa.mm:
2693 * fileapi/FileCocoa.mm:
2694 * html/FileInputType.cpp:
2695 * html/FileListCreator.cpp:
2696 * loader/appcache/ApplicationCacheHost.cpp:
2697 * loader/appcache/ApplicationCacheStorage.cpp:
2699 * page/SecurityOrigin.cpp:
2700 * page/SecurityOriginData.cpp:
2701 * platform/FileHandle.h:
2702 * platform/FileStream.cpp:
2703 * platform/FileStream.h:
2704 * platform/SharedBuffer.h:
2705 * platform/SourcesGLib.txt:
2706 * platform/cocoa/FileMonitorCocoa.mm:
2707 * platform/glib/FileMonitorGLib.cpp:
2708 * platform/glib/SharedBufferGlib.cpp:
2709 * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2710 * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2711 * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
2712 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2713 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2714 * platform/ios/QuickLook.mm:
2715 * platform/ios/WebItemProviderPasteboard.mm:
2716 * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
2717 * platform/network/BlobDataFileReference.cpp:
2718 * platform/network/BlobRegistryImpl.cpp:
2719 * platform/network/BlobResourceHandle.cpp:
2720 * platform/network/FormData.cpp:
2721 * platform/network/cf/FormDataStreamCFNet.cpp:
2722 * platform/network/cocoa/ResourceRequestCocoa.mm:
2723 * platform/network/curl/CookieJarDB.cpp:
2724 * platform/network/curl/CurlCacheEntry.h:
2725 * platform/network/curl/CurlCacheManager.cpp:
2726 * platform/network/curl/CurlFormDataStream.h:
2727 * platform/network/curl/CurlRequest.h:
2728 * platform/network/curl/NetworkStorageSessionCurl.cpp:
2729 * platform/network/curl/ResourceHandleCurl.cpp:
2730 * platform/network/mac/BlobDataFileReferenceMac.mm:
2731 * platform/network/soup/ResourceHandleSoup.cpp:
2732 * platform/network/soup/SoupNetworkSession.cpp:
2733 * platform/posix/SharedBufferPOSIX.cpp:
2734 * platform/sql/SQLiteFileSystem.cpp:
2735 * platform/text/hyphen/HyphenationLibHyphen.cpp:
2736 * platform/win/SearchPopupMenuDB.cpp:
2737 * rendering/RenderTheme.cpp:
2738 * rendering/RenderThemeGtk.cpp:
2739 * rendering/RenderThemeWin.cpp:
2740 * workers/service/server/RegistrationDatabase.cpp:
2742 2019-01-24 Zalan Bujtas <zalan@apple.com>
2744 [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
2745 https://bugs.webkit.org/show_bug.cgi?id=193768
2747 Reviewed by Antti Koivisto.
2749 When it comes to the actual used values it does not really matter, only from correctness point of view.
2750 (This patch also moves some checks to their correct place.)
2752 * layout/blockformatting/BlockMarginCollapse.cpp:
2753 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2754 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2755 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2756 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
2757 (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
2758 (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2760 2019-01-23 Simon Fraser <simon.fraser@apple.com>
2762 Add "frame hosting" nodes to the scrolling tree
2763 https://bugs.webkit.org/show_bug.cgi?id=193753
2765 Reviewed by Antti Koivisto.
2767 When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
2768 require the iframe's scrolling node to get reparented in a new ancestor, which requires
2769 a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
2771 Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
2772 nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
2773 to provide a consistent parent node for the subframe's scrolling node.
2775 This patch adds the node types, but does not instantiate them yet.
2778 * WebCore.xcodeproj/project.pbxproj:
2779 * page/scrolling/ScrollingCoordinator.cpp:
2780 (WebCore::operator<<):
2781 * page/scrolling/ScrollingCoordinator.h:
2782 * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
2783 (WebCore::ScrollingStateFrameHostingNode::create):
2784 (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
2785 (WebCore::ScrollingStateFrameHostingNode::clone):
2786 (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
2787 * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
2788 * page/scrolling/ScrollingStateNode.h:
2789 (WebCore::ScrollingStateNode::isFrameHostingNode const):
2790 * page/scrolling/ScrollingStateTree.cpp:
2791 (WebCore::ScrollingStateTree::createNode):
2792 * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
2793 (WebCore::ScrollingTreeFrameHostingNode::create):
2794 (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
2795 (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
2796 (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
2797 (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
2798 * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
2799 * page/scrolling/ScrollingTreeNode.h:
2800 (WebCore::ScrollingTreeNode::isFrameHostingNode const):
2801 * page/scrolling/ios/ScrollingTreeIOS.cpp:
2802 (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
2803 * page/scrolling/mac/ScrollingTreeMac.cpp:
2804 (ScrollingTreeMac::createScrollingTreeNode):
2805 * rendering/RenderLayerBacking.cpp:
2806 (WebCore::RenderLayerBacking::~RenderLayerBacking):
2807 (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
2808 (WebCore::operator<<):
2809 * rendering/RenderLayerBacking.h:
2810 * rendering/RenderLayerCompositor.cpp:
2811 (WebCore::scrollCoordinationRoleForNodeType):
2812 (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
2813 (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2814 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2815 * rendering/RenderLayerCompositor.h:
2817 2019-01-24 Eric Carlson <eric.carlson@apple.com>
2819 [iOS] Enable media element volume on iPad
2820 https://bugs.webkit.org/show_bug.cgi?id=193745
2821 <rdar://problem/47452297>
2823 Reviewed by Jer Noble.
2825 * html/HTMLMediaElement.cpp:
2826 (WebCore::HTMLMediaElement::setVolume):
2827 (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
2828 (WebCore::HTMLMediaElement::updateVolume):
2830 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2831 (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
2833 2019-01-24 Carlos Garcia Campos <cgarcia@igalia.com>
2835 [GTK][WPE] Support JPEG 2000 images
2836 https://bugs.webkit.org/show_bug.cgi?id=186272
2838 Reviewed by Žan Doberšek.
2840 Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
2843 * platform/ImageDecoders.cmake:
2844 * platform/MIMETypeRegistry.cpp:
2845 (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
2846 * platform/image-decoders/ScalableImageDecoder.cpp:
2847 (WebCore::ScalableImageDecoder::create):
2848 * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
2849 (WebCore::syccToRGB):
2850 (WebCore::sycc444ToRGB):
2851 (WebCore::sycc422ToRGB):
2852 (WebCore::sycc420ToRGB):
2853 (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
2854 (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
2855 (WebCore::JPEG2000ImageDecoder::decode):
2856 * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
2858 2019-01-23 Simon Fraser <simon.fraser@apple.com>
2860 Change some RenderLayerCompositor functions to use references
2861 https://bugs.webkit.org/show_bug.cgi?id=193760
2863 Reviewed by Zalan Bujtas.
2865 RenderWidget* -> RenderWidget&
2867 * rendering/RenderLayerBacking.cpp:
2868 (WebCore::RenderLayerBacking::updateAfterWidgetResize):
2869 (WebCore::RenderLayerBacking::updateConfiguration):
2870 * rendering/RenderLayerCompositor.cpp:
2871 (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2872 (WebCore::RenderLayerCompositor::updateBacking):
2873 (WebCore::RenderLayerCompositor::frameContentsCompositor):
2874 (WebCore::RenderLayerCompositor::parentFrameContentLayers):
2875 * rendering/RenderLayerCompositor.h:
2877 2019-01-23 Benjamin Poulain <benjamin@webkit.org>
2879 <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
2880 https://bugs.webkit.org/show_bug.cgi?id=193742
2882 Reviewed by Eric Carlson.
2884 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2885 The original bug was fixed, see radar: rdar://problem/27686430
2887 2019-01-23 Sihui Liu <sihui_liu@apple.com>
2889 Clean up IndexedDB files between tests
2890 https://bugs.webkit.org/show_bug.cgi?id=192796
2891 <rdar://problem/46824999>
2893 Reviewed by Geoffrey Garen.
2895 We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
2897 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2898 (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2899 (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2901 2019-01-23 Oriol Brufau <obrufau@igalia.com>
2903 Add CSS Logical spec to features.json
2904 https://bugs.webkit.org/show_bug.cgi?id=193717
2906 Reviewed by Manuel Rego Casasnovas.
2910 2019-01-22 Conrad Shultz <conrad_shultz@apple.com>
2912 Clean up USE(WEB_THREAD)
2913 https://bugs.webkit.org/show_bug.cgi?id=193698
2915 Rubber-stamped by Tim Horton.
2917 * page/CaptionUserPreferencesMediaAF.cpp:
2918 (WebCore::userCaptionPreferencesChangedNotificationCallback):
2919 * platform/cf/MainThreadSharedTimerCF.cpp:
2920 (WebCore::applicationDidBecomeActive):
2921 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2922 (WebCore::dispatchToMainThread):
2923 * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
2924 (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
2925 * platform/ios/LegacyTileCache.mm:
2926 (WebCore::LegacyTileCache::layoutTiles):
2927 (WebCore::LegacyTileCache::setTilingMode):
2928 * platform/ios/WebCoreMotionManager.mm:
2929 (-[WebCoreMotionManager sendAccelerometerData:]):
2930 (-[WebCoreMotionManager sendMotionData:withHeading:]):
2931 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2932 (VideoFullscreenControllerContext::requestUpdateInlineRect):
2933 (VideoFullscreenControllerContext::requestVideoContentLayer):
2934 (VideoFullscreenControllerContext::returnVideoContentLayer):
2935 (VideoFullscreenControllerContext::didSetupFullscreen):
2936 (VideoFullscreenControllerContext::willExitFullscreen):
2937 (VideoFullscreenControllerContext::didExitFullscreen):
2938 (VideoFullscreenControllerContext::didCleanupFullscreen):
2939 (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
2940 (VideoFullscreenControllerContext::requestFullscreenMode):
2941 (VideoFullscreenControllerContext::setVideoLayerFrame):
2942 (VideoFullscreenControllerContext::setVideoLayerGravity):
2943 (VideoFullscreenControllerContext::fullscreenModeChanged):
2944 (VideoFullscreenControllerContext::play):
2945 (VideoFullscreenControllerContext::pause):
2946 (VideoFullscreenControllerContext::togglePlayState):
2947 (VideoFullscreenControllerContext::toggleMuted):
2948 (VideoFullscreenControllerContext::setMuted):
2949 (VideoFullscreenControllerContext::setVolume):
2950 (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
2951 (VideoFullscreenControllerContext::beginScrubbing):
2952 (VideoFullscreenControllerContext::endScrubbing):
2953 (VideoFullscreenControllerContext::seekToTime):
2954 (VideoFullscreenControllerContext::fastSeek):
2955 (VideoFullscreenControllerContext::beginScanningForward):
2956 (VideoFullscreenControllerContext::beginScanningBackward):
2957 (VideoFullscreenControllerContext::endScanning):
2958 (VideoFullscreenControllerContext::selectAudioMediaOption):
2959 (VideoFullscreenControllerContext::selectLegibleMediaOption):
2960 (VideoFullscreenControllerContext::duration const):
2961 (VideoFullscreenControllerContext::currentTime const):
2962 (VideoFullscreenControllerContext::bufferedTime const):
2963 (VideoFullscreenControllerContext::isPlaying const):
2964 (VideoFullscreenControllerContext::playbackRate const):
2965 (VideoFullscreenControllerContext::seekableRanges const):
2966 (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
2967 (VideoFullscreenControllerContext::liveUpdateInterval const):
2968 (VideoFullscreenControllerContext::canPlayFastReverse const):
2969 (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
2970 (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
2971 (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
2972 (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
2973 (VideoFullscreenControllerContext::externalPlaybackEnabled const):
2974 (VideoFullscreenControllerContext::externalPlaybackTargetType const):
2975 (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
2976 (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
2977 (VideoFullscreenControllerContext::setUpFullscreen):
2978 (VideoFullscreenControllerContext::exitFullscreen):
2979 (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
2980 (-[WebVideoFullscreenController enterFullscreen:mode:]):
2981 (-[WebVideoFullscreenController exitFullscreen]):
2982 (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
2983 * platform/ios/wak/WAKWindow.mm:
2984 (-[WAKWindow setVisible:]):
2985 (-[WAKWindow setScreenScale:]):
2986 (-[WAKWindow sendEvent:]):
2987 (-[WAKWindow sendMouseMoveEvent:contentChange:]):
2988 * platform/network/ios/NetworkStateNotifierIOS.mm:
2989 (WebCore::NetworkStateNotifier::startObserving):
2990 * rendering/RenderThemeIOS.mm:
2991 (WebCore::contentSizeCategoryDidChange):
2993 2019-01-23 David Kilzer <ddkilzer@apple.com>
2995 REGRESSION (r240292): Attempt to fix WinCairo build
2997 * platform/network/curl/CurlResourceHandleDelegate.cpp:
2998 (WebCore::handleCookieHeaders): Remove argument to
2999 NetworkingContext::storageSession().
3001 2019-01-23 Wenson Hsieh <wenson_hsieh@apple.com>
3003 Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
3004 https://bugs.webkit.org/show_bug.cgi?id=193706
3005 <rdar://problem/44807048>
3007 Reviewed by Ryosuke Niwa.
3009 Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
3010 label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
3011 undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
3012 label simultaneously. There should be no change in behavior.
3014 * editing/CompositeEditCommand.cpp:
3015 (WebCore::EditCommandComposition::label const):
3016 * editing/CompositeEditCommand.h:
3017 * editing/CustomUndoStep.cpp:
3018 (WebCore::CustomUndoStep::label const):
3019 * editing/CustomUndoStep.h:
3020 * editing/EditAction.cpp:
3021 (WebCore::undoRedoLabel):
3022 (WebCore::nameForUndoRedo): Deleted.
3023 * editing/EditAction.h:
3025 Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
3028 * editing/UndoStep.h:
3030 Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
3031 localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
3033 2019-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
3035 [SOUP] Clean up NetworkStorageSession
3036 https://bugs.webkit.org/show_bug.cgi?id=193707
3038 Reviewed by Carlos Garcia Campos.
3040 A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
3041 complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
3042 know the session has always already been created. The soupNetworkSession getter can now
3043 return a reference rather than a pointer, because it will never be NULL except after it has
3044 been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
3045 before process termination after nothing else is using it. Cookie jar syncing can also go
3046 away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
3049 * platform/network/NetworkStorageSession.h:
3050 (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
3051 * platform/network/soup/DNSResolveQueueSoup.cpp:
3052 (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
3053 (WebCore::DNSResolveQueueSoup::platformResolve):
3054 (WebCore::DNSResolveQueueSoup::resolve):
3055 * platform/network/soup/NetworkStorageSessionSoup.cpp:
3056 (WebCore::NetworkStorageSession::NetworkStorageSession):
3057 (WebCore::NetworkStorageSession::~NetworkStorageSession):
3058 (WebCore::NetworkStorageSession::soupNetworkSession const):
3059 (WebCore::NetworkStorageSession::clearSoupNetworkSession):
3060 (WebCore::NetworkStorageSession::cookieStorage const):
3061 (WebCore::NetworkStorageSession::setCookieStorage):
3062 (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
3063 (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
3064 * platform/network/soup/SocketStreamHandleImplSoup.cpp:
3065 (WebCore::SocketStreamHandleImpl::create):
3067 2019-01-23 Zalan Bujtas <zalan@apple.com>
3069 [LFC][BFC] computeStaticPosition should include estimated computation as well.
3070 https://bugs.webkit.org/show_bug.cgi?id=193719
3072 Reviewed by Antti Koivisto.
3074 Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
3075 It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
3076 the containing block's width).
3077 This is also in preparation for moving 'clear' positioning to computeStaticPosition.
3079 * layout/blockformatting/BlockFormattingContext.cpp:
3080 (WebCore::Layout::BlockFormattingContext::layout const):
3081 (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3082 (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
3083 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
3084 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
3085 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
3086 (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
3087 (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3088 (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
3089 (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
3090 (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
3091 (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
3092 (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
3093 (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
3094 * layout/blockformatting/BlockFormattingContext.h:
3095 * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3096 (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3097 * layout/blockformatting/BlockMarginCollapse.cpp:
3098 (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
3100 2019-01-22 Simon Fraser <simon.fraser@apple.com>
3102 Compositing updates need to reparent scrolling tree nodes with a changed ancestor
3103 https://bugs.webkit.org/show_bug.cgi?id=193699
3105 Reviewed by Frédéric Wang.
3107 Now that compositing updates are incremental and may not do a full layer walk,
3108 we need to ensure that when a scrolling tree node is removed, we traverse to all
3109 descendant layers whose scrolling tree nodes refer to the removed node as their parent.
3111 To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
3112 ensures that the updateBackingAndHierarchy part of the compositing update traverses
3113 layers with the bit set.
3115 Adjust the compositing logging to make the legend easier to read.
3117 Tests: scrollingcoordinator/reparent-across-compositing-layers.html
3118 scrollingcoordinator/reparent-with-layer-removal.html
3120 * page/scrolling/AsyncScrollingCoordinator.cpp:
3121 (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
3122 * page/scrolling/AsyncScrollingCoordinator.h:
3123 * page/scrolling/ScrollingCoordinator.h:
3124 (WebCore::ScrollingCoordinator::childrenOfNode const):
3125 * rendering/RenderLayer.cpp:
3126 (WebCore::outputPaintOrderTreeLegend):
3127 (WebCore::outputPaintOrderTreeRecursive):
3128 * rendering/RenderLayer.h:
3129 * rendering/RenderLayerCompositor.cpp:
3130 (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
3131 (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
3133 2019-01-23 Oriol Brufau <obrufau@igalia.com>
3135 [css-logical] Implement flow-relative inset properties
3136 https://bugs.webkit.org/show_bug.cgi?id=189441
3138 Reviewed by Dean Jackson.
3140 Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
3141 'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
3142 behind the CSSLogicalEnabled runtime flag.
3144 Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
3145 webexposed/css-properties-behind-flags.html
3147 * css/CSSComputedStyleDeclaration.cpp:
3148 (WebCore::isLayoutDependent):
3149 (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3150 * css/CSSProperties.json:
3151 * css/CSSProperty.cpp:
3152 (WebCore::CSSProperty::resolveDirectionAwareProperty):
3153 (WebCore::CSSProperty::isDirectionAwareProperty):
3154 * css/StyleProperties.cpp:
3155 (WebCore::StyleProperties::getPropertyValue const):
3156 (WebCore::StyleProperties::asText const):
3157 * css/parser/CSSParserFastPaths.cpp:
3158 (WebCore::isSimpleLengthPropertyID):
3159 * css/parser/CSSPropertyParser.cpp:
3160 (WebCore::CSSPropertyParser::parseSingleValue):
3161 (WebCore::CSSPropertyParser::parseShorthand):
3163 2019-01-23 Oriol Brufau <obrufau@igalia.com>
3165 [css-grid] Properly handle static positions of abspos inside grid items
3166 https://bugs.webkit.org/show_bug.cgi?id=193657
3168 Reviewed by Javier Fernandez.
3170 Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
3171 Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
3172 and only if it's needed (not for abspos descentants in their static position).
3173 Add logicalOffsetForChild that finds the value to be set by the functions above.
3174 Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
3176 Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
3177 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
3178 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
3179 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
3180 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
3181 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
3182 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
3183 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
3184 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
3185 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
3186 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
3187 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
3188 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
3189 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
3190 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
3191 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
3192 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
3193 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
3194 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
3195 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
3196 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
3197 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
3198 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
3199 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
3200 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
3201 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
3202 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
3203 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
3204 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
3205 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
3206 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
3207 imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
3209 * rendering/RenderGrid.cpp:
3210 (WebCore::RenderGrid::layoutGridItems):
3211 (WebCore::RenderGrid::layoutPositionedObject):
3212 (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
3213 (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
3214 (WebCore::RenderGrid::setLogicalPositionForChild const):
3215 (WebCore::RenderGrid::setLogicalOffsetForChild const):
3216 (WebCore::RenderGrid::logicalOffsetForChild const):
3217 * rendering/RenderGrid.h:
3219 2019-01-23 Rob Buis <rbuis@igalia.com>
3221 Update MIME type parser
3222 https://bugs.webkit.org/show_bug.cgi?id=180526
3224 Reviewed by Frédéric Wang.
3226 Add an enum to allow two modes of MIME type parsing, one mode
3227 to keep supporting RFC2045 as before, and one mode to support
3228 the updated MIME parser from mimesniff [1]. Mimesniff support
3229 brings the following changes:
3230 - allows parameter names without matching =value.
3231 - skips whitespace after subtype, parameter value and before
3233 - lower cases MIME type and parameter name.
3234 - parameter names parsed before are discarded.
3236 The old mode is still used by CDM.cpp and MIMEHeader.cpp.
3238 [1] https://mimesniff.spec.whatwg.org/
3240 * Modules/encryptedmedia/CDM.cpp:
3241 (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
3242 * platform/network/MIMEHeader.cpp:
3243 (WebCore::MIMEHeader::parseHeader):
3244 * platform/network/ParsedContentType.cpp:
3245 (WebCore::DummyParsedContentType::setContentType const):
3246 (WebCore::DummyParsedContentType::setContentTypeParameter const):
3247 (WebCore::isQuotedStringTokenCharacter):
3248 (WebCore::isTokenCharacter):
3249 (WebCore::parseToken):
3250 (WebCore::containsNonTokenCharacters):
3251 (WebCore::parseQuotedString):
3252 (WebCore::isNotForwardSlash):
3253 (WebCore::isNotSemicolon):
3254 (WebCore::isNotSemicolonOrEqualSign):
3255 (WebCore::parseContentType):
3256 (WebCore::isValidContentType):
3257 (WebCore::ParsedContentType::ParsedContentType):
3258 (WebCore::ParsedContentType::setContentType):
3259 (WebCore::isNonTokenCharacter):
3260 (WebCore::isNonQuotedStringTokenCharacter):
3261 (WebCore::ParsedContentType::setContentTypeParameter):
3262 * platform/network/ParsedContentType.h:
3264 Test: web-platform-tests/xhr/overridemimetype-blob.html
3266 2019-01-22 Wenson Hsieh <wenson_hsieh@apple.com>
3268 Introduce CustomUndoStep.h and CustomUndoStep.cpp
3269 https://bugs.webkit.org/show_bug.cgi?id=193704
3270 <rdar://problem/44807048>
3272 Reviewed by Ryosuke Niwa.
3274 This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
3275 class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
3277 No change in behavior.
3280 * WebCore.xcodeproj/project.pbxproj:
3281 * editing/CustomUndoStep.cpp:
3282 (WebCore::CustomUndoStep::CustomUndoStep):
3286 (WebCore::CustomUndoStep::unapply):
3287 (WebCore::CustomUndoStep::reapply):
3289 If possible, invoke the UndoItem's undo and redo handlers.
3291 (WebCore::CustomUndoStep::isValid const):
3292 * editing/CustomUndoStep.h:
3293 * editing/EditingStyle.cpp:
3294 * editing/InsertEditableImageCommand.cpp:
3295 (WebCore::InsertEditableImageCommand::doApply):
3297 Unified build fixes.
3301 2019-01-22 Simon Fraser <simon.fraser@apple.com>
3303 Adding a child to a ScrollingStateNode needs to trigger a tree state commit
3304 https://bugs.webkit.org/show_bug.cgi?id=193682
3306 Reviewed by Zalan Bujtas.
3308 Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
3309 need to trigger scrolling tree updates, and currently do not.
3311 Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
3312 this flag when committing the scrolling tree because we always eagerly traverse children, but
3313 we could use it to optimize later. The important part is that we use it to trigger a tree update.
3315 Can't test via z-reordering until webkit.org/b/192529 is fixed.
3317 Tests: scrollingcoordinator/gain-scrolling-node-parent.html
3318 scrollingcoordinator/lose-scrolling-node-parent.html
3320 * page/scrolling/ScrollingStateNode.cpp:
3321 (WebCore::ScrollingStateNode::appendChild):
3322 (WebCore::ScrollingStateNode::insertChild):
3323 (WebCore::ScrollingStateNode::removeChildAtIndex):
3324 * page/scrolling/ScrollingStateNode.h:
3325 * page/scrolling/ScrollingStateTree.cpp:
3326 (WebCore::ScrollingStateTree::attachNode):
3328 2019-01-22 Devin Rousso <drousso@apple.com>
3330 Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
3331 https://bugs.webkit.org/show_bug.cgi?id=116191
3332 <rdar://problem/13905910>
3334 Reviewed by Joseph Pecoraro.
3336 Test inspector/timeline/line-column.html
3338 * bindings/js/ScriptController.cpp:
3339 (WebCore::ScriptController::evaluateInWorld):
3340 (WebCore::ScriptController::evaluateModule):
3342 * bindings/js/JSExecStateInstrumentation.h:
3343 (WebCore::JSExecState::instrumentFunctionInternal):
3345 * inspector/InspectorInstrumentation.h:
3346 (WebCore::InspectorInstrumentation::willCallFunction):
3347 (WebCore::InspectorInstrumentation::willEvaluateScript):
3348 * inspector/InspectorInstrumentation.cpp:
3349 (WebCore::InspectorInstrumentation::willCallFunctionImpl):
3350 (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
3352 * inspector/agents/InspectorTimelineAgent.h:
3353 * inspector/agents/InspectorTimelineAgent.cpp:
3354 (WebCore::InspectorTimelineAgent::willCallFunction):
3355 (WebCore::InspectorTimelineAgent::willEvaluateScript):
3357 * inspector/TimelineRecordFactory.h:
3358 * inspector/TimelineRecordFactory.cpp:
3359 (WebCore::TimelineRecordFactory::createFunctionCallData):
3360 (WebCore::TimelineRecordFactory::createEvaluateScriptData):
3362 * bindings/js/ScriptSourceCode.h:
3363 (WebCore::ScriptSourceCode::startColumn const): Added.
3365 2019-01-22 Devin Rousso <drousso@apple.com>
3367 Web Inspector: expose Audit and Recording versions to the frontend
3368 https://bugs.webkit.org/show_bug.cgi?id=193262
3369 <rdar://problem/47130684>
3371 Reviewed by Joseph Pecoraro.
3373 Tests: inspector/audit/version.html
3374 inspector/recording/version.html
3376 * inspector/agents/InspectorCanvasAgent.cpp:
3377 (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
3379 2019-01-22 Wenson Hsieh <wenson_hsieh@apple.com>
3381 Add some bindings-related bookkeeping to UndoManager and UndoItem
3382 https://bugs.webkit.org/show_bug.cgi?id=193111
3383 <rdar://problem/44807048>