57c90ac0041c15326a3440a20e6486cac0496a85
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Unreviewed, fix WPE/GTK debug builds after r240557
4         https://bugs.webkit.org/show_bug.cgi?id=192742
5         <rdar://problem/46757369>
6
7         Also fix an improper format string that was recently added in a different commit.
8
9         * rendering/RenderLayerCompositor.cpp:
10         (WebCore::RenderLayerCompositor::logLayerInfo):
11         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
12
13 2018-12-15  Darin Adler  <darin@apple.com>
14
15         Replace many uses of String::format with more type-safe alternatives
16         https://bugs.webkit.org/show_bug.cgi?id=192742
17
18         Reviewed by Mark Lam.
19
20         A while back, String::format was more efficient than string concatenation,
21         but that is no longer true, and we should prefer String::number, makeString,
22         or concatenation with the "+" operator to String::format for new code.
23
24         This is not as good for programmers who are fond of printf formatting
25         style, and in some cases it's a little harder to read the strings
26         interspersed with variables rather than a format string, but it's better
27         in a few ways:
28
29         - more efficient (I didn't measure the difference, but it's definitely
30           slower to use String::Format which calls vsnprintf twice than to use
31           the WTF code)
32         - works in a type-safe way without a need to use a format specifier such
33           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
34           subtle differences between platforms
35         - allows us to use StringView in some cases to sidestep the need to
36           allocate temporary WTF::String objects
37         - does not require converting each WTF::String to a C string, allowing
38           us to remove many cases of ".utf8().data()" and similar expressions,
39           eliminating the allocation of temporary WTF::CString objects
40
41         This patch covers a batch of easiest-to-convert call sites.
42         Later patches will allow us to deprecate or remove String::format.
43
44         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
45         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
46         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
47         (WebCore::IDBCursorInfo::loggingString const): Ditto.
48         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
49         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
50         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
51         (WebCore::IDBGetRecordData::loggingString const): Ditto.
52         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
53         (WebCore::IDBIndexInfo::loggingString const): Ditto.
54         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
55         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
56         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
57         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
58         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
59         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
60         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
61         * Modules/webdatabase/Database.cpp:
62         (WebCore::formatErrorMessage): Ditto.
63         * Modules/webdatabase/SQLError.h:
64         (WebCore::SQLError::create): Ditto.
65
66         * bindings/scripts/CodeGeneratorJS.pm:
67         (GenerateImplementation): Use makeString.
68
69         * bindings/scripts/test/JS/JSInterfaceName.cpp:
70         * bindings/scripts/test/JS/JSMapLike.cpp:
71         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
72         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
73         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
74         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
75         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
76         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
77         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
78         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
79         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
80         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
81         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
82         * bindings/scripts/test/JS/JSTestException.cpp:
83         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
84         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
85         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
86         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
87         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
88         * bindings/scripts/test/JS/JSTestInterface.cpp:
89         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
90         * bindings/scripts/test/JS/JSTestIterable.cpp:
91         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
92         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
93         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
94         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
95         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
96         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
97         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
98         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
99         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
100         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
101         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
102         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
103         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
104         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
105         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
106         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
107         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
108         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
109         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
110         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
111         * bindings/scripts/test/JS/JSTestNode.cpp:
112         * bindings/scripts/test/JS/JSTestObj.cpp:
113         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
114         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
115         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
116         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
117         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
118         * bindings/scripts/test/JS/JSTestSerialization.cpp:
119         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
120         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
121         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
122         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
123         * bindings/scripts/test/JS/JSTestStringifier.cpp:
124         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
125         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
126         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
127         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
128         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
129         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
130         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
131         Updated expected results.
132 :
133         * css/parser/CSSPropertyParserHelpers.cpp:
134         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
135         and makeString.
136
137         * html/HTMLSelectElement.cpp:
138         (WebCore::HTMLSelectElement::setLength): Use makeString.
139         * html/ImageDocument.cpp:
140         (WebCore::ImageDocument::imageUpdated): Ditto.
141         * html/parser/XSSAuditor.cpp:
142         (WebCore::XSSAuditor::init): Ditto.
143         * inspector/InspectorFrontendClientLocal.cpp:
144         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
145         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
146         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
147         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
148         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
149         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
150         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
151         * page/MemoryRelease.cpp:
152         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
153
154         * page/cocoa/ResourceUsageOverlayCocoa.mm:
155         (WebCore::formatByteNumber): Use String::number.
156         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
157
158         * page/cocoa/ResourceUsageThreadCocoa.mm:
159         (WebCore::logFootprintComparison): Use makeString.
160         * platform/animation/TimingFunction.cpp:
161         (WebCore::TimingFunction::cssText const): Ditto.
162
163         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
164         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
165         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
166         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
167
168         * platform/graphics/ca/GraphicsLayerCA.cpp:
169         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
170         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
171         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
172         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
173         * platform/mock/MockRealtimeVideoSource.cpp:
174         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
175
176         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
177
178         * platform/network/ParsedContentRange.cpp:
179         (WebCore::ParsedContentRange::headerValue const): Use makeString.
180
181         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
182         compiler conditionals and reorganized the start/stop of namespaces.
183         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
184
185         * platform/sql/SQLiteDatabase.cpp:
186         (WebCore::unauthorizedSQLFunction): Use makeString.
187         * rendering/RenderLayerCompositor.cpp:
188         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
189         * workers/service/server/RegistrationDatabase.cpp:
190         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
191         (WebCore::RegistrationDatabase::importRecords): Ditto.
192
193 2019-01-27  Wenson Hsieh  <wenson_hsieh@apple.com>
194
195         Remove a couple of PLATFORM defines intended for watchOS
196         https://bugs.webkit.org/show_bug.cgi?id=193888
197
198         Reviewed by Alexey Proskuryakov.
199
200         Remove the use of !PLATFORM(WATCH), since this is true on every platform.
201
202         * editing/cocoa/DictionaryLookup.mm:
203
204 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
205
206         Use a load optimizer for some sites
207         https://bugs.webkit.org/show_bug.cgi?id=193881
208         <rdar://problem/46325455>
209
210         Reviewed by Brent Fulgham.
211
212         Expose FormData::flatten to be used by the load optimizer.
213
214         * WebCore.xcodeproj/project.pbxproj:
215         * platform/network/FormData.h:
216
217 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
218
219         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
220         https://bugs.webkit.org/show_bug.cgi?id=193879
221
222         Reviewed by Antti Koivisto.
223
224         Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
225         This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
226         makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
227         updates of the scrolling tree node in an iframe.
228         
229         To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
230         nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
231         simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
232         connect GraphicsLayers together.
233         
234         RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
235
236         Tested by existing tests.
237
238         * page/FrameView.h:
239         * rendering/RenderLayer.cpp:
240         (WebCore::outputPaintOrderTreeRecursive):
241         * rendering/RenderLayerBacking.cpp:
242         (WebCore::RenderLayerBacking::updateConfiguration):
243         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
244         * rendering/RenderLayerCompositor.cpp:
245         (WebCore::frameContentsRenderView):
246         (WebCore::RenderLayerCompositor::frameContentsCompositor):
247         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
248         (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
249         (WebCore::RenderLayerCompositor::detachRootLayer):
250         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
251         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
252         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
253         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
254         (WebCore::RenderLayerCompositor::attachScrollingNode):
255         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
256         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
257         * rendering/RenderLayerCompositor.h:
258         * testing/Internals.cpp:
259         (WebCore::Internals::scrollingStateTreeAsText const):
260
261 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
262
263         AX: Introduce a static accessibility tree
264         https://bugs.webkit.org/show_bug.cgi?id=193348
265         <rdar://problem/47203295>
266
267         Reviewed by Ryosuke Niwa.
268
269         In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which 
270         could be accessed on a different thread by assistive technologies.
271         That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the 
272         "live" AccessibilityObjects (which interact with both DOM and Render trees).
273         These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree 
274         representation and able to be read from anywhere.
275         Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared 
276         with AccessibilityObject.
277         This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
278
279         * CMakeLists.txt:
280         * Configurations/FeatureDefines.xcconfig:
281         * Sources.txt:
282         * WebCore.xcodeproj/project.pbxproj:
283         * accessibility/AXObjectCache.cpp:
284         (WebCore::AXObjectCache::remove):
285         (WebCore::AXObjectCache::createIsolatedAccessibilityTree):
286         (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
287         * accessibility/AXObjectCache.h:
288         * accessibility/AccessibilityObject.h:
289         * accessibility/AccessibilityObjectInterface.h: Added.
290         * accessibility/isolatedtree: Added.
291         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
292         (WebCore::AXIsolatedTree::treeCache):
293         (WebCore::AXIsolatedTree::AXIsolatedTree):
294         (WebCore::AXIsolatedTree::create):
295         (WebCore::AXIsolatedTree::treeForID):
296         (WebCore::AXIsolatedTree::treeForPageID):
297         (WebCore::AXIsolatedTree::nodeForID const):
298         (WebCore::AXIsolatedTree::rootNode):
299         (WebCore::AXIsolatedTree::removeNode):
300         (WebCore::AXIsolatedTree::appendNodeChanges):
301         (WebCore::AXIsolatedTree::applyPendingChanges):
302         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
303         (WebCore::AXIsolatedTree::treeIdentifier const):
304         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
305             To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
306             we may copy an existing node and replace specific values.
307         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
308         (WebCore::AXIsolatedTreeNode::create):
309         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
310         (WebCore::AXIsolatedTreeNode::setProperty):
311         (WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
312         (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
313         (WebCore::AXIsolatedTreeNode::boolAttributeValue const):
314         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
315         (WebCore::AXIsolatedTreeNode::intAttributeValue const):
316         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
317         * accessibility/mac/AXObjectCacheMac.mm:
318         (WebCore::AXObjectCache::associateIsolatedTreeNode):
319         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
320         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
321         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
322         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
323         (-[WebAccessibilityObjectWrapperBase detach]):
324         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
325         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
326         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
327         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
328         (-[WebAccessibilityObjectWrapper role]):
329         (-[WebAccessibilityObjectWrapper subrole]):
330         (-[WebAccessibilityObjectWrapper roleDescription]):
331         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
332         * dom/Document.cpp:
333         (WebCore::Document::pageID const):
334         * dom/Document.h:
335
336 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
337
338         Allow scrolling tree nodes to exist in a detached state
339         https://bugs.webkit.org/show_bug.cgi?id=193754
340
341         Reviewed by Zalan Bujtas.
342
343         One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
344         is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
345         in a connected state; attachToStateTree() required a non-zero parent for any node that was not
346         the root.
347
348         This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
349         the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
350         can be attached. This is a significant difference from compositing, where a subframe can create
351         GraphicsLayers which don't have to be parented right away, and actually get parented later via
352         a compositing update in the parent frame.
353
354         We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
355         connection (anything else is too confusing). So we need to be able to instantiate scrolling
356         tree nodes in a disconnected state, and attach them later.
357
358         To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
359         Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
360         the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
361         by m_stateNodeMap, so it's possible to find them and set state on them.
362
363         Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
364         is really an implementation detail.
365
366         This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
367         in m_orphanedSubframeNodes; now the unparenting is controlled by the client.
368
369         Currently no code creates unparented nodes so there is no behavior change.
370
371         * dom/Document.cpp:
372         (WebCore::Document::setPageCacheState):
373         * page/scrolling/AsyncScrollingCoordinator.cpp:
374         (WebCore::AsyncScrollingCoordinator::createNode):
375         (WebCore::AsyncScrollingCoordinator::insertNode):
376         (WebCore::AsyncScrollingCoordinator::unparentNode):
377         (WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
378         (WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
379         (WebCore::AsyncScrollingCoordinator::clearAllNodes):
380         (WebCore::AsyncScrollingCoordinator::parentOfNode const):
381         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
382         (WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
383         (WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
384         (WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
385         * page/scrolling/AsyncScrollingCoordinator.h:
386         * page/scrolling/ScrollingCoordinator.h:
387         (WebCore::ScrollingCoordinator::handleWheelEvent):
388         (WebCore::ScrollingCoordinator::createNode):
389         (WebCore::ScrollingCoordinator::insertNode):
390         (WebCore::ScrollingCoordinator::unparentNode):
391         (WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
392         (WebCore::ScrollingCoordinator::detachAndDestroySubtree):
393         (WebCore::ScrollingCoordinator::clearAllNodes):
394         (WebCore::ScrollingCoordinator::parentOfNode const):
395         (WebCore::ScrollingCoordinator::childrenOfNode const):
396         (WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
397         (WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
398         (WebCore::ScrollingCoordinator::clearStateTree): Deleted.
399         * page/scrolling/ScrollingStateNode.cpp:
400         (WebCore::ScrollingStateNode::removeFromParent):
401         (WebCore::ScrollingStateNode::removeChild):
402         * page/scrolling/ScrollingStateNode.h:
403         * page/scrolling/ScrollingStateTree.cpp:
404         (WebCore::ScrollingStateTree::ScrollingStateTree):
405         (WebCore::ScrollingStateTree::createUnparentedNode):
406         (WebCore::ScrollingStateTree::insertNode):
407         (WebCore::ScrollingStateTree::unparentNode):
408         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
409         (WebCore::ScrollingStateTree::detachAndDestroySubtree):
410         (WebCore::ScrollingStateTree::clear):
411         (WebCore::ScrollingStateTree::commit):
412         (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
413         (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
414         (showScrollingStateTree):
415         (WebCore::ScrollingStateTree::attachNode): Deleted.
416         (WebCore::ScrollingStateTree::detachNode): Deleted.
417         * page/scrolling/ScrollingStateTree.h:
418         (WebCore::ScrollingStateTree::nodeCount const):
419         * rendering/RenderLayerBacking.cpp:
420         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
421         * rendering/RenderLayerCompositor.cpp:
422         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
423         (WebCore::RenderLayerCompositor::attachScrollingNode):
424
425 2019-01-26  Devin Rousso  <drousso@apple.com>
426
427         Web Inspector: provide a way to edit the user agent of a remote target
428         https://bugs.webkit.org/show_bug.cgi?id=193862
429         <rdar://problem/47359292>
430
431         Reviewed by Joseph Pecoraro.
432
433         Test: inspector/page/overrideUserAgent.html
434
435         * loader/FrameLoader.cpp:
436         (WebCore::FrameLoader::userAgent const):
437         (WebCore::FrameLoader::userAgentForJavaScript const):
438
439         * inspector/InspectorInstrumentation.h:
440         (WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
441         * inspector/InspectorInstrumentation.cpp:
442         (WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.
443
444         * inspector/agents/InspectorPageAgent.h:
445         * inspector/agents/InspectorPageAgent.cpp:
446         (WebCore::InspectorPageAgent::disable):
447         (WebCore::InspectorPageAgent::overrideUserAgent): Added.
448         (WebCore::InspectorPageAgent::applyUserAgentOverride): Added.
449
450 2019-01-26  Zalan Bujtas  <zalan@apple.com>
451
452         [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
453         https://bugs.webkit.org/show_bug.cgi?id=193867
454
455         Reviewed by Antti Koivisto.
456
457         The initial content top/bottom value is the border top + padding top.
458
459         This is only a problem when the box has float children only. While computing the height using the bottom-most float,
460         we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
461         has (top)border/padding.
462
463         Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html
464
465         * layout/FormattingContextGeometry.cpp:
466         (WebCore::Layout::contentHeightForFormattingContextRoot):
467
468 2019-01-26  Zalan Bujtas  <zalan@apple.com>
469
470         [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
471         https://bugs.webkit.org/show_bug.cgi?id=193865
472
473         Reviewed by Antti Koivisto.
474
475         Height computation ->
476         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
477         // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
478         // margin does not collapse with the element's bottom margin
479
480         <div style="border: 1px solid green">
481           <div style="margin-top: 100px;"></div>
482         </div>
483
484         When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
485         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. 
486
487         Test: fast/block/margin-collapse/collapsed-through-child-simple.html
488
489         * layout/MarginTypes.h:
490         (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
491         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
492         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
493         * layout/displaytree/DisplayBox.h:
494         (WebCore::Display::Box::hasCollapsedThroughMargin const):
495
496 2019-01-26  Zalan Bujtas  <zalan@apple.com>
497
498         [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
499         https://bugs.webkit.org/show_bug.cgi?id=193864
500
501         Reviewed by Antti Koivisto.
502
503         * layout/blockformatting/BlockMarginCollapse.cpp:
504         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
505         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
506
507 2019-01-26  Zalan Bujtas  <zalan@apple.com>
508
509         [LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
510         https://bugs.webkit.org/show_bug.cgi?id=193855
511
512         Reviewed by Antti Koivisto.
513
514         Use iterative algorithm to find next/previous siblings.
515
516         * layout/layouttree/LayoutBox.cpp:
517         (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
518
519 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
520
521         Need a mechanism to override navigator.userAgent
522         https://bugs.webkit.org/show_bug.cgi?id=193762
523         <rdar://problem/47504939>
524
525         Reviewed by Brent Fulgham.
526
527         Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
528
529         * loader/DocumentLoader.h:
530         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
531         (WebCore::DocumentLoader::customJavaScriptUserAgent const):
532         * loader/FrameLoader.cpp:
533         (WebCore::FrameLoader::userAgentForJavaScript const):
534         * loader/FrameLoader.h:
535         * page/Navigator.cpp:
536         (WebCore::Navigator::userAgent const):
537
538 2019-01-25  Devin Rousso  <drousso@apple.com>
539
540         Web Inspector: provide a way to edit page settings on a remote target
541         https://bugs.webkit.org/show_bug.cgi?id=193813
542         <rdar://problem/47359510>
543
544         Reviewed by Joseph Pecoraro.
545
546         Test: inspector/page/overrideSetting.html
547
548         * page/Settings.yaml:
549         * Scripts/GenerateSettings.rb:
550         * Scripts/SettingsTemplates/Settings.cpp.erb:
551         * Scripts/SettingsTemplates/Settings.h.erb:
552         Add support for an `inspectorOverride` boolean value for each setting that will take
553         precedence over the actual `Setting`'s value when set.
554
555         * inspector/agents/InspectorPageAgent.h:
556         * inspector/agents/InspectorPageAgent.cpp:
557         (WebCore::InspectorPageAgent::disable):
558         (WebCore::InspectorPageAgent::overrideSetting): Added.
559
560         * inspector/InspectorFrontendHost.idl:
561         * inspector/InspectorFrontendHost.h:
562         * inspector/InspectorFrontendHost.cpp:
563         (WebCore::InspectorFrontendHost::isRemote const): Added.
564         * inspector/InspectorFrontendClient.h:
565         (WebCore::InspectorFrontendClient::isRemote const): Added.
566         * inspector/InspectorFrontendClientLocal.h:
567         (WebCore::InspectorFrontendClientLocal::isRemote const): Added.
568
569 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
570
571         Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
572         https://bugs.webkit.org/show_bug.cgi?id=193843
573
574         Reviewed by Zalan Bujtas.
575
576         * dom/Document.cpp:
577         (WebCore::Document::updateMainArticleElementAfterLayout):
578
579         This function currently does a bit of wasted work after every layout, on clients that don't listen to the
580         "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
581         don't bother keeping the main article element up to date in this scenario by bailing from
582         FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
583         rendered text milestone.
584
585         * page/FrameView.cpp:
586         (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
587
588 2019-01-25  Jer Noble  <jer.noble@apple.com>
589
590         <video> elements not in the DOM should be allowed to AirPlay
591         https://bugs.webkit.org/show_bug.cgi?id=193837
592         <rdar://42559491>
593
594         Reviewed by Eric Carlson.
595
596         Test: media/airplay-allows-buffering.html
597
598         Some websites will switch between <video> elements backed by MSE to one backed by
599         a media file in order to implement an AirPlay control. But when a <video> element is
600         removed from the DOM and paused, further buffering is blocked. For some ports (namely
601         Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
602         elements who have been asked to play wirelessly, but whose wireless playback has not
603         started yet.
604
605         * html/MediaElementSession.cpp:
606         (WebCore::MediaElementSession::dataBufferingPermitted const):
607         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
608
609 2019-01-25  Keith Rollin  <krollin@apple.com>
610
611         Update Xcode projects with "Check .xcfilelists" build phase
612         https://bugs.webkit.org/show_bug.cgi?id=193790
613         <rdar://problem/47201374>
614
615         Reviewed by Alex Christensen.
616
617         Support for XCBuild includes specifying inputs and outputs to various
618         Run Script build phases. These inputs and outputs are specified as
619         .xcfilelist files. Once created, these .xcfilelist files need to be
620         kept up-to-date. In order to check that they are up-to-date or not,
621         add an Xcode build step that invokes an external script that performs
622         the checking. If the .xcfilelists are found to be out-of-date, update
623         them, halt the build, and instruct the developer to restart the build
624         with up-to-date files.
625
626         At this time, the checking and regenerating is performed only if the
627         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
628         who want to use this facility can set this variable and test out the
629         checking/regenerating. Once it seems like there are no egregious
630         issues that upset a developer's workflow, we'll unconditionally enable
631         this facility.
632
633         No new tests since there should be no observable behavior difference.
634
635         * Scripts/check-xcfilelists.sh: Added.
636         * WebCore.xcodeproj/project.pbxproj:
637
638 2019-01-25  Joseph Pecoraro  <pecoraro@apple.com>
639
640         Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
641         https://bugs.webkit.org/show_bug.cgi?id=193796
642         <rdar://problem/47532910>
643
644         Reviewed by Devin Rousso.
645
646         * page/ResourceUsageData.h:
647         * inspector/agents/InspectorCPUProfilerAgent.cpp:
648         (WebCore::InspectorCPUProfilerAgent::collectSample):
649         Show the CPU usage without debugger threads in the Web Inspector's timeline.
650
651         * page/ResourceUsageThread.h:
652         * page/cocoa/ResourceUsageThreadCocoa.mm:
653         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
654         For OS(DARWIN) ports, when starting to observe resource usage,
655         we grab the mach_port_t of SamplingProfiler on the main thread
656         in a thread safe way. For our purposes (Web Inspector timelines),
657         this will be good enough to identify the SamplingProfiler thread
658         during timeline recording. The SamplingProfiler thread won't change
659         during a timeline recording and recording start/stops will never
660         miss the SamplingProfiler changing.
661
662         (WebCore::filterThreads):
663         (WebCore::threadSendRights):
664         (WebCore::threadSendRightsExcludingDebuggerThreads):
665         (WebCore::cpuUsage):
666         (WebCore::ResourceUsageThread::platformCollectCPUData):
667         Calculate CPU usage twice, the second time excluding some threads.
668
669         * page/linux/ResourceUsageThreadLinux.cpp:
670         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
671         (WebCore::ResourceUsageThread::platformCollectCPUData):
672         Stubs for linux ports.
673
674 2019-01-25  Zalan Bujtas  <zalan@apple.com>
675
676         Remove FrameView::m_significantRenderedTextMilestonePending
677         https://bugs.webkit.org/show_bug.cgi?id=193842
678
679         Reviewed by Wenson Hsieh.
680
681         Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
682         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).
683         This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
684
685         * page/FrameView.cpp:
686         (WebCore::FrameView::resetLayoutMilestones):
687         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
688         (WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
689         (WebCore::FrameView::qualifiesAsSignificantRenderedText const):
690         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
691         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
692         * page/FrameView.h:
693
694 2019-01-25  Keith Rollin  <krollin@apple.com>
695
696         Update Xcode projects with "Apply Configuration to XCFileLists" build target
697         https://bugs.webkit.org/show_bug.cgi?id=193781
698         <rdar://problem/47201153>
699
700         Reviewed by Alex Christensen.
701
702         Part of generating the .xcfilelists used as part of adopting XCBuild
703         includes running `make DerivedSources.make` from a standalone script.
704         It’s important for this invocation to have the same environment as
705         when the actual build invokes `make DerivedSources.make`. If the
706         environments are different, then the two invocations will provide
707         different results. In order to get the same environment in the
708         standalone script, have the script launch xcodebuild targeting the
709         "Apply Configuration to XCFileLists" build target, which will then
710         re-invoke our standalone script. The script is now running again, this
711         time in an environment with all workspace, project, target, xcconfig
712         and other environment variables established.
713
714         The "Apply Configuration to XCFileLists" build target accomplishes
715         this task via a small embedded shell script that consists only of:
716
717             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
718
719         The process that invokes "Apply Configuration to XCFileLists" first
720         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
721         evaluated and exports it into the shell environment. When xcodebuild
722         is invoked, it inherits the value of this variable and can `eval` the
723         contents of that variable. Our external standalone script can then set
724         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
725         of command-line parameters needed to restart itself in the appropriate
726         state.
727
728         No new tests since there should be no observable behavior difference.
729
730         * WebCore.xcodeproj/project.pbxproj:
731
732 2019-01-25  Keith Rollin  <krollin@apple.com>
733
734         Update WebKitAdditions.xcconfig with correct order of variable definitions
735         https://bugs.webkit.org/show_bug.cgi?id=193793
736         <rdar://problem/47532439>
737
738         Reviewed by Alex Christensen.
739
740         XCBuild changes the way xcconfig variables are evaluated. In short,
741         all config file assignments are now considered in part of the
742         evaluation. When using the new build system and an .xcconfig file
743         contains multiple assignments of the same build setting:
744
745         - Later assignments using $(inherited) will inherit from earlier
746           assignments in the xcconfig file.
747         - Later assignments not using $(inherited) will take precedence over
748           earlier assignments. An assignment to a more general setting will
749           mask an earlier assignment to a less general setting. For example,
750           an assignment without a condition ('FOO = bar') will completely mask
751           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
752
753         This affects some of our .xcconfig files, in that sometimes platform-
754         or sdk-specific definitions appear before the general definitions.
755         Under the new evaluations rules, the general definitions alway take
756         effect because they always overwrite the more-specific definitions. The
757         solution is to swap the order, so that the general definitions are
758         established first, and then conditionally overwritten by the
759         more-specific definitions.
760
761         No new tests since there should be no observable behavior difference.
762
763         * Configurations/Base.xcconfig:
764         * Configurations/Version.xcconfig:
765
766 2019-01-25  Keith Rollin  <krollin@apple.com>
767
768         Update existing .xcfilelists
769         https://bugs.webkit.org/show_bug.cgi?id=193791
770         <rdar://problem/47201706>
771
772         Reviewed by Alex Christensen.
773
774         Many .xcfilelist files were added in r238824 in order to support
775         XCBuild. Update these with recent changes to the set of build files
776         and with the current generate-xcfilelist script.
777
778         No new tests since there should be no observable behavior difference.
779
780         * DerivedSources-input.xcfilelist:
781         * DerivedSources-output.xcfilelist:
782         * UnifiedSources-input.xcfilelist:
783         * UnifiedSources-output.xcfilelist:
784
785 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
786
787         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
788         https://bugs.webkit.org/show_bug.cgi?id=193297
789         <rdar://problem/47158841>
790
791         Reviewed by Alex Christensen.
792
793         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
794
795         * Modules/websockets/WebSocket.cpp:
796         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
797         * loader/ResourceLoadObserver.cpp:
798         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
799         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
800         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
801         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
802         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
803         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
804
805 2019-01-25  Zalan Bujtas  <zalan@apple.com>
806
807         Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
808         https://bugs.webkit.org/show_bug.cgi?id=193835
809
810         Reviewed by Simon Fraser.
811
812         Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
813         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.
814         The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
815         However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
816         Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
817
818         This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
819
820         * page/FrameView.cpp:
821         (WebCore::FrameView::resetLayoutMilestones):
822         (WebCore::FrameView::loadProgressingStatusChanged):
823         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
824         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
825         (WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
826         * page/FrameView.h:
827         (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
828
829 2019-01-25  David Kilzer  <ddkilzer@apple.com>
830
831         Move soft-linking of Lookup.framework out of LookupSPI.h
832         <https://webkit.org/b/193815>
833
834         Reviewed by Tim Horton.
835
836         * editing/cocoa/DictionaryLookup.mm:
837         - Remove unused header.
838
839         * editing/mac/DictionaryLookupLegacy.mm:
840         (WebCore::tokenRange):
841         (WebCore::showPopupOrCreateAnimationController):
842         (WebCore::DictionaryLookup::hidePopup):
843         - Move soft-linking to LookupSoftLink.{h,mm}.
844
845         * platform/ios/ValidationBubbleIOS.mm:
846         (WebCore::ValidationBubble::show):
847         - Update for changes to UIKitSoftLink.{h,mm} now that
848           UIAccessibilityAnnouncementNotification is using
849           SOFT_LINK_CONSTANT*().
850
851 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
852
853         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
854         https://bugs.webkit.org/show_bug.cgi?id=193829
855
856         Reviewed by Tim Horton.
857
858         No change in behavior.
859
860         * page/EventHandler.h:
861         * page/ios/EventHandlerIOS.mm:
862         (WebCore::EventHandler::tryToBeginDragAtPoint):
863         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
864         * platform/ios/WebItemProviderPasteboard.mm:
865         (linkTemporaryItemProviderFilesToDropStagingDirectory):
866
867 2019-01-25  Jon Davis  <jond@apple.com>
868
869         Updated feature status for several features 
870         https://bugs.webkit.org/show_bug.cgi?id=193794
871
872         Reviewed by Joseph Pecoraro.
873         
874         Updated feature status for the following: CSS Font Display,
875         CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
876         File and Directory Entries API, MediaStream Recording API,
877         Readable Streams, Subresource Integrity, Visual Viewport API,
878         and Web Audio.
879
880         * features.json:
881
882 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
883
884         Need a way for JavaScript (or bundle) code to participate in undo
885         https://bugs.webkit.org/show_bug.cgi?id=190009
886         <rdar://problem/44807048>
887
888         Reviewed by Ryosuke Niwa.
889
890         Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
891
892         Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
893                editing/undo-manager/undo-manager-add-item.html
894                editing/undo-manager/undo-manager-delete-stale-undo-items.html
895                editing/undo-manager/undo-manager-item-labels.html
896                editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
897
898         * editing/CompositeEditCommand.h:
899         * editing/CustomUndoStep.cpp:
900         (WebCore::CustomUndoStep::didRemoveFromUndoManager):
901
902         Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
903         the UndoItem, removing it from its UndoManager.
904
905         * editing/CustomUndoStep.h:
906         * editing/Editor.cpp:
907         (WebCore::Editor::registerCustomUndoStep):
908
909         Add a helper method to register a CustomUndoStep as a platform undoable step.
910
911         * editing/Editor.h:
912         * editing/UndoStep.h:
913         * page/UndoItem.h:
914         (WebCore::UndoItem::undoManager const):
915         * page/UndoManager.cpp:
916         (WebCore::UndoManager::addItem):
917
918         Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
919
920         * page/UndoManager.h:
921         * page/UndoManager.idl:
922
923         Mark addItem() as capable of throwing exceptions.
924
925 2019-01-25  Zalan Bujtas  <zalan@apple.com>
926
927         [LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
928         https://bugs.webkit.org/show_bug.cgi?id=193824
929
930         Reviewed by Antti Koivisto.
931
932         When clear property is set and floats are present, we have to estimate and set the box's vertical position during
933         static positioning to be able to properly layout its subtree.
934
935         <div style="float: left; width: 100px; height: 100px;"></div>
936         <div style="clear: left;">
937           <div style="float: left; width: 100px; height: 100px;"></div>
938         </div>
939
940         In the above example since the second float's parent clears the first float, the second float is positioned below
941         the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
942
943         * layout/blockformatting/BlockFormattingContext.cpp:
944         (WebCore::Layout::BlockFormattingContext::layout const):
945         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
946         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
947         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
948         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
949         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
950         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
951         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
952         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
953         * layout/blockformatting/BlockFormattingContext.h:
954         * layout/blockformatting/BlockMarginCollapse.cpp:
955         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
956         * layout/displaytree/DisplayBox.h:
957
958 2019-01-25  Zalan Bujtas  <zalan@apple.com>
959
960         [LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
961         https://bugs.webkit.org/show_bug.cgi?id=193812
962
963         Reviewed by Antti Koivisto.
964
965         Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
966
967         * layout/blockformatting/BlockFormattingContext.cpp:
968         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
969         * layout/blockformatting/BlockFormattingContext.h:
970         * layout/blockformatting/BlockMarginCollapse.cpp:
971         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
972         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
973         * page/FrameViewLayoutContext.cpp:
974         (WebCore::layoutUsingFormattingContext):
975
976 2019-01-25  Antoine Quint  <graouts@apple.com>
977
978         Use ENABLE_POINTER_EVENTS for the touch-action property
979         https://bugs.webkit.org/show_bug.cgi?id=193819
980
981         Reviewed by Antti Koivisto.
982
983         Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
984         Pointer Events specification of which the touch-action property is a part.
985
986         * css/CSSComputedStyleDeclaration.cpp:
987         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
988         * css/CSSPrimitiveValueMappings.h:
989         * css/CSSProperties.json:
990         * css/CSSValueKeywords.in:
991         * css/StyleBuilderConverter.h:
992         * css/parser/CSSPropertyParser.cpp:
993         (WebCore::CSSPropertyParser::parseSingleValue):
994         * dom/Element.cpp:
995         (WebCore::Element::allowsDoubleTapGesture const):
996         * platform/TouchAction.h:
997         * rendering/style/RenderStyle.h:
998         * rendering/style/StyleRareNonInheritedData.cpp:
999         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1000         (WebCore::StyleRareNonInheritedData::operator== const):
1001         * rendering/style/StyleRareNonInheritedData.h:
1002
1003 2019-01-24  Zalan Bujtas  <zalan@apple.com>
1004
1005         [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
1006         https://bugs.webkit.org/show_bug.cgi?id=193807
1007
1008         Reviewed by Simon Fraser.
1009
1010         Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
1011
1012         * layout/blockformatting/BlockFormattingContext.cpp:
1013         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1014         * layout/blockformatting/BlockFormattingContext.h:
1015         * layout/blockformatting/BlockMarginCollapse.cpp:
1016         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
1017         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
1018
1019 2019-01-24  Joseph Pecoraro  <pecoraro@apple.com>
1020
1021         Web Inspector: CPU Usage Timeline
1022         https://bugs.webkit.org/show_bug.cgi?id=193730
1023         <rdar://problem/46797201>
1024
1025         Reviewed by Devin Rousso.
1026
1027         Test: inspector/cpu-profiler/tracking.html
1028
1029         * Sources.txt:
1030         * UnifiedSources-input.xcfilelist:
1031         * WebCore.xcodeproj/project.pbxproj:
1032         New files.
1033
1034         * inspector/InspectorController.cpp:
1035         (WebCore::InspectorController::createLazyAgents):
1036         * inspector/InstrumentingAgents.cpp:
1037         (WebCore::InstrumentingAgents::reset):
1038         * inspector/InstrumentingAgents.h:
1039         (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
1040         (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
1041         Create and track the CPUProfilerAgent.
1042
1043         * inspector/agents/InspectorTimelineAgent.cpp:
1044         (WebCore::InspectorTimelineAgent::toggleInstruments):
1045         (WebCore::InspectorTimelineAgent::toggleCPUInstrument):
1046         Handle backend auto-start of the CPU instrument / timeline.
1047
1048         * inspector/agents/InspectorCPUProfilerAgent.h:
1049         * inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
1050         (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
1051         (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
1052         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
1053         (WebCore::InspectorCPUProfilerAgent::startTracking):
1054         (WebCore::InspectorCPUProfilerAgent::stopTracking):
1055         (WebCore::InspectorCPUProfilerAgent::collectSample):
1056         CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
1057
1058         * inspector/agents/InspectorTimelineAgent.h:
1059         * inspector/agents/InspectorMemoryAgent.cpp:
1060         (WebCore::InspectorMemoryAgent::startTracking):
1061         (WebCore::InspectorMemoryAgent::collectSample):
1062         Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
1063
1064         * page/ResourceUsageData.h:
1065         * page/ResourceUsageThread.cpp:
1066         (WebCore::ResourceUsageThread::addObserver):
1067         (WebCore::ResourceUsageThread::removeObserver):
1068         (WebCore::ResourceUsageThread::notifyObservers):
1069         (WebCore::ResourceUsageThread::recomputeCollectionMode):
1070         (WebCore::ResourceUsageThread::threadBody):
1071         * page/ResourceUsageThread.h:
1072         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1073         (WebCore::ResourceUsageOverlay::platformInitialize):
1074         * page/cocoa/ResourceUsageThreadCocoa.mm:
1075         (WebCore::ResourceUsageThread::platformCollectCPUData):
1076         (WebCore::ResourceUsageThread::platformCollectMemoryData):
1077         (WebCore::ResourceUsageThread::platformThreadBody): Deleted.
1078         * page/linux/ResourceUsageOverlayLinux.cpp:
1079         (WebCore::ResourceUsageOverlay::platformInitialize):
1080         * page/linux/ResourceUsageThreadLinux.cpp:
1081         (WebCore::ResourceUsageThread::platformCollectCPUData):
1082         (WebCore::ResourceUsageThread::platformCollectMemoryData):
1083         (WebCore::ResourceUsageThread::platformThreadBody):
1084         Give each observer their own collection mode. The ResourceUsageThread
1085         will then collect data that is the union of all of the active observers.
1086         This allows collecting CPU and Memory data separately, reducing the cost
1087         of each when gathered individually.
1088
1089 2019-01-24  Charles Vazac  <cvazac@akamai.com>
1090
1091         Implement PerformanceObserver.supportedEntryTypes
1092         https://bugs.webkit.org/show_bug.cgi?id=193428
1093
1094         PerformanceObserver.supportedEntryTypes should return an array of
1095         entryTypes that can be observed per specification
1096         https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
1097
1098         Reviewed by Joseph Pecoraro.
1099
1100         This is covered by web-platform-tests
1101         LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
1102
1103         * page/PerformanceObserver.cpp:
1104         (WebCore::PerformanceObserver::supportedEntryTypes):
1105         * page/PerformanceObserver.h:
1106         * page/PerformanceObserver.idl:
1107
1108 2019-01-24  Truitt Savell  <tsavell@apple.com>
1109
1110         Unreviewed, rolling out r240446.
1111
1112         Casued 5 API failures
1113
1114         Reverted changeset:
1115
1116         "Activate the WebResourceLoadStatisticsStore in the
1117         NetworkProcess and deactivate it in the UIProcess."
1118         https://bugs.webkit.org/show_bug.cgi?id=193297
1119         https://trac.webkit.org/changeset/240446
1120
1121 2019-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1122
1123         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
1124         https://bugs.webkit.org/show_bug.cgi?id=193758
1125         <rdar://problem/43614978>
1126
1127         Reviewed by Tim Horton.
1128
1129         CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
1130         (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
1131         a helper method to select all the text inside of a text form control, called `selectInput`, which normally
1132         invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
1133         setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
1134         the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
1135
1136         This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
1137         reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
1138
1139         1.  Roll out this ancient demo hack, in favor of standardized behavior.
1140         2.  Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
1141             want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
1142             achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
1143             selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
1144             input, but everywhere else, it selects all the text in the input element.
1145
1146         This causes 6 existing layout tests to begin passing on iOS.
1147
1148         * html/HTMLInputElement.cpp:
1149         (WebCore::HTMLInputElement::updateFocusAppearance):
1150         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
1151         * html/HTMLInputElement.h:
1152         * html/HTMLTextFormControlElement.cpp:
1153         (WebCore::HTMLTextFormControlElement::select):
1154
1155 2019-01-24  Jer Noble  <jer.noble@apple.com>
1156
1157         Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
1158         https://bugs.webkit.org/show_bug.cgi?id=193778
1159
1160         Reviewed by Jon Lee.
1161
1162         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1163         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
1164
1165 2019-01-24  Zalan Bujtas  <zalan@apple.com>
1166
1167         DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
1168         https://bugs.webkit.org/show_bug.cgi?id=193741
1169         <rdar://problem/47135030>
1170
1171         Reviewed by Antti Koivisto and Simon Fraser.
1172
1173         fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
1174             1. the received data is not "contentful" yet
1175             2. and we are expecting some more (loading is not complete yet)
1176             3. but no layout is initiated anymore
1177         nothing triggers the milestone firing.
1178
1179         This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
1180
1181         * page/FrameView.cpp:
1182         (WebCore::FrameView::FrameView):
1183         (WebCore::FrameView::loadProgressingStatusChanged):
1184
1185 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
1186
1187         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
1188         https://bugs.webkit.org/show_bug.cgi?id=193297
1189         <rdar://problem/47158841>
1190
1191         Reviewed by Alex Christensen.
1192
1193         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
1194
1195         * Modules/websockets/WebSocket.cpp:
1196         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
1197         * loader/ResourceLoadObserver.cpp:
1198         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
1199         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
1200         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
1201         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
1202         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
1203         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
1204
1205 2019-01-24  John Wilander  <wilander@apple.com>
1206
1207         Add Ad Click Attribution as an internal/experimental feature
1208         https://bugs.webkit.org/show_bug.cgi?id=193685
1209         <rdar://problem/47450399>
1210
1211         Reviewed by Brent Fulgham.
1212
1213         Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
1214
1215         * html/HTMLAnchorElement.h:
1216         * html/HTMLAnchorElement.idl:
1217         * html/HTMLAttributeNames.in:
1218             Addeed two new experimental attributes:
1219             - adcampaignid: Ad campaign ID.
1220             - addestination: Ad link destination site.
1221         * page/RuntimeEnabledFeatures.h:
1222         (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
1223         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
1224         * page/Settings.yaml:
1225
1226 2019-01-24  Youenn Fablet  <youenn@apple.com>
1227
1228         Use MonotonicTime in WorkerRunLoop
1229         https://bugs.webkit.org/show_bug.cgi?id=193417
1230
1231         Reviewed by Saam Barati.
1232
1233         Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
1234         Ditto for WorkerRunLoop.
1235         No easy way to test the change which should not be easily observable.
1236
1237         * workers/WorkerRunLoop.cpp:
1238         (WebCore::WorkerRunLoop::runInMode):
1239
1240 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
1241
1242         Move FileSystem to WTF
1243         https://bugs.webkit.org/show_bug.cgi?id=193602
1244
1245         Reviewed by Yusuke Suzuki.
1246
1247         * Modules/encryptedmedia/CDM.cpp:
1248         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1249         * Modules/entriesapi/DOMFileSystem.cpp:
1250         * Modules/entriesapi/FileSystemEntry.cpp:
1251         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1252         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1253         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1254         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1255         * Modules/webdatabase/DatabaseTracker.cpp:
1256         * Modules/webdatabase/OriginLock.cpp:
1257         * Modules/webdatabase/OriginLock.h:
1258         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
1259         * PlatformMac.cmake:
1260         * PlatformPlayStation.cmake:
1261         * PlatformWin.cmake:
1262         * Sources.txt:
1263         * SourcesCocoa.txt:
1264         * WebCore.xcodeproj/project.pbxproj:
1265         * bindings/js/GCController.cpp:
1266         * dom/DataTransferItem.cpp:
1267         * editing/cocoa/WebContentReaderCocoa.mm:
1268         * fileapi/File.cpp:
1269         * fileapi/FileCocoa.mm:
1270         * html/FileInputType.cpp:
1271         * html/FileListCreator.cpp:
1272         * loader/appcache/ApplicationCacheHost.cpp:
1273         * loader/appcache/ApplicationCacheStorage.cpp:
1274         * page/Page.cpp:
1275         * page/SecurityOrigin.cpp:
1276         * page/SecurityOriginData.cpp:
1277         * platform/FileHandle.h:
1278         * platform/FileStream.cpp:
1279         * platform/FileStream.h:
1280         * platform/SharedBuffer.h:
1281         * platform/SourcesGLib.txt:
1282         * platform/cocoa/FileMonitorCocoa.mm:
1283         * platform/glib/FileMonitorGLib.cpp:
1284         * platform/glib/SharedBufferGlib.cpp:
1285         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1286         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1287         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1288         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1289         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1290         * platform/ios/QuickLook.mm:
1291         * platform/ios/WebItemProviderPasteboard.mm:
1292         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1293         * platform/network/BlobDataFileReference.cpp:
1294         * platform/network/BlobRegistryImpl.cpp:
1295         * platform/network/BlobResourceHandle.cpp:
1296         * platform/network/FormData.cpp:
1297         * platform/network/cf/FormDataStreamCFNet.cpp:
1298         * platform/network/cocoa/ResourceRequestCocoa.mm:
1299         * platform/network/curl/CookieJarDB.cpp:
1300         * platform/network/curl/CurlCacheEntry.h:
1301         * platform/network/curl/CurlCacheManager.cpp:
1302         * platform/network/curl/CurlFormDataStream.h:
1303         * platform/network/curl/CurlRequest.h:
1304         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1305         * platform/network/curl/ResourceHandleCurl.cpp:
1306         * platform/network/mac/BlobDataFileReferenceMac.mm:
1307         * platform/network/soup/ResourceHandleSoup.cpp:
1308         * platform/network/soup/SoupNetworkSession.cpp:
1309         * platform/posix/SharedBufferPOSIX.cpp:
1310         * platform/sql/SQLiteFileSystem.cpp:
1311         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1312         * platform/win/SearchPopupMenuDB.cpp:
1313         * rendering/RenderTheme.cpp:
1314         * rendering/RenderThemeGtk.cpp:
1315         * rendering/RenderThemeWin.cpp:
1316         * workers/service/server/RegistrationDatabase.cpp:
1317
1318 2019-01-24  Zalan Bujtas  <zalan@apple.com>
1319
1320         [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
1321         https://bugs.webkit.org/show_bug.cgi?id=193768
1322
1323         Reviewed by Antti Koivisto.
1324
1325         When it comes to the actual used values it does not really matter, only from correctness point of view.
1326         (This patch also moves some checks to their correct place.)
1327
1328         * layout/blockformatting/BlockMarginCollapse.cpp:
1329         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1330         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1331         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1332         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1333         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1334         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1335
1336 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
1337
1338         Add "frame hosting" nodes to the scrolling tree
1339         https://bugs.webkit.org/show_bug.cgi?id=193753
1340
1341         Reviewed by Antti Koivisto.
1342
1343         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
1344         require the iframe's scrolling node to get reparented in a new ancestor, which requires
1345         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
1346
1347         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
1348         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
1349         to provide a consistent parent node for the subframe's scrolling node.
1350
1351         This patch adds the node types, but does not instantiate them yet.
1352
1353         * Sources.txt:
1354         * WebCore.xcodeproj/project.pbxproj:
1355         * page/scrolling/ScrollingCoordinator.cpp:
1356         (WebCore::operator<<):
1357         * page/scrolling/ScrollingCoordinator.h:
1358         * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
1359         (WebCore::ScrollingStateFrameHostingNode::create):
1360         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
1361         (WebCore::ScrollingStateFrameHostingNode::clone):
1362         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
1363         * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
1364         * page/scrolling/ScrollingStateNode.h:
1365         (WebCore::ScrollingStateNode::isFrameHostingNode const):
1366         * page/scrolling/ScrollingStateTree.cpp:
1367         (WebCore::ScrollingStateTree::createNode):
1368         * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
1369         (WebCore::ScrollingTreeFrameHostingNode::create):
1370         (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
1371         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
1372         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
1373         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
1374         * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
1375         * page/scrolling/ScrollingTreeNode.h:
1376         (WebCore::ScrollingTreeNode::isFrameHostingNode const):
1377         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1378         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
1379         * page/scrolling/mac/ScrollingTreeMac.cpp:
1380         (ScrollingTreeMac::createScrollingTreeNode):
1381         * rendering/RenderLayerBacking.cpp:
1382         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1383         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1384         (WebCore::operator<<):
1385         * rendering/RenderLayerBacking.h:
1386         * rendering/RenderLayerCompositor.cpp:
1387         (WebCore::scrollCoordinationRoleForNodeType):
1388         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
1389         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1390         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1391         * rendering/RenderLayerCompositor.h:
1392
1393 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
1394
1395         [iOS] Enable media element volume on iPad
1396         https://bugs.webkit.org/show_bug.cgi?id=193745
1397         <rdar://problem/47452297>
1398
1399         Reviewed by Jer Noble.
1400
1401         * html/HTMLMediaElement.cpp:
1402         (WebCore::HTMLMediaElement::setVolume):
1403         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
1404         (WebCore::HTMLMediaElement::updateVolume):
1405
1406         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1407         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
1408
1409 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1410
1411         [GTK][WPE] Support JPEG 2000 images
1412         https://bugs.webkit.org/show_bug.cgi?id=186272
1413
1414         Reviewed by Žan Doberšek.
1415
1416         Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
1417         supported.
1418
1419         * platform/ImageDecoders.cmake:
1420         * platform/MIMETypeRegistry.cpp:
1421         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
1422         * platform/image-decoders/ScalableImageDecoder.cpp:
1423         (WebCore::ScalableImageDecoder::create):
1424         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
1425         (WebCore::syccToRGB):
1426         (WebCore::sycc444ToRGB):
1427         (WebCore::sycc422ToRGB):
1428         (WebCore::sycc420ToRGB):
1429         (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
1430         (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
1431         (WebCore::JPEG2000ImageDecoder::decode):
1432         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
1433
1434 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
1435
1436         Change some RenderLayerCompositor functions to use references
1437         https://bugs.webkit.org/show_bug.cgi?id=193760
1438
1439         Reviewed by Zalan Bujtas.
1440
1441         RenderWidget* -> RenderWidget&
1442
1443         * rendering/RenderLayerBacking.cpp:
1444         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
1445         (WebCore::RenderLayerBacking::updateConfiguration):
1446         * rendering/RenderLayerCompositor.cpp:
1447         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1448         (WebCore::RenderLayerCompositor::updateBacking):
1449         (WebCore::RenderLayerCompositor::frameContentsCompositor):
1450         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1451         * rendering/RenderLayerCompositor.h:
1452
1453 2019-01-23  Benjamin Poulain  <benjamin@webkit.org>
1454
1455         <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
1456         https://bugs.webkit.org/show_bug.cgi?id=193742
1457
1458         Reviewed by Eric Carlson.
1459
1460         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1461         The original bug was fixed, see radar: rdar://problem/27686430
1462
1463 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
1464
1465         Clean up IndexedDB files between tests
1466         https://bugs.webkit.org/show_bug.cgi?id=192796
1467         <rdar://problem/46824999>
1468
1469         Reviewed by Geoffrey Garen.
1470
1471         We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
1472
1473         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1474         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1475         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
1476
1477 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
1478
1479         Add CSS Logical spec to features.json
1480         https://bugs.webkit.org/show_bug.cgi?id=193717
1481
1482         Reviewed by Manuel Rego Casasnovas.
1483
1484         * features.json:
1485
1486 2019-01-22  Conrad Shultz  <conrad_shultz@apple.com>
1487
1488         Clean up USE(WEB_THREAD)
1489         https://bugs.webkit.org/show_bug.cgi?id=193698
1490
1491         Rubber-stamped by Tim Horton.
1492
1493         * page/CaptionUserPreferencesMediaAF.cpp:
1494         (WebCore::userCaptionPreferencesChangedNotificationCallback):
1495         * platform/cf/MainThreadSharedTimerCF.cpp:
1496         (WebCore::applicationDidBecomeActive):
1497         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1498         (WebCore::dispatchToMainThread):
1499         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
1500         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
1501         * platform/ios/LegacyTileCache.mm:
1502         (WebCore::LegacyTileCache::layoutTiles):
1503         (WebCore::LegacyTileCache::setTilingMode):
1504         * platform/ios/WebCoreMotionManager.mm:
1505         (-[WebCoreMotionManager sendAccelerometerData:]):
1506         (-[WebCoreMotionManager sendMotionData:withHeading:]):
1507         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1508         (VideoFullscreenControllerContext::requestUpdateInlineRect):
1509         (VideoFullscreenControllerContext::requestVideoContentLayer):
1510         (VideoFullscreenControllerContext::returnVideoContentLayer):
1511         (VideoFullscreenControllerContext::didSetupFullscreen):
1512         (VideoFullscreenControllerContext::willExitFullscreen):
1513         (VideoFullscreenControllerContext::didExitFullscreen):
1514         (VideoFullscreenControllerContext::didCleanupFullscreen):
1515         (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
1516         (VideoFullscreenControllerContext::requestFullscreenMode):
1517         (VideoFullscreenControllerContext::setVideoLayerFrame):
1518         (VideoFullscreenControllerContext::setVideoLayerGravity):
1519         (VideoFullscreenControllerContext::fullscreenModeChanged):
1520         (VideoFullscreenControllerContext::play):
1521         (VideoFullscreenControllerContext::pause):
1522         (VideoFullscreenControllerContext::togglePlayState):
1523         (VideoFullscreenControllerContext::toggleMuted):
1524         (VideoFullscreenControllerContext::setMuted):
1525         (VideoFullscreenControllerContext::setVolume):
1526         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
1527         (VideoFullscreenControllerContext::beginScrubbing):
1528         (VideoFullscreenControllerContext::endScrubbing):
1529         (VideoFullscreenControllerContext::seekToTime):
1530         (VideoFullscreenControllerContext::fastSeek):
1531         (VideoFullscreenControllerContext::beginScanningForward):
1532         (VideoFullscreenControllerContext::beginScanningBackward):
1533         (VideoFullscreenControllerContext::endScanning):
1534         (VideoFullscreenControllerContext::selectAudioMediaOption):
1535         (VideoFullscreenControllerContext::selectLegibleMediaOption):
1536         (VideoFullscreenControllerContext::duration const):
1537         (VideoFullscreenControllerContext::currentTime const):
1538         (VideoFullscreenControllerContext::bufferedTime const):
1539         (VideoFullscreenControllerContext::isPlaying const):
1540         (VideoFullscreenControllerContext::playbackRate const):
1541         (VideoFullscreenControllerContext::seekableRanges const):
1542         (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
1543         (VideoFullscreenControllerContext::liveUpdateInterval const):
1544         (VideoFullscreenControllerContext::canPlayFastReverse const):
1545         (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
1546         (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
1547         (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
1548         (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
1549         (VideoFullscreenControllerContext::externalPlaybackEnabled const):
1550         (VideoFullscreenControllerContext::externalPlaybackTargetType const):
1551         (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
1552         (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
1553         (VideoFullscreenControllerContext::setUpFullscreen):
1554         (VideoFullscreenControllerContext::exitFullscreen):
1555         (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
1556         (-[WebVideoFullscreenController enterFullscreen:mode:]):
1557         (-[WebVideoFullscreenController exitFullscreen]):
1558         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
1559         * platform/ios/wak/WAKWindow.mm:
1560         (-[WAKWindow setVisible:]):
1561         (-[WAKWindow setScreenScale:]):
1562         (-[WAKWindow sendEvent:]):
1563         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
1564         * platform/network/ios/NetworkStateNotifierIOS.mm:
1565         (WebCore::NetworkStateNotifier::startObserving):
1566         * rendering/RenderThemeIOS.mm:
1567         (WebCore::contentSizeCategoryDidChange):
1568
1569 2019-01-23  David Kilzer  <ddkilzer@apple.com>
1570
1571         REGRESSION (r240292): Attempt to fix WinCairo build
1572
1573         * platform/network/curl/CurlResourceHandleDelegate.cpp:
1574         (WebCore::handleCookieHeaders): Remove argument to
1575         NetworkingContext::storageSession().
1576
1577 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1578
1579         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
1580         https://bugs.webkit.org/show_bug.cgi?id=193706
1581         <rdar://problem/44807048>
1582
1583         Reviewed by Ryosuke Niwa.
1584
1585         Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
1586         label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
1587         undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
1588         label simultaneously. There should be no change in behavior.
1589
1590         * editing/CompositeEditCommand.cpp:
1591         (WebCore::EditCommandComposition::label const):
1592         * editing/CompositeEditCommand.h:
1593         * editing/CustomUndoStep.cpp:
1594         (WebCore::CustomUndoStep::label const):
1595         * editing/CustomUndoStep.h:
1596         * editing/EditAction.cpp:
1597         (WebCore::undoRedoLabel):
1598         (WebCore::nameForUndoRedo): Deleted.
1599         * editing/EditAction.h:
1600
1601         Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
1602         WebKitLegacy.
1603
1604         * editing/UndoStep.h:
1605
1606         Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
1607         localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
1608
1609 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1610
1611         [SOUP] Clean up NetworkStorageSession
1612         https://bugs.webkit.org/show_bug.cgi?id=193707
1613
1614         Reviewed by Carlos Garcia Campos.
1615
1616         A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
1617         complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
1618         know the session has always already been created. The soupNetworkSession getter can now
1619         return a reference rather than a pointer, because it will never be NULL except after it has
1620         been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
1621         before process termination after nothing else is using it. Cookie jar syncing can also go
1622         away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
1623         use its cookie jar.
1624
1625         * platform/network/NetworkStorageSession.h:
1626         (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
1627         * platform/network/soup/DNSResolveQueueSoup.cpp:
1628         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
1629         (WebCore::DNSResolveQueueSoup::platformResolve):
1630         (WebCore::DNSResolveQueueSoup::resolve):
1631         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1632         (WebCore::NetworkStorageSession::NetworkStorageSession):
1633         (WebCore::NetworkStorageSession::~NetworkStorageSession):
1634         (WebCore::NetworkStorageSession::soupNetworkSession const):
1635         (WebCore::NetworkStorageSession::clearSoupNetworkSession):
1636         (WebCore::NetworkStorageSession::cookieStorage const):
1637         (WebCore::NetworkStorageSession::setCookieStorage):
1638         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
1639         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
1640         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1641         (WebCore::SocketStreamHandleImpl::create):
1642
1643 2019-01-23  Zalan Bujtas  <zalan@apple.com>
1644
1645         [LFC][BFC] computeStaticPosition should include estimated computation as well.
1646         https://bugs.webkit.org/show_bug.cgi?id=193719
1647
1648         Reviewed by Antti Koivisto.
1649
1650         Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
1651         It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
1652         the containing block's width).
1653         This is also in preparation for moving 'clear' positioning to computeStaticPosition.
1654
1655         * layout/blockformatting/BlockFormattingContext.cpp:
1656         (WebCore::Layout::BlockFormattingContext::layout const):
1657         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1658         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1659         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
1660         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
1661         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
1662         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
1663         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1664         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1665         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1666         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
1667         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
1668         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
1669         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
1670         * layout/blockformatting/BlockFormattingContext.h:
1671         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1672         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
1673         * layout/blockformatting/BlockMarginCollapse.cpp:
1674         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1675
1676 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
1677
1678         Compositing updates need to reparent scrolling tree nodes with a changed ancestor
1679         https://bugs.webkit.org/show_bug.cgi?id=193699
1680
1681         Reviewed by Frédéric Wang.
1682
1683         Now that compositing updates are incremental and may not do a full layer walk,
1684         we need to ensure that when a scrolling tree node is removed, we traverse to all
1685         descendant layers whose scrolling tree nodes refer to the removed node as their parent.
1686
1687         To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
1688         ensures that the updateBackingAndHierarchy part of the compositing update traverses
1689         layers with the bit set.
1690
1691         Adjust the compositing logging to make the legend easier to read.
1692
1693         Tests: scrollingcoordinator/reparent-across-compositing-layers.html
1694                scrollingcoordinator/reparent-with-layer-removal.html
1695
1696         * page/scrolling/AsyncScrollingCoordinator.cpp:
1697         (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
1698         * page/scrolling/AsyncScrollingCoordinator.h:
1699         * page/scrolling/ScrollingCoordinator.h:
1700         (WebCore::ScrollingCoordinator::childrenOfNode const):
1701         * rendering/RenderLayer.cpp:
1702         (WebCore::outputPaintOrderTreeLegend):
1703         (WebCore::outputPaintOrderTreeRecursive):
1704         * rendering/RenderLayer.h:
1705         * rendering/RenderLayerCompositor.cpp:
1706         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1707         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1708
1709 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
1710
1711         [css-logical] Implement flow-relative inset properties
1712         https://bugs.webkit.org/show_bug.cgi?id=189441
1713
1714         Reviewed by Dean Jackson.
1715
1716         Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
1717         'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
1718         behind the CSSLogicalEnabled runtime flag.
1719
1720         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
1721                webexposed/css-properties-behind-flags.html
1722
1723         * css/CSSComputedStyleDeclaration.cpp:
1724         (WebCore::isLayoutDependent):
1725         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1726         * css/CSSProperties.json:
1727         * css/CSSProperty.cpp:
1728         (WebCore::CSSProperty::resolveDirectionAwareProperty):
1729         (WebCore::CSSProperty::isDirectionAwareProperty):
1730         * css/StyleProperties.cpp:
1731         (WebCore::StyleProperties::getPropertyValue const):
1732         (WebCore::StyleProperties::asText const):
1733         * css/parser/CSSParserFastPaths.cpp:
1734         (WebCore::isSimpleLengthPropertyID):
1735         * css/parser/CSSPropertyParser.cpp:
1736         (WebCore::CSSPropertyParser::parseSingleValue):
1737         (WebCore::CSSPropertyParser::parseShorthand):
1738
1739 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
1740
1741         [css-grid] Properly handle static positions of abspos inside grid items
1742         https://bugs.webkit.org/show_bug.cgi?id=193657
1743
1744         Reviewed by Javier Fernandez.
1745
1746         Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
1747         Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
1748         and only if it's needed (not for abspos descentants in their static position).
1749         Add logicalOffsetForChild that finds the value to be set by the functions above.
1750         Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
1751
1752         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
1753                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
1754                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
1755                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
1756                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
1757                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
1758                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
1759                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
1760                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
1761                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
1762                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
1763                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
1764                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
1765                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
1766                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
1767                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
1768                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
1769                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
1770                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
1771                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
1772                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
1773                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
1774                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
1775                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
1776                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
1777                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
1778                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
1779                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
1780                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
1781                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
1782                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
1783                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
1784
1785         * rendering/RenderGrid.cpp:
1786         (WebCore::RenderGrid::layoutGridItems):
1787         (WebCore::RenderGrid::layoutPositionedObject):
1788         (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
1789         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
1790         (WebCore::RenderGrid::setLogicalPositionForChild const):
1791         (WebCore::RenderGrid::setLogicalOffsetForChild const):
1792         (WebCore::RenderGrid::logicalOffsetForChild const):
1793         * rendering/RenderGrid.h:
1794
1795 2019-01-23  Rob Buis  <rbuis@igalia.com>
1796
1797         Update MIME type parser
1798         https://bugs.webkit.org/show_bug.cgi?id=180526
1799
1800         Reviewed by Frédéric Wang.
1801
1802         Add an enum to allow two modes of MIME type parsing, one mode
1803         to keep supporting RFC2045 as before, and one mode to support
1804         the updated MIME parser from mimesniff [1]. Mimesniff support
1805         brings the following changes:
1806         - allows parameter names without matching =value.
1807         - skips whitespace after subtype, parameter value and before
1808           parameter name.
1809         - lower cases MIME type and parameter name.
1810         - parameter names parsed before are discarded.
1811
1812         The old mode is still used by CDM.cpp and MIMEHeader.cpp.
1813
1814         [1] https://mimesniff.spec.whatwg.org/
1815
1816         * Modules/encryptedmedia/CDM.cpp:
1817         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
1818         * platform/network/MIMEHeader.cpp:
1819         (WebCore::MIMEHeader::parseHeader):
1820         * platform/network/ParsedContentType.cpp:
1821         (WebCore::DummyParsedContentType::setContentType const):
1822         (WebCore::DummyParsedContentType::setContentTypeParameter const):
1823         (WebCore::isQuotedStringTokenCharacter):
1824         (WebCore::isTokenCharacter):
1825         (WebCore::parseToken):
1826         (WebCore::containsNonTokenCharacters):
1827         (WebCore::parseQuotedString):
1828         (WebCore::isNotForwardSlash):
1829         (WebCore::isNotSemicolon):
1830         (WebCore::isNotSemicolonOrEqualSign):
1831         (WebCore::parseContentType):
1832         (WebCore::isValidContentType):
1833         (WebCore::ParsedContentType::ParsedContentType):
1834         (WebCore::ParsedContentType::setContentType):
1835         (WebCore::isNonTokenCharacter):
1836         (WebCore::isNonQuotedStringTokenCharacter):
1837         (WebCore::ParsedContentType::setContentTypeParameter):
1838         * platform/network/ParsedContentType.h:
1839
1840         Test: web-platform-tests/xhr/overridemimetype-blob.html
1841
1842 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1843
1844         Introduce CustomUndoStep.h and CustomUndoStep.cpp
1845         https://bugs.webkit.org/show_bug.cgi?id=193704
1846         <rdar://problem/44807048>
1847
1848         Reviewed by Ryosuke Niwa.
1849
1850         This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
1851         class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
1852
1853         No change in behavior.
1854
1855         * Sources.txt:
1856         * WebCore.xcodeproj/project.pbxproj:
1857         * editing/CustomUndoStep.cpp:
1858         (WebCore::CustomUndoStep::CustomUndoStep):
1859
1860         Subclass UndoStep.
1861
1862         (WebCore::CustomUndoStep::unapply):
1863         (WebCore::CustomUndoStep::reapply):
1864
1865         If possible, invoke the UndoItem's undo and redo handlers.
1866
1867         (WebCore::CustomUndoStep::isValid const):
1868         * editing/CustomUndoStep.h:
1869         * editing/EditingStyle.cpp:
1870         * editing/InsertEditableImageCommand.cpp:
1871         (WebCore::InsertEditableImageCommand::doApply):
1872
1873         Unified build fixes.
1874
1875         * page/UndoItem.h:
1876
1877 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
1878
1879         Adding a child to a ScrollingStateNode needs to trigger a tree state commit
1880         https://bugs.webkit.org/show_bug.cgi?id=193682
1881
1882         Reviewed by Zalan Bujtas.
1883
1884         Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
1885         need to trigger scrolling tree updates, and currently do not.
1886
1887         Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
1888         this flag when committing the scrolling tree because we always eagerly traverse children, but
1889         we could use it to optimize later. The important part is that we use it to trigger a tree update.
1890         
1891         Can't test via z-reordering until webkit.org/b/192529 is fixed.
1892
1893         Tests: scrollingcoordinator/gain-scrolling-node-parent.html
1894                scrollingcoordinator/lose-scrolling-node-parent.html
1895
1896         * page/scrolling/ScrollingStateNode.cpp:
1897         (WebCore::ScrollingStateNode::appendChild):
1898         (WebCore::ScrollingStateNode::insertChild):
1899         (WebCore::ScrollingStateNode::removeChildAtIndex):
1900         * page/scrolling/ScrollingStateNode.h:
1901         * page/scrolling/ScrollingStateTree.cpp:
1902         (WebCore::ScrollingStateTree::attachNode):
1903
1904 2019-01-22  Devin Rousso  <drousso@apple.com>
1905
1906         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
1907         https://bugs.webkit.org/show_bug.cgi?id=116191
1908         <rdar://problem/13905910>
1909
1910         Reviewed by Joseph Pecoraro.
1911
1912         Test inspector/timeline/line-column.html
1913
1914         * bindings/js/ScriptController.cpp:
1915         (WebCore::ScriptController::evaluateInWorld):
1916         (WebCore::ScriptController::evaluateModule):
1917
1918         * bindings/js/JSExecStateInstrumentation.h:
1919         (WebCore::JSExecState::instrumentFunctionInternal):
1920
1921         * inspector/InspectorInstrumentation.h:
1922         (WebCore::InspectorInstrumentation::willCallFunction):
1923         (WebCore::InspectorInstrumentation::willEvaluateScript):
1924         * inspector/InspectorInstrumentation.cpp:
1925         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
1926         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
1927
1928         * inspector/agents/InspectorTimelineAgent.h:
1929         * inspector/agents/InspectorTimelineAgent.cpp:
1930         (WebCore::InspectorTimelineAgent::willCallFunction):
1931         (WebCore::InspectorTimelineAgent::willEvaluateScript):
1932
1933         * inspector/TimelineRecordFactory.h:
1934         * inspector/TimelineRecordFactory.cpp:
1935         (WebCore::TimelineRecordFactory::createFunctionCallData):
1936         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
1937
1938         * bindings/js/ScriptSourceCode.h:
1939         (WebCore::ScriptSourceCode::startColumn const): Added.
1940
1941 2019-01-22  Devin Rousso  <drousso@apple.com>
1942
1943         Web Inspector: expose Audit and Recording versions to the frontend
1944         https://bugs.webkit.org/show_bug.cgi?id=193262
1945         <rdar://problem/47130684>
1946
1947         Reviewed by Joseph Pecoraro.
1948
1949         Tests: inspector/audit/version.html
1950                inspector/recording/version.html
1951
1952         * inspector/agents/InspectorCanvasAgent.cpp:
1953         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1954
1955 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1956
1957         Add some bindings-related bookkeeping to UndoManager and UndoItem
1958         https://bugs.webkit.org/show_bug.cgi?id=193111
1959         <rdar://problem/44807048>
1960
1961         Reviewed by Ryosuke Niwa.
1962
1963         This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
1964         UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
1965         properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).
1966
1967         No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
1968         will write a test to verify that the undo and redo JavaScript functions survive garbage collection.
1969
1970         * Sources.txt:
1971         * WebCore.xcodeproj/project.pbxproj:
1972         * bindings/js/JSUndoItemCustom.cpp:
1973         (WebCore::JSUndoItem::visitAdditionalChildren):
1974
1975         Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
1976         for these functions are not garbage collected underneath the item.
1977
1978         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
1979
1980         Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
1981         This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
1982         `UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
1983         UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
1984         script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
1985         to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).
1986
1987         * dom/Document.cpp:
1988         (WebCore::Document::prepareForDestruction):
1989
1990         Invalidate all undo items when the document is about to go away.
1991
1992         * page/UndoItem.cpp:
1993         (WebCore::UndoItem::setUndoManager):
1994         (WebCore::UndoItem::invalidate):
1995         (WebCore::UndoItem::isValid const):
1996
1997         Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
1998         UndoManager, and is thus associated with a document.
1999
2000         (WebCore::UndoItem::document const):
2001         * page/UndoItem.h:
2002         * page/UndoItem.idl:
2003         * page/UndoManager.cpp:
2004         (WebCore::UndoManager::UndoManager):
2005         (WebCore::UndoManager::addItem):
2006
2007         Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
2008         be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
2009         (this latter behavior is yet to be implemented).
2010
2011         (WebCore::UndoManager::removeItem):
2012         (WebCore::UndoManager::removeAllItems):
2013         * page/UndoManager.h:
2014         (WebCore::UndoManager::UndoManager): Deleted.
2015         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2016
2017         Unified build fix.
2018
2019 2019-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
2020
2021         [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
2022         https://bugs.webkit.org/show_bug.cgi?id=193664
2023
2024         Reviewed by Brent Fulgham.
2025
2026         WinCairo WebKitTestRunner always crash on openning test cases of
2027         HTMLMeterElement.
2028
2029         If GraphicsContext::getWindowsContext retruned null HDC,
2030         LocalWindowsContext shouldn't release the null HDC.
2031
2032         Covered by existing tests.
2033
2034         * platform/graphics/win/LocalWindowsContext.h:
2035         (WebCore::LocalWindowsContext::~LocalWindowsContext):
2036         Release m_hdc only if it isn't null.
2037
2038 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2039
2040         Unreviewed, fix -Wsign-compare warning
2041         https://bugs.webkit.org/show_bug.cgi?id=188697
2042         <rdar://problem/46105624>
2043
2044         * css/StyleProperties.cpp:
2045         (WebCore::StyleProperties::asText const):
2046
2047 2019-01-22  Devin Rousso  <drousso@apple.com>
2048
2049         Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
2050         https://bugs.webkit.org/show_bug.cgi?id=193227
2051         <rdar://problem/46787862>
2052
2053         Reviewed by Joseph Pecoraro.
2054
2055         Test: inspector/audit/run-accessibility.html
2056
2057         * inspector/InspectorAuditAccessibilityObject.idl:
2058         * inspector/InspectorAuditAccessibilityObject.h:
2059         * inspector/InspectorAuditAccessibilityObject.cpp:
2060         (WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
2061
2062 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
2063
2064         Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
2065         https://bugs.webkit.org/show_bug.cgi?id=193692
2066
2067         Reviewed by Zalan Bujtas.
2068
2069         Remove the iOS-specific renderName() implementation.
2070
2071         * rendering/RenderIFrame.h:
2072
2073 2019-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
2074
2075         Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
2076         https://bugs.webkit.org/show_bug.cgi?id=193647
2077
2078         Reviewed by Simon Fraser.
2079
2080         Changing a style attribute of an SVGELement needs to call invalidateInstances().
2081
2082         Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
2083
2084         * svg/SVGElement.cpp:
2085         (WebCore::SVGElement::attributeChanged):
2086
2087 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2088
2089         Fix more builds.
2090
2091         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2092         (WebCore::handleCookieHeaders):
2093         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
2094
2095 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2096
2097         Fix some builds after r240292
2098         https://bugs.webkit.org/show_bug.cgi?id=193580
2099
2100         * platform/network/curl/ResourceHandleCurl.cpp:
2101         (WebCore::ResourceHandle::createCurlRequest):
2102         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2103         (WebCore::ResourceHandle::receivedCredential):
2104         (WebCore::ResourceHandle::getCredential):
2105
2106 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2107
2108         Move NetworkStorageSession ownership to NetworkProcess
2109         https://bugs.webkit.org/show_bug.cgi?id=193580
2110
2111         Reviewed by Geoff Garen.
2112
2113         NetworkStorageSessions used to be owned by a process-global map living in WebCore.
2114         This patch moves the ownership to the WebKit/WebKitLegacy layer.
2115         In WebKitLegacy they are still owned by a process-global map for compatibility.
2116         In WebKit they are owned by a map owned by the NetworkProcess object.
2117         There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
2118         1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
2119         of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
2120         so this code was removed with no change in behavior.
2121         2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
2122         into a static method that does the same thing.  We should audit these calls and decide if we really want them.
2123         3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
2124         storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.
2125
2126         * platform/network/CredentialStorage.h:
2127         * platform/network/NetworkStorageSession.cpp:
2128         (WebCore::NetworkStorageSession::processMayUseCookieAPI):
2129         (WebCore::NetworkStorageSession::globalSessionMap): Deleted.
2130         (WebCore::NetworkStorageSession::storageSession): Deleted.
2131         (WebCore::NetworkStorageSession::destroySession): Deleted.
2132         (WebCore::NetworkStorageSession::forEach): Deleted.
2133         * platform/network/NetworkStorageSession.h:
2134         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2135         (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
2136         (WebCore::createCFStorageSessionForIdentifier): Deleted.
2137         (WebCore::defaultNetworkStorageSession): Deleted.
2138         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2139         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
2140         (WebCore::NetworkStorageSession::ensureSession): Deleted.
2141         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2142         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
2143         * platform/network/cocoa/CookieStorageObserver.h:
2144         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2145         (WebCore::defaultSession): Deleted.
2146         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
2147         (WebCore::NetworkStorageSession::ensureSession): Deleted.
2148         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2149         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2150         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
2151         (WebCore::defaultSession): Deleted.
2152         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
2153         (WebCore::NetworkStorageSession::ensureSession): Deleted.
2154         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2155
2156 2019-01-22  Devin Rousso  <drousso@apple.com>
2157
2158         Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
2159         https://bugs.webkit.org/show_bug.cgi?id=193225
2160         <rdar://problem/46799956>
2161
2162         Reviewed by Joseph Pecoraro.
2163
2164         Test: inspector/audit/run-accessibility.html
2165
2166         * inspector/InspectorAuditAccessibilityObject.idl:
2167         * inspector/InspectorAuditAccessibilityObject.h:
2168         * inspector/InspectorAuditAccessibilityObject.cpp:
2169         (WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
2170         (WebCore::addChildren): Added.
2171         (WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
2172         (WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
2173         (WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
2174         (WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
2175         (WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
2176         (WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
2177         (WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
2178
2179 2019-01-22  David Kilzer  <ddkilzer@apple.com>
2180
2181         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
2182         <https://webkit.org/b/193654>
2183         <rdar://problem/47430290>
2184
2185         Reviewed by Alex Christensen.
2186
2187         - Moves QuickLookSoftLink.{h,mm} to PAL.
2188         - Adds soft-link to 3 classes to consolidate QuickLook.framework
2189           soft-linking.
2190         - Updates existing source to work with above changes.
2191
2192         * SourcesCocoa.txt:
2193         * UnifiedSources-input.xcfilelist:
2194         * WebCore.xcodeproj/project.pbxproj:
2195         - Remove QuickLookSoftLink.{h,mm} due to move to PAL.
2196
2197         * platform/ios/QuickLook.mm:
2198         (WebCore::QLPreviewGetSupportedMIMETypesSet):
2199         (WebCore::registerQLPreviewConverterIfNeeded):
2200         - Update for QuickLookSoftLink.{h,mm} move to PAL.
2201
2202         * platform/network/ios/PreviewConverter.mm:
2203         (WebCore::optionsWithPassword):
2204         (WebCore::PreviewConverter::PreviewConverter):
2205         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
2206
2207         * platform/network/ios/WebCoreURLResponseIOS.mm:
2208         (WebCore::adjustMIMETypeIfNecessary):
2209         - Update for QuickLookSoftLink.{h,mm} move to PAL.
2210
2211 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
2212
2213         Fix the position of layers nested inside of composited overflow-scroll
2214         https://bugs.webkit.org/show_bug.cgi?id=193642
2215
2216         Reviewed by Antti Koivisto and Sam Weinig.
2217
2218         Remove an iOS #ifdef so that layers inside composited overflow gets the correct
2219         positions on macOS too.
2220
2221         Test: compositing/geometry/fixed-inside-overflow-scroll.html
2222
2223         * rendering/RenderLayerBacking.cpp:
2224         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
2225
2226 2019-01-22  Claudio Saavedra  <csaavedra@igalia.com>
2227
2228         [GTK] Build fix for Ubuntu LTS 16.04
2229         https://bugs.webkit.org/show_bug.cgi?id=193672
2230
2231         Unreviewed build fix.
2232
2233         * html/canvas/CanvasStyle.h: Add default copy constructor for
2234         CMYKAColor struct.
2235
2236 2019-01-22  David Kilzer  <ddkilzer@apple.com>
2237
2238         Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2239         <https://webkit.org/b/193673>
2240         <rdar://problem/47448241>
2241
2242         Reviewed by Dean Jackson.
2243
2244         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2245         (WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
2246
2247 2019-01-22  Zalan Bujtas  <zalan@apple.com>
2248
2249         [LFC][Floats] Decouple clearance computation and margin collapsing reset.
2250         https://bugs.webkit.org/show_bug.cgi?id=193670
2251
2252         Reviewed by Antti Koivisto.
2253
2254         Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
2255         This is also in preparation for adding clear to static position.
2256
2257         * layout/FormattingContext.cpp:
2258         (WebCore::Layout::FormattingContext::mapTopToAncestor):
2259         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
2260         * layout/FormattingContext.h:
2261         * layout/blockformatting/BlockFormattingContext.cpp:
2262         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2263         * layout/floats/FloatingContext.cpp:
2264         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2265         * layout/floats/FloatingContext.h:
2266
2267 2019-01-22  Frederic Wang  <fwang@igalia.com>
2268
2269         Minor refactoring of the scrolling code
2270         https://bugs.webkit.org/show_bug.cgi?id=192398
2271
2272         Unreviewed build fix.
2273
2274         * page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
2275
2276 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
2277
2278         [css-logical] Implement flow-relative margin, padding and border shorthands
2279         https://bugs.webkit.org/show_bug.cgi?id=188697
2280
2281         Reviewed by Simon Fraser and Antti Koivisto.
2282
2283         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
2284                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
2285                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
2286                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
2287                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
2288                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
2289                webexposed/css-properties-behind-flags.html
2290
2291         * css/CSSComputedStyleDeclaration.cpp:
2292         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2293         Allow the new properties to serialize their computed value.
2294
2295         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
2296         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
2297         * css/CSSComputedStyleDeclaration.h:
2298         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
2299         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
2300         shorthands.
2301
2302         * css/CSSProperties.json:
2303         Add the new properties behind the CSSLogicalEnabled runtime flag.
2304
2305         * css/CSSStyleDeclaration.cpp:
2306         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
2307         Prevent CSS properties disabled behind a runtime flag from being exposed in
2308         style declarations.
2309
2310         * css/StyleProperties.cpp:
2311         (WebCore::StyleProperties::getPropertyValue const):
2312         Allow the new properties to serialize their specified value.
2313
2314         (WebCore::StyleProperties::get2Values const):
2315         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
2316
2317         (WebCore::StyleProperties::borderPropertyValue const):
2318         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
2319         corresponding to width, style and color.
2320
2321         (WebCore::MutableStyleProperties::setProperty):
2322         Prevent CSS properties disabled behind a runtime flag from being set a value.
2323
2324         (WebCore::StyleProperties::asText const):
2325         Allow the new properties to be serialized in cssText.
2326         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
2327         and serialize the longhands instead. Note that there could be another shorthand
2328         available which is enabled, but a proper solution would require bug 190496.
2329
2330         * css/StyleProperties.h:
2331         Update declarations of borderPropertyValue and get2Values.
2332
2333         * css/makeprop.pl:
2334         (addProperty):
2335         Add isEnabledCSSProperty function for checking that a CSS property is not
2336         disabled behind a runtime flag.
2337
2338         * css/parser/CSSPropertyParser.cpp:
2339         (WebCore::cssPropertyID):
2340         Prevent CSS properties disabled behind a runtime flag from being exposed in
2341         computed styles.
2342
2343         (WebCore::CSSPropertyParser::addProperty):
2344         Prevent CSS properties disabled behind a runtime flag from being set a value.
2345
2346         (WebCore::CSSPropertyParser::consumeBorder):
2347         Change consumeBorder to provide the caller with the parsed values instead of
2348         setting properties. Then the caller can decide to which properties the values
2349         should be set, and whether border-image should be reset or not.
2350
2351         (WebCore::CSSPropertyParser::consume2ValueShorthand):
2352         (WebCore::CSSPropertyParser::consume4ValueShorthand):
2353         Rename consume4Values to consume4ValueShorthand, and add analogous
2354         consume2ValueShorthand for parsing shorthands with two longhands.
2355
2356         (WebCore::CSSPropertyParser::parseShorthand):
2357         Allow the new properties to be parsed.
2358
2359         * css/parser/CSSPropertyParser.h:
2360         Update declarations of consumeBorder, consume2ValueShorthand and
2361         consume4ValueShorthand.
2362
2363         * inspector/agents/InspectorCSSAgent.cpp:
2364         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2365         Prevent CSS properties disabled behind a runtime flag from being exposed in
2366         the CSS inspector tool.
2367
2368         * page/RuntimeEnabledFeatures.h:
2369         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
2370         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
2371         Add the CSSLogicalEnabled runtime flag.
2372
2373 2019-01-21  Antti Koivisto  <antti@apple.com>
2374
2375         [iOS] Handle hit testing for subframes
2376         https://bugs.webkit.org/show_bug.cgi?id=192303
2377
2378         Reviewed by Frédéric Wang.
2379
2380         Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
2381         controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
2382
2383         Test by Frederic Wang.
2384
2385         Test: fast/scrolling/ios/hit-testing-iframe.html
2386
2387         * platform/ScrollView.cpp:
2388         (WebCore::ScrollView::managesScrollbars const):
2389
2390         Add a function that tells if the scrollview should deal with scrollbars at all
2391         This is always false on iOS and not connected to delegatesScrolling bit.
2392
2393         (WebCore::ScrollView::updateScrollbars):
2394         * platform/ScrollView.h:
2395         * rendering/RenderLayerCompositor.cpp:
2396         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2397
2398 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
2399
2400         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
2401         https://bugs.webkit.org/show_bug.cgi?id=193556
2402         <rdar://problem/47368501>
2403
2404         Reviewed by Alex Christensen.
2405
2406         This patch adds a new observer callback used to message the NetworkProcess when
2407         user interaction events are received. This is needed when the ResourceLoadStatistics
2408         data is not being managed by the UIProcess.
2409
2410         Tested by existing ResourceLoadStatistics and storageAccess tests.
2411
2412         * loader/ResourceLoadObserver.cpp:
2413         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
2414         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2415         * loader/ResourceLoadObserver.h:
2416         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2417         (WebCore::NetworkStorageSession::setCookiesFromDOM):
2418
2419 2019-01-21  Zalan Bujtas  <zalan@apple.com>
2420
2421         [LFC][Floats] Take float top position into account when computing containing block height.
2422         https://bugs.webkit.org/show_bug.cgi?id=193655
2423
2424         Reviewed by Antti Koivisto.
2425
2426         When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
2427         However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
2428         computing the containing block's height. Let's take the relevant floats into account as well.
2429
2430         Test: fast/block/float/float-first-child-and-clear-sibling.html
2431
2432         * layout/FormattingContextGeometry.cpp:
2433         (WebCore::Layout::contentHeightForFormattingContextRoot):
2434         * layout/floats/FloatingContext.cpp:
2435         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2436         * layout/floats/FloatingState.cpp:
2437         (WebCore::Layout::FloatingState::top const):
2438         * layout/floats/FloatingState.h:
2439
2440 2019-01-21  David Kilzer  <ddkilzer@apple.com>
2441
2442         REGRESSION (r240237): Revert changes to WebCore Xcode project
2443
2444         * WebCore.xcodeproj/project.pbxproj: Revert changes that were
2445         fixed in r240135.  Darin's patch must have been made prior to
2446         r240135.
2447
2448 2019-01-21  David Kilzer  <ddkilzer@apple.com>
2449
2450         REGRESSION (r240201): Add a POINTER_EVENTS feature flag
2451         https://bugs.webkit.org/show_bug.cgi?id=193577
2452         <rdar://problem/47408511>
2453
2454         * dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
2455         to fix tvOS & watchOS builds.
2456
2457 2019-01-15  Darin Adler  <darin@apple.com>
2458
2459         Use references rather than pointers for register/unregister functions, and more
2460         https://bugs.webkit.org/show_bug.cgi?id=175028
2461
2462         Reviewed by Daniel Bates.
2463
2464         * Modules/applepay/ApplePaySession.cpp:
2465         (WebCore::ApplePaySession::begin): Pass a reference.
2466         (WebCore::ApplePaySession::completePayment): Ditto.
2467         (WebCore::ApplePaySession::didReachFinalState): Ditto.
2468         * Modules/cache/DOMCache.cpp:
2469         (WebCore::DOMCache::retrieveRecords): Ditto.
2470         (WebCore::DOMCache::batchDeleteOperation): Ditto.
2471         (WebCore::DOMCache::batchPutOperation): Ditto.
2472         * Modules/cache/DOMCacheStorage.cpp:
2473         (WebCore::DOMCacheStorage::match): Ditto.
2474         * Modules/fetch/FetchBodyOwner.cpp:
2475         (WebCore::FetchBodyOwner::loadBlob): Ditto.
2476         (WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
2477         * Modules/fetch/FetchBodySource.cpp:
2478         (WebCore::FetchBodySource::setActive): Ditto.
2479         (WebCore::FetchBodySource::setInactive): Ditto.
2480         * Modules/fetch/FetchResponse.cpp:
2481         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
2482         (WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
2483         * Modules/mediasource/MediaSource.cpp:
2484         (WebCore::MediaSource::addedToRegistry): Ditto.
2485         (WebCore::MediaSource::removedFromRegistry): Ditto.
2486         * Modules/mediastream/MediaStream.cpp:
2487         (WebCore::MediaStream::~MediaStream): Ditto.
2488         (WebCore::MediaStream::startProducingData): Ditto.
2489         * Modules/mediastream/MediaStreamTrack.cpp:
2490         (WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
2491         (WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
2492         * Modules/mediastream/RTCDataChannel.cpp:
2493         (WebCore::RTCDataChannel::create): Ditto.
2494         (WebCore::RTCDataChannel::close): Ditto.
2495         * Modules/mediastream/RTCPeerConnection.cpp:
2496         (WebCore::RTCPeerConnection::create): Use auto.
2497         * Modules/notifications/Notification.cpp:
2498         (WebCore::Notification::show): Pass a reference.
2499         (WebCore::Notification::finalize): Ditto.
2500         * Modules/webaudio/AudioBasicInspectorNode.cpp:
2501         (WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
2502
2503         * Modules/webaudio/AudioContext.cpp:
2504         (WebCore::AudioContext::constructCommon): Ditto.
2505         (WebCore::AudioContext::lazyInitialize): Ditto.
2506         (WebCore::AudioContext::clear): Ditto.
2507         (WebCore::AudioContext::uninitialize): Ditto.
2508         (WebCore::AudioContext::markForDeletion): Take a reference.
2509         (WebCore::AudioContext::addAutomaticPullNode): Ditto.
2510         (WebCore::AudioContext::removeAutomaticPullNode): Ditto.
2511         (WebCore::AudioContext::willBeginPlayback): Pass a reference.
2512         (WebCore::AudioContext::willPausePlayback): Ditto.
2513         * Modules/webaudio/AudioContext.h: Update above functions to take
2514         references rather than pointers.
2515
2516         * Modules/webaudio/AudioNode.cpp:
2517         (WebCore::AudioNode::finishDeref): Pass a reference.
2518         * Modules/websockets/WebSocket.cpp:
2519         (WebCore::WebSocket::connect): Ditto.
2520         (WebCore::WebSocket::stop): Ditto.
2521         (WebCore::WebSocket::didClose): Ditto.
2522
2523         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
2524
2525         * bindings/js/JSDOMWindowBase.cpp:
2526         (WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
2527         moduleLoader is now a reference.
2528         (WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
2529         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
2530         (WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
2531         (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
2532
2533         * dom/ActiveDOMObject.h:
2534         (WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
2535         (WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
2536
2537         * dom/CharacterData.cpp:
2538         (WebCore::CharacterData::setData): Pass a reference.
2539         (WebCore::CharacterData::insertData): Ditto.
2540         (WebCore::CharacterData::deleteData): Ditto.
2541         (WebCore::CharacterData::replaceData): Ditto.
2542
2543         * dom/Document.cpp:
2544         (WebCore::Document::getElementByAccessKey): Pass a reference.
2545         (WebCore::Document::buildAccessKeyMap): Take a reference.
2546         (WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
2547         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
2548         (WebCore::Document::addAudioProducer): Ditto.
2549         (WebCore::Document::removeAudioProducer): Ditto.
2550         (WebCore::Document::hoveredElementDidDetach): Ditto.
2551         (WebCore::Document::elementInActiveChainDidDetach): Ditto.
2552         (WebCore::Document::attachNodeIterator): Ditto.
2553         (WebCore::Document::detachNodeIterator): Ditto.
2554         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
2555         a reference.
2556         (WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
2557         (WebCore::Document::nodeWillBeRemoved): Ditto.
2558         (WebCore::Document::textInserted): Take a reference.
2559         (WebCore::Document::textRemoved): Ditto.
2560         (WebCore::Document::textNodesMerged): Ditto.
2561         (WebCore::Document::textNodeSplit): Ditto.
2562         (WebCore::Document::takeDOMWindowFrom): Ditto.
2563         (WebCore::Document::registerForDocumentSuspensionCallbacks): Ditto.
2564         (WebCore::Document::unregisterForDocumentSuspensionCallbacks): Ditto.
2565         (WebCore::Document::registerForMediaVolumeCallbacks): Ditto.
2566         (WebCore::Document::unregisterForMediaVolumeCallbacks): Ditto.
2567         (WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Ditto.
2568         (WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Ditto.
2569         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Ditto.
2570         (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
2571         (WebCore::Document::registerForPageScaleFactorChangedCallbacks): Ditto.
2572         (WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Ditto.
2573         (WebCore::Document::finishedParsing): Use a reference.
2574         (WebCore::Document::attachRange): Take a reference.
2575         (WebCore::Document::detachRange): Ditto.
2576         (WebCore::Document::suspendScheduledTasks): Use a reference.
2577         (WebCore::Document::resumeScheduledTasks): Ditto.
2578         (WebCore::Document::addMediaCanStartListener): Take a reference.
2579         (WebCore::Document::removeMediaCanStartListener): Ditto.
2580         (WebCore::Document::deviceMotionController const): Return a reference.
2581         (WebCore::Document::deviceOrientationController const): Ditto.
2582         (WebCore::Document::simulateDeviceOrientationChange): Use a reference.
2583         (WebCore::Document::fullScreenIsAllowedForElement const): Take a reference.
2584         (WebCore::Document::requestFullScreenForElement): Pass a reference.
2585         (WebCore::Document::webkitExitFullscreen): Ditto.
2586         (WebCore::Document::webkitWillEnterFullScreen): Renamed to remove the
2587         "ForElement" from the function name. Take a reference rather than a pointer.
2588         (WebCore::Document::webkitDidEnterFullScreen): Renamed to remove the
2589         "ForElement" from the function name and removed the unused element argument.
2590         (WebCore::Document::webkitWillExitFullScreen): Ditto.
2591         (WebCore::Document::webkitDidExitFullScreen): Ditto.
2592         (WebCore::Document::pushFullscreenElementStack): Take a reference.
2593         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Ditto.
2594         (WebCore::DocumentParserYieldToken::DocumentParserYieldToken): Use a reference.
2595         (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken): Ditto.
2596         (WebCore::Document::updateHoverActiveState): Updated name of isInActiveChain.
2597
2598         * dom/Document.h: Updated argument types as described above. Changed a couple
2599         of inline functions to return references.
2600
2601         * dom/DocumentMarkerController.cpp:
2602         (WebCore::DocumentMarkerController::addMarker): Take a reference.
2603         (WebCore::DocumentMarkerController::addMarkerToNode): Ditto.
2604         (WebCore::DocumentMarkerController::addTextMatchMarker): Ditto.
2605         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker): Ditto.
2606         (WebCore::DocumentMarkerController::addDictationResultMarker): Ditto.
2607         (WebCore::DocumentMarkerController::addDraggedContentMarker): Ditto.
2608         (WebCore::DocumentMarkerController::removeMarkers): Ditto.
2609         (WebCore::DocumentMarkerController::copyMarkers): Ditto.
2610         (WebCore::DocumentMarkerController::shiftMarkers): Ditto.
2611         (WebCore::DocumentMarkerController::setMarkersActive): DItto.
2612         * dom/DocumentMarkerController.h: Updated argument types as described above.
2613
2614         * dom/Element.cpp:
2615         (WebCore::Element::~Element): Pass a reference.
2616         (WebCore::Element::isUserActionElementInActiveChain const): Updated name of
2617         isInActiveChain.
2618         (WebCore::Element::hasEquivalentAttributes const): Take a reference.
2619         (WebCore::Element::removedFromAncestor): Pass a reference.
2620         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
2621         Pass a reference and updated name of isInActiveChain.
2622
2623         * dom/Element.h: Renamed inActiveChain to isInActiveChain, updated argument
2624         types to be references, and removed unneeded friend declaration and made
2625         SynchronizationOfLazyAttribute private.
2626
2627         * dom/Node.cpp:
2628         (WebCore::Node::normalize): Pass a reference.
2629         (WebCore::Node::isEqualNode const): Ditto.
2630         * dom/NodeIterator.cpp:
2631         (WebCore::NodeIterator::NodeIterator): Ditto.
2632         (WebCore::NodeIterator::~NodeIterator): Ditto.
2633
2634         * dom/RadioButtonGroups.cpp:
2635         (WebCore::RadioButtonGroup::add): Take a reference.
2636         (WebCore::RadioButtonGroup::updateCheckedState): Ditto.
2637         (WebCore::RadioButtonGroup::remove): Ditto.
2638         (WebCore::RadioButtonGroup::contains const): Ditto.
2639         (WebCore::RadioButtonGroups::addButton): Ditto.
2640         (WebCore::RadioButtonGroups::updateCheckedState): Ditto.
2641         (WebCore::RadioButtonGroups::hasCheckedButton const): Ditto.
2642         (WebCore::RadioButtonGroups::isInRequiredGroup const): Ditto.
2643         (WebCore::RadioButtonGroups::removeButton): Ditto.
2644         * dom/RadioButtonGroups.h: Updated argument types.
2645
2646         * dom/Range.cpp:
2647         (WebCore::Range::Range): Pass a reference.
2648         (WebCore::Range::~Range): Ditto.
2649         (WebCore::Range::setDocument): Ditto.
2650         (WebCore::Range::createContextualFragment): Ditto.
2651         (WebCore::boundaryTextInserted): Ditto.
2652         (WebCore::Range::textInserted): Ditto.
2653         (WebCore::boundaryTextRemoved): Ditto.
2654         (WebCore::Range::textRemoved): Ditto.
2655         (WebCore::boundaryTextNodesSplit): Ditto.
2656         (WebCore::Range::textNodeSplit): Ditto.
2657         * dom/Range.h: Take references instead of pointers.
2658
2659         * dom/ScriptElement.cpp:
2660         (WebCore::ScriptElement::prepareScript): Use reference.
2661
2662         * dom/Text.cpp:
2663         (WebCore::Text::splitText): Pass reference.
2664
2665         * dom/UserActionElementSet.h: Renamed inActiveChain to isInActiveChain to
2666         match the naming scheme of the other similar functions, like isActive.
2667
2668         * editing/AlternativeTextController.cpp:
2669         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2670         Pass a reference.
2671         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Ditto.
2672         (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto.
2673         (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
2674         (WebCore::AlternativeTextController::markReversed): Ditto.
2675         (WebCore::AlternativeTextController::markCorrection): Ditto.
2676         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto.
2677         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
2678         * editing/CompositeEditCommand.cpp:
2679         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto.
2680         * editing/DictationCommand.cpp: Ditto.
2681         * editing/Editing.cpp:
2682         (WebCore::areIdenticalElements): Ditto.
2683         * editing/Editor.cpp:
2684         (WebCore::Editor::ignoreSpelling): Ditto.
2685         (WebCore::Editor::learnSpelling): Ditto.
2686         (WebCore::Editor::advanceToNextMisspelling): Ditto.
2687         (WebCore::Editor::clearMisspellingsAndBadGrammar): Ditto.
2688         (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
2689         (WebCore::Editor::markAndReplaceFor): Ditto.
2690         (WebCore::Editor::changeBackToReplacedString): Ditto.
2691         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
2692         (WebCore::Editor::countMatchesForText): Ditto.
2693         (WebCore::Editor::scanRangeForTelephoneNumbers): Ditto.
2694         (WebCore::Editor::editorUIUpdateTimerFired): Ditto.
2695         (WebCore::Editor::handleAcceptedCandidate): Ditto.
2696
2697         * editing/InsertTextCommand.cpp:
2698         (WebCore::InsertTextCommand::doApply): Pass a reference.
2699         * editing/InsertTextCommand.h: Take a reference.
2700
2701         * editing/SpellChecker.cpp:
2702         (WebCore::SpellChecker::didCheckSucceed): Pass a reference.
2703         * editing/SplitTextNodeCommand.cpp:
2704         (WebCore::SplitTextNodeCommand::doApply): Ditto.
2705         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
2706         * editing/TextCheckingHelper.cpp:
2707         (WebCore::TextCheckingHelper::findFirstMisspelling): Pass a reference.
2708         (WebCore::TextCheckingHelper::findFirstGrammarDetail const): Ditto.
2709         * editing/ios/DictationCommandIOS.cpp:
2710         (WebCore::DictationCommandIOS::doApply): Ditto.
2711         Also added a comment about a possible missing null check; behavior should
2712         be no different than before, but using a reference helps make clear there
2713         was never any null check.
2714         * editing/ios/EditorIOS.mm:
2715         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
2716         * fileapi/FileReader.cpp:
2717         (WebCore::FileReader::readInternal): Ditto.
2718         (WebCore::FileReader::abort): Ditto.
2719         (WebCore::FileReader::didFinishLoading): Ditto.
2720         (WebCore::FileReader::didFail): Ditto.
2721
2722         * html/HTMLAppletElement.cpp: Removed unneeded include of HTMLDocument.h.
2723         There's very little left that is truly specific to HTMLDocument vs. Document.
2724
2725         * html/HTMLDocument.h:
2726         (WebCore::HTMLDocument::create): Take a reference.
2727         (WebCore::HTMLDocument::createSynthesizedDocument): Ditto.
2728
2729         * html/HTMLFormElement.cpp:
2730         (WebCore::HTMLFormElement::~HTMLFormElement): Pass a reference.
2731         (WebCore::HTMLFormElement::parseAttribute): Ditto.
2732         (WebCore::HTMLFormElement::didMoveToNewDocument): Ditto.
2733
2734         * html/HTMLIFrameElement.cpp: Removed unneeded include of HTMLDocument.h.
2735
2736         * html/HTMLInputElement.cpp:
2737         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a reference.
2738         (WebCore::HTMLInputElement::setChecked): Ditto.
2739         (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): Ditto.
2740         (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): Ditto.
2741         (WebCore::HTMLInputElement::didMoveToNewDocument): Ditto.
2742         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Ditto.
2743         (WebCore::HTMLInputElement::addToRadioButtonGroup): Ditto.
2744         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Ditto.
2745         * html/HTMLMediaElement.cpp:
2746         (WebCore::HTMLMediaElement::registerWithDocument): Ditto.
2747         (WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
2748         (WebCore::HTMLMediaElement::selectMediaResource): Ditto.
2749         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
2750         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
2751         (WebCore::HTMLMediaElement::resume): Ditto.
2752         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Ditto.
2753
2754         * html/HTMLNameCollection.cpp: Removed unneeded include of HTMLDocument.h.
2755
2756         * html/HTMLPlugInImageElement.cpp:
2757         (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Pass a reference.
2758         (WebCore::HTMLPlugInImageElement::createElementRenderer): Ditto.
2759         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Ditto.
2760
2761         * html/HTMLSourceElement.cpp: Removed unneeded include of HTMLDocument.h.
2762         * html/HTMLTemplateElement.cpp: Ditto.
2763
2764         * html/RadioInputType.cpp:
2765         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
2766         Pass a reference.
2767         * loader/DocumentWriter.cpp:
2768         (WebCore::DocumentWriter::begin): Ditto.
2769         * page/DOMWindow.cpp:
2770         (WebCore::DOMWindow::addEventListener): Ditto.
2771         (WebCore::DOMWindow::removeEventListener): Ditto.
2772         (WebCore::DOMWindow::removeAllEventListeners): Ditto.
2773
2774         * page/EventHandler.cpp:
2775         (WebCore::EventHandler::didStartDrag): Use a reference.
2776
2777         * page/EventSource.cpp:
2778         (WebCore::EventSource::create): Pass reference.
2779         (WebCore::EventSource::networkRequestEnded): Ditto.
2780         (WebCore::EventSource::close): Ditto.
2781         (WebCore::EventSource::abortConnectionAttempt): Ditto.
2782
2783         * page/Frame.cpp: Removed unneeded include of HTMLDocument.h.
2784         * page/FrameView.cpp: Ditto.
2785         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Use reference.
2786
2787         * page/animation/AnimationBase.cpp:
2788         (WebCore::AnimationBase::updateStateMachine): Pass reference.
2789
2790         * page/animation/CSSAnimationController.cpp:
2791         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle): Take reference.
2792         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle): Ditto.
2793         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): Ditto.
2794         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): Ditto.
2795         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): Ditto.
2796         * page/animation/CSSAnimationControllerPrivate.h: Ditto.
2797
2798         * page/animation/CompositeAnimation.cpp:
2799         (WebCore::CompositeAnimation::clearElement): Pass reference.
2800         (WebCore::CompositeAnimation::updateTransitions): Ditto.
2801         (WebCore::CompositeAnimation::updateKeyframeAnimations): Ditto.
2802         * page/ios/FrameIOS.mm:
2803         (WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
2804
2805         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2806         (WebCore::layerContentsFormat): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END so
2807         I can continue to compile with latest headers.
2808
2809         * rendering/CSSFilter.cpp:
2810         (WebCore::CSSFilter::buildReferenceFilter): Pass reference, small coding style
2811         tweaks as well.
2812
2813         * rendering/svg/RenderSVGResource.cpp:
2814         (WebCore::removeFromCacheAndInvalidateDependencies): Pass reference.
2815         * rendering/svg/RenderSVGResourceContainer.cpp:
2816         (WebCore::RenderSVGResourceContainer::registerResource): Ditto.
2817         * rendering/svg/SVGResources.cpp:
2818         (WebCore::registerPendingResource): Ditto.
2819         * rendering/svg/SVGResourcesCache.cpp:
2820         (WebCore::SVGResourcesCache::resourceDestroyed): Ditto.
2821
2822         * svg/SVGDocumentExtensions.cpp:
2823         (WebCore::SVGDocumentExtensions::addTimeContainer): Take reference.
2824         (WebCore::SVGDocumentExtensions::removeTimeContainer): Ditto.
2825         (WebCore::SVGDocumentExtensions::addResource): Ditto.
2826         (WebCore::SVGDocumentExtensions::addPendingResource): Ditto.
2827         (WebCore::SVGDocumentExtensions::isElementWithPendingResources const): Ditto.
2828         (WebCore::SVGDocumentExtensions::isPendingResource const): Ditto.
2829         (WebCore::SVGDocumentExtensions::clearHasPendingResourcesIfPossible): Ditto.
2830         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): Ditto.
2831         (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): Ditto.
2832         (WebCore::SVGDocumentExtensions::addElementReferencingTarget): Ditto.
2833         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Ditto.
2834         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Ditto.
2835         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Ditto.
2836         (WebCore::SVGDocumentExtensions::registerSVGFontFaceElement): Ditto.
2837         (WebCore::SVGDocumentExtensions::unregisterSVGFontFaceElement): Ditto.
2838         * svg/SVGDocumentExtensions.h: Ditto.
2839
2840         * svg/SVGElement.cpp:
2841         (WebCore::SVGElement::~SVGElement): Pass reference.
2842         (WebCore::SVGElement::removedFromAncestor): Ditto.
2843         (WebCore::SVGElement::buildPendingResourcesIfNeeded): Ditto.
2844         * svg/SVGFEImageElement.cpp:
2845         (WebCore::SVGFEImageElement::clearResourceReferences): Ditto.
2846         (WebCore::SVGFEImageElement::buildPendingResource): Ditto.
2847         * svg/SVGFontFaceElement.cpp:
2848         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Ditto.
2849         (WebCore::SVGFontFaceElement::removedFromAncestor): Ditto.
2850         * svg/SVGMPathElement.cpp:
2851         (WebCore::SVGMPathElement::buildPendingResource): Ditto.
2852         (WebCore::SVGMPathElement::clearResourceReferences): Ditto.
2853         * svg/SVGPathElement.cpp:
2854         (WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
2855         * svg/SVGSVGElement.cpp:
2856         (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
2857         (WebCore::SVGSVGElement::~SVGSVGElement): Ditto.
2858         (WebCore::SVGSVGElement::didMoveToNewDocument): Ditto.
2859         (WebCore::SVGSVGElement::insertedIntoAncestor): Ditto.
2860         (WebCore::SVGSVGElement::removedFromAncestor): Ditto.
2861         * svg/SVGTRefElement.cpp:
2862         (WebCore::SVGTRefElement::detachTarget): Ditto.
2863         (WebCore::SVGTRefElement::buildPendingResource): Ditto.
2864         * svg/SVGTextPathElement.cpp:
2865         (WebCore::SVGTextPathElement::clearResourceReferences): Ditto.
2866         (WebCore::SVGTextPathElement::buildPendingResource): Ditto.
2867         * svg/SVGUseElement.cpp:
2868         (WebCore::SVGUseElement::updateShadowTree): Ditto.
2869         * svg/animation/SVGSMILElement.cpp:
2870         (WebCore::SVGSMILElement::clearResourceReferences): Ditto.
2871         (WebCore::SVGSMILElement::buildPendingResource): Ditto.
2872         * testing/Internals.cpp:
2873         (WebCore::Internals::addTextMatchMarker): Ditto.
2874         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
2875         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
2876         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
2877         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
2878         * workers/Worker.cpp:
2879         (WebCore::Worker::create): Ditto.
2880         (WebCore::Worker::notifyFinished): Ditto.
2881         * workers/service/ServiceWorkerContainer.cpp:
2882         (WebCore::ServiceWorkerContainer::scheduleJob): Ditto.
2883         (WebCore::ServiceWorkerContainer::jobDidFinish): Ditto.
2884         * xml/XMLHttpRequest.cpp:
2885         (WebCore::XMLHttpRequest::prepareToSend): Ditto.
2886         (WebCore::XMLHttpRequest::createRequest): Ditto.
2887         (WebCore::XMLHttpRequest::internalAbort): Ditto.
2888         (WebCore::XMLHttpRequest::networkErrorTimerFired): Ditto.
2889         (WebCore::XMLHttpRequest::didFail): Ditto.
2890         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
2891
2892         * xml/XPathStep.cpp: Removed unneeded include of HTMLDocument.h.
2893         (WebCore::XPath::nodeMatchesBasicTest): Changed code to call isHTMLDocument
2894         rather than is<HTMLDocument> since this is not a type check for a downcast,
2895         but rather a behavioral difference that does not depend on any of the data
2896         stored in an HTMLDocument or the use of a distinct C++ class for it.
2897
2898         * xml/XSLTProcessor.cpp:
2899         (WebCore::XSLTProcessor::createDocumentFromSource): Pass a reference.
2900
2901 2019-01-21  David Kilzer  <ddkilzer@apple.com>
2902
2903         Switch remaining VideoToolbox soft-linking in WebCore over to VideoToolboxSoftLink.{cpp,h}
2904         <https://webkit.org/b/193645>
2905         <rdar://problem/47421574>
2906
2907         Reviewed by Alex Christensen.
2908
2909         * platform/cocoa/VideoToolboxSoftLink.cpp:
2910         * platform/cocoa/VideoToolboxSoftLink.h:
2911         - Move soft-linking of VTPixelBufferConformer* functions from
2912           PixelBufferConformerCV.cpp to here.
2913         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2914         - Remove local soft-linking of VideoToolbox.framework and switch
2915           to VideoToolboxSoftLink.h.
2916
2917 2019-01-21  Antti Koivisto  <antti@apple.com>
2918
2919         Move delegatesScrolling() tests to lower level conversion function in ScrollView
2920         https://bugs.webkit.org/show_bug.cgi?id=193649
2921
2922         Reviewed by Frédéric Wang.
2923
2924         This reduces places where these tests are needed and helps avoid mistakes.
2925
2926         * dom/Document.cpp:
2927         (WebCore::computeIntersectionState):
2928         * page/FrameView.cpp:
2929         (WebCore::FrameView::convertFromRendererToContainingView const):
2930         (WebCore::FrameView::convertFromContainingViewToRenderer const):
2931         * platform/ScrollView.cpp:
2932         (WebCore::ScrollView::viewToContents const):
2933         (WebCore::ScrollView::contentsToView const):
2934         (WebCore::ScrollView::contentsToContainingViewContents const):
2935         (WebCore::ScrollView::rootViewToContents const):
2936         (WebCore::ScrollView::contentsToRootView const):
2937         (WebCore::ScrollView::windowToContents const):
2938         (WebCore::ScrollView::contentsToWindow const):
2939
2940 2019-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2941
2942         REGRESSION(r239915): about 130 test failures on WPE
2943         https://bugs.webkit.org/show_bug.cgi?id=193395
2944
2945         Reviewed by Žan Doberšek.
2946
2947         Since r239915 we are only overriding the characters with Default_Ignorable unicode property when the font
2948         doesn't support the code point. If the font happens to provide a glyph for the character, it's later ignored by
2949         harfbuzz when shaping, but the simple text code path doesn't ignore them unless there isn't a glyph.
2950
2951         * platform/graphics/WidthIterator.cpp:
2952         (WebCore::WidthIterator::advanceInternal): Always ignore characters with Default_Ignorable unicode property.
2953         (WebCore::characterMustDrawSomething): Moved to CharacterProperties.h and renamed as isDefaultIgnorableCodePoint().
2954         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2955         (WebCore::GlyphPage::fill): Use isDefaultIgnorableCodePoint().
2956         * platform/text/CharacterProperties.h:
2957         (WebCore::isDefaultIgnorableCodePoint): Return whether the character has Default_Ignorable unicode property.
2958
2959 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
2960
2961         [WHLSL] Implement Metal code generation
2962         https://bugs.webkit.org/show_bug.cgi?id=193531
2963
2964         Reviewed by Dean Jackson.
2965
2966         This implements the majority of the metal code generation piece. There are still a few pieces missing,
2967         that I'll add in follow up patches. There's still enough complexity here that this is worth reviewing
2968         on its own, though.
2969
2970         This patch includes a few pieces:
2971         - Metal typedefs for every WHLSL type. This analysis is actually pretty interesting, because complex
2972               types depend on their inner types, and the inner types need to be emitted first. Therefore,
2973               this patch implements a topological sort when emitting types. Also, WHLSL types need to be de-
2974               duped because array references are implemented in MSL as structs, and if you have two structs
2975               in MSL with the same contents, those two structs are not equal and cannot be assigned to each
2976               other. So, this patch creates a trie to de-dup all the UnnamedTypes, and implements a
2977               dependency graph which includes both nodes in the trie as well as NamedTypes which don't appear
2978               in the trie.
2979         - WHLSL enumeration code generation
2980         - A name mangler, which ensures that no text from the source program is contained within the result
2981               program
2982         - Full support for expressions. An expression like "y = *x + 7;" would be converted to something like
2983               Type1 variable1 = *x;
2984               Type2 variable2 = 7;
2985               Type3 variable3 = variable1 + variable2;
2986               y = variable3;
2987         - Mostly complete support for control flow. This is tricky because of how we transform WHLSL
2988               expressions into C++ statements. Therefore, things like "for ( ; *x + 7; )" is difficult to
2989               compile, because we can't put the "*x + 7" generated statements into the for loop itself.
2990               Instead, we have to emit this code inside the loop, in all the places that would implicitly run
2991               it. This patch doesn't fully handle this, see below. (If MSL supported lambdas, we could put
2992               the statements into a lambda and do something like "for ( ; theLambda(); )" but MSL doesn't
2993               support lambdas.)
2994
2995         Missing pieces:
2996         - Entry point pack / unpack code
2997         - Support for "continue" (See above regarding control flow)
2998         - Knowing whether or not a switch case should end with break or fallthrough
2999         - Trapping
3000         - Zero filling variables
3001         - Code generation for compiler-generated native functions (this patch supports native functions in the
3002               standard library), texture functions, and HLSL's half <-> int functions.
3003
3004         No new tests because it isn't hooked up yet. As soon as we can do entry point packing and unpacking,
3005         I'll start porting the test suite.
3006
3007         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
3008         (WebCore::WHLSL::AST::BuiltInSemantic::targetIndex):
3009         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3010         (WebCore::WHLSL::AST::Expression::resolvedType):
3011         (WebCore::WHLSL::AST::Expression::type): Deleted.
3012         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
3013         (WebCore::WHLSL::AST::FunctionDeclaration::name):
3014         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
3015         (WebCore::WHLSL::AST::StructureDefinition::find):
3016         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Added.
3017         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
3018         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes):
3019         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature):
3020         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack):
3021         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack):
3022         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3023         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Added.
3024         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
3025         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
3026         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
3027         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString):
3028         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
3029         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
3030         (WebCore::WHLSL::Metal::metalFunctions):
3031         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3032         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h.
3033         (WebCore::WHLSL::Metal::generateMetalCode):
3034         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3035         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Added.
3036         (WebCore::WHLSL::Metal::getNativeName):
3037         (WebCore::WHLSL::Metal::mapFunctionName):
3038         (WebCore::WHLSL::Metal::convertAddressSpace):
3039         (WebCore::WHLSL::Metal::writeNativeFunction):
3040         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3041         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Added.
3042         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
3043         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
3044         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
3045         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
3046         (WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
3047         (WebCore::WHLSL::Metal::BaseTypeNameNode::children):
3048         (WebCore::WHLSL::Metal::BaseTypeNameNode::append):
3049         (WebCore::WHLSL::Metal::BaseTypeNameNode::parent):
3050         (WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
3051         (WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
3052         (WebCore::WHLSL::Metal::ArrayTypeNameNode::numElements const):
3053         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
3054         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::addressSpace const):
3055         (WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
3056         (WebCore::WHLSL::Metal::PointerTypeNameNode::addressSpace const):
3057         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
3058         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::namedType):
3059         (WebCore::WHLSL::Metal::TypeNamer::TypeNamer):
3060         (WebCore::WHLSL::Metal::TypeNamer::visit):
3061         (WebCore::WHLSL::Metal::findInVector):
3062         (WebCore::WHLSL::Metal::find):
3063         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
3064         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
3065         (WebCore::WHLSL::Metal::TypeNamer::insert):
3066         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
3067         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString):
3068         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
3069         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
3070         (WebCore::WHLSL::Metal::toString):
3071         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
3072         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
3073         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
3074         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
3075         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
3076         (WebCore::WHLSL::Metal::TypeNamer::metalTypes):
3077         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Added.
3078         (WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
3079         (WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
3080         (WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
3081         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3082         (WebCore::WHLSL::checkSemantics):
3083         (WebCore::WHLSL::Checker::visit):
3084         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
3085         (WebCore::WHLSL::Gatherer::visit):
3086         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
3087         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
3088         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed.
3089         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
3090         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
3091         (WebCore::WHLSL::checkStatementBehavior):
3092         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3093         * Sources.txt:
3094         * WebCore.xcodeproj/project.pbxproj:
3095
3096 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
3097
3098         [WHLSL] Add the statement behavior checker
3099         https://bugs.webkit.org/show_bug.cgi?id=193487
3100
3101         Reviewed by Dean Jackson.
3102
3103         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
3104         into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.
3105
3106         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3107         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3108
3109         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
3110         does.
3111         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
3112         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
3113         (WebCore::WHLSL::checkStatementBehavior):
3114         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3115         * Sources.txt:
3116         * WebCore.xcodeproj/project.pbxproj:
3117
3118 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3119
3120         REGRESSION(r240174): Wrong preprocessor guards in RenderImage::paintAreaElementFocusRing
3121         https://bugs.webkit.org/show_bug.cgi?id=193630
3122
3123         Reviewed by Daniel Bates.
3124
3125         r240174 inadvertently disabled this function on non-Apple platforms.
3126
3127         This fixes layout test fast/images/image-map-outline-in-positioned-container.html.
3128
3129         * rendering/RenderImage.cpp:
3130         (WebCore::RenderImage::paintAreaElementFocusRing):
3131
3132 2019-01-20  chris fleizach  <cfleizach@apple.com>
3133
3134         AX: Support returning relative frames for accessibility
3135         https://bugs.webkit.org/show_bug.cgi?id=193414
3136         <rdar://problem/47268501>
3137
3138         Reviewed by Zalan Bujtas.
3139
3140         Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
3141
3142         Consolidate rect/point conversion methods for macOS and iOS.
3143         This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
3144
3145         Tests: accessibility/mac/relative-frame.html
3146
3147         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3148         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
3149         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
3150         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
3151         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
3152         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
3153         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
3154         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
3155         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3156         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
3157         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3158         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3159         (convertPathToScreenSpaceFunction):
3160         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
3161         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
3162         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3163         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
3164         (-[WebAccessibilityObjectWrapper position]):
3165         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3166         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3167
3168 2019-01-20  Simon Fraser  <simon.fraser@apple.com>
3169
3170         On RenderBox, make client sizing be derived from padding box sizing
3171         https://bugs.webkit.org/show_bug.cgi?id=193621
3172
3173         Reviewed by Daniel Bates.
3174
3175         I never liked how clientWidth/Height, an IE-originated term, was used as the basis
3176         for various RenderBox geometry functions.
3177
3178         Fix by adding some functions which return the dimensions of the padding box (which
3179         is the inside of the border and any scrollbar), and define clientWidth/Height in
3180         terms of them.
3181
3182         Also add paddingBoxRectIncludingScrollbar() function that is used by compositing code.
3183
3184         * rendering/RenderBox.cpp:
3185         (WebCore::RenderBox::clientWidth const):
3186         (WebCore::RenderBox::clientHeight const):
3187         * rendering/RenderBox.h:
3188         (WebCore::RenderBox::borderBoxRect const):
3189         (WebCore::RenderBox::computedCSSContentBoxRect const):
3190         (WebCore::RenderBox::contentWidth const):
3191         (WebCore::RenderBox::contentHeight const):
3192         (WebCore::RenderBox::paddingBoxWidth const):
3193         (WebCore::RenderBox::paddingBoxHeight const):
3194         (WebCore::RenderBox::paddingBoxRect const):
3195         (WebCore::RenderBox::paddingBoxRectIncludingScrollbar const):
3196         (WebCore::RenderBox::hasHorizontalOverflow const):
3197         (WebCore::RenderBox::hasVerticalOverflow const):
3198         * rendering/RenderLayerBacking.cpp:
3199         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
3200         (WebCore::RenderLayerBacking::updateGeometry):
3201
3202 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3203
3204         Unreviewed, rolling out r238275.
3205
3206         Regressed css3/shapes/shape-outside/shape-image/shape-
3207         image-025.html
3208
3209         Reverted changeset:
3210
3211         "ScalableImageDecoder: don't forcefully decode image data when
3212         querying frame completeness, duration"
3213         https://bugs.webkit.org/show_bug.cgi?id=191354
3214         https://trac.webkit.org/changeset/238275
3215
3216 2019-01-19  Zalan Bujtas  <zalan@apple.com>
3217
3218         [LFC][BFC] <body>'s overflow property value is propagated to viewport
3219         https://bugs.webkit.org/show_bug.cgi?id=193617
3220
3221         Reviewed by Antti Koivisto.
3222
3223         When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element
3224         or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport,
3225         if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'.
3226         The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
3227
3228         This also has impact on layout since <body style="overflow: hidden"> would establish a block formatting context.
3229
3230         * layout/layouttree/LayoutBox.cpp:
3231         (WebCore::Layout::Box::isOverflowVisible const):
3232
3233 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3234
3235         Unreviewed, rolling out r240209.
3236
3237         Broke GTK/WPE injected bundle
3238
3239         Reverted changeset:
3240
3241         "AX: Support returning relative frames for accessibility"
3242         https://bugs.webkit.org/show_bug.cgi?id=193414
3243         https://trac.webkit.org/changeset/240209
3244
3245 2019-01-12  Dan Bernstein  <mitz@apple.com>
3246
3247         [Cocoa] Avoid importing directly from subumbrella frameworks
3248         https://bugs.webkit.org/show_bug.cgi?id=186016
3249         <rdar://problem/40591038>
3250
3251         Reviewed by Sam Weinig.
3252
3253         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3254           OTHER_CPLUSPLUSFLAGS.
3255         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
3256         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
3257         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
3258
3259 2019-01-20  chris fleizach  <cfleizach@apple.com>
3260
3261         AX: Support returning relative frames for accessibility
3262         https://bugs.webkit.org/show_bug.cgi?id=193414
3263         <rdar://problem/47268501>
3264
3265         Reviewed by Zalan Bujtas.
3266
3267         Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
3268
3269         Consolidate rect/point conversion methods for macOS and iOS.
3270         This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
3271
3272         Tests: accessibility/mac/relative-frame.html
3273
3274         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3275         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
3276         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
3277         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
3278         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
3279         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
3280         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
3281         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
3282         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3283         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
3284         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3285         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3286         (convertPathToScreenSpaceFunction):
3287         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
3288         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
3289         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3290         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
3291         (-[WebAccessibilityObjectWrapper position]):
3292         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3293         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3294
3295 2019-01-20  Antoine Quint  <graouts@apple.com>
3296
3297         Add a POINTER_EVENTS feature flag
3298         https://bugs.webkit.org/show_bug.cgi?id=193577
3299         <rdar://problem/47408511>
3300
3301         Unreviewed. Also enable Pointer Events for iosmac.
3302
3303         * Configurations/FeatureDefines.xcconfig:
3304
3305 2019-01-19  Zalan Bujtas  <zalan@apple.com>
3306
3307         [LFC][Floats] Ensure that floats in FloatingContext::m_floats are always horizontally ordered.
3308         https://bugs.webkit.org/show_bug.cgi?id=193613
3309
3310         Reviewed by Antti Koivisto.
3311
3312         Float items in m_floats list should stay in horizontal position order (left/right edge).
3313
3314         When adding a new float item to floating state list, we have to ensure that it is definitely the left(right)-most item.
3315         Normally it is, but negative horizontal margins can push the float box beyond another float box.
3316
3317         <div style="float: left; height: 10px; width: 10px;"></div>
3318         <div style="float: left; height: 10px; width: 10px; margin-left: -80px;"></div>
3319
3320         The second float's right edge beyond the first float' left edge. THe second float is not the right(inner)-most float anymore.
3321
3322         Test: fast/block/float/floats-with-negative-horizontal-margin.html
3323
3324         * layout/floats/FloatingContext.cpp:
3325         (WebCore::Layout::areFloatsHorizontallySorted):
3326         (WebCore::Layout::FloatingContext::positionForFloat const):
3327         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
3328         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3329         * layout/floats/FloatingState.cpp:
3330         (WebCore::Layout::FloatingState::append):
3331
3332 2019-01-19  Youenn Fablet  <youenn@apple.com>
3333
3334         getUserMedia with a deviceId exact constraint with an empty string value should succeed
3335         https://bugs.webkit.org/show_bug.cgi?id=193541
3336         <rdar://problem/47357218>
3337
3338         Reviewed by Eric Carlson.
3339
3340         If there is a deviceId constraint, remove any empty string from ideal/exact string list.
3341         This will make the device selection be solely based on other constraints.
3342         An improvement might be for 'exact' constraint to pick the default device.
3343         There is currently no such notion of a default device.
3344         Picking the best fitting device seems a good tradeoff.
3345         Covered by updated test.
3346
3347         * platform/mediastream/MediaConstraints.cpp:
3348         (WebCore::MediaTrackConstraintSetMap::set):
3349         * platform/mediastream/MediaConstraints.h:
3350         (WebCore::StringConstraint::removeEmptyStringConstraint):
3351
3352 2019-01-19  Eric Liang  <ericliang@apple.com>
3353
3354         AXSelected attribute on RadioButton should not be settable.
3355         https://bugs.webkit.org/show_bug.cgi?id=193371
3356
3357         Reviewed by Chris Fleizach.
3358
3359         Test: accessibility/set-selected-editable.html
3360
3361         * accessibility/AccessibilityNodeObject.cpp:
3362         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
3363
3364 2019-01-19  Antoine Quint  <graouts@apple.com>
3365
3366         Add a POINTER_EVENTS feature flag
3367         https://bugs.webkit.org/show_bug.cgi?id=193577
3368
3369         Reviewed by Dean Jackson.
3370
3371         Only expose the PointerEvent interface if the POINTER_EVENTS feature is enabled.
3372
3373         * Configurations/FeatureDefines.xcconfig:
3374         * dom/EventNames.in:
3375         * dom/PointerEvent.cpp:
3376         * dom/PointerEvent.h:
3377         * dom/PointerEvent.idl:
3378
3379 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
3380
3381         iOS: Updating input mode should update the software keyboard
3382         https://bugs.webkit.org/show_bug.cgi?id=193565
3383         <rdar://problem/47376334>
3384
3385         Reviewed by Wenson Hsieh.
3386
3387         Let the chrome client know that the focused element's inputmode had changed.
3388
3389         Test: fast/forms/ios/inputmode-none-removed.html
3390
3391         * html/HTMLElement.cpp:
3392         (WebCore::HTMLElement::parseAttribute):
3393         * page/ChromeClient.h:
3394
3395 2019-01-18  Brian Burg  <bburg@apple.com>
3396
3397         Automation.computeElementLayout should return visual viewport-aware coordinates
3398         https://bugs.webkit.org/show_bug.cgi?id=193598
3399         <rdar://problem/35325644>
3400
3401         Reviewed by Simon Fraser.
3402
3403         * page/FrameView.h: export symbol to be usable from WebKit.
3404         * page/FrameView.cpp:
3405         (WebCore::FrameView::clientToLayoutViewportRect const): Added.
3406         Do the same thing as clientToLayoutViewportPoint with a rect instead.
3407
3408
3409 2019-01-18  Eric Carlson  <eric.carlson@apple.com>
3410
3411         Revert r238815, it broke WK1 video fullscreen on Mac
3412         https://bugs.webkit.org/show_bug.cgi?id=193586
3413         <rdar://problem/47358941>
3414
3415         Reviewed by Jer Noble.
3416
3417         * PlatformMac.cmake:
3418         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3419         (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
3420
3421 2019-01-18  Devin Rousso  <drousso@apple.com>
3422
3423         Web Inspector: Audit: don't keep the injected sub-objects alive between runs
3424         https://bugs.webkit.org/show_bug.cgi?id=193594
3425         <rdar://problem/47398091>
3426
3427         Reviewed by Joseph Pecoraro.
3428
3429         Rather than save the `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject`
3430         between individual `Audit.setup` invocations, we should only keep them alive so long as the
3431         injected `WebInspectorAudit` object is alive (e.g. from `Audit.setup` to `Audit.teardown`).
3432
3433         This change fixes inspector/audit/run-accessibility.html.
3434
3435         * inspector/agents/page/PageAuditAgent.h:
3436         * inspector/agents/page/PageAuditAgent.cpp:
3437         (WebCore::PageAuditAgent::populateAuditObject):
3438
3439 2019-01-18  Daniel Bates  <dabates@apple.com>
3440
3441         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
3442         (https://bugs.webkit.org/show_bug.cgi?id=193583)
3443
3444         Substitute ENABLE(FULL_KEYBOARD_ACCESS) for PLATFORM(MAC). On Mac, we always build with
3445         ENABLE(FULL_KEYBOARD_ACCESS) enabled.
3446
3447         * rendering/RenderElement.cpp:
3448         (WebCore::RenderElement::paintFocusRing):
3449
3450 2019-01-18  Daniel Bates  <dabates@apple.com>
3451
3452         Fix some build issues.
3453
3454         Including UIKitSoftLinking.h is not compatible with unified builds.
3455
3456         * SourcesCocoa.txt:
3457         * WebCore.xcodeproj/project.pbxproj:
3458
3459 2019-01-18  Justin Fan  <justin_fan@apple.com>
3460
3461         (WIP) [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype
3462         https://bugs.webkit.org/show_bug.cgi?id=193457
3463         <rdar://problem/47296678>
3464
3465         Reviewed by Dean Jackson.
3466
3467         Enable WebGPU developers to assign buffer bind groups and access them via render pipeline. 
3468
3469         Test: webgpu/buffer-resource-triangles.html
3470
3471         * Modules/webgpu/WebGPUBindGroup.h:
3472         (WebCore::WebGPUBindGroup::bindGroup const): Added getter.
3473         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: 
3474         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Added. Delegates call to GPUProgrammablePassEncoder.
3475         * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Enable setBindGroup.
3476         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: ditto.
3477         * WebCore.xcodeproj/project.pbxproj:
3478         * platform/graphics/gpu/GPUBindGroup.h: 
3479         (WebCore::GPUBindGroup::layout const): Added getter.
3480         (WebCore::GPUBindGroup::bindings const): ditto.
3481         * platform/graphics/gpu/GPUBindGroupLayout.h: Added ArgumentEncoderBuffer struct to retain ptr to both MTLArgumentEncoders and their argument MTLBuffers.
3482         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::operator! const):
3483         (WebCore::GPUBindGroupLayout::vertexArguments const): Added. Getter.
3484         (WebCore::GPUBindGroupLayout::fragmentArguments const): ditto.
3485         (WebCore::GPUBindGroupLayout::computeArguments const): ditto.
3486         * platform/graphics/gpu/GPUDevice.cpp: Refactored unnecessary header include.
3487         * platform/graphics/gpu/GPUDevice.h: ditto.
3488         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
3489         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer): Added. Delegates to MTLCommandEncoder call.
3490         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer): ditto.
3491         * platform/graphics/gpu/GPURenderPassEncoder.h: 
3492         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
3493         (WebCore::tryCreateArgumentEncoderAndBuffer): Replace newEncoder(). Now create an ArgumentEncoderBuffer object from an array of MTLArgumentDescriptors, if able.
3494         (WebCore::GPUBindGroupLayout::tryCreate): Refactor to support ArgumentEncoderBuffers, and allocate MTLBuffers for argument encoders.
3495         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): Support ArgumentEncoderBuffers.
3496         (WebCore::newEncoder): Deleted.
3497         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
3498         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
3499         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
3500         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Set a buffer resource on the MTLArgumentEncoder, and call useResource on the command encoder.
3501         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Parses the bind group to assign each resource on its matching MTLArgumentEncoder.
3502         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: 
3503         (WebCore::GPURenderPassEncoder::useResource): Resolves call from GPUProgrammablePassEncoder to call on MTLRenderCommandEncoder.
3504         (WebCore::GPURenderPassEncoder::setVertexBuffer): ditto.
3505         (WebCore::GPURenderPassEncoder::setFragmentBuffer): ditto.
3506
3507 2019-01-18  Daniel Bates  <dabates@apple.com>
3508
3509         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
3510         (https://bugs.webkit.org/show_bug.cgi?id=193583)
3511
3512         Only override RenderTheme::platformFocusRingColor() when building with ENABLE(FULL_KEYBOARD_ACCESS)
3513         enabled.
3514
3515         * rendering/RenderThemeIOS.h:
3516         * rendering/RenderThemeIOS.mm:
3517
3518 2019-01-18  Daniel Bates  <dabates@apple.com>
3519
3520         Attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
3521         (https://bugs.webkit.org/show_bug.cgi?id=193583)
3522
3523         Namespace qualify call to getUIColorClass().
3524
3525         * rendering/RenderThemeIOS.mm:
3526         (WebCore::RenderThemeIOS::platformFocusRingColor const):
3527
3528 2019-01-18  Jer Noble  <jer.noble@apple.com>
3529
3530         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
3531         https://bugs.webkit.org/show_bug.cgi?id=189553
3532
3533         Reviewed by Tim Horton.
3534
3535         * Configurations/Base.xcconfig:
3536         * Configurations/SDKVariant.xcconfig: Added.
3537         * Configurations/WebCore.xcconfig:
3538
3539 2019-01-18  Daniel Bates  <dabates@apple.com>
3540
3541         CSS auto focus-ring outlines don't render on iOS
3542         https://bugs.webkit.org/show_bug.cgi?id=193583
3543         <rdar://problem/6508697>
3544
3545         Reviewed by Simon Fraser.
3546
3547         Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
3548         enabled.
3549
3550         For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
3551         animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.
3552
3553         * SourcesCocoa.txt: Add file ColorIOS.mm.
3554         * WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.
3555
3556         * platform/graphics/GraphicsContext.h:
3557         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
3558         (WebCore::drawFocusRingAtTime):
3559         (WebCore::GraphicsContext::drawFocusRing):
3560         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
3561         This is always enabled on Mac.
3562         
3563         * platform/ios/ColorIOS.h: Added.
3564         * platform/ios/ColorIOS.mm: Added.
3565         (WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.
3566
3567         * rendering/RenderElement.cpp:
3568         (WebCore::RenderElement::paintFocusRing):
3569         * rendering/RenderImage.cpp:
3570         (WebCore::RenderImage::paintAreaElementFocusRing):
3571         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
3572         This is always enabled on Mac.
3573
3574         * rendering/RenderThemeIOS.h:
3575         * rendering/RenderThemeIOS.mm:
3576         (WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
3577         (WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
3578         return false - the iOS theme code does not support painting focus rings. By returning false we
3579         will use the platform-independent, non-theme code path to draw focus rings.
3580
3581 2019-01-18  David Kilzer  <ddkilzer@apple.com>
3582
3583         Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
3584         <https://webkit.org/b/193568>
3585         <rdar://problem/47381130>
3586
3587         * editing/cocoa/DictionaryLookup.mm:
3588         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
3589         Fix the build by changing getUIApplicationClass() to
3590         PAL::getUIApplicationClass().
3591
3592 2019-01-18  David Kilzer  <ddkilzer@apple.com>
3593
3594         Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
3595         <https://webkit.org/b/193568>
3596         <rdar://problem/47381130>
3597
3598         Reviewed by Alex Christensen.
3599
3600         This does the following:
3601         - Removes local soft-linking of UIKit.
3602         - Switches to using PAL functions for soft-linking.
3603
3604         * SourcesCocoa.txt: Add 4 source files to UnifiedSources.
3605         * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
3606         from WebCore target now that they are in UnifiedSources.
3607         * editing/cocoa/DictionaryLookup.mm:
3608         * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
3609         declarations in public headers.
3610         (_fontForNameAndSize): Change use of getUIFontClass() to
3611         PlatformFontClass.
3612         (HTMLConverter::_processElement): Add cast here since compiler
3613         finds the wrong selector for +clearColor and thinks it returns a
3614         `CIColor *` object.  The same cast already exists in
3615         VideoFullscreenInterfaceAVKit.mm.
3616         * page/cocoa/SettingsBaseCocoa.mm:
3617         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
3618         * platform/audio/ios/MediaSessionManagerIOS.mm:
3619         (-[WebMediaSessionHelper initWithCallback:]):
3620         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3621         (WebCore::exernalDeviceDisplayNameForPlayer):
3622         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3623         (WebCore::showLetterpressedGlyphsWithAdvances):
3624         * platform/ios/DragImageIOS.mm:
3625         (WebCore::scaleDragImage):
3626         (WebCore::createDragImageFromImage):
3627         (WebCore::cascadeForSystemFont):
3628         (WebCore::createDragImageForLink):
3629         (WebCore::createDragImageForSelection):
3630         (WebCore::createDragImageForRange):
3631         (WebCore::createDragImageForColor):
3632         * platform/ios/PlatformPasteboardIOS.mm:
3633         (WebCore::PlatformPasteboard::PlatformPasteboard):
3634         (WebCore::PlatformPasteboard::color):
3635         (WebCore::registerItemToPasteboard):
3636         (WebCore::PlatformPasteboard::setColor):
3637         * platform/ios/ThemeIOS.mm:
3638         (WebCore::ThemeIOS::userPrefersReducedMotion const):
3639         * platform/ios/UserAgentIOS.mm:
3640         (WebCore::isClassic):
3641         (WebCore::isClassicPad):
3642         (WebCore::isClassicPhone):
3643         * platform/ios/ValidationBubbleIOS.mm:
3644         (-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
3645         (WebCore::ValidationBubble::ValidationBubble):
3646         (WebCore::ValidationBubble::show):
3647         (WebCore::fallbackViewController):
3648         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3649         (clearUIColor):
3650         (allocWebAVPictureInPicturePlayerLayerViewInstance):
3651         (WebAVPlayerLayerView_videoView):
3652         (fallbackViewController):
3653         (VideoFullscreenInterfaceAVKit::doSetup):
3654         * platform/ios/WebEvent.mm:
3655         (+[WebEvent modifierFlags]):
3656         * platform/ios/WebItemProviderPasteboard.mm:
3657         (allLoadableClasses):
3658         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3659         (VideoFullscreenControllerContext::setUpFullscreen):
3660         * platform/network/mac/WebCoreURLResponse.mm: Add missing header
3661         after unified sources were updated.
3662         * rendering/RenderThemeIOS.mm:
3663         (WebCore::contentSizeCategoryDidChange):
3664         (WebCore::RenderThemeIOS::RenderThemeIOS):
3665         (WebCore::RenderThemeIOS::contentSizeCategory):
3666         (WebCore::RenderThemeIOS::systemColor const):
3667         (WebCore::attachmentActionColor):
3668         (WebCore::attachmentTitleColor):
3669         (WebCore::attachmentSubtitleColor):
3670         (WebCore::iconForAttachment):
3671         * testing/Internals.mm:
3672         (WebCore::Internals::userPrefersReducedMotion const):
3673
3674 2019-01-18  Antti Koivisto  <antti@apple.com>
3675
3676         Implement asynchronous frame scrolling for iOS
3677         https://bugs.webkit.org/show_bug.cgi?id=193539
3678         <rdar://problem/47379873>
3679
3680         Reviewed by Simon Fraser.
3681
3682         This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
3683         internal setting (still off by default).
3684
3685         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
3686         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
3687         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
3688         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
3689
3690         Export ScrollingTreeFrameScrollingNodeIOS.
3691
3692         * rendering/RenderLayerCompositor.cpp:
3693         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
3694         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
3695         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
3696
3697         If we don't have a separate clip layer, just resize and position the scroll layer.
3698
3699         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
3700         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
3701         (WebCore::RenderLayerCompositor::ensureRootLayer):
3702
3703         Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
3704         Don't create a separate clip layer since the scroll layer will handle clipping.
3705
3706         * rendering/RenderLayerCompositor.h:
3707
3708 2019-01-18  Ali Juma  <ajuma@chromium.org>
3709
3710         FetchResponse::url should return the empty string for tainted responses
3711         https://bugs.webkit.org/show_bug.cgi?id=193553
3712
3713         Reviewed by Youenn Fablet.
3714
3715         Check whether the response is tainted in FetchResponse::url, to match
3716         the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
3717
3718         * Modules/fetch/FetchResponse.cpp:
3719         (WebCore::FetchResponse::url const):
3720
3721 2019-01-18  Youenn Fablet  <youenn@apple.com>
3722
3723         A track source should be unmuted whenever reenabled after setDirection changes
3724         https://bugs.webkit.org/show_bug.cgi?id=193554
3725         <rdar://problem/47366196>
3726
3727         Reviewed by Eric Carlson.
3728
3729         Ensure that track gets unmuted after being fired as part of track event.
3730         Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
3731         Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
3732         some enqueued samples might not be from the right active video track or there might be no active video track.
3733
3734         Test: webrtc/video-setDirection.html
3735
3736         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3737         (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
3738         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3739         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3740         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
3741         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
3742
3743 2019-01-18  Charlie Turner  <cturner@igalia.com>
3744
3745         [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
3746         https://bugs.webkit.org/show_bug.cgi?id=192229
3747
3748         Reviewed by Xabier Rodriguez-Calvar.
3749
3750         Covered by existing tests.
3751
3752         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
3753         (WebCore::parseLicenseFormat): There is a defect in some C++11
3754         compiles where they will copy this return value since the type
3755         doesn't exactly match. Force a move with WTFMove.
3756         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3757         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
3758         Deleted. No longer used by anything.
3759         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
3760         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
3761         Rename these methods to avoid "namespacing names".
3762         (webkit_media_clear_key_decrypt_class_init):
3763         (finalize):
3764         (handleKeyResponse): This is a temporary fix, we need some more
3765         reorganisation to be full driven by CDMInstance APIs for decryption.
3766         (findAndSetKey):
3767         (decrypt):
3768         (webKitMediaClearKeyDecryptorFinalize): Deleted.
3769         (webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
3770         (webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
3771         (webKitMediaClearKeyDecryptorDecrypt): Deleted.
3772         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
3773         (webkit_media_common_encryption_decrypt_class_init):
3774         (finalize):
3775         (transformCaps):
3776         (transformInPlace):
3777         (isCDMInstanceAvailable):
3778         (sinkEventHandler):
3779         (queryHandler):
3780         (changeState):
3781         (setContext):
3782         (webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
3783         (webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
3784         (webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
3785         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
3786         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
3787         (webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
3788         (webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
3789         (webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
3790         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
3791         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3792         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
3793         Deleted. No longer passing key information over bus messages.
3794         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
3795
3796 2019-01-18  Zalan Bujtas  <zalan@apple.com>
3797
3798         [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
3799         https://bugs.webkit.org/show_bug.cgi?id=193564
3800
3801         Reviewed by Antti Koivisto.
3802
3803         Float boxes prevent collapsing through.
3804
3805         Test: fast/block/float/float-in-descendant-formatting-context.html
3806
3807         * layout/blockformatting/BlockMarginCollapse.cpp:
3808         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
3809
3810 2019-01-18  Zalan Bujtas  <zalan@apple.com>
3811
3812         [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
3813         https://bugs.webkit.org/show_bug.cgi?id=193562
3814
3815         Reviewed by Antti Koivisto.
3816
3817         The current floating context's (float) boxes could belong to descendant formatting contexts.
3818         We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
3819
3820         <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
3821         While computing the height for "container", the float box needs to be taken into account even though
3822         it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
3823
3824         * layout/floats/FloatingState.cpp:
3825         (WebCore::Layout::FloatingState::bottom const):
3826         * layout/floats/FloatingState.h:
3827         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
3828         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
3829
3830 2019-01-18  Zalan Bujtas  <zalan@apple.com>
3831
3832         [LFC][BFC] Check for inflow children while computing height for block formatting context roots.
3833         https://bugs.webkit.org/show_bug.cgi?id=193555
3834
3835         Reviewed by Antti Koivisto.
3836
3837         This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs. 
3838
3839         * layout/FormattingContextGeometry.cpp:
3840         (WebCore::Layout::contentHeightForFormattingContextRoot):
3841         * layout/Verification.cpp:
3842         (WebCore::Layout::areEssentiallyEqual):
3843         * page/FrameViewLayoutContext.cpp:
3844         (WebCore::layoutUsingFormattingContext):
3845
3846 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
3847
3848         [WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
3849         https://bugs.webkit.org/show_bug.cgi?id=192590
3850
3851         Reviewed by Philippe Normand.
3852
3853         When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
3854
3855         On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
3856         DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
3857
3858         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
3859         (WebCore::DefaultAudioDestinationNode::uninitialize):
3860
3861 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
3862
3863         [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
3864         https://bugs.webkit.org/show_bug.cgi?id=192586
3865
3866         Reviewed by Philippe Normand.
3867
3868         When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
3869         the AudioDestinationNode is not destroyed.
3870
3871         In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
3872         is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
3873         the resources leak.
3874
3875         AudioContext::uninitialize() is not called immediately since r94608.
3876         This modification can now be reverted without regression in WebAudio tests.
3877
3878         Test: webaudio/mediaelementaudiosourcenode-gc.html
3879
3880         * Modules/webaudio/AudioContext.cpp:
3881         (WebCore::AudioContext::stop):
3882
3883 2019-01-18  Simon Fraser  <simon.fraser@apple.com>
3884
3885         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
3886         https://bugs.webkit.org/show_bug.cgi?id=193559
3887
3888         Reviewed by Antti Koivisto.
3889
3890         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
3891         but the code that used it was removed in webkit.org/r229318 so we can remove it and
3892         code that calls it.
3893
3894         * page/scrolling/ScrollingCoordinator.h:
3895         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
3896         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
3897         * rendering/RenderLayerBacking.cpp:
3898         (WebCore::RenderLayerBacking::updateGeometry):
3899         * rendering/RenderLayerCompositor.cpp:
3900         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
3901         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
3902         (WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
3903         * rendering/RenderLayerCompositor.h:
3904
3905 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
3906
3907         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
3908         https://bugs.webkit.org/show_bug.cgi?id=193494
3909         <rdar://problem/46859627>
3910
3911         Reviewed by Simon Fraser and Tim Horton.
3912
3913         When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
3914         just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
3915         position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
3916         the scroll position to be the origin.
3917
3918         However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
3919         view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
3920         end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
3921         autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
3922         Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).
3923
3924         To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
3925         the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
3926         position which is already visible won't cause us to scroll away the content inset area and only show the
3927         unobscured rect.
3928
3929         Tests:  editing/selection/ios/autoscroll-with-top-content-inset.html
3930                 fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
3931
3932         * page/FrameView.cpp:
3933         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
3934
3935         Introduce a helper method that expands the unobscured content rect to include surrounding content insets.
3936
3937         * page/FrameView.h: