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