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