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