Unreviewed, fix -Wsign-compare warning
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2
3         Unreviewed, fix -Wsign-compare warning
4         https://bugs.webkit.org/show_bug.cgi?id=188697
5         <rdar://problem/46105624>
6
7         * css/StyleProperties.cpp:
8         (WebCore::StyleProperties::asText const):
9
10 2019-01-22  Devin Rousso  <drousso@apple.com>
11
12         Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
13         https://bugs.webkit.org/show_bug.cgi?id=193227
14         <rdar://problem/46787862>
15
16         Reviewed by Joseph Pecoraro.
17
18         Test: inspector/audit/run-accessibility.html
19
20         * inspector/InspectorAuditAccessibilityObject.idl:
21         * inspector/InspectorAuditAccessibilityObject.h:
22         * inspector/InspectorAuditAccessibilityObject.cpp:
23         (WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
24
25 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
26
27         Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
28         https://bugs.webkit.org/show_bug.cgi?id=193692
29
30         Reviewed by Zalan Bujtas.
31
32         Remove the iOS-specific renderName() implementation.
33
34         * rendering/RenderIFrame.h:
35
36 2019-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
37
38         Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
39         https://bugs.webkit.org/show_bug.cgi?id=193647
40
41         Reviewed by Simon Fraser.
42
43         Changing a style attribute of an SVGELement needs to call invalidateInstances().
44
45         Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
46
47         * svg/SVGElement.cpp:
48         (WebCore::SVGElement::attributeChanged):
49
50 2019-01-22  Alex Christensen  <achristensen@webkit.org>
51
52         Fix more builds.
53
54         * platform/network/curl/CurlResourceHandleDelegate.cpp:
55         (WebCore::handleCookieHeaders):
56         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
57
58 2019-01-22  Alex Christensen  <achristensen@webkit.org>
59
60         Fix some builds after r240292
61         https://bugs.webkit.org/show_bug.cgi?id=193580
62
63         * platform/network/curl/ResourceHandleCurl.cpp:
64         (WebCore::ResourceHandle::createCurlRequest):
65         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
66         (WebCore::ResourceHandle::receivedCredential):
67         (WebCore::ResourceHandle::getCredential):
68
69 2019-01-22  Alex Christensen  <achristensen@webkit.org>
70
71         Move NetworkStorageSession ownership to NetworkProcess
72         https://bugs.webkit.org/show_bug.cgi?id=193580
73
74         Reviewed by Geoff Garen.
75
76         NetworkStorageSessions used to be owned by a process-global map living in WebCore.
77         This patch moves the ownership to the WebKit/WebKitLegacy layer.
78         In WebKitLegacy they are still owned by a process-global map for compatibility.
79         In WebKit they are owned by a map owned by the NetworkProcess object.
80         There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
81         1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
82         of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
83         so this code was removed with no change in behavior.
84         2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
85         into a static method that does the same thing.  We should audit these calls and decide if we really want them.
86         3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
87         storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.
88
89         * platform/network/CredentialStorage.h:
90         * platform/network/NetworkStorageSession.cpp:
91         (WebCore::NetworkStorageSession::processMayUseCookieAPI):
92         (WebCore::NetworkStorageSession::globalSessionMap): Deleted.
93         (WebCore::NetworkStorageSession::storageSession): Deleted.
94         (WebCore::NetworkStorageSession::destroySession): Deleted.
95         (WebCore::NetworkStorageSession::forEach): Deleted.
96         * platform/network/NetworkStorageSession.h:
97         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
98         (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
99         (WebCore::createCFStorageSessionForIdentifier): Deleted.
100         (WebCore::defaultNetworkStorageSession): Deleted.
101         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
102         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
103         (WebCore::NetworkStorageSession::ensureSession): Deleted.
104         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
105         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
106         * platform/network/cocoa/CookieStorageObserver.h:
107         * platform/network/curl/NetworkStorageSessionCurl.cpp:
108         (WebCore::defaultSession): Deleted.
109         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
110         (WebCore::NetworkStorageSession::ensureSession): Deleted.
111         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
112         * platform/network/soup/NetworkStorageSessionSoup.cpp:
113         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
114         (WebCore::defaultSession): Deleted.
115         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
116         (WebCore::NetworkStorageSession::ensureSession): Deleted.
117         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
118
119 2019-01-22  Devin Rousso  <drousso@apple.com>
120
121         Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
122         https://bugs.webkit.org/show_bug.cgi?id=193225
123         <rdar://problem/46799956>
124
125         Reviewed by Joseph Pecoraro.
126
127         Test: inspector/audit/run-accessibility.html
128
129         * inspector/InspectorAuditAccessibilityObject.idl:
130         * inspector/InspectorAuditAccessibilityObject.h:
131         * inspector/InspectorAuditAccessibilityObject.cpp:
132         (WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
133         (WebCore::addChildren): Added.
134         (WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
135         (WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
136         (WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
137         (WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
138         (WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
139         (WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
140         (WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
141
142 2019-01-22  David Kilzer  <ddkilzer@apple.com>
143
144         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
145         <https://webkit.org/b/193654>
146         <rdar://problem/47430290>
147
148         Reviewed by Alex Christensen.
149
150         - Moves QuickLookSoftLink.{h,mm} to PAL.
151         - Adds soft-link to 3 classes to consolidate QuickLook.framework
152           soft-linking.
153         - Updates existing source to work with above changes.
154
155         * SourcesCocoa.txt:
156         * UnifiedSources-input.xcfilelist:
157         * WebCore.xcodeproj/project.pbxproj:
158         - Remove QuickLookSoftLink.{h,mm} due to move to PAL.
159
160         * platform/ios/QuickLook.mm:
161         (WebCore::QLPreviewGetSupportedMIMETypesSet):
162         (WebCore::registerQLPreviewConverterIfNeeded):
163         - Update for QuickLookSoftLink.{h,mm} move to PAL.
164
165         * platform/network/ios/PreviewConverter.mm:
166         (WebCore::optionsWithPassword):
167         (WebCore::PreviewConverter::PreviewConverter):
168         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
169
170         * platform/network/ios/WebCoreURLResponseIOS.mm:
171         (WebCore::adjustMIMETypeIfNecessary):
172         - Update for QuickLookSoftLink.{h,mm} move to PAL.
173
174 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
175
176         Fix the position of layers nested inside of composited overflow-scroll
177         https://bugs.webkit.org/show_bug.cgi?id=193642
178
179         Reviewed by Antti Koivisto and Sam Weinig.
180
181         Remove an iOS #ifdef so that layers inside composited overflow gets the correct
182         positions on macOS too.
183
184         Test: compositing/geometry/fixed-inside-overflow-scroll.html
185
186         * rendering/RenderLayerBacking.cpp:
187         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
188
189 2019-01-22  Claudio Saavedra  <csaavedra@igalia.com>
190
191         [GTK] Build fix for Ubuntu LTS 16.04
192         https://bugs.webkit.org/show_bug.cgi?id=193672
193
194         Unreviewed build fix.
195
196         * html/canvas/CanvasStyle.h: Add default copy constructor for
197         CMYKAColor struct.
198
199 2019-01-22  David Kilzer  <ddkilzer@apple.com>
200
201         Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
202         <https://webkit.org/b/193673>
203         <rdar://problem/47448241>
204
205         Reviewed by Dean Jackson.
206
207         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
208         (WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
209
210 2019-01-22  Zalan Bujtas  <zalan@apple.com>
211
212         [LFC][Floats] Decouple clearance computation and margin collapsing reset.
213         https://bugs.webkit.org/show_bug.cgi?id=193670
214
215         Reviewed by Antti Koivisto.
216
217         Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
218         This is also in preparation for adding clear to static position.
219
220         * layout/FormattingContext.cpp:
221         (WebCore::Layout::FormattingContext::mapTopToAncestor):
222         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
223         * layout/FormattingContext.h:
224         * layout/blockformatting/BlockFormattingContext.cpp:
225         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
226         * layout/floats/FloatingContext.cpp:
227         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
228         * layout/floats/FloatingContext.h:
229
230 2019-01-22  Frederic Wang  <fwang@igalia.com>
231
232         Minor refactoring of the scrolling code
233         https://bugs.webkit.org/show_bug.cgi?id=192398
234
235         Unreviewed build fix.
236
237         * page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
238
239 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
240
241         [css-logical] Implement flow-relative margin, padding and border shorthands
242         https://bugs.webkit.org/show_bug.cgi?id=188697
243
244         Reviewed by Simon Fraser and Antti Koivisto.
245
246         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
247                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
248                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
249                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
250                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
251                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
252                webexposed/css-properties-behind-flags.html
253
254         * css/CSSComputedStyleDeclaration.cpp:
255         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
256         Allow the new properties to serialize their computed value.
257
258         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
259         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
260         * css/CSSComputedStyleDeclaration.h:
261         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
262         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
263         shorthands.
264
265         * css/CSSProperties.json:
266         Add the new properties behind the CSSLogicalEnabled runtime flag.
267
268         * css/CSSStyleDeclaration.cpp:
269         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
270         Prevent CSS properties disabled behind a runtime flag from being exposed in
271         style declarations.
272
273         * css/StyleProperties.cpp:
274         (WebCore::StyleProperties::getPropertyValue const):
275         Allow the new properties to serialize their specified value.
276
277         (WebCore::StyleProperties::get2Values const):
278         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
279
280         (WebCore::StyleProperties::borderPropertyValue const):
281         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
282         corresponding to width, style and color.
283
284         (WebCore::MutableStyleProperties::setProperty):
285         Prevent CSS properties disabled behind a runtime flag from being set a value.
286
287         (WebCore::StyleProperties::asText const):
288         Allow the new properties to be serialized in cssText.
289         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
290         and serialize the longhands instead. Note that there could be another shorthand
291         available which is enabled, but a proper solution would require bug 190496.
292
293         * css/StyleProperties.h:
294         Update declarations of borderPropertyValue and get2Values.
295
296         * css/makeprop.pl:
297         (addProperty):
298         Add isEnabledCSSProperty function for checking that a CSS property is not
299         disabled behind a runtime flag.
300
301         * css/parser/CSSPropertyParser.cpp:
302         (WebCore::cssPropertyID):
303         Prevent CSS properties disabled behind a runtime flag from being exposed in
304         computed styles.
305
306         (WebCore::CSSPropertyParser::addProperty):
307         Prevent CSS properties disabled behind a runtime flag from being set a value.
308
309         (WebCore::CSSPropertyParser::consumeBorder):
310         Change consumeBorder to provide the caller with the parsed values instead of
311         setting properties. Then the caller can decide to which properties the values
312         should be set, and whether border-image should be reset or not.
313
314         (WebCore::CSSPropertyParser::consume2ValueShorthand):
315         (WebCore::CSSPropertyParser::consume4ValueShorthand):
316         Rename consume4Values to consume4ValueShorthand, and add analogous
317         consume2ValueShorthand for parsing shorthands with two longhands.
318
319         (WebCore::CSSPropertyParser::parseShorthand):
320         Allow the new properties to be parsed.
321
322         * css/parser/CSSPropertyParser.h:
323         Update declarations of consumeBorder, consume2ValueShorthand and
324         consume4ValueShorthand.
325
326         * inspector/agents/InspectorCSSAgent.cpp:
327         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
328         Prevent CSS properties disabled behind a runtime flag from being exposed in
329         the CSS inspector tool.
330
331         * page/RuntimeEnabledFeatures.h:
332         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
333         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
334         Add the CSSLogicalEnabled runtime flag.
335
336 2019-01-21  Antti Koivisto  <antti@apple.com>
337
338         [iOS] Handle hit testing for subframes
339         https://bugs.webkit.org/show_bug.cgi?id=192303
340
341         Reviewed by Frédéric Wang.
342
343         Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
344         controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
345
346         Test by Frederic Wang.
347
348         Test: fast/scrolling/ios/hit-testing-iframe.html
349
350         * platform/ScrollView.cpp:
351         (WebCore::ScrollView::managesScrollbars const):
352
353         Add a function that tells if the scrollview should deal with scrollbars at all
354         This is always false on iOS and not connected to delegatesScrolling bit.
355
356         (WebCore::ScrollView::updateScrollbars):
357         * platform/ScrollView.h:
358         * rendering/RenderLayerCompositor.cpp:
359         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
360
361 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
362
363         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
364         https://bugs.webkit.org/show_bug.cgi?id=193556
365         <rdar://problem/47368501>
366
367         Reviewed by Alex Christensen.
368
369         This patch adds a new observer callback used to message the NetworkProcess when
370         user interaction events are received. This is needed when the ResourceLoadStatistics
371         data is not being managed by the UIProcess.
372
373         Tested by existing ResourceLoadStatistics and storageAccess tests.
374
375         * loader/ResourceLoadObserver.cpp:
376         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
377         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
378         * loader/ResourceLoadObserver.h:
379         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
380         (WebCore::NetworkStorageSession::setCookiesFromDOM):
381
382 2019-01-21  Zalan Bujtas  <zalan@apple.com>
383
384         [LFC][Floats] Take float top position into account when computing containing block height.
385         https://bugs.webkit.org/show_bug.cgi?id=193655
386
387         Reviewed by Antti Koivisto.
388
389         When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
390         However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
391         computing the containing block's height. Let's take the relevant floats into account as well.
392
393         Test: fast/block/float/float-first-child-and-clear-sibling.html
394
395         * layout/FormattingContextGeometry.cpp:
396         (WebCore::Layout::contentHeightForFormattingContextRoot):
397         * layout/floats/FloatingContext.cpp:
398         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
399         * layout/floats/FloatingState.cpp:
400         (WebCore::Layout::FloatingState::top const):
401         * layout/floats/FloatingState.h:
402
403 2019-01-21  David Kilzer  <ddkilzer@apple.com>
404
405         REGRESSION (r240237): Revert changes to WebCore Xcode project
406
407         * WebCore.xcodeproj/project.pbxproj: Revert changes that were
408         fixed in r240135.  Darin's patch must have been made prior to
409         r240135.
410
411 2019-01-21  David Kilzer  <ddkilzer@apple.com>
412
413         REGRESSION (r240201): Add a POINTER_EVENTS feature flag
414         https://bugs.webkit.org/show_bug.cgi?id=193577
415         <rdar://problem/47408511>
416
417         * dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
418         to fix tvOS & watchOS builds.
419
420 2019-01-15  Darin Adler  <darin@apple.com>
421
422         Use references rather than pointers for register/unregister functions, and more
423         https://bugs.webkit.org/show_bug.cgi?id=175028
424
425         Reviewed by Daniel Bates.
426
427         * Modules/applepay/ApplePaySession.cpp:
428         (WebCore::ApplePaySession::begin): Pass a reference.
429         (WebCore::ApplePaySession::completePayment): Ditto.
430         (WebCore::ApplePaySession::didReachFinalState): Ditto.
431         * Modules/cache/DOMCache.cpp:
432         (WebCore::DOMCache::retrieveRecords): Ditto.
433         (WebCore::DOMCache::batchDeleteOperation): Ditto.
434         (WebCore::DOMCache::batchPutOperation): Ditto.
435         * Modules/cache/DOMCacheStorage.cpp:
436         (WebCore::DOMCacheStorage::match): Ditto.
437         * Modules/fetch/FetchBodyOwner.cpp:
438         (WebCore::FetchBodyOwner::loadBlob): Ditto.
439         (WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
440         * Modules/fetch/FetchBodySource.cpp:
441         (WebCore::FetchBodySource::setActive): Ditto.
442         (WebCore::FetchBodySource::setInactive): Ditto.
443         * Modules/fetch/FetchResponse.cpp:
444         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
445         (WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
446         * Modules/mediasource/MediaSource.cpp:
447         (WebCore::MediaSource::addedToRegistry): Ditto.
448         (WebCore::MediaSource::removedFromRegistry): Ditto.
449         * Modules/mediastream/MediaStream.cpp:
450         (WebCore::MediaStream::~MediaStream): Ditto.
451         (WebCore::MediaStream::startProducingData): Ditto.
452         * Modules/mediastream/MediaStreamTrack.cpp:
453         (WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
454         (WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
455         * Modules/mediastream/RTCDataChannel.cpp:
456         (WebCore::RTCDataChannel::create): Ditto.
457         (WebCore::RTCDataChannel::close): Ditto.
458         * Modules/mediastream/RTCPeerConnection.cpp:
459         (WebCore::RTCPeerConnection::create): Use auto.
460         * Modules/notifications/Notification.cpp:
461         (WebCore::Notification::show): Pass a reference.
462         (WebCore::Notification::finalize): Ditto.
463         * Modules/webaudio/AudioBasicInspectorNode.cpp:
464         (WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
465
466         * Modules/webaudio/AudioContext.cpp:
467         (WebCore::AudioContext::constructCommon): Ditto.
468         (WebCore::AudioContext::lazyInitialize): Ditto.
469         (WebCore::AudioContext::clear): Ditto.
470         (WebCore::AudioContext::uninitialize): Ditto.
471         (WebCore::AudioContext::markForDeletion): Take a reference.
472         (WebCore::AudioContext::addAutomaticPullNode): Ditto.
473         (WebCore::AudioContext::removeAutomaticPullNode): Ditto.
474         (WebCore::AudioContext::willBeginPlayback): Pass a reference.
475         (WebCore::AudioContext::willPausePlayback): Ditto.
476         * Modules/webaudio/AudioContext.h: Update above functions to take
477         references rather than pointers.
478
479         * Modules/webaudio/AudioNode.cpp:
480         (WebCore::AudioNode::finishDeref): Pass a reference.
481         * Modules/websockets/WebSocket.cpp:
482         (WebCore::WebSocket::connect): Ditto.
483         (WebCore::WebSocket::stop): Ditto.
484         (WebCore::WebSocket::didClose): Ditto.
485
486         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
487
488         * bindings/js/JSDOMWindowBase.cpp:
489         (WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
490         moduleLoader is now a reference.
491         (WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
492         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
493         (WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
494         (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
495
496         * dom/ActiveDOMObject.h:
497         (WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
498         (WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
499
500         * dom/CharacterData.cpp:
501         (WebCore::CharacterData::setData): Pass a reference.
502         (WebCore::CharacterData::insertData): Ditto.
503         (WebCore::CharacterData::deleteData): Ditto.
504         (WebCore::CharacterData::replaceData): Ditto.
505
506         * dom/Document.cpp:
507         (WebCore::Document::getElementByAccessKey): Pass a reference.
508         (WebCore::Document::buildAccessKeyMap): Take a reference.
509         (WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
510         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
511         (WebCore::Document::addAudioProducer): Ditto.
512         (WebCore::Document::removeAudioProducer): Ditto.
513         (WebCore::Document::hoveredElementDidDetach): Ditto.
514         (WebCore::Document::elementInActiveChainDidDetach): Ditto.
515         (WebCore::Document::attachNodeIterator): Ditto.
516         (WebCore::Document::detachNodeIterator): Ditto.
517         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
518         a reference.
519         (WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
520         (WebCore::Document::nodeWillBeRemoved): Ditto.
521         (WebCore::Document::textInserted): Take a reference.
522         (WebCore::Document::textRemoved): Ditto.
523         (WebCore::Document::textNodesMerged): Ditto.
524         (WebCore::Document::textNodeSplit): Ditto.
525         (WebCore::Document::takeDOMWindowFrom): Ditto.
526         (WebCore::Document::registerForDocumentSuspensionCallbacks): Ditto.
527         (WebCore::Document::unregisterForDocumentSuspensionCallbacks): Ditto.
528         (WebCore::Document::registerForMediaVolumeCallbacks): Ditto.
529         (WebCore::Document::unregisterForMediaVolumeCallbacks): Ditto.
530         (WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Ditto.
531         (WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Ditto.
532         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Ditto.
533         (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
534         (WebCore::Document::registerForPageScaleFactorChangedCallbacks): Ditto.
535         (WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Ditto.
536         (WebCore::Document::finishedParsing): Use a reference.
537         (WebCore::Document::attachRange): Take a reference.
538         (WebCore::Document::detachRange): Ditto.
539         (WebCore::Document::suspendScheduledTasks): Use a reference.
540         (WebCore::Document::resumeScheduledTasks): Ditto.
541         (WebCore::Document::addMediaCanStartListener): Take a reference.
542         (WebCore::Document::removeMediaCanStartListener): Ditto.
543         (WebCore::Document::deviceMotionController const): Return a reference.
544         (WebCore::Document::deviceOrientationController const): Ditto.
545         (WebCore::Document::simulateDeviceOrientationChange): Use a reference.
546         (WebCore::Document::fullScreenIsAllowedForElement const): Take a reference.
547         (WebCore::Document::requestFullScreenForElement): Pass a reference.
548         (WebCore::Document::webkitExitFullscreen): Ditto.
549         (WebCore::Document::webkitWillEnterFullScreen): Renamed to remove the
550         "ForElement" from the function name. Take a reference rather than a pointer.
551         (WebCore::Document::webkitDidEnterFullScreen): Renamed to remove the
552         "ForElement" from the function name and removed the unused element argument.
553         (WebCore::Document::webkitWillExitFullScreen): Ditto.
554         (WebCore::Document::webkitDidExitFullScreen): Ditto.
555         (WebCore::Document::pushFullscreenElementStack): Take a reference.
556         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Ditto.
557         (WebCore::DocumentParserYieldToken::DocumentParserYieldToken): Use a reference.
558         (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken): Ditto.
559         (WebCore::Document::updateHoverActiveState): Updated name of isInActiveChain.
560
561         * dom/Document.h: Updated argument types as described above. Changed a couple
562         of inline functions to return references.
563
564         * dom/DocumentMarkerController.cpp:
565         (WebCore::DocumentMarkerController::addMarker): Take a reference.
566         (WebCore::DocumentMarkerController::addMarkerToNode): Ditto.
567         (WebCore::DocumentMarkerController::addTextMatchMarker): Ditto.
568         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker): Ditto.
569         (WebCore::DocumentMarkerController::addDictationResultMarker): Ditto.
570         (WebCore::DocumentMarkerController::addDraggedContentMarker): Ditto.
571         (WebCore::DocumentMarkerController::removeMarkers): Ditto.
572         (WebCore::DocumentMarkerController::copyMarkers): Ditto.
573         (WebCore::DocumentMarkerController::shiftMarkers): Ditto.
574         (WebCore::DocumentMarkerController::setMarkersActive): DItto.
575         * dom/DocumentMarkerController.h: Updated argument types as described above.
576
577         * dom/Element.cpp:
578         (WebCore::Element::~Element): Pass a reference.
579         (WebCore::Element::isUserActionElementInActiveChain const): Updated name of
580         isInActiveChain.
581         (WebCore::Element::hasEquivalentAttributes const): Take a reference.
582         (WebCore::Element::removedFromAncestor): Pass a reference.
583         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
584         Pass a reference and updated name of isInActiveChain.
585
586         * dom/Element.h: Renamed inActiveChain to isInActiveChain, updated argument
587         types to be references, and removed unneeded friend declaration and made
588         SynchronizationOfLazyAttribute private.
589
590         * dom/Node.cpp:
591         (WebCore::Node::normalize): Pass a reference.
592         (WebCore::Node::isEqualNode const): Ditto.
593         * dom/NodeIterator.cpp:
594         (WebCore::NodeIterator::NodeIterator): Ditto.
595         (WebCore::NodeIterator::~NodeIterator): Ditto.
596
597         * dom/RadioButtonGroups.cpp:
598         (WebCore::RadioButtonGroup::add): Take a reference.
599         (WebCore::RadioButtonGroup::updateCheckedState): Ditto.
600         (WebCore::RadioButtonGroup::remove): Ditto.
601         (WebCore::RadioButtonGroup::contains const): Ditto.
602         (WebCore::RadioButtonGroups::addButton): Ditto.
603         (WebCore::RadioButtonGroups::updateCheckedState): Ditto.
604         (WebCore::RadioButtonGroups::hasCheckedButton const): Ditto.
605         (WebCore::RadioButtonGroups::isInRequiredGroup const): Ditto.
606         (WebCore::RadioButtonGroups::removeButton): Ditto.
607         * dom/RadioButtonGroups.h: Updated argument types.
608
609         * dom/Range.cpp:
610         (WebCore::Range::Range): Pass a reference.
611         (WebCore::Range::~Range): Ditto.
612         (WebCore::Range::setDocument): Ditto.
613         (WebCore::Range::createContextualFragment): Ditto.
614         (WebCore::boundaryTextInserted): Ditto.
615         (WebCore::Range::textInserted): Ditto.
616         (WebCore::boundaryTextRemoved): Ditto.
617         (WebCore::Range::textRemoved): Ditto.
618         (WebCore::boundaryTextNodesSplit): Ditto.
619         (WebCore::Range::textNodeSplit): Ditto.
620         * dom/Range.h: Take references instead of pointers.
621
622         * dom/ScriptElement.cpp:
623         (WebCore::ScriptElement::prepareScript): Use reference.
624
625         * dom/Text.cpp:
626         (WebCore::Text::splitText): Pass reference.
627
628         * dom/UserActionElementSet.h: Renamed inActiveChain to isInActiveChain to
629         match the naming scheme of the other similar functions, like isActive.
630
631         * editing/AlternativeTextController.cpp:
632         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
633         Pass a reference.
634         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Ditto.
635         (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto.
636         (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
637         (WebCore::AlternativeTextController::markReversed): Ditto.
638         (WebCore::AlternativeTextController::markCorrection): Ditto.
639         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto.
640         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
641         * editing/CompositeEditCommand.cpp:
642         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto.
643         * editing/DictationCommand.cpp: Ditto.
644         * editing/Editing.cpp:
645         (WebCore::areIdenticalElements): Ditto.
646         * editing/Editor.cpp:
647         (WebCore::Editor::ignoreSpelling): Ditto.
648         (WebCore::Editor::learnSpelling): Ditto.
649         (WebCore::Editor::advanceToNextMisspelling): Ditto.
650         (WebCore::Editor::clearMisspellingsAndBadGrammar): Ditto.
651         (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
652         (WebCore::Editor::markAndReplaceFor): Ditto.
653         (WebCore::Editor::changeBackToReplacedString): Ditto.
654         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
655         (WebCore::Editor::countMatchesForText): Ditto.
656         (WebCore::Editor::scanRangeForTelephoneNumbers): Ditto.
657         (WebCore::Editor::editorUIUpdateTimerFired): Ditto.
658         (WebCore::Editor::handleAcceptedCandidate): Ditto.
659
660         * editing/InsertTextCommand.cpp:
661         (WebCore::InsertTextCommand::doApply): Pass a reference.
662         * editing/InsertTextCommand.h: Take a reference.
663
664         * editing/SpellChecker.cpp:
665         (WebCore::SpellChecker::didCheckSucceed): Pass a reference.
666         * editing/SplitTextNodeCommand.cpp:
667         (WebCore::SplitTextNodeCommand::doApply): Ditto.
668         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
669         * editing/TextCheckingHelper.cpp:
670         (WebCore::TextCheckingHelper::findFirstMisspelling): Pass a reference.
671         (WebCore::TextCheckingHelper::findFirstGrammarDetail const): Ditto.
672         * editing/ios/DictationCommandIOS.cpp:
673         (WebCore::DictationCommandIOS::doApply): Ditto.
674         Also added a comment about a possible missing null check; behavior should
675         be no different than before, but using a reference helps make clear there
676         was never any null check.
677         * editing/ios/EditorIOS.mm:
678         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
679         * fileapi/FileReader.cpp:
680         (WebCore::FileReader::readInternal): Ditto.
681         (WebCore::FileReader::abort): Ditto.
682         (WebCore::FileReader::didFinishLoading): Ditto.
683         (WebCore::FileReader::didFail): Ditto.
684
685         * html/HTMLAppletElement.cpp: Removed unneeded include of HTMLDocument.h.
686         There's very little left that is truly specific to HTMLDocument vs. Document.
687
688         * html/HTMLDocument.h:
689         (WebCore::HTMLDocument::create): Take a reference.
690         (WebCore::HTMLDocument::createSynthesizedDocument): Ditto.
691
692         * html/HTMLFormElement.cpp:
693         (WebCore::HTMLFormElement::~HTMLFormElement): Pass a reference.
694         (WebCore::HTMLFormElement::parseAttribute): Ditto.
695         (WebCore::HTMLFormElement::didMoveToNewDocument): Ditto.
696
697         * html/HTMLIFrameElement.cpp: Removed unneeded include of HTMLDocument.h.
698
699         * html/HTMLInputElement.cpp:
700         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a reference.
701         (WebCore::HTMLInputElement::setChecked): Ditto.
702         (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): Ditto.
703         (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): Ditto.
704         (WebCore::HTMLInputElement::didMoveToNewDocument): Ditto.
705         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Ditto.
706         (WebCore::HTMLInputElement::addToRadioButtonGroup): Ditto.
707         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Ditto.
708         * html/HTMLMediaElement.cpp:
709         (WebCore::HTMLMediaElement::registerWithDocument): Ditto.
710         (WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
711         (WebCore::HTMLMediaElement::selectMediaResource): Ditto.
712         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
713         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
714         (WebCore::HTMLMediaElement::resume): Ditto.
715         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Ditto.
716
717         * html/HTMLNameCollection.cpp: Removed unneeded include of HTMLDocument.h.
718
719         * html/HTMLPlugInImageElement.cpp:
720         (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Pass a reference.
721         (WebCore::HTMLPlugInImageElement::createElementRenderer): Ditto.
722         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Ditto.
723
724         * html/HTMLSourceElement.cpp: Removed unneeded include of HTMLDocument.h.
725         * html/HTMLTemplateElement.cpp: Ditto.
726
727         * html/RadioInputType.cpp:
728         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
729         Pass a reference.
730         * loader/DocumentWriter.cpp:
731         (WebCore::DocumentWriter::begin): Ditto.
732         * page/DOMWindow.cpp:
733         (WebCore::DOMWindow::addEventListener): Ditto.
734         (WebCore::DOMWindow::removeEventListener): Ditto.
735         (WebCore::DOMWindow::removeAllEventListeners): Ditto.
736
737         * page/EventHandler.cpp:
738         (WebCore::EventHandler::didStartDrag): Use a reference.
739
740         * page/EventSource.cpp:
741         (WebCore::EventSource::create): Pass reference.
742         (WebCore::EventSource::networkRequestEnded): Ditto.
743         (WebCore::EventSource::close): Ditto.
744         (WebCore::EventSource::abortConnectionAttempt): Ditto.
745
746         * page/Frame.cpp: Removed unneeded include of HTMLDocument.h.
747         * page/FrameView.cpp: Ditto.
748         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Use reference.
749
750         * page/animation/AnimationBase.cpp:
751         (WebCore::AnimationBase::updateStateMachine): Pass reference.
752
753         * page/animation/CSSAnimationController.cpp:
754         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle): Take reference.
755         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle): Ditto.
756         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): Ditto.
757         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): Ditto.
758         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): Ditto.
759         * page/animation/CSSAnimationControllerPrivate.h: Ditto.
760
761         * page/animation/CompositeAnimation.cpp:
762         (WebCore::CompositeAnimation::clearElement): Pass reference.
763         (WebCore::CompositeAnimation::updateTransitions): Ditto.
764         (WebCore::CompositeAnimation::updateKeyframeAnimations): Ditto.
765         * page/ios/FrameIOS.mm:
766         (WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
767
768         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
769         (WebCore::layerContentsFormat): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END so
770         I can continue to compile with latest headers.
771
772         * rendering/CSSFilter.cpp:
773         (WebCore::CSSFilter::buildReferenceFilter): Pass reference, small coding style
774         tweaks as well.
775
776         * rendering/svg/RenderSVGResource.cpp:
777         (WebCore::removeFromCacheAndInvalidateDependencies): Pass reference.
778         * rendering/svg/RenderSVGResourceContainer.cpp:
779         (WebCore::RenderSVGResourceContainer::registerResource): Ditto.
780         * rendering/svg/SVGResources.cpp:
781         (WebCore::registerPendingResource): Ditto.
782         * rendering/svg/SVGResourcesCache.cpp:
783         (WebCore::SVGResourcesCache::resourceDestroyed): Ditto.
784
785         * svg/SVGDocumentExtensions.cpp:
786         (WebCore::SVGDocumentExtensions::addTimeContainer): Take reference.
787         (WebCore::SVGDocumentExtensions::removeTimeContainer): Ditto.
788         (WebCore::SVGDocumentExtensions::addResource): Ditto.
789         (WebCore::SVGDocumentExtensions::addPendingResource): Ditto.
790         (WebCore::SVGDocumentExtensions::isElementWithPendingResources const): Ditto.
791         (WebCore::SVGDocumentExtensions::isPendingResource const): Ditto.
792         (WebCore::SVGDocumentExtensions::clearHasPendingResourcesIfPossible): Ditto.
793         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): Ditto.
794         (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): Ditto.
795         (WebCore::SVGDocumentExtensions::addElementReferencingTarget): Ditto.
796         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Ditto.
797         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Ditto.
798         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Ditto.
799         (WebCore::SVGDocumentExtensions::registerSVGFontFaceElement): Ditto.
800         (WebCore::SVGDocumentExtensions::unregisterSVGFontFaceElement): Ditto.
801         * svg/SVGDocumentExtensions.h: Ditto.
802
803         * svg/SVGElement.cpp:
804         (WebCore::SVGElement::~SVGElement): Pass reference.
805         (WebCore::SVGElement::removedFromAncestor): Ditto.
806         (WebCore::SVGElement::buildPendingResourcesIfNeeded): Ditto.
807         * svg/SVGFEImageElement.cpp:
808         (WebCore::SVGFEImageElement::clearResourceReferences): Ditto.
809         (WebCore::SVGFEImageElement::buildPendingResource): Ditto.
810         * svg/SVGFontFaceElement.cpp:
811         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Ditto.
812         (WebCore::SVGFontFaceElement::removedFromAncestor): Ditto.
813         * svg/SVGMPathElement.cpp:
814         (WebCore::SVGMPathElement::buildPendingResource): Ditto.
815         (WebCore::SVGMPathElement::clearResourceReferences): Ditto.
816         * svg/SVGPathElement.cpp:
817         (WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
818         * svg/SVGSVGElement.cpp:
819         (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
820         (WebCore::SVGSVGElement::~SVGSVGElement): Ditto.
821         (WebCore::SVGSVGElement::didMoveToNewDocument): Ditto.
822         (WebCore::SVGSVGElement::insertedIntoAncestor): Ditto.
823         (WebCore::SVGSVGElement::removedFromAncestor): Ditto.
824         * svg/SVGTRefElement.cpp:
825         (WebCore::SVGTRefElement::detachTarget): Ditto.
826         (WebCore::SVGTRefElement::buildPendingResource): Ditto.
827         * svg/SVGTextPathElement.cpp:
828         (WebCore::SVGTextPathElement::clearResourceReferences): Ditto.
829         (WebCore::SVGTextPathElement::buildPendingResource): Ditto.
830         * svg/SVGUseElement.cpp:
831         (WebCore::SVGUseElement::updateShadowTree): Ditto.
832         * svg/animation/SVGSMILElement.cpp:
833         (WebCore::SVGSMILElement::clearResourceReferences): Ditto.
834         (WebCore::SVGSMILElement::buildPendingResource): Ditto.
835         * testing/Internals.cpp:
836         (WebCore::Internals::addTextMatchMarker): Ditto.
837         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
838         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
839         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
840         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
841         * workers/Worker.cpp:
842         (WebCore::Worker::create): Ditto.
843         (WebCore::Worker::notifyFinished): Ditto.
844         * workers/service/ServiceWorkerContainer.cpp:
845         (WebCore::ServiceWorkerContainer::scheduleJob): Ditto.
846         (WebCore::ServiceWorkerContainer::jobDidFinish): Ditto.
847         * xml/XMLHttpRequest.cpp:
848         (WebCore::XMLHttpRequest::prepareToSend): Ditto.
849         (WebCore::XMLHttpRequest::createRequest): Ditto.
850         (WebCore::XMLHttpRequest::internalAbort): Ditto.
851         (WebCore::XMLHttpRequest::networkErrorTimerFired): Ditto.
852         (WebCore::XMLHttpRequest::didFail): Ditto.
853         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
854
855         * xml/XPathStep.cpp: Removed unneeded include of HTMLDocument.h.
856         (WebCore::XPath::nodeMatchesBasicTest): Changed code to call isHTMLDocument
857         rather than is<HTMLDocument> since this is not a type check for a downcast,
858         but rather a behavioral difference that does not depend on any of the data
859         stored in an HTMLDocument or the use of a distinct C++ class for it.
860
861         * xml/XSLTProcessor.cpp:
862         (WebCore::XSLTProcessor::createDocumentFromSource): Pass a reference.
863
864 2019-01-21  David Kilzer  <ddkilzer@apple.com>
865
866         Switch remaining VideoToolbox soft-linking in WebCore over to VideoToolboxSoftLink.{cpp,h}
867         <https://webkit.org/b/193645>
868         <rdar://problem/47421574>
869
870         Reviewed by Alex Christensen.
871
872         * platform/cocoa/VideoToolboxSoftLink.cpp:
873         * platform/cocoa/VideoToolboxSoftLink.h:
874         - Move soft-linking of VTPixelBufferConformer* functions from
875           PixelBufferConformerCV.cpp to here.
876         * platform/graphics/cv/PixelBufferConformerCV.cpp:
877         - Remove local soft-linking of VideoToolbox.framework and switch
878           to VideoToolboxSoftLink.h.
879
880 2019-01-21  Antti Koivisto  <antti@apple.com>
881
882         Move delegatesScrolling() tests to lower level conversion function in ScrollView
883         https://bugs.webkit.org/show_bug.cgi?id=193649
884
885         Reviewed by Frédéric Wang.
886
887         This reduces places where these tests are needed and helps avoid mistakes.
888
889         * dom/Document.cpp:
890         (WebCore::computeIntersectionState):
891         * page/FrameView.cpp:
892         (WebCore::FrameView::convertFromRendererToContainingView const):
893         (WebCore::FrameView::convertFromContainingViewToRenderer const):
894         * platform/ScrollView.cpp:
895         (WebCore::ScrollView::viewToContents const):
896         (WebCore::ScrollView::contentsToView const):
897         (WebCore::ScrollView::contentsToContainingViewContents const):
898         (WebCore::ScrollView::rootViewToContents const):
899         (WebCore::ScrollView::contentsToRootView const):
900         (WebCore::ScrollView::windowToContents const):
901         (WebCore::ScrollView::contentsToWindow const):
902
903 2019-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
904
905         REGRESSION(r239915): about 130 test failures on WPE
906         https://bugs.webkit.org/show_bug.cgi?id=193395
907
908         Reviewed by Žan Doberšek.
909
910         Since r239915 we are only overriding the characters with Default_Ignorable unicode property when the font
911         doesn't support the code point. If the font happens to provide a glyph for the character, it's later ignored by
912         harfbuzz when shaping, but the simple text code path doesn't ignore them unless there isn't a glyph.
913
914         * platform/graphics/WidthIterator.cpp:
915         (WebCore::WidthIterator::advanceInternal): Always ignore characters with Default_Ignorable unicode property.
916         (WebCore::characterMustDrawSomething): Moved to CharacterProperties.h and renamed as isDefaultIgnorableCodePoint().
917         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
918         (WebCore::GlyphPage::fill): Use isDefaultIgnorableCodePoint().
919         * platform/text/CharacterProperties.h:
920         (WebCore::isDefaultIgnorableCodePoint): Return whether the character has Default_Ignorable unicode property.
921
922 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
923
924         [WHLSL] Implement Metal code generation
925         https://bugs.webkit.org/show_bug.cgi?id=193531
926
927         Reviewed by Dean Jackson.
928
929         This implements the majority of the metal code generation piece. There are still a few pieces missing,
930         that I'll add in follow up patches. There's still enough complexity here that this is worth reviewing
931         on its own, though.
932
933         This patch includes a few pieces:
934         - Metal typedefs for every WHLSL type. This analysis is actually pretty interesting, because complex
935               types depend on their inner types, and the inner types need to be emitted first. Therefore,
936               this patch implements a topological sort when emitting types. Also, WHLSL types need to be de-
937               duped because array references are implemented in MSL as structs, and if you have two structs
938               in MSL with the same contents, those two structs are not equal and cannot be assigned to each
939               other. So, this patch creates a trie to de-dup all the UnnamedTypes, and implements a
940               dependency graph which includes both nodes in the trie as well as NamedTypes which don't appear
941               in the trie.
942         - WHLSL enumeration code generation
943         - A name mangler, which ensures that no text from the source program is contained within the result
944               program
945         - Full support for expressions. An expression like "y = *x + 7;" would be converted to something like
946               Type1 variable1 = *x;
947               Type2 variable2 = 7;
948               Type3 variable3 = variable1 + variable2;
949               y = variable3;
950         - Mostly complete support for control flow. This is tricky because of how we transform WHLSL
951               expressions into C++ statements. Therefore, things like "for ( ; *x + 7; )" is difficult to
952               compile, because we can't put the "*x + 7" generated statements into the for loop itself.
953               Instead, we have to emit this code inside the loop, in all the places that would implicitly run
954               it. This patch doesn't fully handle this, see below. (If MSL supported lambdas, we could put
955               the statements into a lambda and do something like "for ( ; theLambda(); )" but MSL doesn't
956               support lambdas.)
957
958         Missing pieces:
959         - Entry point pack / unpack code
960         - Support for "continue" (See above regarding control flow)
961         - Knowing whether or not a switch case should end with break or fallthrough
962         - Trapping
963         - Zero filling variables
964         - Code generation for compiler-generated native functions (this patch supports native functions in the
965               standard library), texture functions, and HLSL's half <-> int functions.
966
967         No new tests because it isn't hooked up yet. As soon as we can do entry point packing and unpacking,
968         I'll start porting the test suite.
969
970         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
971         (WebCore::WHLSL::AST::BuiltInSemantic::targetIndex):
972         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
973         (WebCore::WHLSL::AST::Expression::resolvedType):
974         (WebCore::WHLSL::AST::Expression::type): Deleted.
975         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
976         (WebCore::WHLSL::AST::FunctionDeclaration::name):
977         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
978         (WebCore::WHLSL::AST::StructureDefinition::find):
979         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Added.
980         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
981         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes):
982         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature):
983         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack):
984         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack):
985         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
986         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Added.
987         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
988         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
989         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
990         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString):
991         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
992         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
993         (WebCore::WHLSL::Metal::metalFunctions):
994         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
995         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h.
996         (WebCore::WHLSL::Metal::generateMetalCode):
997         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
998         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Added.
999         (WebCore::WHLSL::Metal::getNativeName):
1000         (WebCore::WHLSL::Metal::mapFunctionName):
1001         (WebCore::WHLSL::Metal::convertAddressSpace):
1002         (WebCore::WHLSL::Metal::writeNativeFunction):
1003         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1004         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Added.
1005         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
1006         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
1007         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
1008         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
1009         (WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
1010         (WebCore::WHLSL::Metal::BaseTypeNameNode::children):
1011         (WebCore::WHLSL::Metal::BaseTypeNameNode::append):
1012         (WebCore::WHLSL::Metal::BaseTypeNameNode::parent):
1013         (WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
1014         (WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
1015         (WebCore::WHLSL::Metal::ArrayTypeNameNode::numElements const):
1016         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
1017         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::addressSpace const):
1018         (WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
1019         (WebCore::WHLSL::Metal::PointerTypeNameNode::addressSpace const):
1020         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
1021         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::namedType):
1022         (WebCore::WHLSL::Metal::TypeNamer::TypeNamer):
1023         (WebCore::WHLSL::Metal::TypeNamer::visit):
1024         (WebCore::WHLSL::Metal::findInVector):
1025         (WebCore::WHLSL::Metal::find):
1026         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
1027         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
1028         (WebCore::WHLSL::Metal::TypeNamer::insert):
1029         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
1030         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString):
1031         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
1032         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
1033         (WebCore::WHLSL::Metal::toString):
1034         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
1035         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
1036         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
1037         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
1038         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
1039         (WebCore::WHLSL::Metal::TypeNamer::metalTypes):
1040         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Added.
1041         (WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
1042         (WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
1043         (WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
1044         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
1045         (WebCore::WHLSL::checkSemantics):
1046         (WebCore::WHLSL::Checker::visit):
1047         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
1048         (WebCore::WHLSL::Gatherer::visit):
1049         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
1050         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
1051         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed.
1052         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
1053         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
1054         (WebCore::WHLSL::checkStatementBehavior):
1055         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1056         * Sources.txt:
1057         * WebCore.xcodeproj/project.pbxproj:
1058
1059 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
1060
1061         [WHLSL] Add the statement behavior checker
1062         https://bugs.webkit.org/show_bug.cgi?id=193487
1063
1064         Reviewed by Dean Jackson.
1065
1066         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
1067         into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.
1068
1069         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
1070         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
1071
1072         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
1073         does.
1074         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
1075         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
1076         (WebCore::WHLSL::checkStatementBehavior):
1077         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
1078         * Sources.txt:
1079         * WebCore.xcodeproj/project.pbxproj:
1080
1081 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1082
1083         REGRESSION(r240174): Wrong preprocessor guards in RenderImage::paintAreaElementFocusRing
1084         https://bugs.webkit.org/show_bug.cgi?id=193630
1085
1086         Reviewed by Daniel Bates.
1087
1088         r240174 inadvertently disabled this function on non-Apple platforms.
1089
1090         This fixes layout test fast/images/image-map-outline-in-positioned-container.html.
1091
1092         * rendering/RenderImage.cpp:
1093         (WebCore::RenderImage::paintAreaElementFocusRing):
1094
1095 2019-01-20  chris fleizach  <cfleizach@apple.com>
1096
1097         AX: Support returning relative frames for accessibility
1098         https://bugs.webkit.org/show_bug.cgi?id=193414
1099         <rdar://problem/47268501>
1100
1101         Reviewed by Zalan Bujtas.
1102
1103         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.
1104
1105         Consolidate rect/point conversion methods for macOS and iOS.
1106         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.
1107
1108         Tests: accessibility/mac/relative-frame.html
1109
1110         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1111         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
1112         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
1113         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
1114         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
1115         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
1116         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
1117         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
1118         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
1119         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
1120         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1121         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1122         (convertPathToScreenSpaceFunction):
1123         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
1124         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
1125         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1126         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
1127         (-[WebAccessibilityObjectWrapper position]):
1128         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1129         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
1130
1131 2019-01-20  Simon Fraser  <simon.fraser@apple.com>
1132
1133         On RenderBox, make client sizing be derived from padding box sizing
1134         https://bugs.webkit.org/show_bug.cgi?id=193621
1135
1136         Reviewed by Daniel Bates.
1137
1138         I never liked how clientWidth/Height, an IE-originated term, was used as the basis
1139         for various RenderBox geometry functions.
1140
1141         Fix by adding some functions which return the dimensions of the padding box (which
1142         is the inside of the border and any scrollbar), and define clientWidth/Height in
1143         terms of them.
1144
1145         Also add paddingBoxRectIncludingScrollbar() function that is used by compositing code.
1146
1147         * rendering/RenderBox.cpp:
1148         (WebCore::RenderBox::clientWidth const):
1149         (WebCore::RenderBox::clientHeight const):
1150         * rendering/RenderBox.h:
1151         (WebCore::RenderBox::borderBoxRect const):
1152         (WebCore::RenderBox::computedCSSContentBoxRect const):
1153         (WebCore::RenderBox::contentWidth const):
1154         (WebCore::RenderBox::contentHeight const):
1155         (WebCore::RenderBox::paddingBoxWidth const):
1156         (WebCore::RenderBox::paddingBoxHeight const):
1157         (WebCore::RenderBox::paddingBoxRect const):
1158         (WebCore::RenderBox::paddingBoxRectIncludingScrollbar const):
1159         (WebCore::RenderBox::hasHorizontalOverflow const):
1160         (WebCore::RenderBox::hasVerticalOverflow const):
1161         * rendering/RenderLayerBacking.cpp:
1162         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
1163         (WebCore::RenderLayerBacking::updateGeometry):
1164
1165 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1166
1167         Unreviewed, rolling out r238275.
1168
1169         Regressed css3/shapes/shape-outside/shape-image/shape-
1170         image-025.html
1171
1172         Reverted changeset:
1173
1174         "ScalableImageDecoder: don't forcefully decode image data when
1175         querying frame completeness, duration"
1176         https://bugs.webkit.org/show_bug.cgi?id=191354
1177         https://trac.webkit.org/changeset/238275
1178
1179 2019-01-19  Zalan Bujtas  <zalan@apple.com>
1180
1181         [LFC][BFC] <body>'s overflow property value is propagated to viewport
1182         https://bugs.webkit.org/show_bug.cgi?id=193617
1183
1184         Reviewed by Antti Koivisto.
1185
1186         When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element
1187         or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport,
1188         if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'.
1189         The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
1190
1191         This also has impact on layout since <body style="overflow: hidden"> would establish a block formatting context.
1192
1193         * layout/layouttree/LayoutBox.cpp:
1194         (WebCore::Layout::Box::isOverflowVisible const):
1195
1196 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
1197
1198         Unreviewed, rolling out r240209.
1199
1200         Broke GTK/WPE injected bundle
1201
1202         Reverted changeset:
1203
1204         "AX: Support returning relative frames for accessibility"
1205         https://bugs.webkit.org/show_bug.cgi?id=193414
1206         https://trac.webkit.org/changeset/240209
1207
1208 2019-01-12  Dan Bernstein  <mitz@apple.com>
1209
1210         [Cocoa] Avoid importing directly from subumbrella frameworks
1211         https://bugs.webkit.org/show_bug.cgi?id=186016
1212         <rdar://problem/40591038>
1213
1214         Reviewed by Sam Weinig.
1215
1216         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
1217           OTHER_CPLUSPLUSFLAGS.
1218         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
1219         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
1220         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
1221
1222 2019-01-20  chris fleizach  <cfleizach@apple.com>
1223
1224         AX: Support returning relative frames for accessibility
1225         https://bugs.webkit.org/show_bug.cgi?id=193414
1226         <rdar://problem/47268501>
1227
1228         Reviewed by Zalan Bujtas.
1229
1230         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.
1231
1232         Consolidate rect/point conversion methods for macOS and iOS.
1233         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.
1234
1235         Tests: accessibility/mac/relative-frame.html
1236
1237         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1238         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
1239         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
1240         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
1241         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
1242         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
1243         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
1244         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
1245         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
1246         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
1247         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1248         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1249         (convertPathToScreenSpaceFunction):
1250         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
1251         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
1252         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1253         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
1254         (-[WebAccessibilityObjectWrapper position]):
1255         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1256         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
1257
1258 2019-01-20  Antoine Quint  <graouts@apple.com>
1259
1260         Add a POINTER_EVENTS feature flag
1261         https://bugs.webkit.org/show_bug.cgi?id=193577
1262         <rdar://problem/47408511>
1263
1264         Unreviewed. Also enable Pointer Events for iosmac.
1265
1266         * Configurations/FeatureDefines.xcconfig:
1267
1268 2019-01-19  Zalan Bujtas  <zalan@apple.com>
1269
1270         [LFC][Floats] Ensure that floats in FloatingContext::m_floats are always horizontally ordered.
1271         https://bugs.webkit.org/show_bug.cgi?id=193613
1272
1273         Reviewed by Antti Koivisto.
1274
1275         Float items in m_floats list should stay in horizontal position order (left/right edge).
1276
1277         When adding a new float item to floating state list, we have to ensure that it is definitely the left(right)-most item.
1278         Normally it is, but negative horizontal margins can push the float box beyond another float box.
1279
1280         <div style="float: left; height: 10px; width: 10px;"></div>
1281         <div style="float: left; height: 10px; width: 10px; margin-left: -80px;"></div>
1282
1283         The second float's right edge beyond the first float' left edge. THe second float is not the right(inner)-most float anymore.
1284
1285         Test: fast/block/float/floats-with-negative-horizontal-margin.html
1286
1287         * layout/floats/FloatingContext.cpp:
1288         (WebCore::Layout::areFloatsHorizontallySorted):
1289         (WebCore::Layout::FloatingContext::positionForFloat const):
1290         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
1291         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1292         * layout/floats/FloatingState.cpp:
1293         (WebCore::Layout::FloatingState::append):
1294
1295 2019-01-19  Youenn Fablet  <youenn@apple.com>
1296
1297         getUserMedia with a deviceId exact constraint with an empty string value should succeed
1298         https://bugs.webkit.org/show_bug.cgi?id=193541
1299         <rdar://problem/47357218>
1300
1301         Reviewed by Eric Carlson.
1302
1303         If there is a deviceId constraint, remove any empty string from ideal/exact string list.
1304         This will make the device selection be solely based on other constraints.
1305         An improvement might be for 'exact' constraint to pick the default device.
1306         There is currently no such notion of a default device.
1307         Picking the best fitting device seems a good tradeoff.
1308         Covered by updated test.
1309
1310         * platform/mediastream/MediaConstraints.cpp:
1311         (WebCore::MediaTrackConstraintSetMap::set):
1312         * platform/mediastream/MediaConstraints.h:
1313         (WebCore::StringConstraint::removeEmptyStringConstraint):
1314
1315 2019-01-19  Eric Liang  <ericliang@apple.com>
1316
1317         AXSelected attribute on RadioButton should not be settable.
1318         https://bugs.webkit.org/show_bug.cgi?id=193371
1319
1320         Reviewed by Chris Fleizach.
1321
1322         Test: accessibility/set-selected-editable.html
1323
1324         * accessibility/AccessibilityNodeObject.cpp:
1325         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
1326
1327 2019-01-19  Antoine Quint  <graouts@apple.com>
1328
1329         Add a POINTER_EVENTS feature flag
1330         https://bugs.webkit.org/show_bug.cgi?id=193577
1331
1332         Reviewed by Dean Jackson.
1333
1334         Only expose the PointerEvent interface if the POINTER_EVENTS feature is enabled.
1335
1336         * Configurations/FeatureDefines.xcconfig:
1337         * dom/EventNames.in:
1338         * dom/PointerEvent.cpp:
1339         * dom/PointerEvent.h:
1340         * dom/PointerEvent.idl:
1341
1342 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
1343
1344         iOS: Updating input mode should update the software keyboard
1345         https://bugs.webkit.org/show_bug.cgi?id=193565
1346         <rdar://problem/47376334>
1347
1348         Reviewed by Wenson Hsieh.
1349
1350         Let the chrome client know that the focused element's inputmode had changed.
1351
1352         Test: fast/forms/ios/inputmode-none-removed.html
1353
1354         * html/HTMLElement.cpp:
1355         (WebCore::HTMLElement::parseAttribute):
1356         * page/ChromeClient.h:
1357
1358 2019-01-18  Brian Burg  <bburg@apple.com>
1359
1360         Automation.computeElementLayout should return visual viewport-aware coordinates
1361         https://bugs.webkit.org/show_bug.cgi?id=193598
1362         <rdar://problem/35325644>
1363
1364         Reviewed by Simon Fraser.
1365
1366         * page/FrameView.h: export symbol to be usable from WebKit.
1367         * page/FrameView.cpp:
1368         (WebCore::FrameView::clientToLayoutViewportRect const): Added.
1369         Do the same thing as clientToLayoutViewportPoint with a rect instead.
1370
1371
1372 2019-01-18  Eric Carlson  <eric.carlson@apple.com>
1373
1374         Revert r238815, it broke WK1 video fullscreen on Mac
1375         https://bugs.webkit.org/show_bug.cgi?id=193586
1376         <rdar://problem/47358941>
1377
1378         Reviewed by Jer Noble.
1379
1380         * PlatformMac.cmake:
1381         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1382         (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
1383
1384 2019-01-18  Devin Rousso  <drousso@apple.com>
1385
1386         Web Inspector: Audit: don't keep the injected sub-objects alive between runs
1387         https://bugs.webkit.org/show_bug.cgi?id=193594
1388         <rdar://problem/47398091>
1389
1390         Reviewed by Joseph Pecoraro.
1391
1392         Rather than save the `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject`
1393         between individual `Audit.setup` invocations, we should only keep them alive so long as the
1394         injected `WebInspectorAudit` object is alive (e.g. from `Audit.setup` to `Audit.teardown`).
1395
1396         This change fixes inspector/audit/run-accessibility.html.
1397
1398         * inspector/agents/page/PageAuditAgent.h:
1399         * inspector/agents/page/PageAuditAgent.cpp:
1400         (WebCore::PageAuditAgent::populateAuditObject):
1401
1402 2019-01-18  Daniel Bates  <dabates@apple.com>
1403
1404         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
1405         (https://bugs.webkit.org/show_bug.cgi?id=193583)
1406
1407         Substitute ENABLE(FULL_KEYBOARD_ACCESS) for PLATFORM(MAC). On Mac, we always build with
1408         ENABLE(FULL_KEYBOARD_ACCESS) enabled.
1409
1410         * rendering/RenderElement.cpp:
1411         (WebCore::RenderElement::paintFocusRing):
1412
1413 2019-01-18  Daniel Bates  <dabates@apple.com>
1414
1415         Fix some build issues.
1416
1417         Including UIKitSoftLinking.h is not compatible with unified builds.
1418
1419         * SourcesCocoa.txt:
1420         * WebCore.xcodeproj/project.pbxproj:
1421
1422 2019-01-18  Justin Fan  <justin_fan@apple.com>
1423
1424         (WIP) [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype
1425         https://bugs.webkit.org/show_bug.cgi?id=193457
1426         <rdar://problem/47296678>
1427
1428         Reviewed by Dean Jackson.
1429
1430         Enable WebGPU developers to assign buffer bind groups and access them via render pipeline. 
1431
1432         Test: webgpu/buffer-resource-triangles.html
1433
1434         * Modules/webgpu/WebGPUBindGroup.h:
1435         (WebCore::WebGPUBindGroup::bindGroup const): Added getter.
1436         * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: 
1437         (WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Added. Delegates call to GPUProgrammablePassEncoder.
1438         * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Enable setBindGroup.
1439         * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: ditto.
1440         * WebCore.xcodeproj/project.pbxproj:
1441         * platform/graphics/gpu/GPUBindGroup.h: 
1442         (WebCore::GPUBindGroup::layout const): Added getter.
1443         (WebCore::GPUBindGroup::bindings const): ditto.
1444         * platform/graphics/gpu/GPUBindGroupLayout.h: Added ArgumentEncoderBuffer struct to retain ptr to both MTLArgumentEncoders and their argument MTLBuffers.
1445         (WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::operator! const):
1446         (WebCore::GPUBindGroupLayout::vertexArguments const): Added. Getter.
1447         (WebCore::GPUBindGroupLayout::fragmentArguments const): ditto.
1448         (WebCore::GPUBindGroupLayout::computeArguments const): ditto.
1449         * platform/graphics/gpu/GPUDevice.cpp: Refactored unnecessary header include.
1450         * platform/graphics/gpu/GPUDevice.h: ditto.
1451         * platform/graphics/gpu/GPUProgrammablePassEncoder.h:
1452         (WebCore::GPUProgrammablePassEncoder::setVertexBuffer): Added. Delegates to MTLCommandEncoder call.
1453         (WebCore::GPUProgrammablePassEncoder::setFragmentBuffer): ditto.
1454         * platform/graphics/gpu/GPURenderPassEncoder.h: 
1455         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
1456         (WebCore::tryCreateArgumentEncoderAndBuffer): Replace newEncoder(). Now create an ArgumentEncoderBuffer object from an array of MTLArgumentDescriptors, if able.
1457         (WebCore::GPUBindGroupLayout::tryCreate): Refactor to support ArgumentEncoderBuffers, and allocate MTLBuffers for argument encoders.
1458         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): Support ArgumentEncoderBuffers.
1459         (WebCore::newEncoder): Deleted.
1460         * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
1461         (WebCore::GPUCommandBuffer::GPUCommandBuffer):
1462         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
1463         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Set a buffer resource on the MTLArgumentEncoder, and call useResource on the command encoder.
1464         (WebCore::GPUProgrammablePassEncoder::setBindGroup): Parses the bind group to assign each resource on its matching MTLArgumentEncoder.
1465         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: 
1466         (WebCore::GPURenderPassEncoder::useResource): Resolves call from GPUProgrammablePassEncoder to call on MTLRenderCommandEncoder.
1467         (WebCore::GPURenderPassEncoder::setVertexBuffer): ditto.
1468         (WebCore::GPURenderPassEncoder::setFragmentBuffer): ditto.
1469
1470 2019-01-18  Daniel Bates  <dabates@apple.com>
1471
1472         Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
1473         (https://bugs.webkit.org/show_bug.cgi?id=193583)
1474
1475         Only override RenderTheme::platformFocusRingColor() when building with ENABLE(FULL_KEYBOARD_ACCESS)
1476         enabled.
1477
1478         * rendering/RenderThemeIOS.h:
1479         * rendering/RenderThemeIOS.mm:
1480
1481 2019-01-18  Daniel Bates  <dabates@apple.com>
1482
1483         Attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
1484         (https://bugs.webkit.org/show_bug.cgi?id=193583)
1485
1486         Namespace qualify call to getUIColorClass().
1487
1488         * rendering/RenderThemeIOS.mm:
1489         (WebCore::RenderThemeIOS::platformFocusRingColor const):
1490
1491 2019-01-18  Jer Noble  <jer.noble@apple.com>
1492
1493         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
1494         https://bugs.webkit.org/show_bug.cgi?id=189553
1495
1496         Reviewed by Tim Horton.
1497
1498         * Configurations/Base.xcconfig:
1499         * Configurations/SDKVariant.xcconfig: Added.
1500         * Configurations/WebCore.xcconfig:
1501
1502 2019-01-18  Daniel Bates  <dabates@apple.com>
1503
1504         CSS auto focus-ring outlines don't render on iOS
1505         https://bugs.webkit.org/show_bug.cgi?id=193583
1506         <rdar://problem/6508697>
1507
1508         Reviewed by Simon Fraser.
1509
1510         Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
1511         enabled.
1512
1513         For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
1514         animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.
1515
1516         * SourcesCocoa.txt: Add file ColorIOS.mm.
1517         * WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.
1518
1519         * platform/graphics/GraphicsContext.h:
1520         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1521         (WebCore::drawFocusRingAtTime):
1522         (WebCore::GraphicsContext::drawFocusRing):
1523         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
1524         This is always enabled on Mac.
1525         
1526         * platform/ios/ColorIOS.h: Added.
1527         * platform/ios/ColorIOS.mm: Added.
1528         (WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.
1529
1530         * rendering/RenderElement.cpp:
1531         (WebCore::RenderElement::paintFocusRing):
1532         * rendering/RenderImage.cpp:
1533         (WebCore::RenderImage::paintAreaElementFocusRing):
1534         Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
1535         This is always enabled on Mac.
1536
1537         * rendering/RenderThemeIOS.h:
1538         * rendering/RenderThemeIOS.mm:
1539         (WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
1540         (WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
1541         return false - the iOS theme code does not support painting focus rings. By returning false we
1542         will use the platform-independent, non-theme code path to draw focus rings.
1543
1544 2019-01-18  David Kilzer  <ddkilzer@apple.com>
1545
1546         Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
1547         <https://webkit.org/b/193568>
1548         <rdar://problem/47381130>
1549
1550         * editing/cocoa/DictionaryLookup.mm:
1551         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
1552         Fix the build by changing getUIApplicationClass() to
1553         PAL::getUIApplicationClass().
1554
1555 2019-01-18  David Kilzer  <ddkilzer@apple.com>
1556
1557         Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
1558         <https://webkit.org/b/193568>
1559         <rdar://problem/47381130>
1560
1561         Reviewed by Alex Christensen.
1562
1563         This does the following:
1564         - Removes local soft-linking of UIKit.
1565         - Switches to using PAL functions for soft-linking.
1566
1567         * SourcesCocoa.txt: Add 4 source files to UnifiedSources.
1568         * WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
1569         from WebCore target now that they are in UnifiedSources.
1570         * editing/cocoa/DictionaryLookup.mm:
1571         * editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
1572         declarations in public headers.
1573         (_fontForNameAndSize): Change use of getUIFontClass() to
1574         PlatformFontClass.
1575         (HTMLConverter::_processElement): Add cast here since compiler
1576         finds the wrong selector for +clearColor and thinks it returns a
1577         `CIColor *` object.  The same cast already exists in
1578         VideoFullscreenInterfaceAVKit.mm.
1579         * page/cocoa/SettingsBaseCocoa.mm:
1580         (WebCore::SettingsBase::defaultTextAutosizingEnabled):
1581         * platform/audio/ios/MediaSessionManagerIOS.mm:
1582         (-[WebMediaSessionHelper initWithCallback:]):
1583         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1584         (WebCore::exernalDeviceDisplayNameForPlayer):
1585         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1586         (WebCore::showLetterpressedGlyphsWithAdvances):
1587         * platform/ios/DragImageIOS.mm:
1588         (WebCore::scaleDragImage):
1589         (WebCore::createDragImageFromImage):
1590         (WebCore::cascadeForSystemFont):
1591         (WebCore::createDragImageForLink):
1592         (WebCore::createDragImageForSelection):
1593         (WebCore::createDragImageForRange):
1594         (WebCore::createDragImageForColor):
1595         * platform/ios/PlatformPasteboardIOS.mm:
1596         (WebCore::PlatformPasteboard::PlatformPasteboard):
1597         (WebCore::PlatformPasteboard::color):
1598         (WebCore::registerItemToPasteboard):
1599         (WebCore::PlatformPasteboard::setColor):
1600         * platform/ios/ThemeIOS.mm:
1601         (WebCore::ThemeIOS::userPrefersReducedMotion const):
1602         * platform/ios/UserAgentIOS.mm:
1603         (WebCore::isClassic):
1604         (WebCore::isClassicPad):
1605         (WebCore::isClassicPhone):
1606         * platform/ios/ValidationBubbleIOS.mm:
1607         (-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
1608         (WebCore::ValidationBubble::ValidationBubble):
1609         (WebCore::ValidationBubble::show):
1610         (WebCore::fallbackViewController):
1611         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1612         (clearUIColor):
1613         (allocWebAVPictureInPicturePlayerLayerViewInstance):
1614         (WebAVPlayerLayerView_videoView):
1615         (fallbackViewController):
1616         (VideoFullscreenInterfaceAVKit::doSetup):
1617         * platform/ios/WebEvent.mm:
1618         (+[WebEvent modifierFlags]):
1619         * platform/ios/WebItemProviderPasteboard.mm:
1620         (allLoadableClasses):
1621         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1622         (VideoFullscreenControllerContext::setUpFullscreen):
1623         * platform/network/mac/WebCoreURLResponse.mm: Add missing header
1624         after unified sources were updated.
1625         * rendering/RenderThemeIOS.mm:
1626         (WebCore::contentSizeCategoryDidChange):
1627         (WebCore::RenderThemeIOS::RenderThemeIOS):
1628         (WebCore::RenderThemeIOS::contentSizeCategory):
1629         (WebCore::RenderThemeIOS::systemColor const):
1630         (WebCore::attachmentActionColor):
1631         (WebCore::attachmentTitleColor):
1632         (WebCore::attachmentSubtitleColor):
1633         (WebCore::iconForAttachment):
1634         * testing/Internals.mm:
1635         (WebCore::Internals::userPrefersReducedMotion const):
1636
1637 2019-01-18  Antti Koivisto  <antti@apple.com>
1638
1639         Implement asynchronous frame scrolling for iOS
1640         https://bugs.webkit.org/show_bug.cgi?id=193539
1641         <rdar://problem/47379873>
1642
1643         Reviewed by Simon Fraser.
1644
1645         This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
1646         internal setting (still off by default).
1647
1648         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1649         (WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
1650         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1651         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
1652
1653         Export ScrollingTreeFrameScrollingNodeIOS.
1654
1655         * rendering/RenderLayerCompositor.cpp:
1656         (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
1657         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1658         (WebCore::RenderLayerCompositor::updateScrollLayerClipping):
1659
1660         If we don't have a separate clip layer, just resize and position the scroll layer.
1661
1662         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
1663         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1664         (WebCore::RenderLayerCompositor::ensureRootLayer):
1665
1666         Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
1667         Don't create a separate clip layer since the scroll layer will handle clipping.
1668
1669         * rendering/RenderLayerCompositor.h:
1670
1671 2019-01-18  Ali Juma  <ajuma@chromium.org>
1672
1673         FetchResponse::url should return the empty string for tainted responses
1674         https://bugs.webkit.org/show_bug.cgi?id=193553
1675
1676         Reviewed by Youenn Fablet.
1677
1678         Check whether the response is tainted in FetchResponse::url, to match
1679         the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
1680
1681         * Modules/fetch/FetchResponse.cpp:
1682         (WebCore::FetchResponse::url const):
1683
1684 2019-01-18  Youenn Fablet  <youenn@apple.com>
1685
1686         A track source should be unmuted whenever reenabled after setDirection changes
1687         https://bugs.webkit.org/show_bug.cgi?id=193554
1688         <rdar://problem/47366196>
1689
1690         Reviewed by Eric Carlson.
1691
1692         Ensure that track gets unmuted after being fired as part of track event.
1693         Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
1694         Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
1695         some enqueued samples might not be from the right active video track or there might be no active video track.
1696
1697         Test: webrtc/video-setDirection.html
1698
1699         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1700         (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
1701         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1702         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1703         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
1704         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
1705
1706 2019-01-18  Charlie Turner  <cturner@igalia.com>
1707
1708         [GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
1709         https://bugs.webkit.org/show_bug.cgi?id=192229
1710
1711         Reviewed by Xabier Rodriguez-Calvar.
1712
1713         Covered by existing tests.
1714
1715         * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
1716         (WebCore::parseLicenseFormat): There is a defect in some C++11
1717         compiles where they will copy this return value since the type
1718         doesn't exactly match. Force a move with WTFMove.
1719         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1720         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
1721         Deleted. No longer used by anything.
1722         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
1723         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
1724         Rename these methods to avoid "namespacing names".
1725         (webkit_media_clear_key_decrypt_class_init):
1726         (finalize):
1727         (handleKeyResponse): This is a temporary fix, we need some more
1728         reorganisation to be full driven by CDMInstance APIs for decryption.
1729         (findAndSetKey):
1730         (decrypt):
1731         (webKitMediaClearKeyDecryptorFinalize): Deleted.
1732         (webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
1733         (webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
1734         (webKitMediaClearKeyDecryptorDecrypt): Deleted.
1735         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
1736         (webkit_media_common_encryption_decrypt_class_init):
1737         (finalize):
1738         (transformCaps):
1739         (transformInPlace):
1740         (isCDMInstanceAvailable):
1741         (sinkEventHandler):
1742         (queryHandler):
1743         (changeState):
1744         (setContext):
1745         (webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
1746         (webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
1747         (webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
1748         (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
1749         (webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
1750         (webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
1751         (webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
1752         (webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
1753         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
1754         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1755         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
1756         Deleted. No longer passing key information over bus messages.
1757         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1758
1759 2019-01-18  Zalan Bujtas  <zalan@apple.com>
1760
1761         [LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
1762         https://bugs.webkit.org/show_bug.cgi?id=193564
1763
1764         Reviewed by Antti Koivisto.
1765
1766         Float boxes prevent collapsing through.
1767
1768         Test: fast/block/float/float-in-descendant-formatting-context.html
1769
1770         * layout/blockformatting/BlockMarginCollapse.cpp:
1771         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
1772
1773 2019-01-18  Zalan Bujtas  <zalan@apple.com>
1774
1775         [LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
1776         https://bugs.webkit.org/show_bug.cgi?id=193562
1777
1778         Reviewed by Antti Koivisto.
1779
1780         The current floating context's (float) boxes could belong to descendant formatting contexts.
1781         We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
1782
1783         <div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
1784         While computing the height for "container", the float box needs to be taken into account even though
1785         it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
1786
1787         * layout/floats/FloatingState.cpp:
1788         (WebCore::Layout::FloatingState::bottom const):
1789         * layout/floats/FloatingState.h:
1790         (WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
1791         (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
1792
1793 2019-01-18  Zalan Bujtas  <zalan@apple.com>
1794
1795         [LFC][BFC] Check for inflow children while computing height for block formatting context roots.
1796         https://bugs.webkit.org/show_bug.cgi?id=193555
1797
1798         Reviewed by Antti Koivisto.
1799
1800         This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs. 
1801
1802         * layout/FormattingContextGeometry.cpp:
1803         (WebCore::Layout::contentHeightForFormattingContextRoot):
1804         * layout/Verification.cpp:
1805         (WebCore::Layout::areEssentiallyEqual):
1806         * page/FrameViewLayoutContext.cpp:
1807         (WebCore::layoutUsingFormattingContext):
1808
1809 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
1810
1811         [WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
1812         https://bugs.webkit.org/show_bug.cgi?id=192590
1813
1814         Reviewed by Philippe Normand.
1815
1816         When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
1817
1818         On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
1819         DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
1820
1821         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1822         (WebCore::DefaultAudioDestinationNode::uninitialize):
1823
1824 2019-01-18  Yacine Bandou  <yacine.bandou@softathome.com>
1825
1826         [WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
1827         https://bugs.webkit.org/show_bug.cgi?id=192586
1828
1829         Reviewed by Philippe Normand.
1830
1831         When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
1832         the AudioDestinationNode is not destroyed.
1833
1834         In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
1835         is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
1836         the resources leak.
1837
1838         AudioContext::uninitialize() is not called immediately since r94608.
1839         This modification can now be reverted without regression in WebAudio tests.
1840
1841         Test: webaudio/mediaelementaudiosourcenode-gc.html
1842
1843         * Modules/webaudio/AudioContext.cpp:
1844         (WebCore::AudioContext::stop):
1845
1846 2019-01-18  Simon Fraser  <simon.fraser@apple.com>
1847
1848         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
1849         https://bugs.webkit.org/show_bug.cgi?id=193559
1850
1851         Reviewed by Antti Koivisto.
1852
1853         ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
1854         but the code that used it was removed in webkit.org/r229318 so we can remove it and
1855         code that calls it.
1856
1857         * page/scrolling/ScrollingCoordinator.h:
1858         (WebCore::ScrollingCoordinator::willDestroyScrollableArea):
1859         (WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
1860         * rendering/RenderLayerBacking.cpp:
1861         (WebCore::RenderLayerBacking::updateGeometry):
1862         * rendering/RenderLayerCompositor.cpp:
1863         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1864         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1865         (WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
1866         * rendering/RenderLayerCompositor.h:
1867
1868 2019-01-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1869
1870         [iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
1871         https://bugs.webkit.org/show_bug.cgi?id=193494
1872         <rdar://problem/46859627>
1873
1874         Reviewed by Simon Fraser and Tim Horton.
1875
1876         When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
1877         just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
1878         position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
1879         the scroll position to be the origin.
1880
1881         However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
1882         view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
1883         end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
1884         autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
1885         Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).
1886
1887         To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
1888         the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
1889         position which is already visible won't cause us to scroll away the content inset area and only show the
1890         unobscured rect.
1891
1892         Tests:  editing/selection/ios/autoscroll-with-top-content-inset.html
1893                 fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
1894
1895         * page/FrameView.cpp:
1896         (WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
1897
1898         Introduce a helper method that expands the unobscured content rect to include surrounding content insets.
1899
1900         * page/FrameView.h:
1901         * page/Page.h:
1902         (WebCore::Page::contentInsets const):
1903         (WebCore::Page::setContentInsets):
1904         * rendering/RenderLayer.cpp:
1905         (WebCore::RenderLayer::scrollRectToVisible):
1906         (WebCore::RenderLayer::getRectToExpose const):
1907
1908 2019-01-17  Truitt Savell  <tsavell@apple.com>
1909
1910         Unreviewed, rolling out r240124.
1911
1912         This commit broke an internal build.
1913
1914         Reverted changeset:
1915
1916         "SDK_VARIANT build destinations should be separate from non-
1917         SDK_VARIANT builds"
1918         https://bugs.webkit.org/show_bug.cgi?id=189553
1919         https://trac.webkit.org/changeset/240124
1920
1921 2019-01-17  Devin Rousso  <drousso@apple.com>
1922
1923         Web Inspector: fix Xcode project file list after r239976
1924         https://bugs.webkit.org/show_bug.cgi?id=193474
1925
1926         Reviewed by Timothy Hatcher.
1927
1928         * WebCore.xcodeproj/project.pbxproj:
1929
1930 2019-01-17  Ross Kirsling  <ross.kirsling@sony.com>
1931
1932         Unreviewed WinCairo fix -- hundreds of tests crash after r240031.
1933
1934         * platform/network/curl/ResourceHandleCurl.cpp:
1935         (WebCore::ResourceHandle::createCurlRequest):
1936         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1937         (WebCore::ResourceHandle::receivedCredential):
1938         (WebCore::ResourceHandle::getCredential):
1939
1940 2019-01-17  John Wilander  <wilander@apple.com>
1941
1942         Add infrastructure to enable/disable ITP Debug Mode through Preferences
1943         https://bugs.webkit.org/show_bug.cgi?id=193510
1944         <rdar://problem/47330969>
1945
1946         Reviewed by Dean Jackson.
1947
1948         No new tests. These changes are purely for settings/preferences.
1949
1950         * page/RuntimeEnabledFeatures.h:
1951         (WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
1952         (WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
1953         (WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
1954         (WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
1955             Renamed.
1956         * page/Settings.yaml:
1957             Removed since this particular setting should not be persisted for privacy
1958             reasons.
1959
1960 2019-01-17  Jer Noble  <jer.noble@apple.com>
1961
1962         SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
1963         https://bugs.webkit.org/show_bug.cgi?id=189553
1964
1965         Reviewed by Tim Horton.
1966
1967         * Configurations/Base.xcconfig:
1968         * Configurations/SDKVariant.xcconfig: Added.
1969         * Configurations/WebCore.xcconfig:
1970
1971 2019-01-17  Jer Noble  <jer.noble@apple.com>
1972
1973         MediaPlayerPrivateAVFoundationObjC can return incorrect paused information
1974         https://bugs.webkit.org/show_bug.cgi?id=193499
1975
1976         Reviewed by Eric Carlson.
1977
1978         MediaPlayerPrivateAVFoundation uses rate() as an indicator of whether the player
1979         is paused or not. This is incorrect when playback is stalled waiting for more data.
1980         For MPPAVFObjC, use the timeControlStatus as a more accurate indicator of whether
1981         the player is playing.
1982
1983         Now that we have correct play state information, we can remove the handlePlaybackCommand()
1984         path when playing remotely for a more direct approach of notifying the HTMLMediaElement
1985         that the play state has changed.
1986
1987         Drive-by fix: Before throwing away the AVPlayer, clear its output context. This keeps
1988         remote devices from keeping the AVPlayer alive.
1989
1990         Drive-by fix #2: The NullMediaPlayer should always return "true" for paused(), not "false",
1991         since it can't possibly play anything.
1992
1993         * platform/graphics/MediaPlayer.cpp:
1994         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1995         (WebCore::MediaPlayerPrivateAVFoundation::paused const):
1996         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1997         (WebCore::MediaPlayerPrivateAVFoundation::platformPaused const):
1998         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1999         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2000         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2001         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPaused const):
2002         (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
2003
2004 2019-01-17  Jiewen Tan  <jiewen_tan@apple.com>
2005
2006         [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
2007         https://bugs.webkit.org/show_bug.cgi?id=193478
2008         <rdar://problem/34368591>
2009
2010         Reviewed by Brent Fulgham.
2011
2012         By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
2013         as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
2014         is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
2015         website that assumes submit buttons are focusable, and will prohibit users from completing immigration
2016         forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
2017         HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.
2018
2019         This quirk is for ceac.state.gov specifically, and therefore no tests.
2020
2021         * html/HTMLFormControlElement.cpp:
2022         (WebCore::HTMLFormControlElement::isMouseFocusable const):
2023         (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
2024         * html/HTMLFormControlElement.h:
2025
2026 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2027
2028         Fix WinCairo build after r240117
2029         https://bugs.webkit.org/show_bug.cgi?id=193529
2030
2031         * PlatformWin.cmake:
2032         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2033
2034 2019-01-17  Youenn Fablet  <youenn@apple.com>
2035
2036         Add release logging for incoming and outgoing webrtc audio tracks
2037         https://bugs.webkit.org/show_bug.cgi?id=185545
2038
2039         Reviewed by Eric Carlson.
2040
2041         Add logging of audio tracks. When doing a WebRTC call,
2042         one log line is added each second for each audio track.
2043         Validated that logging is done through manual testing.
2044
2045         Refactored code to use LogHelper and apply it to video sources as well.
2046
2047         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2048         (WebCore::LibWebRTCMediaEndpoint::addTrack):
2049         (WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
2050         (WebCore::sourceFromNewReceiver): Deleted.
2051         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2052         * platform/mediastream/RealtimeIncomingAudioSource.cpp:
2053         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
2054         (WebCore::RealtimeIncomingAudioSource::logChannel const):
2055         (WebCore::RealtimeIncomingAudioSource::logger const):
2056         * platform/mediastream/RealtimeIncomingAudioSource.h:
2057         (WebCore::RealtimeIncomingAudioSource::setLogger):
2058         * platform/mediastream/RealtimeIncomingVideoSource.cpp:
2059         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2060         (WebCore::RealtimeIncomingVideoSource::logChannel const):
2061         (WebCore::RealtimeIncomingVideoSource::logger const):
2062         * platform/mediastream/RealtimeIncomingVideoSource.h:
2063         (WebCore::RealtimeIncomingVideoSource::setLogger):
2064         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
2065         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
2066         (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
2067         (WebCore::RealtimeOutgoingAudioSource::logChannel const):
2068         (WebCore::RealtimeOutgoingAudioSource::logger const):
2069         * platform/mediastream/RealtimeOutgoingAudioSource.h:
2070         (WebCore::RealtimeOutgoingAudioSource::setLogger):
2071         * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
2072         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2073         (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
2074         (WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
2075         (WebCore::RealtimeOutgoingVideoSource::logChannel const):
2076         (WebCore::RealtimeOutgoingVideoSource::logger const):
2077         * platform/mediastream/RealtimeOutgoingVideoSource.h:
2078         (WebCore::RealtimeOutgoingVideoSource::setLogger):
2079         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
2080         (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
2081         * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
2082         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
2083         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
2084         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
2085         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
2086         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
2087         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
2088         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2089         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
2090         (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
2091
2092 2019-01-17  Alex Christensen  <achristensen@webkit.org>
2093
2094         Stop using NetworkStorageSession::storageSession in WebCore
2095         https://bugs.webkit.org/show_bug.cgi?id=193529
2096
2097         Reviewed by Tim Horton.
2098
2099         Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
2100         so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object.
2101         I've called this client StorageSessionProvider::storageSession.  Right now it just looks in NetworkStorageSession::storageSession,
2102         but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.
2103
2104         * Modules/websockets/WebSocketChannel.cpp:
2105         (WebCore::WebSocketChannel::connect):
2106         * WebCore.xcodeproj/project.pbxproj:
2107         * loader/CookieJar.cpp:
2108         (WebCore::CookieJar::create):
2109         (WebCore::CookieJar::CookieJar):
2110         (WebCore::CookieJar::cookies const):
2111         (WebCore::CookieJar::setCookies):
2112         (WebCore::CookieJar::cookiesEnabled const):
2113         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
2114         (WebCore::CookieJar::getRawCookies const):
2115         (WebCore::CookieJar::deleteCookie):
2116         * loader/CookieJar.h:
2117         * loader/EmptyClients.cpp:
2118         (WebCore::pageConfigurationWithEmptyClients):
2119         * page/Page.h:
2120         * page/SocketProvider.cpp:
2121         (WebCore::SocketProvider::createSocketStreamHandle):
2122         * page/SocketProvider.h:
2123         * platform/network/NetworkingContext.h:
2124         * platform/network/SocketStreamHandleImpl.cpp:
2125         (WebCore::cookieDataForHandshake):
2126         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
2127         * platform/network/StorageSessionProvider.h: Added.
2128         (WebCore::StorageSessionProvider::~StorageSessionProvider):
2129         * platform/network/cf/SocketStreamHandleImpl.h:
2130         (WebCore::SocketStreamHandleImpl::create):
2131         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2132         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
2133         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
2134         * platform/network/curl/SocketStreamHandleImpl.h:
2135         (WebCore::SocketStreamHandleImpl::create):
2136         * platform/network/soup/SocketStreamHandleImpl.h:
2137         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2138         (WebCore::SocketStreamHandleImpl::create):
2139
2140 2019-01-17  Jon Lee  <jonlee@apple.com>
2141
2142         [EME] Remove Amazon Prime Video from quirks list
2143         https://bugs.webkit.org/show_bug.cgi?id=193514
2144         rdar://problem/47295330
2145
2146         Reviewed by Jer Noble.
2147
2148         * page/Quirks.cpp:
2149         (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
2150
2151 2019-01-17  Zalan Bujtas  <zalan@apple.com>
2152
2153         [LFC][BFC] An element with transform is a containing block for positioned descendants.
2154         https://bugs.webkit.org/show_bug.cgi?id=193534
2155
2156         Reviewed by Antti Koivisto.
2157
2158         "For elements whose layout is governed by the CSS box model, any value other than none for the transform
2159         property also causes the element to establish a containing block for all descendants."
2160         https://www.w3.org/TR/css-transforms-1/
2161
2162         * layout/layouttree/LayoutBox.cpp:
2163         (WebCore::Layout::Box::containingBlock const):
2164
2165 2019-01-17  Simon Fraser  <simon.fraser@apple.com>
2166
2167         ScrollingCoordinator: separate updating node geometry from node layers
2168         https://bugs.webkit.org/show_bug.cgi?id=193527
2169
2170         Reviewed by Antti Koivisto.
2171
2172         Updating scrolling tree node layers happens in a different code path from updating geometry;
2173         the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
2174         Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.
2175         
2176         We can also clean up the ScrollingCoordinator API and have a single function that updates
2177         node layers (handling different node types), and separate functions for pushing viewport-constrained
2178         and scrolling node geometry.
2179
2180         No observable behavior change.
2181
2182         * page/scrolling/AsyncScrollingCoordinator.cpp:
2183         (WebCore::AsyncScrollingCoordinator::setNodeLayers):
2184         (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
2185         (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
2186         (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
2187         (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
2188         (WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
2189         (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
2190         * page/scrolling/AsyncScrollingCoordinator.h:
2191         * page/scrolling/ScrollingCoordinator.h:
2192         (WebCore::ScrollingCoordinator::setNodeLayers):
2193         (WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
2194         (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
2195         (WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
2196         (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
2197         (WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
2198         (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
2199         * rendering/RenderLayerCompositor.cpp:
2200         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2201         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2202         * rendering/RenderLayerCompositor.h:
2203
2204 2019-01-17  Zalan Bujtas  <zalan@apple.com>
2205
2206         [LFC][BFC][Quirk] Take body padding and border into account when stretching height.
2207         https://bugs.webkit.org/show_bug.cgi?id=193528
2208
2209         Reviewed by Antti Koivisto.
2210
2211         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
2212         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2213         * layout/displaytree/DisplayBox.h:
2214         (WebCore::Display::Box::verticalBorder const):
2215         (WebCore::Display::Box::horizontalBorder const):
2216         (WebCore::Display::Box::verticalPadding const):
2217         (WebCore::Display::Box::horizontalPadding const):
2218         * page/FrameViewLayoutContext.cpp:
2219         (WebCore::layoutUsingFormattingContext):
2220
2221 2019-01-17  Zalan Bujtas  <zalan@apple.com>
2222
2223         [LFC][BFC] For height computation, the bottom edge of the last line box value should not include top border/padding
2224         https://bugs.webkit.org/show_bug.cgi?id=193520
2225
2226         Reviewed by Antti Koivisto.
2227
2228         This is similar to the other "10.6.3" cases. The bottom edge of the last inline box is in the coordinate systyem
2229         of the containing block's border box (and for content height computation it needs to be mapped to the containing block's content box instead).
2230
2231         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2232         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2233
2234 2019-01-16  Simon Fraser  <simon.fraser@apple.com>
2235
2236         Stub out scrolling tree classes for overflow scrolling nodes on macOS
2237         https://bugs.webkit.org/show_bug.cgi?id=193524
2238
2239         Reviewed by Antti Koivisto.
2240
2241         Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change
2242         ScrollingTreeMac::createScrollingTreeNode() to create these nodes.
2243         
2244         Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask
2245         the scrolling coordinator if it can coordinate scrolling for this layer; no behavior
2246         change for existing code paths.
2247
2248         * SourcesCocoa.txt:
2249         * WebCore.xcodeproj/project.pbxproj:
2250         * page/scrolling/ScrollingCoordinator.cpp:
2251         (WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const):
2252         * page/scrolling/ScrollingCoordinator.h:
2253         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
2254         * page/scrolling/mac/ScrollingTreeMac.cpp:
2255         (ScrollingTreeMac::createScrollingTreeNode):
2256         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
2257         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added.
2258         (WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
2259         (WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
2260         (WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac):
2261         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
2262         (WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
2263         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
2264         (WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
2265         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2266         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll):
2267         * rendering/RenderLayer.cpp:
2268         (WebCore::RenderLayer::usesAsyncScrolling const):
2269         * rendering/RenderLayerCompositor.cpp:
2270         (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2271         * rendering/RenderLayerCompositor.h:
2272
2273 2019-01-16  Justin Fan  <justin_fan@apple.com>
2274
2275         [WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
2276         https://bugs.webkit.org/show_bug.cgi?id=193473
2277
2278         Reviewed by Dean Jackson and Myles Maxfield.
2279
2280         Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct. 
2281         As of now I cannot determine an analog for WebGPU's shaderLocation in Metal. 
2282
2283         Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.
2284
2285         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
2286         (WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex. 
2287
2288 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
2289
2290         [WHLSL] Add the function stage checker
2291         https://bugs.webkit.org/show_bug.cgi?id=193479
2292
2293         Reviewed by Dean Jackson and Robin Morisset.
2294
2295         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/CheckNativeFuncStages.mjs into C++.
2296
2297         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2298         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2299
2300         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
2301         (WebCore::WHLSL::AST::CallExpression::function):
2302         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Added.
2303         (WebCore::WHLSL::FunctionStageChecker::FunctionStageChecker):
2304         (WebCore::WHLSL::checkFunctionStages):
2305         * Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Added.
2306         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
2307         (WebCore::WHLSL::Intrinsics::add):
2308         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
2309         (WebCore::WHLSL::Intrinsics::ddx const):
2310         (WebCore::WHLSL::Intrinsics::ddy const):
2311         (WebCore::WHLSL::Intrinsics::allMemoryBarrier const):
2312         (WebCore::WHLSL::Intrinsics::deviceMemoryBarrier const):
2313         (WebCore::WHLSL::Intrinsics::groupMemoryBarrier const):
2314         (WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
2315         * Sources.txt:
2316         * WebCore.xcodeproj/project.pbxproj:
2317
2318 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
2319
2320         [WHLSL] Delete the 'restricted' keyword
2321         https://bugs.webkit.org/show_bug.cgi?id=193469
2322
2323         Reviewed by Dean Jackson and Robin Morisset.
2324
2325         This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.
2326
2327         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2328         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2329
2330         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
2331         (WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
2332         (WebCore::WHLSL::AST::FunctionDefinition::block):
2333         (WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
2334         * Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
2335         (WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
2336         (WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
2337         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2338         (WebCore::WHLSL::resolveWithOperatorAnderIndexer):
2339         (WebCore::WHLSL::resolveWithOperatorLength):
2340         (WebCore::WHLSL::resolveWithReferenceComparator):
2341         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
2342         (WebCore::WHLSL::resolveFunctionOverloadImpl):
2343         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2344         (WebCore::WHLSL::synthesizeArrayOperatorLength):
2345         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2346         (WebCore::WHLSL::synthesizeConstructors):
2347         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2348         (WebCore::WHLSL::synthesizeEnumerationFunctions):
2349         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2350         (WebCore::WHLSL::synthesizeStructureAccessors):
2351
2352 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
2353
2354         [WHLSL] Implement the recursion checker
2355         https://bugs.webkit.org/show_bug.cgi?id=193436
2356
2357         Reviewed by Saam Barati.
2358
2359         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/RecursionChecker.mjs into C++.
2360
2361         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2362         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2363
2364         * Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
2365         (WebCore::WHLSL::AST::CallExpression::function):
2366         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp.
2367         (WebCore::WHLSL::checkRecursion):
2368         * Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Added.
2369         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
2370         * Sources.txt:
2371         * WebCore.xcodeproj/project.pbxproj:
2372
2373 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
2374
2375         [WHLSL] Add the literal type checker
2376         https://bugs.webkit.org/show_bug.cgi?id=193430
2377
2378         Reviewed by Dean Jackson.
2379
2380         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LiteralTypeChecker.mjs into C++.
2381
2382         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2383         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2384
2385         * Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
2386         (WebCore::WHLSL::AST::FloatLiteralType::value const):
2387         * Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
2388         (WebCore::WHLSL::AST::IntegerLiteralType::value const):
2389         * Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
2390         (WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const):
2391         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Added.
2392         (WebCore::WHLSL::getNativeTypeDeclaration):
2393         (WebCore::WHLSL::LiteralTypeChecker::visit):
2394         (WebCore::WHLSL::checkLiteralTypes):
2395         * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
2396         * Sources.txt:
2397         * WebCore.xcodeproj/project.pbxproj:
2398
2399 2019-01-16  Zalan Bujtas  <zalan@apple.com>
2400
2401         [LFC][BFC] Inflow non-replaced used width should not be negative.
2402         https://bugs.webkit.org/show_bug.cgi?id=193495
2403
2404         Reviewed by Antti Koivisto.
2405
2406         min-width (initial value 0) enforces non-negative used width. 
2407
2408         * layout/blockformatting/BlockFormattingContext.cpp:
2409         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2410
2411 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
2412
2413         [WHLSL] Add a handwritten parser
2414         https://bugs.webkit.org/show_bug.cgi?id=192355
2415
2416         Reviewed by Dean Jackson.
2417
2418         The parser is a mechanical representation of WHLSL's ANTLR grammar at
2419         https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. The parser
2420         uses Expected<> to return an appropriate Error string when parsing fails.
2421
2422         This patch doesn't include the AST nodes themselves - those are in
2423         https://bugs.webkit.org/show_bug.cgi?id=192991. I split up the patch to
2424         aid easier reviewing.
2425
2426         No new tests because the parser isn't hooked up yet.
2427
2428         * Modules/webgpu/WHLSL/WHLSLParser.cpp:
2429         (WebCore::WHLSL::Parser::Parser):
2430         (WebCore::WHLSL::Parser::parse):
2431         (WebCore::WHLSL::Parser::fail):
2432         (WebCore::WHLSL::Parser::peek):
2433         (WebCore::WHLSL::Parser::tryType):
2434         (WebCore::WHLSL::Parser::tryTypes):
2435         (WebCore::WHLSL::Parser::consumeType):
2436         (WebCore::WHLSL::Parser::consumeTypes):
2437         (WebCore::WHLSL::digitValue):
2438         (WebCore::WHLSL::intLiteralToInt):
2439         (WebCore::WHLSL::uintLiteralToUint):
2440         (WebCore::WHLSL::floatLiteralToFloat):
2441         (WebCore::WHLSL::Parser::consumeIntegralLiteral):
2442         (WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
2443         (WebCore::WHLSL::recognizeSimpleUnsignedInteger):
2444         (WebCore::WHLSL::Parser::parseConstantExpression):
2445         (WebCore::WHLSL::Parser::parseTypeArgument):
2446         (WebCore::WHLSL::Parser::parseTypeArguments):
2447         (WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
2448         (WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
2449         (WebCore::WHLSL::Parser::parseAddressSpaceType):
2450         (WebCore::WHLSL::Parser::parseNonAddressSpaceType):
2451         (WebCore::WHLSL::Parser::parseType):
2452         (WebCore::WHLSL::Parser::parseTypeDefinition):
2453         (WebCore::WHLSL::Parser::parseBuiltInSemantic):
2454         (WebCore::WHLSL::Parser::parseResourceSemantic):
2455         (WebCore::WHLSL::Parser::parseSpecializationConstantSemantic):
2456         (WebCore::WHLSL::Parser::parseStageInOutSemantic):
2457         (WebCore::WHLSL::Parser::parseSemantic):
2458         (WebCore::WHLSL::Parser::parseQualifiers):
2459         (WebCore::WHLSL::Parser::parseStructureElement):
2460         (WebCore::WHLSL::Parser::parseStructureDefinition):
2461         (WebCore::WHLSL::Parser::parseEnumerationDefinition):
2462         (WebCore::WHLSL::Parser::parseEnumerationMember):
2463         (WebCore::WHLSL::Parser::parseNativeTypeDeclaration):
2464         (WebCore::WHLSL::Parser::parseNumThreadsFunctionAttribute):
2465         (WebCore::WHLSL::Parser::parseAttributeBlock):
2466         (WebCore::WHLSL::Parser::parseParameter):
2467         (WebCore::WHLSL::Parser::parseParameters):
2468         (WebCore::WHLSL::Parser::parseFunctionDefinition):
2469         (WebCore::WHLSL::Parser::parseEntryPointFunctionDeclaration):
2470         (WebCore::WHLSL::Parser::parseRegularFunctionDeclaration):
2471         (WebCore::WHLSL::Parser::parseOperatorFunctionDeclaration):
2472         (WebCore::WHLSL::Parser::parseFunctionDeclaration):
2473         (WebCore::WHLSL::Parser::parseNativeFunctionDeclaration):
2474         (WebCore::WHLSL::Parser::parseBlock):
2475         (WebCore::WHLSL::Parser::parseBlockBody):
2476         (WebCore::WHLSL::Parser::parseIfStatement):
2477         (WebCore::WHLSL::Parser::parseSwitchStatement):
2478         (WebCore::WHLSL::Parser::parseSwitchCase):
2479         (WebCore::WHLSL::Parser::parseForLoop):
2480         (WebCore::WHLSL::Parser::parseWhileLoop):
2481         (WebCore::WHLSL::Parser::parseDoWhileLoop):
2482         (WebCore::WHLSL::Parser::parseVariableDeclaration):
2483         (WebCore::WHLSL::Parser::parseVariableDeclarations):
2484         (WebCore::WHLSL::Parser::parseStatement):
2485         (WebCore::WHLSL::Parser::parseEffectfulExpression):
2486         (WebCore::WHLSL::Parser::parseEffectfulAssignment):
2487         (WebCore::WHLSL::Parser::parseEffectfulPrefix):
2488         (WebCore::WHLSL::Parser::parseEffectfulSuffix):
2489         (WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
2490         (WebCore::WHLSL::Parser::parseSuffixOperator):
2491         (WebCore::WHLSL::Parser::parseExpression):
2492         (WebCore::WHLSL::Parser::parseTernaryConditional):
2493         (WebCore::WHLSL::Parser::parseAssignment):
2494         (WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
2495         (WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
2496         (WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
2497         (WebCore::WHLSL::Parser::parsePossibleShift):
2498         (WebCore::WHLSL::Parser::parsePossibleAdd):
2499         (WebCore::WHLSL::Parser::parsePossibleMultiply):
2500         (WebCore::WHLSL::Parser::parsePossiblePrefix):
2501         (WebCore::WHLSL::Parser::parsePossibleSuffix):
2502         (WebCore::WHLSL::Parser::parseCallExpression):
2503         (WebCore::WHLSL::Parser::parseTerm):
2504         * Modules/webgpu/WHLSL/WHLSLParser.h:
2505         (WebCore::WHLSL::Parser::Error::Error):
2506         (WebCore::WHLSL::Parser::backtrackingScope):
2507         (WebCore::WHLSL::Parser::SuffixExpression::SuffixExpression):
2508         (WebCore::WHLSL::Parser::SuffixExpression::operator bool const):
2509
2510 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
2511
2512         IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
2513         https://bugs.webkit.org/show_bug.cgi?id=193093
2514
2515         Reviewed by Brady Eidson.
2516
2517         performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
2518         task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.
2519
2520         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2521         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2522         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2523         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
2524
2525 2019-01-16  Alex Christensen  <achristensen@webkit.org>
2526
2527         Internal build fix.
2528
2529         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2530         (WebCore::layerContentsFormat):
2531
2532 2019-01-16  Youenn Fablet  <youenn@apple.com>
2533
2534         ServiceWorkerContainer is leaking due to a ref cycle
2535         https://bugs.webkit.org/show_bug.cgi?id=193462
2536         <rdar://problem/47026303>
2537
2538         Reviewed by Brady Eidson.
2539
2540         ServiceWorkerContainer keeps a reference to its ready promise.
2541         The ready promise keeps a ref to its value which is a ServiceWorkerRegistration.
2542         ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer.
2543
2544         To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped.
2545
2546         Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking.
2547
2548         * workers/service/ServiceWorkerContainer.cpp:
2549         (WebCore::ServiceWorkerContainer::stop):
2550
2551 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
2552
2553         Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping
2554         https://bugs.webkit.org/show_bug.cgi?id=193290
2555
2556         Reviewed by Tim Horton.
2557
2558         RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for
2559         the flushed layer, but it's not clear what has changed at this point.
2560
2561         didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the
2562         case where the underlying platform layer for a GraphicsLayer changes because the layer swaps
2563         between tiled and non-tiled, and structural layer changes; we need to push the new layer to
2564         the scrolling tree because it operates on platform layers. So the only work that
2565         didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't
2566         need to do any geometry updating. Move towards that goal by renaming this callback to
2567         didChangePlatformLayerForLayer() to make its function more explicit.
2568
2569         * platform/graphics/GraphicsLayerClient.h:
2570         (WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer):
2571         (WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted.
2572         * platform/graphics/ca/GraphicsLayerCA.cpp:
2573         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
2574         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
2575         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2576         * platform/graphics/ca/GraphicsLayerCA.h:
2577         * rendering/RenderLayerBacking.cpp:
2578         (WebCore::RenderLayerBacking::didChangePlatformLayerForLayer):
2579         (WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted.
2580         * rendering/RenderLayerBacking.h:
2581         * rendering/RenderLayerCompositor.cpp:
2582         (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
2583         (WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer):
2584         (WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted.
2585         (WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted.
2586         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted.
2587         * rendering/RenderLayerCompositor.h:
2588
2589 2019-01-16  Chris Dumez  <cdumez@apple.com>
2590
2591         Regression(PSON) View becomes blank after click a cross-site download link
2592         https://bugs.webkit.org/show_bug.cgi?id=193361
2593         <rdar://problem/47099573>
2594
2595         Reviewed by Geoffrey Garen.
2596
2597         * loader/FrameLoader.cpp:
2598         (WebCore::FrameLoader::commitProvisionalLoad):
2599         When restoring from PageCache, make sure we notify the client that the load was committed
2600         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
2601         logic in the UIProcess.
2602
2603 2019-01-16  Devin Rousso  <drousso@apple.com>
2604
2605         Web Inspector: extend overlay element bounds lines to the right/below as well
2606         https://bugs.webkit.org/show_bug.cgi?id=193336
2607
2608         Reviewed by Matt Baker.
2609
2610         This patch is purely a visual change for WebInspector, and doesn't affect anything else.
2611
2612         * inspector/InspectorOverlayPage.js:
2613         (_drawBounds):
2614
2615 2019-01-16  Youenn Fablet  <youenn@apple.com>
2616
2617         Prevent WorkerRunLoop::runInMode from spinning in nested cases
2618         https://bugs.webkit.org/show_bug.cgi?id=193359
2619         <rdar://problem/46345353>
2620
2621         Reviewed by Joseph Pecoraro.
2622
2623         Speculative fix for some cases where service worker is spinning and consuming a lot of CPU.
2624         The hypothesis is that:
2625         - Service Worker is checking for its script freshness through WorkerScriptLoader.
2626         This triggers the worker run loop to be nested.
2627         - The run loop timer is active and needs to fire immediately.
2628         The hypothesis is that this happens in some cases like restarting a device after sleep mode.
2629
2630         WorkerRunLoop::runInMode will then compute a 0 timeout value for getting a message.
2631         This will trigger a timeout while waiting for the message queue.
2632         Since the run loop is nested,  the run loop timer will not be able to fire,
2633         and it will keep ask to fire immediately.
2634         runInMode will return timeout as a result and WorkerRunLoop::run will call it immediately.
2635
2636         The fix is to prevent the shared timer to fire only when the run loop is being debugged through the web inspector.
2637         We compute this by checking the run loop mode as debuggerMode().
2638         Did some refactoring by introducing helper routines for running the loop and posting task in debugger mode.
2639
2640         * inspector/WorkerScriptDebugServer.cpp:
2641         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
2642         * workers/WorkerInspectorProxy.cpp:
2643         (WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
2644         (WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
2645         (WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
2646         (WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController):
2647         * workers/WorkerRunLoop.cpp:
2648         (WebCore::ModePredicate::ModePredicate):
2649         (WebCore::WorkerRunLoop::WorkerRunLoop):
2650         (WebCore::debuggerMode):
2651         (WebCore::RunLoopSetup::RunLoopSetup):
2652         (WebCore::RunLoopSetup::~RunLoopSetup):
2653         (WebCore::WorkerRunLoop::run):
2654         (WebCore::WorkerRunLoop::runInDebuggerMode):
2655         (WebCore::WorkerRunLoop::runInMode):
2656         (WebCore::WorkerRunLoop::Task::performTask):
2657         * workers/WorkerRunLoop.h:
2658         (WebCore::WorkerRunLoop::isBeingDebugged const):
2659         * workers/WorkerThread.cpp:
2660         (WebCore::WorkerThread::startRunningDebuggerTasks):
2661         * workers/service/context/ServiceWorkerInspectorProxy.cpp:
2662         (WebCore::ServiceWorkerInspectorProxy::connectToWorker):
2663         (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
2664         (WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
2665
2666 2019-01-16  Sihui Liu  <sihui_liu@apple.com>
2667
2668         IndexedDB: leak WebIDBConnectionToClient for retain cycle
2669         https://bugs.webkit.org/show_bug.cgi?id=193097
2670         <rdar://problem/46899601>
2671
2672         Reviewed by David Kilzer.
2673
2674         Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live 
2675         forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself.
2676
2677         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
2678         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
2679         (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
2680         (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
2681         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
2682         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
2683         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
2684         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
2685         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
2686         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
2687         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
2688         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
2689         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
2690         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2691
2692 2019-01-16  Antti Koivisto  <antti@apple.com>
2693
2694         Add more assertions to find root cause for release assert hit in StyleResolver
2695         https://bugs.webkit.org/show_bug.cgi?id=193488
2696         <rdar://problem/30983040>
2697
2698         Reviewed by Zalan Bujtas.
2699
2700         * css/StyleResolver.cpp:
2701         (WebCore::StyleResolver::~StyleResolver):
2702
2703         Release assert we are not resolving tree style.
2704
2705         * dom/Document.cpp:
2706         (WebCore::Document::setIsResolvingTreeStyle):
2707         * dom/Document.h:
2708         (WebCore::Document::isResolvingTreeStyle const):
2709         * style/StyleTreeResolver.cpp:
2710         (WebCore::Style::TreeResolver::Scope::Scope):
2711         (WebCore::Style::TreeResolver::Scope::~Scope):
2712
2713         Set isResolvingTreeStyle bit when we have a tree resolver scope.
2714
2715 2019-01-16  Zalan Bujtas  <zalan@apple.com>
2716
2717         [LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
2718         https://bugs.webkit.org/show_bug.cgi?id=193470
2719
2720         Reviewed by Antti Koivisto.
2721
2722         Non-auto vertical margin values (which is mostly the case) should be set as used values.
2723
2724         Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html
2725
2726         * layout/FormattingContextGeometry.cpp:
2727         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2728
2729 2019-01-16  Alan Kinsley  <zalan@apple.com>
2730
2731         [LFC] Adjust margin box verification.
2732         https://bugs.webkit.org/show_bug.cgi?id=193482
2733
2734         Reviewed by Antti Koivisto.
2735
2736         In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
2737         so let's check the individual margin values instead (and at this point we know that all other boxes match).
2738
2739         Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
2740
2741         * layout/Verification.cpp:
2742         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2743
2744 2019-01-16  Zan Dobersek  <zdobersek@igalia.com>
2745
2746         [FreeType] Cache the zero-width space glyph in GlyphPage::fill()
2747         https://bugs.webkit.org/show_bug.cgi?id=193485
2748
2749         Reviewed by Carlos Garcia Campos.
2750
2751         In FreeType's implementation of GlyphPage::fill(), we can cache the
2752         zero-width space glyph upon first retrieval through the
2753         FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls
2754         for other ignorable characters.
2755
2756         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2757         (WebCore::GlyphPage::fill):
2758
2759 2019-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
2760
2761         [WHLSL] Add the high zombie finder
2762         https://bugs.webkit.org/show_bug.cgi?id=193432
2763
2764         Reviewed by Robin Morisset and Saam Barati.
2765
2766         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++.
2767
2768         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2769         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2770
2771         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added.
2772         (WebCore::WHLSL::findHighZombies):
2773         * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added.
2774         * Sources.txt:
2775         * WebCore.xcodeproj/project.pbxproj:
2776
2777 2019-01-15  Fujii Hironori  <Hironori.Fujii@sony.com>
2778
2779         Unreviewed WinCairo build fix.
2780
2781         * platform/network/curl/ResourceHandleCurl.cpp:
2782         (WebCore::ResourceHandle::createCurlRequest):
2783         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2784         (WebCore::ResourceHandle::receivedCredential):
2785         (WebCore::ResourceHandle::getCredential):
2786
2787 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2788
2789         Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
2790         https://bugs.webkit.org/show_bug.cgi?id=193368
2791
2792         Reviewed by Geoff Garen.
2793
2794         The NetworkStorageSession ownership needs to move to the WebKit/WebKitLegacy layer instead of being a process-global static map.
2795
2796         * loader/EmptyClients.cpp:
2797         * platform/network/CredentialStorage.cpp:
2798         (WebCore::CredentialStorage::defaultCredentialStorage): Deleted.
2799         * platform/network/CredentialStorage.h:
2800         * platform/network/NetworkStorageSession.h:
2801         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2802         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2803         (WebCore::NetworkStorageSession::ensureSession):
2804         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
2805         (WebCore::createPrivateStorageSession):
2806         * platform/network/curl/ResourceHandleCurl.cpp:
2807         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2808         (WebCore::ResourceHandle::receivedCredential):
2809         (WebCore::ResourceHandle::getCredential):
2810
2811 2019-01-15  Ryosuke Niwa  <rniwa@webkit.org>
2812
2813         VisualViewport API should be updated upon opening of keyboard
2814         https://bugs.webkit.org/show_bug.cgi?id=193475
2815
2816         Reviewed by Simon Fraser.
2817
2818         Added a function to update the visual viewport API and schedule a resize event to FrameView.
2819
2820         Test: fast/visual-viewport/ios/resize-event-for-keyboard.html
2821
2822         * page/FrameView.cpp:
2823         (WebCore::FrameView::didUpdateViewportOverrideRects):
2824         * page/FrameView.h:
2825
2826 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
2827
2828         Fix build after r240018
2829         https://bugs.webkit.org/show_bug.cgi?id=193434
2830
2831         Unreviewed.
2832
2833         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
2834         (WebCore::WHLSL::checkLoops):
2835         (WebCore::WHLSL::findHighZombies): Deleted.
2836         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h:
2837
2838 2019-01-15  Megan Gardner  <megan_gardner@apple.com>
2839
2840         Add Reveal support in iOSMac
2841         https://bugs.webkit.org/show_bug.cgi?id=193408
2842         <rdar://problem/47300699>
2843
2844         Reviewed by Tim Horton.
2845
2846         iOSMac and Reveal are currently not testable.
2847
2848         Add support for the reveal SPI specifically for iOSMac.
2849         Show the controller when called, and implement the delegate to 
2850         correctly re-paint the content with the auto-generated highlight from
2851         the reveal framework.
2852
2853         * Configurations/WebCore.xcconfig:
2854         * editing/cocoa/DictionaryLookup.mm:
2855         (-[WebRevealHighlight initWithHighlightRect:view:]):
2856         (-[WebRevealHighlight setImage:]):
2857         (-[WebRevealHighlight highlightRectsForItem:]):
2858         (-[WebRevealHighlight startHighlightingItem:]):
2859         (-[WebRevealHighlight highlightItem:withProgress:]):
2860         (-[WebRevealHighlight completeHighlightingItem:]):
2861         (-[WebRevealHighlight stopHighlightingItem:]):
2862         (-[WebRevealHighlight highlightRangeChangedForItem:]):
2863         (-[WebRevealHighlight highlighting]):
2864         (-[WebRevealHighlight drawHighlightContentForItem:context:]):
2865         (WebCore::showPopupOrCreateAnimationController):
2866         (WebCore::DictionaryLookup::showPopup):
2867         * editing/mac/DictionaryLookup.h:
2868
2869 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
2870
2871         [WHLSL] Add ending namespace comments to make namespace boundaries more clear
2872         https://bugs.webkit.org/show_bug.cgi?id=193471
2873
2874         Reviewed by Saam Barati.
2875
2876         This patch only adds the comments to the files that are too long to fit on a single screen in my editor.
2877
2878         No new tests because there is no behavior change.
2879
2880         * Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
2881         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
2882         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
2883         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
2884         * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
2885         * Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
2886         * Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
2887         * Modules/webgpu/WHLSL/WHLSLLexer.cpp:
2888         * Modules/webgpu/WHLSL/WHLSLLexer.h:
2889         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
2890         * Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
2891         * Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
2892         * Modules/webgpu/WHLSL/WHLSLNameResolver.h:
2893         * Modules/webgpu/WHLSL/WHLSLParser.h:
2894         * Modules/webgpu/WHLSL/WHLSLProgram.h:
2895         * Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
2896         * Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
2897         * Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
2898         * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
2899         * Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
2900         * Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
2901         * Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
2902         * Modules/webgpu/WHLSL/WHLSLVisitor.h:
2903
2904 2019-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
2905
2906         [WHLSL] Implement the loop checker
2907         https://bugs.webkit.org/show_bug.cgi?id=193434
2908
2909         Reviewed by Saam Barati.
2910
2911         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LoopChecker.mjs into C++.
2912
2913         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
2914         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
2915
2916         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Added.
2917         (WebCore::WHLSL::findHighZombies):
2918         * Modules/webgpu/WHLSL/WHLSLLoopChecker.h: Added.
2919         * Sources.txt:
2920         * WebCore.xcodeproj/project.pbxproj:
2921
2922 2019-01-15  Chris Dumez  <cdumez@apple.com>
2923
2924         Unreviewed, rolling out r239993, r239995, r239997, and
2925         r239999.
2926
2927         Caused assertions under
2928         ViewGestureController::disconnectFromProcess()
2929
2930         Reverted changesets:
2931
2932         "Regression(PSON) View becomes blank after click a cross-site
2933         download link"
2934         https://bugs.webkit.org/show_bug.cgi?id=193361
2935         https://trac.webkit.org/changeset/239993
2936
2937         "Unreviewed iOS build fix after r239993."
2938         https://trac.webkit.org/changeset/239995
2939
2940         "Fix iOS build after r239993"
2941         https://bugs.webkit.org/show_bug.cgi?id=193361
2942         https://trac.webkit.org/changeset/239997
2943
2944         "Unreviewed, revert part of r239997 as it is not needed to fix
2945         the build."
2946         https://trac.webkit.org/changeset/239999
2947
2948 2019-01-15  Alex Christensen  <achristensen@webkit.org>
2949
2950         Stop using CookiesStrategy
2951         https://bugs.webkit.org/show_bug.cgi?id=161106
2952
2953         Reviewed by Don Olmstead and Antti Koivisto.
2954
2955         CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
2956         Instead, use a CookieJar object in the WebProcess.  This has the additional benefit of making it more clear which code
2957         is used in the WebProcess and which code is used in the NetworkProcess.
2958
2959         * Modules/beacon/NavigatorBeacon.cpp:
2960         * Modules/websockets/WebSocketChannel.cpp:
2961         (WebCore::WebSocketChannel::processBuffer):
2962         * Modules/websockets/WebSocketHandshake.cpp:
2963         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
2964         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
2965         * WebCore.xcodeproj/project.pbxproj:
2966         * css/StyleRuleImport.cpp:
2967         (WebCore::StyleRuleImport::requestStyleSheet):
2968         * dom/Document.cpp:
2969         (WebCore::Document::cookie):
2970         (WebCore::Document::setCookie):
2971         * html/HTMLMediaElement.cpp:
2972         (WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
2973         * inspector/agents/InspectorPageAgent.cpp:
2974         (WebCore::InspectorPageAgent::getCookies):
2975         (WebCore::InspectorPageAgent::deleteCookie):
2976         * loader/CookieJar.cpp:
2977         (WebCore::CookieJar::shouldIncludeSecureCookies):
2978         (WebCore::CookieJar::sameSiteInfo):
2979         (WebCore::CookieJar::create):
2980         (WebCore::CookieJar::cookies const):
2981         (WebCore::CookieJar::cookieRequestHeaderFieldProxy):
2982         (WebCore::CookieJar::setCookies):
2983         (WebCore::CookieJar::cookiesEnabled const):
2984         (WebCore::CookieJar::cookieRequestHeaderFieldValue const):
2985         (WebCore::CookieJar::getRawCookies const):
2986         (WebCore::CookieJar::deleteCookie):
2987         (WebCore::shouldIncludeSecureCookies): Deleted.
2988         (WebCore::sameSiteInfo): Deleted.
2989         (WebCore::cookies): Deleted.
2990         (WebCore::cookieRequestHeaderFieldProxy): Deleted.
2991         (WebCore::setCookies): Deleted.
2992         (WebCore::cookiesEnabled): Deleted.
2993         (WebCore::cookieRequestHeaderFieldValue): Deleted.
2994         (WebCore::getRawCookies): Deleted.
2995         (WebCore::deleteCookie): Deleted.
2996         * loader/CookieJar.h:
2997         * loader/EmptyClients.cpp:
2998         (WebCore::pageConfigurationWithEmptyClients):
2999         * loader/ImageLoader.cpp:
3000         (WebCore::ImageLoader::updateFromElement):
3001         * loader/cache/CachedApplicationManifest.cpp:
3002         (WebCore::CachedApplicationManifest::CachedApplicationManifest):
3003         * loader/cache/CachedApplicationManifest.h:
3004         * loader/cache/CachedCSSStyleSheet.cpp:
3005         (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
3006         * loader/cache/CachedCSSStyleSheet.h:
3007         * loader/cache/CachedFont.cpp:
3008         (WebCore::CachedFont::CachedFont):
3009         * loader/cache/CachedFont.h:
3010         * loader/cache/CachedImage.cpp:
3011         (WebCore::CachedImage::CachedImage):
3012         * loader/cache/CachedImage.h:
3013         * loader/cache/CachedRawResource.cpp:
3014         (WebCore::CachedRawResource::CachedRawResource):
3015         * loader/cache/CachedRawResource.h:
3016         * loader/cache/CachedResource.cpp:
3017         (WebCore::CachedResource::CachedResource):
3018         (WebCore::CachedResource::setResponse):
3019         (WebCore::CachedResource::varyHeaderValuesMatch):
3020         * loader/cache/CachedResource.h:
3021         (WebCore::CachedResource::cookieJar const):
3022         * loader/cache/CachedResourceLoader.cpp:
3023         (WebCore::createResource):
3024         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3025         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
3026         (WebCore::CachedResourceLoader::requestResource):
3027         (WebCore::CachedResourceLoader::revalidateResource):
3028         (WebCore::CachedResourceLoader::loadResource):
3029         * loader/cache/CachedResourceLoader.h:
3030         * loader/cache/CachedSVGDocument.cpp:
3031         (WebCore::CachedSVGDocument::CachedSVGDocument):
3032         * loader/cache/CachedSVGDocument.h:
3033         * loader/cache/CachedSVGFont.cpp:
3034         (WebCore::CachedSVGFont::CachedSVGFont):
3035         * loader/cache/CachedSVGFont.h:
3036         * loader/cache/CachedScript.cpp:
3037         (WebCore::CachedScript::CachedScript):
3038         * loader/cache/CachedScript.h:
3039         * loader/cache/CachedTextTrack.cpp:
3040         (WebCore::CachedTextTrack::CachedTextTrack):
3041         * loader/cache/CachedTextTrack.h:
3042         * loader/cache/CachedXSLStyleSheet.cpp:
3043         (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
3044         * loader/cache/CachedXSLStyleSheet.h:
3045         * loader/cache/MemoryCache.cpp:
3046         (WebCore::MemoryCache::addImageToCache):
3047         * loader/cache/MemoryCache.h:
3048         * page/Navigator.cpp:
3049         (WebCore::Navigator::cookieEnabled const):
3050         * page/Page.cpp:
3051         (WebCore::Page::Page):
3052         * page/Page.h:
3053         (WebCore::Page::cookieJar):
3054         * page/PageConfiguration.cpp:
3055         (WebCore::PageConfiguration::PageConfiguration):
3056         * page/PageConfiguration.h:
3057         * platform/CookiesStrategy.h: Removed.
3058         * platform/PlatformStrategies.h:
3059         (WebCore::PlatformStrategies::cookiesStrategy): Deleted.
3060         * platform/network/CacheValidation.cpp:
3061         (WebCore::cookieRequestHeaderFieldValue):
3062         (WebCore::collectVaryingRequestHeaders):
3063         (WebCore::verifyVaryingRequestHeaders):
3064         * platform/network/CacheValidation.h:
3065         * platform/network/CookieRequestHeaderFieldProxy.h:
3066         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
3067         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3068         * platform/network/curl/ResourceHandleCurl.cpp:
3069         * rendering/RenderSnapshottedPlugIn.cpp:
3070         (WebCore::RenderSnapshottedPlugIn::updateSnapshot):
3071         * testing/Internals.cpp:
3072         (WebCore::Internals::getCookies const):
3073
3074 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
3075
3076         Animations should only trigger layer recomposite when necessary
3077         https://bugs.webkit.org/show_bug.cgi?id=193450
3078
3079         Reviewed by Antoine Quint.
3080
3081         Animations only need to trigger compositing updates when their states change in a way
3082         that affects compositing. RenderLayerCompositor::requiresCompositingForAnimation() checks for
3083         running animations of properties that can be accelerated, so this patch fixes the legacy
3084         animation logic to only set 'shouldRecompositeLayer' in TreeResolver::createAnimatedElementUpdate()
3085         when the running state of such an animation changes.
3086
3087         ImplicitAnimation::animate() and KeyframeAnimation::animate() now return OptionSet<AnimateChange>.
3088         This contains information about whether the running state changed, so CompositeAnimation::animate()
3089         asks about whether the running state of an accelerated property changed, and returns this in
3090         the AnimationUpdate result.
3091
3092         * page/animation/AnimationBase.h:
3093         (WebCore::AnimationBase::isPausedState):
3094         (WebCore::AnimationBase::isRunningState):
3095         (WebCore::AnimationBase::inPausedState const):
3096         (WebCore::AnimationBase::inRunningState const):
3097         (WebCore::AnimationBase::isAnimatingProperty const):
3098         * page/animation/CSSAnimationController.h:
3099         * page/animation/CompositeAnimation.cpp:
3100         (WebCore::CompositeAnimation::animate):
3101         * page/animation/ImplicitAnimation.cpp:
3102         (WebCore::ImplicitAnimation::animate):
3103         (WebCore::ImplicitAnimation::affectsAcceleratedProperty const):
3104         * page/animation/ImplicitAnimation.h:
3105         * page/animation/KeyframeAnimation.cpp:
3106         (WebCore::KeyframeAnimation::KeyframeAnimation):
3107         (WebCore::KeyframeAnimation::animate):
3108         (WebCore::KeyframeAnimation::computeStackingContextImpact): Deleted.
3109         * page/animation/KeyframeAnimation.h:
3110         * style/StyleTreeResolver.cpp:
3111         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3112
3113 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
3114
3115         Clean up code related to the updating of Dashboard and touch event regions
3116         https://bugs.webkit.org/show_bug.cgi?id=193460
3117
3118         Reviewed by Zalan Bujtas.
3119
3120         In preparation for layout testing that can count the number of event region
3121         updates, move the code related to updating "annotated" (Dashboard) regions, and
3122         touch event regions into bottleneck functions in Document.
3123         
3124         Updating these two kinds of regions is generally similar, but there are some code paths
3125         that eagerly update annotated regions.
3126
3127         No behavior change.
3128
3129         * dom/Document.cpp:
3130         (WebCore::Document::updateAnnotatedRegions): Moved from FrameView.
3131         (WebCore::Document::invalidateRenderingDependentRegions):
3132         (WebCore::Document::invalidateScrollbarDependentRegions):
3133         (WebCore::Document::updateZOrderDependentRegions):
3134         * dom/Document.h:
3135         (WebCore::Document::setAnnotatedRegionsDirty):
3136         (WebCore::Document::annotatedRegionsDirty const):
3137         (WebCore::Document::hasAnnotatedRegions const):
3138         * page/FrameView.cpp:
3139         (WebCore::FrameView::didLayout):
3140         (WebCore::FrameView::didPaintContents):
3141         (WebCore::FrameView::updateAnnotatedRegions): Deleted.
3142         * page/FrameView.h:
3143         * rendering/RenderElement.cpp: Drive-by header cleanup.
3144         (WebCore::RenderElement::styleWillChange):
3145         * rendering/RenderLayer.cpp:
3146         (WebCore::RenderLayer::scrollTo):
3147         (WebCore::RenderLayer::setHasHorizontalScrollbar):
3148         (WebCore::RenderLayer::setHasVerticalScrollbar):
3149         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
3150         (WebCore::RenderLayer::calculateClipRects const):
3151         * rendering/RenderListBox.cpp:
3152         (WebCore::RenderListBox::setHasVerticalScrollbar):
3153
3154 2019-01-15  David Kilzer  <ddkilzer@apple.com>
3155
3156         Let Xcode have its way with the WebCore project
3157
3158         * WebCore.xcodeproj/project.pbxproj:
3159         - Change the lastKnownFileType for *.gperf and *.idl files from
3160           "file" to "text".
3161         - Resort source files into UUID order.
3162
3163 2019-01-15  Youenn Fablet  <youenn@apple.com>
3164
3165         Correctly handle rotation for local video playback
3166         https://bugs.webkit.org/show_bug.cgi?id=193412
3167
3168         Reviewed by Eric Carlson.
3169
3170         Update AVVideoCaptureSource to compute the size given to settings after rotating the sample.
3171         This ensures computing the size of video elements appropriately.
3172         Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size.
3173         Covered by manual testing as we do not have yet emulation of local capture with rotation.
3174
3175         * platform/mediastream/RealtimeMediaSource.cpp:
3176         (WebCore::RealtimeMediaSource::setIntrinsicSize):
3177         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3178         (WebCore::AVVideoCaptureSource::settings):
3179         (WebCore::AVVideoCaptureSource::computeSampleRotation):
3180
3181 2019-01-15  Chris Dumez  <cdumez@apple.com>
3182
3183         Regression(PSON) View becomes blank after click a cross-site download link
3184         https://bugs.webkit.org/show_bug.cgi?id=193361
3185         <rdar://problem/47099573>
3186
3187         Reviewed by Geoff Garen.
3188
3189         * loader/FrameLoader.cpp:
3190         (WebCore::FrameLoader::commitProvisionalLoad):
3191         When restoring from PageCache, make sure we notify the client that the load was committed
3192         *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
3193         logic in the UIProcess.
3194
3195 2019-01-15  Zalan Bujtas  <zalan@apple.com>
3196
3197         [LFC][Out-of-flow] Ignore bottom when the vertical values are over-constrained
3198         https://bugs.webkit.org/show_bug.cgi?id=193448
3199
3200         Reviewed by Antti Koivisto.
3201
3202         Add missing check. We should only resolve auto values. 
3203
3204         Test: fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
3205
3206         * layout/FormattingContextGeometry.cpp:
3207         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3208
3209 2019-01-15  Devin Rousso  <drousso@apple.com>
3210
3211         Web Inspector: Audit: provide a way to determine whether a give node has event listeners
3212         https://bugs.webkit.org/show_bug.cgi?id=193226
3213         <rdar://problem/46800005>
3214
3215         Reviewed by Joseph Pecoraro.
3216
3217         Test: inspector/audit/run-dom.html
3218
3219         * inspector/InspectorAuditDOMObject.idl:
3220         * inspector/InspectorAuditDOMObject.h:
3221         * inspector/InspectorAuditDOMObject.cpp:
3222         (WebCore::InspectorAuditDOMObject::hasEventListeners): Added.
3223
3224 2019-01-15  Devin Rousso  <drousso@apple.com>
3225
3226         Web Inspector: Audit: provide a way to query for all nodes with a given computed Accessibility role
3227         https://bugs.webkit.org/show_bug.cgi?id=193228
3228         <rdar://problem/46787787>
3229
3230         Reviewed by Joseph Pecoraro.
3231
3232         Test: inspector/audit/run-accessibility.html
3233
3234         * inspector/InspectorAuditAccessibilityObject.idl:
3235         * inspector/InspectorAuditAccessibilityObject.h:
3236         * inspector/InspectorAuditAccessibilityObject.cpp:
3237         (WebCore::accessiblityObjectForNode): Added.
3238         (WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole): Added.
3239
3240 2019-01-15  Simon Fraser  <simon.fraser@apple.com>
3241
3242         Simplify isRunningAnimationOnRenderer()
3243         https://bugs.webkit.org/show_bug.cgi?id=193435
3244
3245         Reviewed by Darin Adler.
3246
3247         All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused,
3248         so we can remove the parameter and just hardcode this behavior.
3249         
3250         This will simplify a later patch that needs to consider state changes between running and not running.
3251         
3252         No behavior change.
3253
3254         * page/animation/AnimationBase.h:
3255         (WebCore::AnimationBase::isAnimatingProperty const):
3256         * page/animation/CSSAnimationController.cpp:
3257         (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
3258         (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
3259         (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
3260         (WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
3261         (WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
3262         * page/animation/CSSAnimationController.h:
3263         * page/animation/CSSAnimationControllerPrivate.h:
3264         * page/animation/CompositeAnimation.cpp:
3265         (WebCore::CompositeAnimation::isAnimatingProperty const):
3266         * page/animation/CompositeAnimation.h:
3267         * rendering/RenderLayer.cpp:
3268         (WebCore::RenderLayer::currentTransform const):
3269         * rendering/RenderLayerBacking.cpp:
3270         (WebCore::RenderLayerBacking::updateGeometry):
3271         * rendering/RenderLayerCompositor.cpp:
3272         (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
3273         (WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
3274
3275 2019-01-15  Antti Koivisto  <antti@apple.com>
3276
3277         Remove unused fields from Scrollbar
3278         https://bugs.webkit.org/show_bug.cgi?id=193442
3279
3280         Reviewed by Zalan Bujtas.
3281
3282         * platform/Scrollbar.cpp:
3283         (WebCore::Scrollbar::Scrollbar):
3284         * platform/Scrollbar.h:
3285         (WebCore::Scrollbar::isCustomScrollbar const):
3286
3287         Make virtual so it doesn't need a bit.
3288
3289         (WebCore::Scrollbar::isAlphaLocked const): Deleted.
3290         (WebCore::Scrollbar::setIsAlphaLocked): Deleted.
3291         * platform/mac/ScrollAnimatorMac.mm:
3292         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
3293         * rendering/RenderScrollbar.cpp:
3294         (WebCore::RenderScrollbar::RenderScrollbar):
3295         * rendering/RenderScrollbar.h:
3296
3297 2019-01-15  Zalan Bujtas  <zalan@apple.com>
3298
3299         [LFC] Use the containing block's padding box to position out-of-flow elements.
3300         https://bugs.webkit.org/show_bug.cgi?id=193431
3301
3302         Reviewed by Antti Koivisto.
3303
3304         If the element has 'position: absolute', the containing block is established by the nearest ancestor
3305         with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:
3306
3307         1. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding
3308         boxes of the first and the last inline boxes generated for that element. In CSS 2.2, if the inline element is split
3309         across multiple lines, the containing block is undefined.
3310
3311         2. Otherwise, the containing block is formed by the padding edge of the ancestor.
3312
3313         This patch covers #2. 
3314
3315         Test: fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
3316
3317         * layout/displaytree/DisplayBox.h:
3318         (WebCore::Display::Box::width const):
3319         (WebCore::Display::Box::height const):
3320         (WebCore::Display::Box::contentBoxTop const):
3321         (WebCore::Display::Box::contentBoxLeft const):
3322         (WebCore::Display::Box::paddingBoxTop const):
3323         (WebCore::Display::Box::paddingBoxLeft const):
3324         (WebCore::Display::Box::paddingBoxBottom const):
3325         (WebCore::Display::Box::paddingBoxRight const):
3326         (WebCore::Display::Box::paddingBoxHeight const):
3327         (WebCore::Display::Box::paddingBoxWidth const):
3328         * page/FrameViewLayoutContext.cpp:
3329         (WebCore::layoutUsingFormattingContext):
3330
3331 2019-01-11  Antoine Quint  <graouts@apple.com>
3332
3333         Support parsing of additional values for the touch-action property
3334         https://bugs.webkit.org/show_bug.cgi?id=193314
3335         <rdar://problem/47176519>
3336
3337         Reviewed by Dean Jackson.
3338
3339         We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.
3340
3341         * WebCore.xcodeproj/project.pbxproj:
3342         * css/CSSComputedStyleDeclaration.cpp:
3343         (WebCore::touchActionFlagsToCSSValue):
3344         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3345         * css/CSSPrimitiveValueMappings.h:
3346         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3347         (WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
3348         (WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
3349         * css/CSSProperties.json:
3350         * css/CSSValueKeywords.in:
3351         * css/StyleBuilderConverter.h:
3352         (WebCore::StyleBuilderConverter::convertTouchAction):
3353         * css/parser/CSSParserFastPaths.cpp:
3354         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3355         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3356         * css/parser/CSSPropertyParser.cpp:
3357         (WebCore::consumeTouchAction):
3358         * dom/Element.cpp:
3359         (WebCore::Element::allowsDoubleTapGesture const):
3360         * platform/TouchAction.h: Added.
3361         * rendering/style/RenderStyle.h:
3362         (WebCore::RenderStyle::touchActions const):
3363         (WebCore::RenderStyle::setTouchActions):
3364         (WebCore::RenderStyle::initialTouchActions):
3365         (WebCore::RenderStyle::touchAction const): Deleted.
3366         (WebCore::RenderStyle::setTouchAction): Deleted.
3367         (WebCore::RenderStyle::initialTouchAction): Deleted.
3368         * rendering/style/RenderStyleConstants.h:
3369         * rendering/style/StyleRareNonInheritedData.cpp:
3370         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3371         (WebCore::StyleRareNonInheritedData::operator== const):
3372         * rendering/style/StyleRareNonInheritedData.h:
3373
3374 2019-01-15  Devin Rousso  <drousso@apple.com>
3375
3376         Web Inspector: Audit: create new IDL type for exposing special functionality in test context
3377         https://bugs.webkit.org/show_bug.cgi?id=193149
3378         <rdar://problem/46801218>
3379
3380         Reviewed by Joseph Pecoraro.
3381
3382         Tests: inspector/audit/run.html
3383                inspector/audit/setup.html
3384                inspector/audit/teardown.html
3385
3386         Create a new `AuditAgent` (and various subclasses for different inspection targets), as well
3387         as `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject` objects that will
3388         be injected into the test function to allow for more advanced testing.
3389
3390         * inspector/InspectorAuditAccessibilityObject.idl: Added.
3391         * inspector/InspectorAuditAccessibilityObject.h: Added.
3392         (WebCore::InspectorAuditAccessibilityObject::create):
3393         * inspector/InspectorAuditAccessibilityObject.cpp: Added.
3394         (WebCore::InspectorAuditAccessibilityObject::InspectorAuditAccessibilityObject):
3395
3396         * inspector/InspectorAuditDOMObject.idl: Added.
3397         * inspector/InspectorAuditDOMObject.h: Added.
3398         (WebCore::InspectorAuditDOMObject::create):
3399         * inspector/InspectorAuditDOMObject.cpp: Added.
3400         (WebCore::InspectorAuditDOMObject::InspectorAuditDOMObject):
3401
3402       &nb