Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-09  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
4         https://bugs.webkit.org/show_bug.cgi?id=193284
5
6         Reviewed by Joseph Pecoraro.
7
8         No newe tests, as this is simply exposes a value.
9
10         * inspector/InspectorFrontendHost.idl:
11         * inspector/InspectorFrontendHost.h:
12         * inspector/InspectorFrontendHost.cpp:
13         (WebCore::InspectorFrontendHost::isBeingInspected): Added.
14
15 2019-01-09  Zalan Bujtas  <zalan@apple.com>
16
17         [LFC][BFC][MarginCollapsing] Add support for peculiar cases.
18         https://bugs.webkit.org/show_bug.cgi?id=192625
19
20         Reviewed by Antti Koivisto.
21
22         Implement some of the more peculiar cases like margin collpasing through multiple boxes etc.
23         Add ~100 new passing cases.
24
25         * layout/FormattingContextGeometry.cpp:
26         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
27         * layout/LayoutState.h:
28         (WebCore::Layout::LayoutState::hasFormattingState const):
29         * layout/MarginTypes.h:
30         * layout/blockformatting/BlockFormattingContext.cpp:
31         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
32         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
33         (WebCore::Layout::hasPrecomputedMarginBefore):
34         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
35         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
36         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
37         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
38         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
39         * layout/blockformatting/BlockFormattingContext.h:
40         (WebCore::Layout::BlockFormattingContext::blockFormattingState const):
41         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
42         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
43         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
44         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): Deleted.
45         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): Deleted.
46         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
47         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
48         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter):
49         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): Deleted.
50         * layout/blockformatting/BlockFormattingState.h:
51         (WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin):
52         (WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const):
53         (WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const):
54         (WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore):
55         (WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore):
56         (WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const):
57         * layout/blockformatting/BlockMarginCollapse.cpp:
58         (WebCore::Layout::hasClearance):
59         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
60         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
61         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
62         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
63         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
64         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
65         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
66         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore):
67         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
68         (WebCore::Layout::computedPositiveAndNegativeMargin):
69         (WebCore::Layout::marginValue):
70         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter):
71         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
72         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
73         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
74         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
75         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
76         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
77         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
78         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): Deleted.
79         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): Deleted.
80         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
81         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
82         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
83         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
84         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): Deleted.
85         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): Deleted.
86         * layout/displaytree/DisplayBox.cpp:
87         (WebCore::Display::Box::Box):
88         * layout/displaytree/DisplayBox.h:
89         (WebCore::Display::Box::hasClearance const):
90         (WebCore::Display::Box::setEstimatedMarginBefore):
91         (WebCore::Display::Box::estimatedMarginBefore const):
92         (WebCore::Display::Box::setHasClearance):
93         (WebCore::Display::Box::invalidateEstimatedMarginBefore):
94         (WebCore::Display::Box::setVerticalMargin):
95         (WebCore::Display::Box::rectWithMargin const):
96         * layout/floats/FloatingContext.cpp:
97         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
98         * layout/inlineformatting/InlineFormattingContext.cpp:
99         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
100
101 2019-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
102
103         REGRESSION(r239156): [FreeType] fixed width, and synthetic bold/italic not correctly applied since r239156
104         https://bugs.webkit.org/show_bug.cgi?id=193276
105
106         Reviewed by Žan Doberšek.
107
108         FontCache::createFontPlatformData() is calling getFontPropertiesFromPattern() with the configure pattern instead
109         of the result one after the match.
110
111         * platform/graphics/freetype/FontCacheFreeType.cpp:
112         (WebCore::FontCache::createFontPlatformData):
113
114 2019-01-08  Dean Jackson  <dino@apple.com>
115
116         Blob references for System Previews don't get a correct file extension
117         https://bugs.webkit.org/show_bug.cgi?id=193268
118         <rdar://problem/47133037>
119
120         Reviewed by Tim Horton.
121
122         Apple platforms don't yet have a mapping from the USD MIME type to
123         file extensions (and we support some non-standard MIME types), which
124         means that downloads from Blob references don't get correctly named.
125
126         Fix this by adding an explicit mapping between System Preview types
127         and ".usdz".
128
129         WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming
130
131         * platform/MIMETypeRegistry.cpp:
132         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since
133         this applies to macOS and iOS now.
134         * platform/MIMETypeRegistry.h:
135         * platform/cocoa/MIMETypeRegistryCocoa.mm:
136         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping
137         for USDZ.
138
139 2019-01-08  Tim Horton  <timothy_horton@apple.com>
140
141         Editable images sometimes don't become focused when tapped
142         https://bugs.webkit.org/show_bug.cgi?id=193259
143         <rdar://problem/47038424>
144
145         Reviewed by Wenson Hsieh.
146
147         Often when tapping an editable image inside an editable text area, the
148         text area's selection will change instead of focusing the editable image.
149
150         No new tests; I have had no luck writing a test that reliably failed 
151         beforehand (the "sometimes" is a problem).
152
153         * html/HTMLImageElement.cpp:
154         (WebCore::HTMLImageElement::defaultEventHandler):
155         * html/HTMLImageElement.h:
156         Override mousedown on editable images, focus the image, and prevent
157         the default behavior.
158
159 2019-01-08  Jiewen Tan  <jiewen_tan@apple.com>
160
161         [WebAuthN] Support U2F HID Authenticators on macOS
162         https://bugs.webkit.org/show_bug.cgi?id=191535
163         <rdar://problem/47102027>
164
165         Reviewed by Brent Fulgham.
166
167         This patch changes U2fCommandConstructor to produce register commands with
168         enforcing test of user presence. Otherwise, authenticators would silently
169         generate credentials. It also renames readFromU2fSignResponse to
170         readU2fSignResponse.
171
172         Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
173                http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html
174                http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
175                http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html
176                http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html
177                http/wpt/webauthn/public-key-credential-get-success-u2f.https.html
178
179         * Modules/webauthn/fido/U2fCommandConstructor.cpp:
180         (fido::WebCore::constructU2fRegisterCommand):
181         * Modules/webauthn/fido/U2fResponseConverter.cpp:
182         (fido::readU2fSignResponse):
183         (fido::readFromU2fSignResponse): Deleted.
184         * Modules/webauthn/fido/U2fResponseConverter.h:
185
186 2019-01-08  Wenson Hsieh  <wenson_hsieh@apple.com>
187
188         [iOS] Dispatch a synthetic mousedown event prior to starting drags
189         https://bugs.webkit.org/show_bug.cgi?id=193229
190         <rdar://problem/46717097>
191
192         Reviewed by Tim Horton.
193
194         Tweaks some drag initiation logic on iOS to actually send a "mousedown" event to the page prior to drag start.
195         This improves drag and drop compatibility with web pages that expect a mousedown to always precede dragging.
196         Additionally, ensure that preventing the "mousedown" event also prevents "dragstart", which matches macOS
197         behavior.
198
199         Test: DragAndDropTests.PreventingMouseDownShouldPreventDragStart
200
201         * page/EventHandler.cpp:
202
203         Make the text drag delay 0 on iOS. This was introduced on iOS when originally bringing up drag and drop, and was
204         made to simply match macOS. However, it doesn't make sense to respect the delay here, since the purpose of this
205         delay is to disambiguate between making a text selection and starting a drag when pressing on text that is
206         already selected; on iOS (including iOSMac), this gesture conflict is already resolved by platform gesture
207         recognizers in the client layer, so there is always no delay between mouse down and drag here.
208
209         * page/ios/EventHandlerIOS.mm:
210
211         Dispatch a mousedown and inspect the value of `m_mouseDownMayStartDrag` when starting a drag on iOS. This brings
212         our behavior closer in line with macOS.
213
214         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
215
216 2019-01-08  Youenn Fablet  <youenn@apple.com>
217
218         service worker fetch handler results in bad referrer
219         https://bugs.webkit.org/show_bug.cgi?id=188248
220         <rdar://problem/47050478>
221
222         Reviewed by Alex Christensen.
223
224         Response sanitization was removing the ReferrerPolicy header from opaque redirect responses.
225         Reduce sanitization of opaque redirect responses to opaque responses and allow Location header.
226         Make sure referrer policy is updated for all load redirections, not only CORS loads.
227
228         Test: http/tests/security/referrer-policy-redirect-link-downgrade.html
229
230         * loader/SubresourceLoader.cpp:
231         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
232         * platform/network/ResourceResponseBase.cpp:
233         (WebCore::isSafeCrossOriginResponseHeader):
234         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
235
236 2019-01-08  Youenn Fablet  <youenn@apple.com>
237
238         IDB storage of Crypto keys does not work in private browsing mode
239         https://bugs.webkit.org/show_bug.cgi?id=193219
240
241         Reviewed by Brady Eidson.
242
243         https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization.
244         This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object.
245
246         To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject.
247         If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject.
248
249         Covered by updated test.
250
251         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
252         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
253         (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
254         * bindings/js/JSDOMGlobalObject.cpp:
255         * bindings/js/JSDOMGlobalObject.h:
256         * bindings/js/JSDOMWrapper.cpp:
257         (WebCore::JSDOMObject::JSDOMObject):
258         * bindings/js/SerializedScriptValue.cpp:
259         (WebCore::CloneSerializer::dumpArrayBufferView):
260         (WebCore::CloneSerializer::toJSArrayBuffer):
261
262 2019-01-08  Justin Fan  <justin_fan@apple.com>
263
264         [WebGPU] Update createRenderPipeline for WebGPUPipelineLayout
265         https://bugs.webkit.org/show_bug.cgi?id=193247
266
267         Reviewed by Dean Jackson.
268
269         Add WebGPUPipelineLayout to WebGPURenderPipeline via WebGPUPipelineDescriptorBase.
270
271         Test: Updated render-pipelines.html to test new functionality.
272
273         * Modules/webgpu/WebGPUDevice.cpp:
274         (WebCore::WebGPUDevice::createRenderPipeline const): Convert WebGPUPipelineLayout to GPUPipelineLayout.
275         * Modules/webgpu/WebGPUPipelineDescriptorBase.h:
276         * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Add layout field.
277         * Modules/webgpu/WebGPUPipelineLayout.h: 
278         (WebCore::WebGPUPipelineLayout::pipelineLayout): Added. Getter.
279         * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Updated from out-of-date version.
280         * platform/graphics/gpu/GPUPipelineLayout.cpp:
281         (WebCore::GPUPipelineLayout::GPUPipelineLayout): Now retains bindGroupLayouts from descriptor.
282         * platform/graphics/gpu/GPUPipelineLayout.h:
283         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Now inherits from GPUPipelineDescriptorBase.
284         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Custom constructor for non-aggregate struct.
285
286 2019-01-08  Chris Dumez  <cdumez@apple.com>
287
288         Prevent cross-site top-level navigations from third-party iframes
289         https://bugs.webkit.org/show_bug.cgi?id=193076
290         <rdar://problem/36074736>
291
292         Reviewed by Alex Christensen.
293
294         Prevent cross-site top-level navigations from third-party iframes if the following conditions are met:
295         1. Its tries to navigate the top-level page cross-site (different eTDL+1)
296         2. The user has never interacted with the third-party iframe or any of its subframes
297
298         This experiment's intent is to block suspicious main-frame navigations by third-party content. The feature
299         is behind a runtime experimental feature flag, on by default.
300
301         Tests: http/tests/security/allow-top-level-navigations-by-third-party-iframes-to-same-origin.html
302                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-previous-user-activation.html
303                http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-user-activation.html
304                http/tests/security/block-top-level-navigations-by-third-party-iframes.html
305
306         * dom/Document.cpp:
307         (WebCore::printNavigationErrorMessage):
308         (WebCore::Document::canNavigate):
309         (WebCore::Document::canNavigateInternal):
310         (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
311         * dom/Document.h:
312         * dom/UserGestureIndicator.cpp:
313         * page/DOMWindow.cpp:
314         (WebCore::DOMWindow::setLocation):
315         * page/DOMWindow.h:
316         * page/Frame.h:
317         * page/Location.cpp:
318         (WebCore::Location::replace):
319         (WebCore::Location::setLocation):
320         * page/Settings.yaml:
321
322 2019-01-08  Alex Christensen  <achristensen@webkit.org>
323
324         Stop using NetworkStorageSession in WebProcess
325         https://bugs.webkit.org/show_bug.cgi?id=193236
326
327         Reviewed by Don Olmstead.
328
329         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
330         and for cookies, which are handled in the NetworkProcess in modern WebKit.
331
332         * loader/CookieJar.cpp:
333         (WebCore::storageSession):
334         * loader/EmptyClients.cpp:
335         * platform/network/NetworkingContext.h:
336         * platform/network/mac/ResourceHandleMac.mm:
337         (WebCore::ResourceHandle::createNSURLConnection):
338         (WebCore::ResourceHandle::start):
339         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
340         (WebCore::ResourceHandle::willSendRequest):
341         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
342         (WebCore::ResourceHandle::receivedCredential):
343
344 2019-01-08  Alex Christensen  <achristensen@webkit.org>
345
346         Unreviewed, rolling out r239727.
347
348         Broke API tests
349
350         Reverted changeset:
351
352         "Stop using NetworkStorageSession in WebProcess"
353         https://bugs.webkit.org/show_bug.cgi?id=193236
354         https://trac.webkit.org/changeset/239727
355
356 2019-01-08  Alex Christensen  <achristensen@webkit.org>
357
358         Stop using NetworkStorageSession in WebProcess
359         https://bugs.webkit.org/show_bug.cgi?id=193236
360
361         Reviewed by Don Olmstead.
362
363         No change in behavior.  Some code was only used for ResourceHandle, which isn't used in modern WebKit,
364         and for cookies, which are handled in the NetworkProcess in modern WebKit.
365
366         * loader/CookieJar.cpp:
367         (WebCore::storageSession):
368         * loader/EmptyClients.cpp:
369         * platform/network/NetworkingContext.h:
370         * platform/network/mac/ResourceHandleMac.mm:
371         (WebCore::ResourceHandle::createNSURLConnection):
372         (WebCore::ResourceHandle::start):
373         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
374         (WebCore::ResourceHandle::willSendRequest):
375         (WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
376         (WebCore::ResourceHandle::receivedCredential):
377
378 2019-01-08  Chris Dumez  <cdumez@apple.com>
379
380         Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow
381         https://bugs.webkit.org/show_bug.cgi?id=193224
382         <rdar://problem/47097726>
383
384         Reviewed by Alex Christensen.
385
386         Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation.
387         When we return to a suspended page, we load the current history item again and it normally properly restores
388         the page from PageCache, even though we load the same history item and the current one and even though the
389         page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache).
390
391         The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would
392         return true because both the source and destination URLs (which are the same) contains a fragment. To address
393         the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is
394         suspended.
395
396         * loader/FrameLoader.cpp:
397         (WebCore::FrameLoader::shouldPerformFragmentNavigation):
398
399 2019-01-08  Alex Christensen  <achristensen@webkit.org>
400
401         Move Windows-specific code from NetworkStorageSessionCFNet.cpp to its own file
402         https://bugs.webkit.org/show_bug.cgi?id=192958
403
404         Reviewed by Yusuke Suzuki.
405
406         This makes it easier to reason about what code is used where.
407
408         * PlatformAppleWin.cmake:
409         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
410         (WebCore::createPrivateStorageSession): Deleted.
411         (WebCore::cookieDomain): Deleted.
412         (WebCore::canonicalCookieTime): Deleted.
413         (WebCore::cookieCreatedTime): Deleted.
414         (WebCore::cookieExpirationTime): Deleted.
415         (WebCore::cookieName): Deleted.
416         (WebCore::cookiePath): Deleted.
417         (WebCore::cookieValue): Deleted.
418         (WebCore::filterCookies): Deleted.
419         (WebCore::copyCookiesForURLWithFirstPartyURL): Deleted.
420         (WebCore::createCookies): Deleted.
421         (WebCore::NetworkStorageSession::setCookiesFromDOM const): Deleted.
422         (WebCore::containsSecureCookies): Deleted.
423         (WebCore::NetworkStorageSession::cookiesForDOM const): Deleted.
424         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Deleted.
425         (WebCore::NetworkStorageSession::cookiesEnabled const): Deleted.
426         (WebCore::NetworkStorageSession::getRawCookies const): Deleted.
427         (WebCore::NetworkStorageSession::deleteCookie const): Deleted.
428         (WebCore::NetworkStorageSession::getHostnamesWithCookies): Deleted.
429         (WebCore::NetworkStorageSession::deleteAllCookies): Deleted.
430         (WebCore::NetworkStorageSession::deleteCookiesForHostnames): Deleted.
431         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince): Deleted.
432         * platform/network/cf/NetworkStorageSessionCFNetWin.cpp: Added.
433         (WebCore::createPrivateStorageSession):
434         (WebCore::NetworkStorageSession::setCookies):
435         (WebCore::cookieDomain):
436         (WebCore::canonicalCookieTime):
437         (WebCore::cookieCreatedTime):
438         (WebCore::cookieExpirationTime):
439         (WebCore::cookieName):
440         (WebCore::cookiePath):
441         (WebCore::cookieValue):
442         (WebCore::filterCookies):
443         (WebCore::copyCookiesForURLWithFirstPartyURL):
444         (WebCore::createCookies):
445         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
446         (WebCore::containsSecureCookies):
447         (WebCore::NetworkStorageSession::cookiesForDOM const):
448         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
449         (WebCore::NetworkStorageSession::cookiesEnabled const):
450         (WebCore::NetworkStorageSession::getRawCookies const):
451         (WebCore::NetworkStorageSession::deleteCookie const):
452         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
453         (WebCore::NetworkStorageSession::deleteAllCookies):
454         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
455         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
456
457 2018-12-19  Antoine Quint  <graouts@apple.com>
458
459         [Web Animations] Compute animation effect timing properties in batch
460         https://bugs.webkit.org/show_bug.cgi?id=192850
461
462         Reviewed by Dean Jackson.
463
464         We remove a host of functions from AnimationEffect that would allow the computation of various timing properties
465         defined by the Web Animations specification: phase, progress, current iteration, etc. Indeed, a lot of these functions
466         would call each other in a chain, and we would re-compute a lot of the earlier properties in those chains several times
467         when doing something like querying the animation progress. Additionally, some functions, such as WebAnimation::computeRelevance()
468         and WebAnimation::timeToNextTick() would yield the computation of several such properties numerous times. All of those
469         functions are called during each animation frame and are ripe for optimizations.
470
471         We now compute all timing properties across two functions:
472         
473         1. the new AnimationEffect::getBasicTiming() which computes the local time, end time, active duration, active time and phase,
474         2. the existing AnimationEffect::getComputedTiming() which now also exposes the phase and simple iteration progress.
475
476         To support this we introduce a new BasicEffectTiming struct to contain the values computed in AnimationEffect::getBasicTiming()
477         and spun the AnimationEffect::Phase struct as AnimationEffectPhase so that it may be used across BasicEffectTiming and
478         ComputedEffectTiming.
479
480         No new test since there is no user-observable change.
481
482         * WebCore.xcodeproj/project.pbxproj:
483         * animation/AnimationEffect.cpp:
484         (WebCore::AnimationEffect::getTiming const):
485         (WebCore::AnimationEffect::getBasicTiming const):
486         (WebCore::AnimationEffect::getComputedTiming const):
487         (WebCore::AnimationEffect::localTime const): Deleted.
488         (WebCore::AnimationEffect::phase const): Deleted.
489         (WebCore::AnimationEffect::activeTime const): Deleted.
490         (WebCore::AnimationEffect::overallProgress const): Deleted.
491         (WebCore::AnimationEffect::simpleIterationProgress const): Deleted.
492         (WebCore::AnimationEffect::currentIteration const): Deleted.
493         (WebCore::AnimationEffect::currentDirection const): Deleted.
494         (WebCore::AnimationEffect::directedProgress const): Deleted.
495         (WebCore::AnimationEffect::transformedProgress const): Deleted.
496         (WebCore::AnimationEffect::iterationProgress const): Deleted.
497         (WebCore::AnimationEffect::getTiming): Deleted.
498         (WebCore::AnimationEffect::getComputedTiming): Deleted.
499         (WebCore::AnimationEffect::endTime const): Deleted.
500         (WebCore::AnimationEffect::activeDuration const): Deleted.
501         * animation/AnimationEffect.h:
502         * animation/AnimationEffectPhase.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
503         * animation/AnimationTimeline.cpp:
504         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
505         * animation/AnimationTimeline.h:
506         * animation/BasicEffectTiming.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
507         * animation/ComputedEffectTiming.h:
508         * animation/DeclarativeAnimation.cpp:
509         (WebCore::DeclarativeAnimation::cancel):
510         (WebCore::DeclarativeAnimation::phaseWithoutEffect const):
511         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
512         * animation/DeclarativeAnimation.h:
513         * animation/KeyframeEffect.cpp:
514         (WebCore::KeyframeEffect::apply):
515         (WebCore::KeyframeEffect::getAnimatedStyle):
516         * animation/WebAnimation.cpp:
517         (WebCore::WebAnimation::effectEndTime const):
518         (WebCore::WebAnimation::computeRelevance):
519         (WebCore::WebAnimation::timeToNextTick const):
520
521 2019-01-07  Youenn Fablet  <youenn@apple.com>
522
523         Crash in SWServer::Connection::resolveRegistrationReadyRequests
524         https://bugs.webkit.org/show_bug.cgi?id=193217
525
526         Reviewed by Chris Dumez.
527
528         As can be seen from the traces, SWServer might clear its connections HashMap in its destructor.
529         This might then trigger calling SWServer::resolveRegistrationReadyRequests.
530         This method is iterating on the connections HashMap which is being cleared.
531         To remove this problem, move the HashMap in a temporary variable and clear the temporary variable.
532
533         * workers/service/server/SWServer.cpp:
534         (WebCore::SWServer::~SWServer):
535
536 2019-01-07  Jer Noble  <jer.noble@apple.com>
537
538         REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53
539         https://bugs.webkit.org/show_bug.cgi?id=193211
540         <rdar://problem/46937412>
541
542         Reviewed by Eric Carlson.
543
544         Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in
545         std::unique_ptrs, and not in Ref or RefPtr.
546
547         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
548         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
549         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
550         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
551
552 2019-01-07  David Kilzer  <ddkilzer@apple.com>
553
554         Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
555         <https://webkit.org/b/193056>
556
557         Reviewed by Alex Christensen.
558
559         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
560         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
561         (-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
562         * platform/network/cf/AuthenticationChallenge.h:
563         - Remove '*' from RetainPtr<> type.
564
565         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
566         (WebCore::cookiesForURL):
567         - Once retainPtr() was changed to return RetainPtr<NSArray>
568           instead of RetainPtr<NSArray *> here, that forced the type of
569           `cookiesPtr` to change as well since
570           Optional<RetainPtr<NSArray>> is not assignable to
571           Optional<RetainPtr<NSArray *>> without further template
572           specialization, which didn't seem useful since
573           Optional<RetainPtr<>> variable types are rarely used.
574
575 2019-01-07  Devin Rousso  <drousso@apple.com>
576
577         Web Inspector: extend XHR breakpoints to work with fetch
578         https://bugs.webkit.org/show_bug.cgi?id=185843
579         <rdar://problem/40431027>
580
581         Reviewed by Matt Baker.
582
583         Test: inspector/dom-debugger/url-breakpoints.html
584
585         * Modules/fetch/FetchResponse.cpp:
586         (WebCore::FetchResponse::fetch):
587
588         * inspector/InspectorInstrumentation.h:
589         (WebCore::InspectorInstrumentation::willFetch): Added.
590         * inspector/InspectorInstrumentation.cpp:
591         (WebCore::InspectorInstrumentation::willFetchImpl): Added.
592
593         * inspector/agents/InspectorDOMDebuggerAgent.h:
594         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
595         (WebCore::InspectorDOMDebuggerAgent::disable):
596         (WebCore::InspectorDOMDebuggerAgent::discardBindings):
597         (WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): Added.
598         (WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): Added.
599         (WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): Added.
600         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
601         (WebCore::InspectorDOMDebuggerAgent::willFetch): Added.
602         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Deleted.
603         (WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint): Deleted.
604
605 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
606
607         Cleanup AudioTrackPrivateMediaStreamCocoa
608         https://bugs.webkit.org/show_bug.cgi?id=193208
609         <rdar://problem/42225870>
610
611         Reviewed by Youenn Fablet.
612
613         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
614         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
615         output format descriptions after stopping the audio unit.
616
617 2019-01-07  Devin Rousso  <drousso@apple.com>
618
619         Web Inspector: Network: show secure connection details per-request
620         https://bugs.webkit.org/show_bug.cgi?id=191539
621         <rdar://problem/45979891>
622
623         Reviewed by Joseph Pecoraro.
624
625         Test: http/tests/inspector/network/resource-security-connection.html
626
627         * platform/network/NetworkLoadMetrics.h:
628         (WebCore::NetworkLoadMetrics:isolatedCopy):
629         (WebCore::NetworkLoadMetrics:clearNonTimingData):
630         (WebCore::NetworkLoadMetrics:operator==):
631         (WebCore::NetworkLoadMetrics:encode):
632         (WebCore::NetworkLoadMetrics:decode):
633
634         * inspector/agents/InspectorNetworkAgent.cpp:
635         (WebCore::InspectorNetworkAgent::buildObjectForMetrics):
636
637 2019-01-07  Eric Carlson  <eric.carlson@apple.com>
638
639         Deactivate audio session whenever possible
640         https://bugs.webkit.org/show_bug.cgi?id=193188
641         <rdar://problem/42678977>
642
643         Reviewed by Jer Noble.
644
645         Test: media/deactivate-audio-session.html
646
647         * platform/audio/AudioSession.cpp:
648         (WebCore::AudioSession::tryToSetActive):
649         (WebCore::AudioSession::tryToSetActiveInternal):
650         * platform/audio/AudioSession.h:
651         (WebCore::AudioSession::isActive const):
652
653         * platform/audio/PlatformMediaSessionManager.cpp:
654         (WebCore::PlatformMediaSessionManager::removeSession):
655         (WebCore::deactivateAudioSession):
656         (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
657         (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
658         * platform/audio/PlatformMediaSessionManager.h:
659
660         * platform/audio/ios/AudioSessionIOS.mm:
661         (WebCore::AudioSession::tryToSetActiveInternal):
662         (WebCore::AudioSession::tryToSetActive): Deleted.
663
664         * platform/audio/mac/AudioSessionMac.cpp:
665         (WebCore::AudioSession::tryToSetActiveInternal):
666         (WebCore::AudioSession::tryToSetActive): Deleted.
667
668         * testing/Internals.cpp:
669         (WebCore::Internals::audioSessionActive const):
670         * testing/Internals.h:
671         * testing/Internals.idl:
672
673 2019-01-07  David Kilzer  <ddkilzer@apple.com>
674
675         PlatformECKey should use a std::unique_ptr
676         <https://webkit.org/b/193170>
677
678         Reviewed by Brent Fulgham.
679
680         Broadly:
681         - Switch from using raw pointers to using std::unique_ptr<> to
682           hold PlatformECKey.
683         - Introduce PlatformECKeyContainer type to handle different
684           std::unique_ptr<> types on each platform.
685         - Get rid of custom CryptoKeyEC destructors since the
686           std::unique_ptr<> handles that with a Deleter.
687         - Initialize stack variables to nullptr.
688
689         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
690         (WebCore::CryptoKeyEC::keySizeInBits const):
691         (WebCore::CryptoKeyEC::platformGeneratePair):
692         (WebCore::CryptoKeyEC::platformImportRaw):
693         (WebCore::CryptoKeyEC::platformImportJWKPublic):
694         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
695         (WebCore::CryptoKeyEC::platformImportSpki):
696         (WebCore::CryptoKeyEC::platformImportPkcs8):
697         (WebCore::CryptoKeyEC::platformExportRaw const):
698         (WebCore::CryptoKeyEC::platformAddFieldElements const):
699         (WebCore::CryptoKeyEC::platformExportSpki const):
700         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
701         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
702         * crypto/keys/CryptoKeyEC.cpp:
703         (WebCore::CryptoKeyEC::CryptoKeyEC):
704         * crypto/keys/CryptoKeyEC.h:
705         (WebCore::CCECCryptorRefDeleter::operator() const):
706         * crypto/mac/CryptoKeyECMac.cpp:
707         (WebCore::CryptoKeyEC::keySizeInBits const):
708         (WebCore::CryptoKeyEC::platformGeneratePair):
709         (WebCore::CryptoKeyEC::platformImportRaw):
710         (WebCore::CryptoKeyEC::platformExportRaw const):
711         (WebCore::CryptoKeyEC::platformImportJWKPublic):
712         (WebCore::CryptoKeyEC::platformImportJWKPrivate):
713         (WebCore::CryptoKeyEC::platformAddFieldElements const):
714         (WebCore::CryptoKeyEC::platformImportSpki):
715         (WebCore::CryptoKeyEC::platformExportSpki const):
716         (WebCore::CryptoKeyEC::platformImportPkcs8):
717         (WebCore::CryptoKeyEC::platformExportPkcs8 const):
718         (WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
719
720 2019-01-07  Antti Koivisto  <antti@apple.com>
721
722         UI process side scrollbars for UI side compositing on Mac
723         https://bugs.webkit.org/show_bug.cgi?id=193106
724
725         Reviewed by Tim Horton.
726
727         * page/FrameView.cpp:
728         (WebCore::FrameView::paintScrollCorner):
729         * page/scrolling/AsyncScrollingCoordinator.cpp:
730         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
731
732         Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
733
734         * page/scrolling/ScrollingCoordinator.cpp:
735         (WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
736         (WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
737         * page/scrolling/ScrollingCoordinator.h:
738         (WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
739         (WebCore::ScrollableAreaParameters::operator== const):
740         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
741         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
742         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
743         * page/scrolling/ScrollingStateFrameScrollingNode.h:
744         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
745         * page/scrolling/ScrollingTreeScrollingNode.h:
746         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
747         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
748         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
749         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
750         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
751         * platform/ScrollableArea.cpp:
752         (WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
753
754         Factor into a function as this is used in several places.
755
756         * platform/ScrollableArea.h:
757         * platform/mac/NSScrollerImpDetails.h:
758         * platform/mac/ScrollAnimatorMac.mm:
759         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
760         * platform/mac/ScrollbarThemeMac.h:
761
762 2019-01-07  Wenson Hsieh  <wenson_hsieh@apple.com>
763
764         Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
765         https://bugs.webkit.org/show_bug.cgi?id=193180
766         <rdar://problem/45971041>
767
768         Reviewed by Tim Horton.
769
770         Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
771         container that is also empty. See WebKit ChangeLog for more details.
772
773         Test:   editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
774                 editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
775
776         * rendering/RenderObject.cpp:
777         (WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
778         (WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
779         * rendering/RenderObject.h:
780
781 2019-01-07  Zalan Bujtas  <zalan@apple.com>
782
783         [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
784         https://bugs.webkit.org/show_bug.cgi?id=193183
785
786         Reviewed by Antti Koivisto.
787
788         * layout/FormattingContext.cpp:
789         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
790         * layout/FormattingContextGeometry.cpp:
791         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
792         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
793         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
794         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
795         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
796         * layout/LayoutUnits.h:
797         * layout/blockformatting/BlockFormattingContext.cpp:
798         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
799         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
800         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
801         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
802         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
803         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
804         * layout/inlineformatting/InlineFormattingContext.cpp:
805         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
806
807 2019-01-07  Zalan Bujtas  <zalan@apple.com>
808
809         [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
810         https://bugs.webkit.org/show_bug.cgi?id=193181
811
812         Reviewed by Antti Koivisto.
813
814         This is in preparation to share margin collapsing across all boxes in block formatting context.
815
816         * layout/blockformatting/BlockFormattingContext.h:
817         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
818         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
819         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
820         * layout/blockformatting/BlockMarginCollapse.cpp:
821         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
822         (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
823         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
824         (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
825         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
826         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
827         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
828         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
829         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
830         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
831         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
832         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
833         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
834         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
835         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
836         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
837         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
838         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
839         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
840         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
841         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
842         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
843         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
844         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
845         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
846         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
847         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
848         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
849         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
850         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
851         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
852         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
853
854 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
855
856         [WPE] Use Widget bounds for PlatformScreen rectangle information
857         https://bugs.webkit.org/show_bug.cgi?id=193190
858
859         Reviewed by Philippe Normand.
860
861         Provide a better screen area estimate in screenRect() and
862         screenAvailableRect() return values than the current 1240x640 value by
863         using the Widget's bounds rectangle.
864
865         This approach is only factually correct when the Widget-associated view
866         is displayed in fullscreen, but it provides a better estimate even when
867         displayed in any other case as well. WPE doesn't provide specific API
868         that could enable the embedding environment to provide this information.
869
870         * platform/wpe/PlatformScreenWPE.cpp:
871         (WebCore::screenRect): Return bounds of the Widget object.
872         (WebCore::screenAvailableRect): Relay the call to screenRect().
873
874 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
875
876         Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
877         https://bugs.webkit.org/show_bug.cgi?id=193189
878
879         Reviewed by Philippe Normand.
880
881         The transform getter methods on the Gradient and Pattern classes both
882         return const references to the transform objects, and don't modify any
883         internal state. They should be marked const accordingly, allowing
884         invocations of these two methods through const references to Gradient
885         and Pattern objects.
886
887         * platform/graphics/Gradient.h:
888         (WebCore::Gradient::gradientSpaceTransform): Now const.
889         * platform/graphics/Pattern.h:
890         (WebCore::Pattern::patternSpaceTransform): Now const.
891
892 2019-01-07  Zan Dobersek  <zdobersek@igalia.com>
893
894         REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
895         https://bugs.webkit.org/show_bug.cgi?id=193187
896
897         Reviewed by Philippe Normand.
898
899         * platform/graphics/ImageSource.cpp:
900         (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
901         setEncodedDataStatusChangeCallback() method when the returned
902         ImageDecoder object is null.
903
904 2019-01-06  Zan Dobersek  <zdobersek@igalia.com>
905
906         [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
907         https://bugs.webkit.org/show_bug.cgi?id=193133
908
909         Reviewed by Michael Catanzaro.
910
911         Move the CoordinatedGraphics-specific files under
912         page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
913         with renaming the files and classes accordingly. Implementation will
914         only depend on the Nicosia-specific layer structure and is not specific
915         to the CoordinatedGraphics system.
916
917         * PlatformPlayStation.cmake:
918         * SourcesGTK.txt:
919         * SourcesWPE.txt:
920         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
921         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
922         * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
923         * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
924         * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
925         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
926         * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
927         * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
928         * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
929         * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
930         * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
931         * platform/TextureMapper.cmake:
932
933 2019-01-06  Jiewen Tan  <jiewen_tan@apple.com>
934
935         [WebAuthN] Import U2F command/response converters from Chromium
936         https://bugs.webkit.org/show_bug.cgi?id=193150
937         <rdar://problem/47054028>
938
939         Reviewed by Brent Fulgham.
940
941         This patch imports Chromium's U2F command/response converters:
942         https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
943         1. It directly imports the following files and suit them to WebKit's coding style:
944         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
945         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
946         https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
947         2. It gathers the following methods into U2fResponseConverter:
948         AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
949         AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
950         3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
951
952         Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
953         and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
954
955         Covered by API tests.
956
957         * Modules/webauthn/AuthenticatorCoordinator.cpp:
958         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
959         * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
960         * Modules/webauthn/WebAuthenticationUtils.cpp: Added.
961         (WebCore::convertBytesToVector):
962         (WebCore::produceRpIdHash):
963         (WebCore::encodeES256PublicKeyAsCBOR):
964         (WebCore::buildAttestedCredentialData):
965         (WebCore::buildAuthData):
966         (WebCore::buildAttestationObject):
967         * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
968         * Modules/webauthn/fido/DeviceResponseConverter.cpp:
969         (fido::getCredentialId):
970         (fido::readCTAPGetInfoResponse):
971         * Modules/webauthn/fido/FidoConstants.h:
972         * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
973         (fido::WebCore::constructU2fRegisterCommand):
974         (fido::WebCore::constructU2fSignCommand):
975         (fido::isConvertibleToU2fRegisterCommand):
976         (fido::isConvertibleToU2fSignCommand):
977         (fido::convertToU2fRegisterCommand):
978         (fido::convertToU2fCheckOnlySignCommand):
979         (fido::convertToU2fSignCommand):
980         (fido::constructBogusU2fRegistrationCommand):
981         * Modules/webauthn/fido/U2fCommandConstructor.h: Added.
982         * Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
983         (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
984         (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
985         (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
986         (fido::WebCore::parseX509Length):
987         (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
988         (fido::readU2fRegisterResponse):
989         (fido::readFromU2fSignResponse):
990         * Modules/webauthn/fido/U2fResponseConverter.h: Added.
991         * Modules/webgpu/WebGPUCommandBuffer.cpp:
992         * Sources.txt:
993         * WebCore.xcodeproj/project.pbxproj:
994
995 2019-01-06  David Kilzer  <ddkilzer@apple.com>
996
997         Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
998         <https://webkit.org/b/193177>
999         <rdar://problem/47072196>
1000
1001         Reviewed by Saam Barati.
1002
1003         * crypto/mac/CryptoKeyRSAMac.cpp:
1004         (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
1005         raw pointers to heap-allocated __block variables to hold the
1006         WTF::Function objects until they are consumed within the block
1007         passed to dispatch_async().  The __block variables act like
1008         captured variables in a C++ lambda and have the same lifetime as
1009         the block that they are captured in.  Note that we would have to
1010         convert the source file from C++ to Objective-C++ to use a C++
1011         lambda functor with dispatch_async(), which creates its own
1012         issue because the comipiler requires a copy constructor to
1013         convert the C++ lambda to a block functor, but the copy
1014         constructor for the C++ lambda is implicitly deleted because the
1015         WTF::Function copy constructor is explicitly deleted.  Whew!
1016
1017 2019-01-06  Pablo Saavedra  <psaavedra@igalia.com>
1018
1019         [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
1020         https://bugs.webkit.org/show_bug.cgi?id=193174
1021
1022         Reviewed by Michael Catanzaro.
1023
1024         * page/Page.cpp:
1025         (WebCore::Page::stopAllMediaPlayback):
1026         (WebCore::Page::suspendAllMediaPlayback):
1027         (WebCore::Page::resumeAllMediaPlayback):
1028
1029 2019-01-05  David Kilzer  <ddkilzer@apple.com>
1030
1031         Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
1032         <https://webkit.org/b/193154>
1033         <rdar://problem/47052993>
1034
1035         Reviewed by Brent Fulgham.
1036
1037         Broadly:
1038         - Fix leaks by switching from using raw pointers to using
1039           std::unique_ptr<>.
1040         - Introduce PlatformRSAKeyContainer type to handle different
1041           std::unique_ptr<> on each platform.
1042         - Get rid of custom CryptoKeyRSA destructors since the
1043           std::unique_ptr<> handles that with a Deleter.
1044         - Initialize stack variables to nullptr.
1045
1046         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1047         (WebCore::CryptoKeyRSA::create):
1048         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1049         (WebCore::CryptoKeyRSA::keySizeInBits const):
1050         (WebCore::CryptoKeyRSA::generatePair):
1051         (WebCore::CryptoKeyRSA::importSpki):
1052         (WebCore::CryptoKeyRSA::importPkcs8):
1053         (WebCore::CryptoKeyRSA::exportSpki const):
1054         (WebCore::CryptoKeyRSA::exportPkcs8 const):
1055         (WebCore::CryptoKeyRSA::algorithm const):
1056         (WebCore::CryptoKeyRSA::exportData const):
1057         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
1058         * crypto/keys/CryptoKeyRSA.h:
1059         (WebCore::CCRSACryptorRefDeleter::operator() const):
1060         * crypto/mac/CryptoKeyRSAMac.cpp:
1061         (WebCore::getPublicKeyComponents):
1062         (WebCore::getPrivateKeyComponents):
1063         (WebCore::CryptoKeyRSA::CryptoKeyRSA):
1064         (WebCore::CryptoKeyRSA::create):
1065         (WebCore::CryptoKeyRSA::exportData const):
1066         (WebCore::CryptoKeyRSA::generatePair):
1067         (WebCore::CryptoKeyRSA::importSpki):
1068         (WebCore::CryptoKeyRSA::importPkcs8):
1069         (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
1070
1071 2019-01-05  Zalan Bujtas  <zalan@apple.com>
1072
1073         Incorrect clipping across compositing boundary.
1074         https://bugs.webkit.org/show_bug.cgi?id=193172
1075         <rdar://problem/44693008>
1076
1077         Reviewed by Simon Fraser.
1078
1079         Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
1080
1081         The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
1082         clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
1083         For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
1084         but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
1085         It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root. 
1086
1087         Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
1088
1089         * rendering/RenderLayer.cpp:
1090         (WebCore::RenderLayer::calculateClipRects const):
1091
1092 2019-01-05  Youenn Fablet  <youenn@apple.com>
1093
1094         Service Worker fetch should obey its referrer policy
1095         https://bugs.webkit.org/show_bug.cgi?id=193152
1096
1097         Reviewed by Chris Dumez.
1098
1099         Pass referrer policy retrieved when fetching the service worker script to the SWServer.
1100         The SWServer then stores it persistently and sends it to the manager creating service workers.
1101         This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
1102
1103         Covered by rebased test.
1104
1105         * workers/WorkerScriptLoader.cpp:
1106         (WebCore::WorkerScriptLoader::didReceiveResponse):
1107         * workers/WorkerScriptLoader.h:
1108         (WebCore::WorkerScriptLoader::referrerPolicy const):
1109         * workers/service/SWClientConnection.cpp:
1110         (WebCore::SWClientConnection::failedFetchingScript):
1111         * workers/service/ServiceWorkerContainer.cpp:
1112         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
1113         * workers/service/ServiceWorkerContainer.h:
1114         * workers/service/ServiceWorkerContextData.cpp:
1115         (WebCore::ServiceWorkerContextData::isolatedCopy const):
1116         * workers/service/ServiceWorkerContextData.h:
1117         (WebCore::ServiceWorkerContextData::encode const):
1118         (WebCore::ServiceWorkerContextData::decode):
1119         * workers/service/ServiceWorkerFetchResult.h:
1120         (WebCore::ServiceWorkerFetchResult::encode const):
1121         (WebCore::ServiceWorkerFetchResult::decode):
1122         * workers/service/ServiceWorkerJob.cpp:
1123         (WebCore::ServiceWorkerJob::notifyFinished):
1124         * workers/service/ServiceWorkerJobClient.h:
1125         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1126         (WebCore::createPageForServiceWorker):
1127         * workers/service/server/RegistrationDatabase.cpp:
1128         (WebCore::recordsTableSchema):
1129         (WebCore::RegistrationDatabase::doPushChanges):
1130         (WebCore::RegistrationDatabase::importRecords):
1131         * workers/service/server/SWServer.cpp:
1132         (WebCore::SWServer::addRegistrationFromStore):
1133         (WebCore::SWServer::updateWorker):
1134         (WebCore::SWServer::installContextData):
1135         * workers/service/server/SWServer.h:
1136         * workers/service/server/SWServerJobQueue.cpp:
1137         (WebCore::SWServerJobQueue::scriptFetchFinished):
1138         * workers/service/server/SWServerWorker.cpp:
1139         (WebCore::SWServerWorker::SWServerWorker):
1140         (WebCore::SWServerWorker::contextData const):
1141         * workers/service/server/SWServerWorker.h:
1142
1143 2019-01-04  Simon Fraser  <simon.fraser@apple.com>
1144
1145         Factor legacy WK1 code for fixed and scrolling layers into their own helper class
1146         https://bugs.webkit.org/show_bug.cgi?id=193165
1147
1148         Reviewed by Frédéric Wang.
1149
1150         RenderLayerCompositor has some code to handle registration of viewport-constrained
1151         and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
1152         into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
1153         allocated for iOS WK1.
1154         
1155         iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
1156         we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
1157         (i.e. WK1).
1158         
1159         * page/ChromeClient.h:
1160         * rendering/RenderLayerCompositor.cpp:
1161         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
1162         (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
1163         (WebCore::RenderLayerCompositor::didFlushChangesForLayer):
1164         (WebCore::RenderLayerCompositor::setIsInWindow):
1165         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
1166         destroy the render tree of pages in the page cache, so we should never hit this code path.
1167         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
1168         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
1169         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
1170         (WebCore::scrollbarHasDisplayNone):
1171         (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
1172         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
1173         (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
1174         (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
1175         (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
1176         (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
1177         (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
1178         (WebCore::updateScrollingLayerWithClient): Deleted.
1179         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
1180         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
1181         (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
1182         (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
1183         * rendering/RenderLayerCompositor.h:
1184         (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
1185         * workers/service/ServiceWorkerContainer.cpp:
1186         (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
1187
1188 2019-01-05  Zalan Bujtas  <zalan@apple.com>
1189
1190         [LFC] VerticalMargin should only have the used values.
1191         https://bugs.webkit.org/show_bug.cgi?id=193168
1192
1193         Reviewed by Antti Koivisto.
1194
1195         Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
1196         ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
1197         collapsed (optional) and the non-collapsed values.
1198
1199         * layout/FormattingContext.cpp:
1200         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
1201         * layout/FormattingContext.h:
1202         * layout/FormattingContextGeometry.cpp:
1203         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
1204         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1205         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1206         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
1207         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1208         (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
1209         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
1210         * layout/FormattingContextQuirks.cpp:
1211         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
1212         * layout/LayoutUnits.h:
1213         * layout/MarginTypes.h:
1214         (WebCore::Layout::UsedVerticalMargin::before const):
1215         (WebCore::Layout::UsedVerticalMargin::after const):
1216         (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
1217         (WebCore::Layout::UsedVerticalMargin::collapsedValues const):
1218         (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
1219         (WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
1220         (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
1221         (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
1222         (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
1223         (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
1224         (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
1225         (WebCore::Layout::VerticalMargin::usedValues const): Deleted.
1226         * layout/blockformatting/BlockFormattingContext.cpp:
1227         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1228         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1229         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1230         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
1231         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
1232         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
1233         * layout/blockformatting/BlockMarginCollapse.cpp:
1234         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
1235         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
1236         * layout/displaytree/DisplayBox.h:
1237         (WebCore::Display::Box::setVerticalMargin):
1238         (WebCore::Display::Box::verticalMargin const):
1239         (WebCore::Display::Box::marginBefore const):
1240         (WebCore::Display::Box::marginAfter const):
1241         * layout/floats/FloatingContext.cpp:
1242         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
1243         * layout/inlineformatting/InlineFormattingContext.cpp:
1244         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1245
1246 2019-01-04  Daniel Bates  <dabates@apple.com>
1247
1248         REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
1249         https://bugs.webkit.org/show_bug.cgi?id=192996
1250         <rdar://problem/46573552>
1251
1252         Reviewed by Simon Fraser.
1253
1254         Only scroll a text field if its inner text size changes and it is the currently active and
1255         focused element on the page.
1256
1257         Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
1258
1259         * rendering/RenderTextControlSingleLine.cpp:
1260         (WebCore::RenderTextControlSingleLine::layout):
1261
1262 2019-01-04  Alex Christensen  <achristensen@webkit.org>
1263
1264         Progress towards fixing Mac CMake build
1265         https://bugs.webkit.org/show_bug.cgi?id=193105
1266
1267         Reviewed by Don Olmstead.
1268
1269         * PlatformMac.cmake:
1270         * Sources.txt:
1271         * SourcesCocoa.txt:
1272         * WebCore.xcodeproj/project.pbxproj:
1273         * platform/graphics/gpu/GPURenderPassEncoder.h:
1274
1275 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1276
1277         [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
1278         https://bugs.webkit.org/show_bug.cgi?id=189608
1279         <rdar://problem/44473299>
1280
1281         Reviewed by Simon Fraser.
1282
1283         When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
1284
1285         Covered by fast/frames/invalid-frameset.html.
1286
1287         * rendering/RenderFrameSet.cpp:
1288         (WebCore::clearSiblingSubtrees):
1289         (WebCore::RenderFrameSet::positionFrames):
1290         (WebCore::RenderFrameSet::positionFramesWithFlattening):
1291
1292 2019-01-04  Youenn Fablet  <youenn@apple.com>
1293
1294         [Fetch API] Implement abortable fetch
1295         https://bugs.webkit.org/show_bug.cgi?id=174980
1296         <rdar://problem/46861402>
1297
1298         Reviewed by Chris Dumez.
1299
1300         Add an AbortSignal to FetchRequest.
1301
1302         Add support for AbortSignal algorithm.
1303         The fetch request signal is added an algorithm to abort the fetch.
1304         Update clone algorithm to let signal of the cloned request be following the origin request.
1305
1306         Update ReadableStream error handling to return an exception instead of a string.
1307         This allows passing an AbortError instead of a TypeError as previously done.
1308
1309         Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
1310         The latter is used for passing the error from service worker back to the page.
1311         The former is used to pass it to ReadableStream or body accessors.
1312
1313         Covered by enabled tests.
1314
1315         * Modules/cache/DOMCache.cpp:
1316         (WebCore::DOMCache::put):
1317         * Modules/fetch/FetchBody.cpp:
1318         (WebCore::FetchBody::consumeAsStream):
1319         (WebCore::FetchBody::loadingFailed):
1320         * Modules/fetch/FetchBody.h:
1321         * Modules/fetch/FetchBodyConsumer.cpp:
1322         (WebCore::FetchBodyConsumer::loadingFailed):
1323         * Modules/fetch/FetchBodyConsumer.h:
1324         * Modules/fetch/FetchBodyOwner.cpp:
1325         (WebCore::FetchBodyOwner::arrayBuffer):
1326         (WebCore::FetchBodyOwner::blob):
1327         (WebCore::FetchBodyOwner::cloneBody):
1328         (WebCore::FetchBodyOwner::formData):
1329         (WebCore::FetchBodyOwner::json):
1330         (WebCore::FetchBodyOwner::text):
1331         (WebCore::FetchBodyOwner::loadBlob):
1332         (WebCore::FetchBodyOwner::blobLoadingFailed):
1333         (WebCore::FetchBodyOwner::consumeBodyAsStream):
1334         (WebCore::FetchBodyOwner::setLoadingError):
1335         * Modules/fetch/FetchBodyOwner.h:
1336         (WebCore::FetchBodyOwner::loadingError const):
1337         (WebCore::FetchBodyOwner::loadingException const):
1338         * Modules/fetch/FetchBodySource.cpp:
1339         (WebCore::FetchBodySource::error):
1340         * Modules/fetch/FetchBodySource.h:
1341         * Modules/fetch/FetchRequest.cpp:
1342         (WebCore::FetchRequest::initializeWith):
1343         (WebCore::FetchRequest::clone):
1344         * Modules/fetch/FetchRequest.h:
1345         (WebCore::FetchRequest::FetchRequest):
1346         * Modules/fetch/FetchRequest.idl:
1347         * Modules/fetch/FetchRequestInit.h:
1348         (WebCore::FetchRequestInit::hasMembers const):
1349         * Modules/fetch/FetchRequestInit.idl:
1350         * Modules/fetch/FetchResponse.cpp:
1351         (WebCore::FetchResponse::clone):
1352         (WebCore::FetchResponse::fetch):
1353         (WebCore::FetchResponse::BodyLoader::didFail):
1354         * Modules/fetch/FetchResponse.h:
1355         * bindings/js/ReadableStreamDefaultController.h:
1356         (WebCore::ReadableStreamDefaultController::error):
1357         * dom/AbortSignal.cpp:
1358         (WebCore::AbortSignal::abort):
1359         (WebCore::AbortSignal::follow):
1360         * dom/AbortSignal.h:
1361
1362 2019-01-04  Brent Fulgham  <bfulgham@apple.com>
1363
1364         Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
1365         https://bugs.webkit.org/show_bug.cgi?id=193155
1366         <rdar://problem/40230982>
1367
1368         Reviewed by Chris Dumez.
1369
1370         Test: fast/loader/comment-only-javascript-url.html
1371
1372         Make a special case for URLs beginning with 'javascript:'. We should always
1373         treat these as JS URLs, even if the content contained within the URL
1374         string might match other parts of the URL parsing spec.
1375
1376         * html/URLUtils.h:
1377         (WebCore::URLUtils<T>::protocol const):
1378
1379 2019-01-04  Jer Noble  <jer.noble@apple.com>
1380
1381         [WebKitLegacy] Media playback pauses on scroll
1382         https://bugs.webkit.org/show_bug.cgi?id=192829
1383
1384         Reviewed by Eric Carlson.
1385
1386         New API tests:
1387             WebKitLegacy.ScrollingDoesNotPauseMedia
1388             WKWebView.StopAllMediaPlayback
1389             WKWebView.SuspendResumeAllMediaPlayback
1390
1391         Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
1392         video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
1393         suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
1394
1395         * dom/Document.cpp:
1396         (WebCore::Document::~Document):
1397         (WebCore::Document::stopAllMediaPlayback):
1398         (WebCore::Document::suspendAllMediaPlayback):
1399         (WebCore::Document::resumeAllMediaPlayback):
1400         * dom/Document.h:
1401         * html/HTMLMediaElement.cpp:
1402         (WebCore::HTMLMediaElement::HTMLMediaElement):
1403         (WebCore::HTMLMediaElement::parseAttribute):
1404         (WebCore::HTMLMediaElement::didFinishInsertingNode):
1405         (WebCore::HTMLMediaElement::setSrcObject):
1406         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1407         (WebCore::HTMLMediaElement::suspend):
1408         (WebCore::HTMLMediaElement::resume):
1409         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
1410         * html/HTMLMediaElement.h:
1411         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
1412         * html/MediaElementSession.cpp:
1413         (WebCore::MediaElementSession::playbackPermitted const):
1414         * page/Page.cpp:
1415         (WebCore::Page::stopAllMediaPlayback):
1416         (WebCore::Page::suspendAllMediaPlayback):
1417         (WebCore::Page::resumeAllMediaPlayback):
1418         * page/Page.h:
1419         (WebCore::Page::mediaPlaybackIsSuspended):
1420         * platform/audio/PlatformMediaSession.h:
1421         * platform/audio/PlatformMediaSessionManager.cpp:
1422         (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
1423         (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
1424         * platform/audio/PlatformMediaSessionManager.h:
1425
1426 2019-01-04  Chris Dumez  <cdumez@apple.com>
1427
1428         Add support for toggling device orientation API support per site
1429         https://bugs.webkit.org/show_bug.cgi?id=193143
1430         <rdar://problem/46605724>
1431
1432         Reviewed by Alex Christensen.
1433
1434         Add support for toggling device orientation API support per site via _WKWebsitePolicies.
1435
1436         * dom/Document.cpp:
1437         (WebCore::Document::simulateDeviceOrientationChange):
1438         * dom/Document.h:
1439         * loader/DocumentLoader.h:
1440         (WebCore::DocumentLoader::deviceOrientationEventEnabled const):
1441         (WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
1442         * page/DOMWindow.cpp:
1443         (WebCore::DOMWindow::addEventListener):
1444
1445 2019-01-04  Jer Noble  <jer.noble@apple.com>
1446
1447         Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
1448         https://bugs.webkit.org/show_bug.cgi?id=191806
1449         <rdar://problem/46151477>
1450
1451         Reviewed by Dean Jackson.
1452
1453         Test: http/tests/images/mp4-partial-load.html
1454
1455         Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
1456         synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
1457         sample metadata, including the byte offset and byte length of the sample data. By waiting until the
1458         AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
1459         blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
1460         attachements in the sample with actual data, and mark the sample as "complete".
1461
1462         Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
1463         synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
1464         allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
1465         CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
1466         renderer's animation loop.
1467
1468         * loader/cache/CachedImage.cpp:
1469         (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
1470         (WebCore::CachedImage::encodedDataStatusChanged):
1471         * loader/cache/CachedImage.h:
1472         * platform/graphics/ImageDecoder.h:
1473         (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
1474         * platform/graphics/ImageObserver.h:
1475         (WebCore::ImageObserver::encodedDataStatusChanged):
1476         * platform/graphics/ImageSource.cpp:
1477         (WebCore::ImageSource::ensureDecoderAvailable):
1478         (WebCore::ImageSource::encodedDataStatusChanged):
1479         (WebCore::ImageSource::frameDecodingStatusAtIndex):
1480         * platform/graphics/ImageSource.h:
1481         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
1482         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1483         (-[WebCoreSharedBufferResourceLoaderDelegate data]):
1484         (WebCore::ImageDecoderAVFObjCSample::byteRange const):
1485         (WebCore::ImageDecoderAVFObjC::readSamples):
1486         (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
1487         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
1488         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
1489         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
1490         (WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
1491
1492 2019-01-04  Youenn Fablet  <youenn@apple.com>
1493
1494         CSP violation reports should bypass CSP checks
1495         https://bugs.webkit.org/show_bug.cgi?id=192857
1496         <rdar://problem/46887236>
1497
1498         Reviewed by Chris Dumez.
1499
1500         For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
1501         This new option is unused by WebKit Legacy.
1502         It is used by WebKit loader strategy to only send any CSP response header to network process
1503         in case CSP checks should be done.
1504
1505         This option is used to disable CSP checks for Ping Loads that report CSP violations.
1506
1507         Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
1508
1509         * loader/LoaderStrategy.h:
1510         * loader/PingLoader.cpp:
1511         (WebCore::PingLoader::loadImage):
1512         (WebCore::PingLoader::sendPing):
1513         (WebCore::PingLoader::sendViolationReport):
1514         (WebCore::PingLoader::startPingLoad):
1515         * loader/PingLoader.h:
1516         * loader/cache/CachedResource.cpp:
1517         (WebCore::CachedResource::load):
1518
1519 2019-01-04  Wenson Hsieh  <wenson_hsieh@apple.com>
1520
1521         [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
1522         https://bugs.webkit.org/show_bug.cgi?id=193129
1523
1524         Reviewed by Tim Horton.
1525
1526         Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
1527
1528         * Sources.txt:
1529         * WebCore.xcodeproj/project.pbxproj:
1530         * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
1531         (WebCore::nameForUndoRedo):
1532         * editing/EditAction.h:
1533         * editing/Editor.cpp:
1534
1535 2019-01-03  Matt Rajca  <mrajca@apple.com>
1536
1537         Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
1538         https://bugs.webkit.org/show_bug.cgi?id=193128
1539         rdar://34554231
1540
1541         Reviewed by Jer Noble.
1542
1543         Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
1544         media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
1545         event along with a flag that indicates whether or not autoplay was actually prevented.
1546         Moreover, we can include a flag that indicates whether the media element in question
1547         is main content. Clients will then know in more cases when media was played with a user
1548         gesture, whether or not it has audio, as well as its main content status. While the main
1549         content heuristics may not be perfect, they covered the top 20 video-centric websites that
1550         this was tested with and are meant to be used by clients for data evaluation purposes.
1551
1552         As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
1553         since it now also applies to cases where there is a user gesture. The
1554         `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
1555         `playbackStartedTime` which also covers all the cases we care about.
1556
1557         Tests: existing API tests were updated to reflect the new names. New API tests
1558         were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
1559
1560         * html/HTMLMediaElement.cpp:
1561         (WebCore::convertEnumerationToString): Update to new enum cases.
1562         (WebCore::HTMLMediaElement::setReadyState): Ditto.
1563         (WebCore::HTMLMediaElement::play): Ditto.
1564         (WebCore::HTMLMediaElement::playInternal): Also cover the case where
1565          playback was not prevented but there was a user gesture.
1566         (WebCore::HTMLMediaElement::pauseInternal): Use new name.
1567         (WebCore::HTMLMediaElement::setVolume): Use new name.
1568         (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
1569          DidPlayMediaWithUserGesture event when playback was started with a user
1570          gesture as well.
1571         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
1572         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
1573         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
1574         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
1575         (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
1576         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
1577         (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
1578          m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
1579         (WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
1580         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
1581         * html/HTMLMediaElement.h:
1582         (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
1583         (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
1584         * html/MediaElementSession.cpp:
1585         (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
1586          do the hit testing check for the purposes of autoplay events. It seems to fail on the
1587          basic Vimeo player due to overlapping divs.
1588         (WebCore::isElementMainContentForPurposesOfAutoplay):
1589         (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
1590          here of hit testing.
1591         (WebCore::isMainContentForPurposesOfAutoplay): Renamed.
1592         * html/MediaElementSession.h:
1593         * page/AutoplayEvent.h:
1594
1595 2019-01-04  Youenn Fablet  <youenn@apple.com>
1596
1597         Crash in WebCore::ServiceWorkerGlobalScope
1598         https://bugs.webkit.org/show_bug.cgi?id=192513
1599         <rdar://problem/46563880>
1600
1601         Reviewed by Alex Christensen.
1602
1603         Store the identifier in its own variable to make sure we do not use workerThread after being moved.
1604
1605         * workers/service/ServiceWorkerGlobalScope.cpp:
1606         (WebCore::ServiceWorkerGlobalScope::skipWaiting):
1607
1608 2019-01-04  Chris Fleizach  <cfleizach@apple.com>
1609
1610         AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
1611         https://bugs.webkit.org/show_bug.cgi?id=193041
1612         <rdar://problem/46954090>
1613
1614         Reviewed by Zalan Bujtas.
1615
1616         * en.lproj/Localizable.strings:
1617         * platform/cocoa/LocalizedStringsCocoa.mm:
1618         (WebCore::AXHorizontalRuleDescriptionText):
1619
1620 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1621
1622         [LFC] ComputedHorizontalMargin should have optional members
1623         https://bugs.webkit.org/show_bug.cgi?id=193131
1624
1625         Reviewed by Antti Koivisto.
1626
1627         Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
1628         (see computed vs used values)
1629
1630         * layout/FormattingContext.h:
1631         * layout/FormattingContextGeometry.cpp:
1632         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1633         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1634         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1635         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
1636         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1637         (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
1638         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
1639         * layout/LayoutUnits.h:
1640         * layout/MarginTypes.h:
1641         * layout/Verification.cpp:
1642         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1643         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1644         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1645         * layout/displaytree/DisplayBox.h:
1646         (WebCore::Display::Box::setHorizontalMargin):
1647         (WebCore::Display::Box::setHorizontalComputedMargin):
1648         (WebCore::Display::Box::computedMarginStart const):
1649         (WebCore::Display::Box::computedMarginEnd const):
1650         * layout/floats/FloatAvoider.h:
1651         (WebCore::Layout::FloatAvoider::marginStart const):
1652         (WebCore::Layout::FloatAvoider::marginEnd const):
1653         * layout/inlineformatting/InlineFormattingContext.cpp:
1654         (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
1655         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1656         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1657
1658 2019-01-04  Zalan Bujtas  <zalan@apple.com>
1659
1660         [LFC][BFC] Use computedValue and usedValue consistently
1661         https://bugs.webkit.org/show_bug.cgi?id=193059
1662
1663         Reviewed by Antti Koivisto.
1664
1665         https://www.w3.org/TR/CSS22/cascade.html#value-stages
1666
1667         6.1.2 Computed values
1668         Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
1669         are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
1670
1671         6.1.3 Used values
1672         Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
1673         is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
1674         until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
1675         dependencies into an absolute value.
1676
1677         * layout/FormattingContext.cpp:
1678         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1679         * layout/FormattingContextGeometry.cpp:
1680         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1681         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
1682         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
1683         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
1684         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
1685         * layout/LayoutState.cpp:
1686         (WebCore::Layout::LayoutState::LayoutState):
1687         * layout/LayoutUnits.h:
1688         * layout/Verification.cpp:
1689         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
1690         * layout/blockformatting/BlockFormattingContext.cpp:
1691         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1692         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1693         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
1694         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
1695         * layout/displaytree/DisplayBox.cpp:
1696         (WebCore::Display::Box::Box):
1697         * layout/displaytree/DisplayBox.h:
1698         (WebCore::Display::Box::setHasValidHorizontalComputedMargin):
1699         (WebCore::Display::Box::setHorizontalComputedMargin):
1700         (WebCore::Display::Box::computedMarginStart const):
1701         (WebCore::Display::Box::computedMarginEnd const):
1702         (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
1703         (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
1704         (WebCore::Display::Box::nonComputedMarginStart const): Deleted.
1705         (WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
1706         * layout/floats/FloatAvoider.h:
1707         (WebCore::Layout::FloatAvoider::marginStart const):
1708         (WebCore::Layout::FloatAvoider::marginEnd const):
1709         * layout/inlineformatting/InlineFormattingContext.cpp:
1710         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1711
1712 2019-01-03  Zalan Bujtas  <zalan@apple.com>
1713
1714         REGRESSION: -webkit-appearance test case crashes
1715         https://bugs.webkit.org/show_bug.cgi?id=189302
1716         <rdar://problem/44143049>
1717
1718         Reviewed by Wenson Hsieh.
1719
1720         The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
1721         This patch removes the previous position inlining attempts.
1722
1723         Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
1724
1725         * rendering/RenderThemeMac.mm:
1726         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
1727
1728 2019-01-03  David Kilzer  <ddkilzer@apple.com>
1729
1730         Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1731         <https://webkit.org/b/193122>
1732         <rdar://problem/47022987>
1733
1734         Reviewed by Youenn Fablet.
1735
1736         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
1737         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
1738         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
1739         - Remove `final` keyword so that
1740           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
1741           can be called.
1742         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
1743         - To fix the leak call
1744           `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
1745           to create the object.
1746
1747 2019-01-03  Simon Fraser  <simon.fraser@apple.com>
1748
1749         REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
1750         https://bugs.webkit.org/show_bug.cgi?id=193124
1751         rdar://problem/46755409
1752
1753         Reviewed by Tim Horton.
1754
1755         Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
1756         an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
1757         So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
1758         path that runs when top content inset changes.
1759
1760         Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
1761
1762         * rendering/RenderLayerCompositor.cpp:
1763         (WebCore::RenderLayerCompositor::frameViewDidChangeSize):
1764
1765 2019-01-03  Chris Dumez  <cdumez@apple.com>
1766
1767         Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
1768         https://bugs.webkit.org/show_bug.cgi?id=192997
1769         <rdar://problem/46217271>
1770
1771         Reviewed by Antti Koivisto.
1772
1773         isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
1774         The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
1775
1776         To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
1777         only check if the frames belong to the same pages or if their openers do. We no longer check
1778         openers' opener and up.
1779
1780         Note that this function is used to check if a frame is allowed to target another. In practice,
1781         it is unlikely to be useful to navigate an opener's opener and an openee's openee.
1782
1783         Tests: fast/dom/Window/window-open-opener-cycle.html
1784                fast/dom/Window/window-open-self-as-opener.html
1785
1786         * page/FrameTree.cpp:
1787         (WebCore::isFrameFamiliarWith):
1788
1789 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1790
1791         REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
1792         https://bugs.webkit.org/show_bug.cgi?id=193095
1793         <rdar://problem/47014944>
1794
1795         Reviewed by Zalan Bujtas.
1796         
1797         In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
1798         and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
1799         which continues to affect the appearance of text.
1800         
1801         Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
1802
1803         Test: compositing/contents-format/subpixel-antialiased-text.html
1804
1805         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1806         (WebCore::PlatformCALayer::drawLayerContents):
1807
1808 2019-01-02  David Kilzer  <ddkilzer@apple.com>
1809
1810         Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
1811         <https://webkit.org/b/193016>
1812         <rdar://problem/46925703>
1813
1814         Reviewed by Simon Fraser.
1815
1816         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1817         (WebCore::copySampleBufferWithCurrentTimeStamp):
1818         - Change to return RetainPtr<CMSampleBufferRef>.
1819         - Check return value of CMSampleBufferCreateCopyWithNewTiming().
1820         (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
1821         - Check return value of copySampleBufferWithCurrentTimeStamp().
1822         - Fix leak by using RetainPtr<CMSampleBufferRef> returned from
1823           copySampleBufferWithCurrentTimeStamp() instead of leaking
1824           `bufferWithCurrentTime` by using retainPtr().
1825         (WebCore::createAudioFormatDescription):
1826         - Extract method from appendAudioSampleBuffer() to return
1827           RetainPtr<CMFormatDescriptionRef> after calling
1828           CMAudioFormatDescriptionCreate().
1829         - Check return value of CMAudioFormatDescriptionCreate().
1830         (WebCore::createAudioSampleBufferWithPacketDescriptions):
1831         - Extract method from appendAudioSampleBuffer() to return
1832           RetainPtr<CMSampleBufferRef> after calling
1833           CMAudioSampleBufferCreateWithPacketDescriptions().
1834         (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
1835         - Check return values of createAudioFormatDescription() and
1836           createAudioSampleBufferWithPacketDescriptions().
1837         - Fix leaks by extracting code into helper methods that return
1838           RetainPtr<> objects instead of leaking CMFormatDescriptionRef
1839           directly or leaking `sampleBuffer` by using retainPtr().
1840
1841 2019-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1842
1843         Add support for using the current text selection as the find string on iOS
1844         https://bugs.webkit.org/show_bug.cgi?id=193034
1845         <rdar://problem/45138739>
1846
1847         Reviewed by Tim Horton.
1848
1849         Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
1850         pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
1851         process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
1852         able to trigger find-in-page with this string.
1853
1854         Test: WebKit.UseSelectionAsFindString
1855
1856         * editing/Editor.cpp:
1857         (WebCore::Editor::canCopyExcludingStandaloneImages const):
1858
1859         Make this helper function cross-platform.
1860
1861         * editing/Editor.h:
1862         * editing/EditorCommand.cpp:
1863         (WebCore::createCommandMap):
1864         * editing/cocoa/EditorCocoa.mm:
1865         (WebCore::Editor::takeFindStringFromSelection):
1866
1867         Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
1868         find string (see WebKit/ChangeLog for more details).
1869
1870         * editing/mac/EditorMac.mm:
1871         (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
1872         (WebCore::Editor::takeFindStringFromSelection): Deleted.
1873         * loader/EmptyClients.cpp:
1874         * page/EditorClient.h:
1875
1876         Add a new editor client method to send the string for find-in-page to the UI process.
1877
1878 2019-01-02  Devin Rousso  <webkit@devinrousso.com>
1879
1880         Web Inspector: Implement `queryObjects` Command Line API
1881         https://bugs.webkit.org/show_bug.cgi?id=176766
1882         <rdar://problem/34890689>
1883
1884         Reviewed by Joseph Pecoraro.
1885
1886         Test: inspector/console/queryObjects.html
1887
1888         * inspector/CommandLineAPIModuleSource.js:
1889         (CommandLineAPI):
1890         (CommandLineAPIImpl.prototype.queryObjects): Added.
1891
1892 2019-01-02  Charles Vazac  <cvazac@gmail.com>
1893
1894         Fix resourcetimingbufferfull bubbles attribute
1895         https://bugs.webkit.org/show_bug.cgi?id=193087
1896
1897         Reviewed by Chris Dumez.
1898
1899         This change is covered by web-platform-tests [1].
1900
1901         [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
1902
1903         * page/Performance.cpp:
1904         (WebCore::Performance::resourceTimingBufferFullTimerFired):
1905
1906 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1907
1908         Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
1909         https://bugs.webkit.org/show_bug.cgi?id=193010
1910
1911         Reviewed by Zalan Bujtas.
1912
1913         Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
1914         and make it an enum class.
1915
1916         * page/FrameView.cpp:
1917         (WebCore::FrameView::scrollLayerID const):
1918         * rendering/RenderLayer.h:
1919         * rendering/RenderLayerBacking.cpp:
1920         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1921         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1922         (WebCore::operator<<):
1923         * rendering/RenderLayerBacking.h:
1924         * rendering/RenderLayerCompositor.cpp:
1925         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
1926         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
1927         (WebCore::scrollCoordinationRoleForNodeType):
1928         (WebCore::RenderLayerCompositor::attachScrollingNode):
1929         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1930         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1931         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
1932         * rendering/RenderLayerCompositor.h:
1933
1934 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1935
1936         Don't spin up a CalcParser if the current token is not a function token
1937         https://bugs.webkit.org/show_bug.cgi?id=193067
1938
1939         Reviewed by Zalan Bujtas.
1940
1941         Various functions in CSSPropertyParserHelpers fall back to trying to parse
1942         a calc expression if the normal parsing fails. Don't do this unless the
1943         current token is a function token, which should be slightly more efficient.
1944
1945         * css/parser/CSSPropertyParserHelpers.cpp:
1946         (WebCore::CSSPropertyParserHelpers::consumeInteger):
1947         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
1948         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
1949         (WebCore::CSSPropertyParserHelpers::consumeNumber):
1950         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
1951         (WebCore::CSSPropertyParserHelpers::consumeLength):
1952         (WebCore::CSSPropertyParserHelpers::consumePercent):
1953         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
1954         (WebCore::CSSPropertyParserHelpers::consumeAngle):
1955         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
1956         (WebCore::CSSPropertyParserHelpers::consumeTime):
1957
1958 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1959
1960         Support css-color-4 rgb functions
1961         https://bugs.webkit.org/show_bug.cgi?id=192321
1962
1963         Reviewed by Zalan Bujtas.
1964         
1965         Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
1966         The differences are:
1967         1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
1968             rgb(128 34 56)
1969             rgb(128 34 56 / 50%)
1970         2. Floating point values are allowed, and rounded:
1971             rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
1972         3. rgba() is a pure alias for rgb(), so these are equivalent:
1973             rgb(128 34 56 / 50%)
1974             rgba(128 34 56 / 50%)
1975             
1976         hsl()/hsla() parsing was already updated to this new syntax in r230861.
1977
1978         Tested by tests in imported/w3c/web-platform-tests/css/css-color/
1979
1980         * css/parser/CSSPropertyParserHelpers.cpp:
1981         (WebCore::CSSPropertyParserHelpers::clampRGBComponent):
1982         (WebCore::CSSPropertyParserHelpers::parseRGBParameters):
1983         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
1984
1985 2019-01-02  Simon Fraser  <simon.fraser@apple.com>
1986
1987         Handle calc() expressions in gradient color stops
1988         https://bugs.webkit.org/show_bug.cgi?id=193066
1989         rdar://problem/46961985
1990
1991         Reviewed by Sam Weinig.
1992         
1993         Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
1994         for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
1995         calc values as well as angle ones.
1996
1997         Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
1998         just as isPx() etc do.
1999
2000         Test: fast/gradients/conic-calc-stop-position.html
2001
2002         * css/CSSPrimitiveValue.h:
2003         (WebCore::CSSPrimitiveValue::isAngle const):
2004         * css/parser/CSSPropertyParserHelpers.cpp:
2005         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
2006         (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2007
2008 2018-12-31  Keith Miller  <keith_miller@apple.com>
2009
2010         SourceProviders should use an actual URL instead of a string
2011         https://bugs.webkit.org/show_bug.cgi?id=192734
2012
2013         Reviewed by Yusuke Suzuki.
2014
2015         Remove ScriptSourceCode's URL member and make the url() method
2016         reference the URL on the SourceProvider. Also, avoid some
2017         ref count churn.
2018
2019         Additionally, this patch fixes an existing bug in
2020         WorkletGlobalScope() that would use a ScriptSourceCode after
2021         WTFMoving it.
2022
2023         * bindings/js/CachedScriptSourceProvider.h:
2024         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
2025         * bindings/js/ScheduledAction.cpp:
2026         (WebCore::ScheduledAction::execute):
2027         * bindings/js/ScriptController.cpp:
2028         (WebCore::ScriptController::executeScriptInWorld):
2029         (WebCore::ScriptController::executeScript):
2030         * bindings/js/ScriptSourceCode.h:
2031         (WebCore::ScriptSourceCode::ScriptSourceCode):
2032         (WebCore::ScriptSourceCode::m_code):
2033         (WebCore::ScriptSourceCode::url const):
2034         (WebCore::ScriptSourceCode::m_url): Deleted.
2035         * dom/ScriptElement.cpp:
2036         (WebCore::ScriptElement::prepareScript):
2037         (WebCore::ScriptElement::requestModuleScript):
2038         (WebCore::ScriptElement::executePendingScript):
2039         * html/HTMLMediaElement.cpp:
2040         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
2041         * page/Frame.cpp:
2042         (WebCore::Frame::injectUserScriptImmediately):
2043         * workers/WorkerGlobalScope.cpp:
2044         (WebCore::WorkerGlobalScope::importScripts):
2045         * workers/WorkerThread.cpp:
2046         (WebCore::WorkerThread::workerThread):
2047         * worklets/WorkletGlobalScope.cpp:
2048         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
2049         * xml/parser/XMLDocumentParserLibxml2.cpp:
2050         (WebCore::XMLDocumentParser::endElementNs):
2051
2052 2019-01-01  Jeff Miller  <jeffm@apple.com>
2053
2054         Update user-visible copyright strings to include 2019
2055         https://bugs.webkit.org/show_bug.cgi?id=192811
2056
2057         Reviewed by Mark Lam.
2058
2059         * Info.plist:
2060
2061 2018-12-30  David Kilzer  <ddkilzer@apple.com>
2062
2063         clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
2064         <https://webkit.org/b/193058>
2065         <rdar://problem/46979275>
2066
2067         Reviewed by Yusuke Suzuki.
2068
2069         * rendering/BorderEdge.cpp:
2070         (WebCore::BorderEdge::BorderEdge): Reorder initialization to
2071         match new instance variable order.
2072         * rendering/BorderEdge.h: Reorder instance variables to save
2073         8 padding bytes.
2074
2075 2018-12-28  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2076
2077         [JSC] Remove one indirection in JSObject::toStringName
2078         https://bugs.webkit.org/show_bug.cgi?id=193037
2079
2080         Reviewed by Keith Miller.
2081
2082         Use old JSObject::toStringName function here.
2083
2084         * bindings/js/JSDOMConstructorBase.cpp:
2085         (WebCore::JSDOMConstructorBase::className):
2086         (WebCore::JSDOMConstructorBase::toStringName):
2087         * bindings/js/JSDOMConstructorBase.h:
2088         (WebCore::JSDOMConstructorBase::className): Deleted.
2089
2090 2018-12-27  Alex Christensen  <achristensen@webkit.org>
2091
2092         Resurrect Mac CMake build
2093         https://bugs.webkit.org/show_bug.cgi?id=192658
2094
2095         Reviewed by Yusuke Suzuki.
2096
2097         This makes it so JSC and most of WebCore builds.
2098         WebCore's use of ARC seems inconsistent, so I'll fix that later.
2099
2100         * PlatformMac.cmake:
2101         * config.h:
2102
2103 2018-12-26  Jim Mason  <jmason@ibinx.com>
2104
2105         [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
2106         https://bugs.webkit.org/show_bug.cgi?id=193036
2107
2108         Reviewed by Michael Catanzaro.
2109
2110         * platform/graphics/FontPlatformData.h:
2111         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2112
2113 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2114
2115         Remove "using namespace std;"
2116         https://bugs.webkit.org/show_bug.cgi?id=192973
2117         <rdar://problem/46937309>
2118
2119         Unreviewed Windows port Debug builds fix.
2120
2121         No new tests since no behavior changes.
2122
2123         * accessibility/win/AXObjectCacheWin.cpp:
2124         (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
2125
2126 2018-12-24  Fujii Hironori  <Hironori.Fujii@sony.com>
2127
2128         Remove "using namespace std;"
2129         https://bugs.webkit.org/show_bug.cgi?id=192973
2130
2131         Reviewed by Alex Christensen.
2132
2133         Removed "using namespace std" statement, and use std:: prefix.
2134
2135         No new tests since no behavior changes.
2136
2137         * accessibility/win/AXObjectCacheWin.cpp:
2138         * platform/graphics/GraphicsContext3DPrivate.cpp:
2139         * platform/graphics/cairo/ImageBufferCairo.cpp:
2140         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2141         * platform/graphics/win/FontWin.cpp:
2142         (WebCore::FontCascade::floatWidthForComplexText const):
2143         * platform/graphics/win/GraphicsContextCGWin.cpp:
2144         * platform/graphics/win/GraphicsContextCairoWin.cpp:
2145         * platform/graphics/win/GraphicsContextDirect2D.cpp:
2146         * platform/graphics/win/GraphicsContextWin.cpp:
2147         * platform/graphics/win/SimpleFontDataCGWin.cpp:
2148         * platform/graphics/win/UniscribeController.cpp:
2149         (WebCore::UniscribeController::UniscribeController):
2150         (WebCore::UniscribeController::shapeAndPlaceItem):
2151         * platform/image-decoders/ScalableImageDecoder.cpp:
2152         * platform/text/LocaleICU.cpp:
2153         * platform/text/win/LocaleWin.cpp:
2154         * platform/win/ScrollbarThemeWin.cpp:
2155         * rendering/RenderRubyRun.cpp:
2156         (WebCore::RenderRubyRun::layoutBlock):
2157         * rendering/RenderThemeWin.cpp:
2158         (WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
2159         (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
2160         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
2161         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
2162         (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
2163         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
2164         (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
2165
2166 2018-12-24  Simon Fraser  <simon.fraser@apple.com>
2167
2168         Change ScrollingNodeType to an enum class
2169         https://bugs.webkit.org/show_bug.cgi?id=193009
2170
2171         Reviewed by Zalan Bujtas.
2172
2173         Change the ScrollingNodeType enum to an enum class.
2174         
2175         No behavior change.
2176
2177         * page/scrolling/AsyncScrollingCoordinator.cpp:
2178         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
2179         * page/scrolling/ScrollingCoordinator.cpp:
2180         (WebCore::operator<<):
2181         * page/scrolling/ScrollingCoordinator.h:
2182         * page/scrolling/ScrollingStateFixedNode.cpp:
2183         (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
2184         * page/scrolling/ScrollingStateNode.h:
2185         (WebCore::ScrollingStateNode::isFixedNode const):
2186         (WebCore::ScrollingStateNode::isStickyNode const):
2187         (WebCore::ScrollingStateNode::isFrameScrollingNode const):
2188         (WebCore::ScrollingStateNode::isOverflowScrollingNode const):
2189         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
2190         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
2191         * page/scrolling/ScrollingStateStickyNode.cpp:
2192         (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
2193         * page/scrolling/ScrollingStateTree.cpp:
2194         (WebCore::ScrollingStateTree::createNode):
2195         (WebCore::ScrollingStateTree::attachNode):
2196         * page/scrolling/ScrollingTreeNode.h:
2197         (WebCore::ScrollingTreeNode::isFixedNode const):
2198         (WebCore::ScrollingTreeNode::isStickyNode const):
2199         (WebCore::ScrollingTreeNode::isFrameScrollingNode const):
2200         (WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
2201         * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
2202         (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
2203         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2204         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
2205         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2206         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
2207         * page/scrolling/mac/ScrollingTreeMac.cpp:
2208         (ScrollingTreeMac::createScrollingTreeNode):
2209         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2210         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
2211         * platform/graphics/GraphicsLayerClient.h:
2212         * rendering/RenderLayerCompositor.cpp:
2213         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2214         (WebCore::scrollCoordinationRoleForNodeType):
2215         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
2216         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2217
2218 2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2219
2220         [HarfBuzz] Width not correctly reported as 0 for zero font size
2221         https://bugs.webkit.org/show_bug.cgi?id=192986
2222
2223         Reviewed by Michael Catanzaro.
2224
2225         Fixes test fast/text/font-size-zero.html
2226
2227         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
2228         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
2229         size is zero.
2230
2231 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
2232
2233         Use Ref<> as much as possible
2234         https://bugs.webkit.org/show_bug.cgi?id=192808
2235
2236         Reviewed by Alex Christensen.
2237
2238         * Modules/encryptedmedia/NavigatorEME.cpp:
2239         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
2240         * Modules/fetch/FetchBody.cpp:
2241         (WebCore::FetchBody::bodyAsFormData const):
2242         * Modules/geolocation/Geolocation.cpp:
2243         (WebCore::Geolocation::getCurrentPosition):
2244         (WebCore::Geolocation::watchPosition):
2245         * Modules/indexeddb/IDBDatabase.cpp:
2246         (WebCore::IDBDatabase::objectStoreNames const):
2247         * Modules/indexeddb/IDBDatabase.h:
2248         * Modules/indexeddb/IDBObjectStore.cpp:
2249         (WebCore::IDBObjectStore::indexNames const):
2250         * Modules/indexeddb/IDBObjectStore.h:
2251         * Modules/indexeddb/IDBTransaction.cpp:
2252         (WebCore::IDBTransaction::scheduleOperation):
2253         * Modules/indexeddb/IDBTransaction.h:
2254         * Modules/indexeddb/client/TransactionOperation.h:
2255         (WebCore::IDBClient::createTransactionOperation):
2256         * Modules/mediastream/MediaDevices.cpp:
2257         (WebCore::MediaDevices::getUserMedia const):
2258         (WebCore::MediaDevices::getDisplayMedia const):
2259         * Modules/mediastream/UserMediaRequest.cpp:
2260         (WebCore::UserMediaRequest::create):
2261         * Modules/mediastream/UserMediaRequest.h:
2262         * Modules/webaudio/AudioParam.cpp:
2263         (WebCore::AudioParam::calculateFinalValues):
2264         * Modules/webaudio/ScriptProcessorNode.cpp:
2265         (WebCore::ScriptProcessorNode::initialize):
2266         * Modules/webdatabase/SQLStatement.cpp:
2267         (WebCore::SQLStatement::execute):
2268         * Modules/webgpu/WebGPU.cpp:
2269         (WebCore::WebGPU::requestAdapter const):
2270         * Modules/webgpu/WebGPUAdapter.cpp:
2271         (WebCore::WebGPUAdapter::create):
2272         * Modules/webgpu/WebGPUAdapter.h:
2273         * Modules/webgpu/WebGPUBuffer.cpp:
2274         (WebCore::WebGPUBuffer::create):
2275         * Modules/webgpu/WebGPUBuffer.h:
2276         * Modules/webgpu/WebGPUCommandBuffer.cpp:
2277         (WebCore::WebGPUCommandBuffer::create):
2278         (WebCore::WebGPUCommandBuffer::beginRenderPass):
2279         * Modules/webgpu/WebGPUCommandBuffer.h:
2280         * Modules/webgpu/WebGPUDevice.cpp:
2281         (WebCore::WebGPUDevice::create):
2282         (WebCore::WebGPUDevice::createBuffer const):
2283         (WebCore::WebGPUDevice::createShaderModule const):
2284         (WebCore::WebGPUDevice::createRenderPipeline const):
2285         (WebCore::WebGPUDevice::createCommandBuffer const):
2286         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
2287         (WebCore::WebGPURenderPassEncoder::create):
2288         * Modules/webgpu/WebGPURenderPassEncoder.h:
2289         * Modules/webgpu/WebGPURenderPipeline.cpp:
2290         (WebCore::WebGPURenderPipeline::create):
2291         * Modules/webgpu/WebGPURenderPipeline.h:
2292         * Modules/webgpu/WebGPUShaderModule.cpp:
2293         (WebCore::WebGPUShaderModule::create):
2294         * Modules/webgpu/WebGPUShaderModule.h:
2295         * Modules/webgpu/WebGPUTexture.cpp:
2296         (WebCore::WebGPUTexture::createDefaultTextureView):
2297         * Modules/webgpu/WebGPUTextureView.cpp:
2298         (WebCore::WebGPUTextureView::create):
2299         * Modules/webgpu/WebGPUTextureView.h:
2300         * accessibility/AXObjectCache.cpp:
2301         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
2302         * accessibility/atk/AXObjectCacheAtk.cpp:
2303         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
2304         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2305         (webkitAccessibleHyperlinkGetStartIndex):
2306         (webkitAccessibleHyperlinkGetEndIndex):
2307         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2308         (getSelectionOffsetsForObject):
2309         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2310         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2311         * bindings/js/JSDOMGlobalObjectTask.cpp:
2312         * bindings/js/JSDOMWindowBase.cpp:
2313         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
2314         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2315         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
2316         * bindings/js/ScriptControllerMac.mm:
2317         (WebCore::ScriptController::createScriptInstanceForWidget):
2318         * bindings/js/SerializedScriptValue.cpp:
2319         (WebCore::CloneDeserializer::readTerminal):
2320         (WebCore::SerializedScriptValue::create):
2321         * bridge/objc/objc_instance.h:
2322         * bridge/objc/objc_instance.mm:
2323         (ObjcInstance::create):
2324         * css/CSSComputedStyleDeclaration.cpp:
2325         (WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
2326         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
2327         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
2328         (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
2329         * css/CSSComputedStyleDeclaration.h:
2330         * css/CSSFontFaceSource.cpp:
2331         (WebCore::CSSFontFaceSource::load):
2332         * css/CSSStyleSheet.cpp:
2333         (WebCore::CSSStyleSheet::rules):
2334         * css/FontFace.cpp:
2335         (WebCore::FontFace::unicodeRange const):
2336         (WebCore::FontFace::featureSettings const):
2337         * css/InspectorCSSOMWrappers.cpp:
2338         (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
2339         * css/SVGCSSComputedStyleDeclaration.cpp:
2340         (WebCore::strokeDashArrayToCSSValueList):
2341         (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
2342         * css/StyleResolver.cpp:
2343         (WebCore::StyleResolver::createFilterOperations):
2344         * css/StyleRule.cpp:
2345         (WebCore::StyleRuleBase::createCSSOMWrapper const):
2346         * css/StyleRule.h:
2347         * dom/ChildListMutationScope.cpp:
2348         (WebCore::ChildListMutationAccumulator::getOrCreate):
2349         * dom/ChildListMutationScope.h:
2350         * dom/DocumentMarkerController.cpp:
2351         (WebCore::updateRenderedRectsForMarker):
2352         * dom/InlineStyleSheetOwner.cpp:
2353         (WebCore::InlineStyleSheetOwner::createSheet):
2354         * dom/PointerEvent.h:
2355         * dom/UserGestureIndicator.h:
2356         (WebCore::UserGestureToken::create):
2357         * editing/AlternativeTextController.cpp:
2358         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
2359         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
2360         (WebCore::AlternativeTextController::respondToUnappliedEditing):
2361         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
2362         (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
2363         * editing/ApplyStyleCommand.cpp:
2364         (WebCore::ApplyStyleCommand::applyBlockStyle):
2365         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2366         * editing/CompositeEditCommand.cpp:
2367         (WebCore::CompositeEditCommand::targetRanges const):
2368         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
2369         (WebCore::CompositeEditCommand::moveParagraphs):
2370         * editing/DeleteSelectionCommand.cpp:
2371         (WebCore::DeleteSelectionCommand::mergeParagraphs):
2372         * editing/Editing.cpp:
2373         (WebCore::visiblePositionForIndexUsingCharacterIterator):
2374         * editing/EditingStyle.cpp:
2375         (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
2376         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
2377         (WebCore::EditingStyle::prepareToApplyAt):
2378         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
2379         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
2380         (WebCore::EditingStyle::removeStyleFromRulesAndContext):
2381         (WebCore::extractPropertiesNotIn):
2382         * editing/Editor.cpp:
2383         (WebCore::Editor::setBaseWritingDirection):
2384         (WebCore::Editor::setComposition):
2385         * editing/EditorCommand.cpp:
2386         (WebCore::executeApplyParagraphStyle):
2387         (WebCore::executeMakeTextWritingDirectionLeftToRight):
2388         (WebCore::executeMakeTextWritingDirectionNatural):
2389         (WebCore::executeMakeTextWritingDirectionRightToLeft):
2390         * editing/FormatBlockCommand.cpp:
2391         (WebCore::FormatBlockCommand::formatRange):
2392         * editing/RemoveFormatCommand.cpp:
2393         (WebCore::RemoveFormatCommand::doApply):
2394         * editing/ReplaceRangeWithTextCommand.cpp:
2395         (WebCore::ReplaceRangeWithTextCommand::targetRanges const):
2396         * editing/ReplaceSelectionCommand.cpp:
2397         (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
2398         (WebCore::handleStyleSpansBeforeInsertion):
2399         (WebCore::ReplaceSelectionCommand::handleStyleSpans):
2400         * editing/SpellingCorrectionCommand.cpp:
2401         (WebCore::SpellingCorrectionCommand::targetRanges const):
2402         * editing/TextCheckingHelper.cpp:
2403         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
2404         * editing/TypingCommand.cpp:
2405         (WebCore::TypingCommand::insertText):
2406         (WebCore::TypingCommand::willAddTypingToOpenCommand):
2407         * editing/VisibleUnits.cpp:
2408         (WebCore::distanceBetweenPositions):
2409         * editing/cocoa/EditorCocoa.mm:
2410         (WebCore::Editor::selectionInWebArchiveFormat):
2411         * editing/ios/DictationCommandIOS.cpp:
2412         (WebCore::DictationCommandIOS::doApply):
2413         * editing/ios/EditorIOS.mm:
2414         (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
2415         (WebCore::Editor::removeUnchangeableStyles):
2416         (WebCore::Editor::writeImageToPasteboard):
2417         * editing/mac/EditorMac.mm:
2418         (WebCore::Editor::replaceNodeFromPasteboard):
2419         (WebCore::Editor::imageInWebArchiveFormat):
2420         * editing/markup.cpp:
2421         (WebCore::styleFromMatchedRulesAndInlineDecl):
2422         (WebCore::createFragmentForTransformToFragment):
2423         * fileapi/FileReaderLoader.cpp:
2424         (WebCore::FileReaderLoader::didFinishLoading):
2425         * html/FTPDirectoryDocument.cpp:
2426         (WebCore::createTemplateDocumentData):
2427         * html/HTMLMediaElement.cpp:
2428         (WebCore::HTMLMediaElement::scheduleEvent):
2429         (WebCore::HTMLMediaElement::createMediaControls):
2430         * html/HTMLTableElement.cpp:
2431         (WebCore::HTMLTableElement::createSharedCellStyle):
2432         * html/HTMLTableElement.h:
2433         * html/URLUtils.h:
2434         (WebCore::URLUtils<T>::origin const):
2435         * html/parser/HTMLConstructionSite.cpp:
2436         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2437         * html/shadow/TextControlInnerElements.cpp:
2438         (WebCore::TextControlInnerElement::resolveCustomStyle):
2439         * html/track/WebVTTParser.cpp:
2440         (WebCore::WebVTTParser::createNewCue):
2441         * inspector/DOMPatchSupport.cpp:
2442         * inspector/InspectorCanvas.cpp:
2443         (WebCore::InspectorCanvas::buildInitialState):
2444         (WebCore::InspectorCanvas::buildAction):
2445         * inspector/InspectorFrontendClientLocal.cpp:
2446         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2447         * inspector/InspectorStyleSheet.cpp:
2448         (WebCore::asCSSRuleList):
2449         (WebCore::InspectorStyle::styleWithProperties const):
2450         (WebCore::InspectorStyleSheet::ensureSourceData):
2451         * inspector/agents/InspectorCanvasAgent.cpp:
2452         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
2453         * inspector/agents/InspectorIndexedDBAgent.cpp:
2454         (WebCore::Inspector::keyPathFromIDBKeyPath):
2455         * inspector/agents/InspectorPageAgent.cpp:
2456         (WebCore::InspectorPageAgent::archive):
2457         * loader/EmptyClients.cpp:
2458         (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
2459         (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
2460         (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
2461         (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
2462         * loader/FrameLoader.cpp:
2463         (WebCore::FrameLoader::loadURL):
2464         (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
2465         (WebCore::FrameLoader::loadDifferentDocumentItem):
2466         * loader/WorkerThreadableLoader.cpp:
2467         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
2468         * loader/archive/mhtml/MHTMLParser.cpp:
2469         (WebCore::MHTMLParser::addResourceToArchive):
2470         (WebCore::MHTMLParser::parseNextPart):
2471         * loader/cache/MemoryCache.cpp:
2472         (WebCore::MemoryCache::addImageToCache):
2473         (WebCore::MemoryCache::removeResourcesWithOrigin):
2474         * page/DOMWindow.cpp:
2475         (WebCore::DOMWindow::getMatchedCSSRules const):
2476         (WebCore::DOMWindow::createWindow):
2477         * page/EventHandler.cpp:
2478         (WebCore::textDistance):
2479         * page/Page.cpp:
2480         (WebCore::Page::userStyleSheet const):
2481         * page/animation/CSSPropertyAnimation.cpp:
2482         (WebCore::blendFilterOperations):
2483         * page/ios/FrameIOS.mm:
2484         (WebCore::Frame::initWithSimpleHTMLDocument):
2485         (WebCore::Frame::interpretationsForCurrentRoot const):
2486         * page/mac/ServicesOverlayController.mm:
2487         (WebCore::ServicesOverlayController::Highlight::fadeIn):
2488         (WebCore::ServicesOverlayController::Highlight::fadeOut):
2489         * platform/SharedBuffer.cpp:
2490         (WebCore::SharedBuffer::tryCreateArrayBuffer const):
2491         * platform/audio/HRTFElevation.cpp:
2492         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
2493         * platform/audio/SincResampler.cpp:
2494         (WebCore::SincResampler::consumeSource):
2495         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2496         (WebCore::AudioFileReader::createBus):
2497         * platform/audio/mac/AudioFileReaderMac.cpp:
2498         (WebCore::AudioFileReader::createBus):
2499         * platform/graphics/Icon.h:
2500         (WebCore::Icon::create):
2501         * platform/graphics/InbandTextTrackPrivate.h:
2502         (WebCore::InbandTextTrackPrivate::create):
2503         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2504         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
2505         * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
2506         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2507         (WebCore::fulfillRequestWithKeyData):
2508         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2509         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2510         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2511         (WebCore::MediaSourcePrivateAVFObjC::create):
2512         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
2513         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2514         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2515         (WebCore::SourceBufferPrivateAVFObjC::create):
2516         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
2517         * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
2518         * platform/graphics/ca/TileController.cpp:
2519         (WebCore::TileController::createTileLayer):
2520         * platform/graphics/ca/TileController.h:
2521         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2522         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
2523         (WebCore::CACFLayerTreeHost::create):
2524         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
2525         (WebCore::GPUBuffer::create):
2526         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2527         (WebCore::MediaPlayerPrivateGStreamer::updateTracks):
2528         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
2529         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
2530         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
2531         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
2532         (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
2533         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
2534         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2535         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2536         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2537         (WebCore::AppendPipeline::appsinkNewSample):
2538         * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
2539         (WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
2540         * platform/graphics/iso/ISOTrackEncryptionBox.cpp:
2541         (WebCore::ISOTrackEncryptionBox::parse):
2542         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2543         (WebCore::applyFilterAnimation):
2544         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
2545         (WebCore::TextureMapperPlatformLayerBuffer::clone):
2546         * platform/graphics/transforms/TransformOperations.cpp:
2547         (WebCore::TransformOperations::blendByMatchingOperations const):
2548         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2549         (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
2550         * platform/mock/mediasource/MockBox.cpp:
2551         (WebCore::MockInitializationBox::MockInitializationBox):
2552         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
2553         (WebCore::MockSourceBufferPrivate::create):
2554         (WebCore::MockSourceBufferPrivate::append):
2555         * platform/mock/mediasource/MockSourceBufferPrivate.h:
2556         * platform/mock/mediasource/MockTracks.h:
2557         (WebCore::MockTextTrackPrivate::create):
2558         (WebCore::MockVideoTrackPrivate::create):
2559         * platform/network/FormData.h:
2560         (WebCore::FormData::decode):
2561         * platform/network/cocoa/CookieStorageObserver.h:
2562         * platform/network/cocoa/CookieStorageObserver.mm:
2563         (WebCore::CookieStorageObserver::create):
2564         * platform/network/soup/ResourceRequestSoup.cpp:
2565         (WebCore::appendEncodedBlobItemToSoupMessageBody):
2566         (WebCore::ResourceRequest::updateSoupMessageBody const):
2567         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2568         (WebCore::HyphenationDictionary::createNull):
2569         (WebCore::HyphenationDictionary::create):
2570         * platform/win/SearchPopupMenuWin.cpp:
2571         (WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
2572         (WebCore::SearchPopupMenuWin::popupMenu):
2573         * platform/win/SearchPopupMenuWin.h:
2574         * rendering/RenderThemeIOS.mm:
2575         (WebCore::applyCommonButtonPaddingToStyle):
2576         (WebCore::RenderThemeIOS::paintProgressBar):
2577         (WebCore::RenderThemeIOS::adjustButtonStyle const):
2578         (WebCore::paintAttachmentIcon):
2579         * rendering/svg/SVGRenderTreeAsText.cpp:
2580         (WebCore::writeSVGResourceContainer):
2581         * storage/Storage.cpp:
2582         (WebCore::Storage::create):
2583         (WebCore::Storage::Storage):
2584         * storage/Storage.h:
2585         (WebCore::Storage::area const):
2586         * storage/StorageNamespace.h:
2587         * storage/StorageNamespaceProvider.cpp:
2588         (WebCore::StorageNamespaceProvider::localStorageArea):
2589         * storage/StorageNamespaceProvider.h:
2590         * svg/SVGElement.cpp:
2591         (WebCore::SVGElement::getPresentationAttribute):
2592         * svg/SVGFEBlendElement.cpp:
2593         (WebCore::SVGFEBlendElement::build):
2594         * svg/SVGFEColorMatrixElement.cpp:
2595         (WebCore::SVGFEColorMatrixElement::build):
2596         * svg/SVGFEComponentTransferElement.cpp:
2597         (WebCore::SVGFEComponentTransferElement::build):
2598         * svg/SVGFECompositeElement.cpp:
2599         (WebCore::SVGFECompositeElement::build):
2600         * svg/SVGFEDiffuseLightingElement.cpp:
2601         (WebCore::SVGFEDiffuseLightingElement::build):
2602         * svg/SVGFEDisplacementMapElement.cpp:
2603         (WebCore::SVGFEDisplacementMapElement::build):
2604         * svg/SVGFEDropShadowElement.cpp:
2605         (WebCore::SVGFEDropShadowElement::build):
2606         * svg/SVGFEGaussianBlurElement.cpp:
2607         (WebCore::SVGFEGaussianBlurElement::build):
2608         * svg/SVGFEMergeElement.cpp:
2609         (WebCore::SVGFEMergeElement::build):
2610         * svg/SVGFEMorphologyElement.cpp:
2611         (WebCore::SVGFEMorphologyElement::build):
2612         * svg/SVGFEOffsetElement.cpp:
2613         (WebCore::SVGFEOffsetElement::build):
2614         * svg/SVGFESpecularLightingElement.cpp:
2615         (WebCore::SVGFESpecularLightingElement::build):
2616         * svg/SVGFETileElement.cpp:
2617         (WebCore::SVGFETileElement::build):
2618         * testing/GCObservation.h:
2619         * xml/XSLTProcessor.cpp:
2620         (WebCore::XSLTProcessor::createDocumentFromSource):
2621         * xml/parser/XMLDocumentParser.cpp:
2622         (WebCore::XMLDocumentParser::parseDocumentFragment):
2623
2624 2018-12-21  Chris Dumez  <cdumez@apple.com>
2625
2626         navigator.userAgent in service workers does not reflect customUserAgent set by client
2627         https://bugs.webkit.org/show_bug.cgi?id=192951
2628
2629         Reviewed by Youenn Fablet.
2630
2631         Whenever a service worker client registers itself, also pass its effective user agent.
2632         In the network process, for each origin, we store the latest client's user agent and
2633         use it when starting the service worker.
2634
2635         * dom/Document.cpp:
2636         (WebCore::Document::setServiceWorkerConnection):
2637         * loader/DocumentLoader.cpp:
2638         (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
2639         * workers/service/SWClientConnection.h:
2640         * workers/service/server/SWServer.cpp:
2641         (WebCore::SWServer::serviceWorkerClientUserAgent const):
2642         (WebCore::SWServer::installContextData):
2643         (WebCore::SWServer::runServiceWorker):
2644         (WebCore::SWServer::registerServiceWorkerClient):
2645         * workers/service/server/SWServer.h:
2646         * workers/service/server/SWServerToContextConnection.h:
2647         * workers/service/server/SWServerWorker.cpp:
2648         (WebCore::SWServerWorker::userAgent const):
2649         * workers/service/server/SWServerWorker.h:
2650
2651 2018-12-21  Youenn Fablet  <youenn@apple.com>
2652
2653         RTCRtpSender.setParameters() does set active parameter
2654         https://bugs.webkit.org/show_bug.cgi?id=192848
2655
2656         Reviewed by Eric Carlson.
2657
2658         Covered by updated test.
2659
2660         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
2661         (WebCore::updateRTCRtpSendParameters):
2662         The routine was updating the local value, not the out parameter.
2663
2664 2018-12-21  Eric Carlson  <eric.carlson@apple.com>
2665
2666         'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
2667         https://bugs.webkit.org/show_bug.cgi?id=187896
2668         <rdar://problem/42681445>
2669
2670         Reviewed by Jer Noble.
2671
2672         No new tests, tested manually.
2673
2674         * platform/mediastream/mac/AVVideoCaptureSource.h:
2675         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2676         (WebCore::AVVideoCaptureSource::deviceDisconnected):
2677         (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
2678         (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
2679         (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
2680         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
2681         (WebCore::deviceHasInputStreams):
2682         (WebCore::isValidCaptureDevice):
2683         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
2684         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
2685         (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
2686         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
2687         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2688         (WebCore::CoreAudioSharedUnit::setCaptureDevice):
2689         (WebCore::CoreAudioSharedUnit::devicesChanged):
2690         (WebCore::CoreAudioSharedUnit::startProducingData):
2691         (WebCore::CoreAudioSharedUnit::startInternal):
2692         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
2693         (WebCore::CoreAudioSharedUnit::captureFailed):
2694         (WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
2695         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2696         (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
2697         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2698
2699 2018-12-20  Ryosuke Niwa  <rniwa@webkit.org>
2700
2701         REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
2702         TestWebKitAPI.QuickLook.LegacyQuickLookContent
2703         https://bugs.webkit.org/show_bug.cgi?id=192859
2704         <rdar://problem/46887237>
2705
2706         Reviewed by Antti Koivisto.
2707
2708         After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
2709         is inside a delegate callback even when there is a ScriptDisallowedScope defined.
2710
2711         Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
2712         by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
2713
2714         Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
2715
2716         * dom/ContainerNodeAlgorithms.cpp:
2717         (WebCore::notifyChildNodeInserted):
2718         (WebCore::notifyChildNodeRemoved):
2719         * dom/Document.cpp:
2720         (WebCore::Document::nodeChildrenWillBeRemoved):
2721         (WebCore::Document::nodeWillBeRemoved):
2722         * dom/ScriptDisallowedScope.h:
2723         (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
2724         * html/HTMLFormElement.cpp:
2725         (WebCore:: const):
2726
2727 2018-12-21  Joseph Pecoraro  <pecoraro@apple.com>
2728
2729         Update status of some WebCore features in features.json
2730         https://bugs.webkit.org/show_bug.cgi?id=192998
2731
2732         Reviewed by Tim Horton.
2733
2734         * features.json:
2735         - Variation Fonts: Supported
2736         - Conic Gradients: Supported in Preview
2737         - Web Share: Supported in Preview
2738         - <datalist>: Supported in Preview
2739         - Intersection Observers: Supported in Preview
2740
2741 2018-12-21  Zalan Bujtas  <zalan@apple.com>
2742
2743         [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
2744         https://bugs.webkit.org/show_bug.cgi?id=192357
2745         <rdar://problem/42852260>
2746
2747         Reviewed by Simon Fraser.
2748
2749         Do not try to paint the file picker when painting is disabled.
2750
2751         * rendering/RenderFileUploadControl.cpp:
2752         (WebCore::RenderFileUploadControl::paintObject):
2753
2754 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2755
2756         [WebAuthN] userPresence should always be true
2757         https://bugs.webkit.org/show_bug.cgi?id=192835
2758         <rdar://problem/46538788>
2759
2760         Reviewed by Brent Fulgham.
2761
2762         In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
2763         This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
2764         After discussing with other members of the working group, we decided to make userPresence always default to true.
2765
2766         Covered by exisiting tests.
2767
2768         * Modules/webauthn/fido/DeviceRequestConverter.cpp:
2769         (fido::encodeGetAssertionRequestAsCBOR):
2770
2771 2018-12-21  Jiewen Tan  <jiewen_tan@apple.com>
2772
2773         [WebAuthN] Import an APDU coder from Chromium
2774         https://bugs.webkit.org/show_bug.cgi?id=192949
2775         <rdar://problem/46879933>
2776
2777         Reviewed by Brent Fulgham.
2778
2779         This patch imports an APDU coder from Chromium. Here is the documentation:
2780         https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
2781         APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
2782
2783         Here is a list of files that are imported from Chromium:
2784         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
2785         https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2786         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2787         https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2788         https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
2789
2790         Covered by API tests.
2791
2792         * Modules/webauthn/apdu/ApduCommand.cpp: Added.
2793         (apdu::ApduCommand::createFromMessage):
2794         (apdu::ApduCommand::ApduCommand):
2795         (apdu::ApduCommand::getEncodedCommand const):
2796         * Modules/webauthn/apdu/ApduCommand.h: Added.
2797         * Modules/webauthn/apdu/ApduResponse.cpp: Added.
2798         (apdu::ApduResponse::createFromMessage):
2799         (apdu::ApduResponse::ApduResponse):
2800         (apdu::ApduResponse::getEncodedResponse const):
2801         * Modules/webauthn/apdu/ApduResponse.h: Added.
2802         * Sources.txt:
2803         * WebCore.xcodeproj/project.pbxproj:
2804
2805 2018-12-21  Jer Noble  <jer.noble@apple.com>
2806
2807         Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
2808         https://bugs.webkit.org/show_bug.cgi?id=192985
2809         <rdar://problem/46750743>
2810
2811         Reviewed by Eric Carlson.
2812
2813         Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
2814
2815         * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
2816         (WebCore::WebKitMediaKeys::setMediaElement):
2817         * Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
2818         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
2819         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2820         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2821         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
2822         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2823
2824 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
2825
2826         CSS variables don't work for colors in "border" property
2827         https://bugs.webkit.org/show_bug.cgi?id=192922
2828
2829         Reviewed by Simon Fraser.
2830
2831         ParseColorFunction no longer consumes anything if the color was not valid.
2832
2833         Test: css-custom-properties-api/border-variable-parsing.html
2834
2835         * css/parser/CSSPropertyParserHelpers.cpp:
2836         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2837
2838 2018-12-21  Justin Fan  <justin_fan@apple.com>
2839
2840         [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
2841         https://bugs.webkit.org/show_bug.cgi?id=192990
2842
2843         Reviewed by Myles C. Maxfield.
2844
2845         Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
2846         Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
2847
2848         No new tests; no change in behavior.
2849
2850         * Modules/webgpu/WebGPUBindGroupLayout.cpp:
2851         (WebCore::WebGPUBindGroupLayout::create):
2852         (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
2853         * Modules/webgpu/WebGPUBindGroupLayout.h:
2854         (WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
2855         * Modules/webgpu/WebGPUDevice.cpp:
2856         (WebCore::WebGPUDevice::createBindGroupLayout const):
2857         * platform/graphics/gpu/GPUBindGroupLayout.h:
2858         * platform/graphics/gpu/GPUDevice.cpp:
2859         (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. 
2860         (WebCore::GPUDevice::createBindGroupLayout const): Deleted.
2861         * platform/graphics/gpu/GPUDevice.h:
2862         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2863         (WebCore::appendArgumentToArray):
2864         (WebCore::newEncoder):
2865         (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
2866         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2867         (WebCore::appendArgumentToArrayInMap): Deleted.
2868         (WebCore::GPUBindGroupLayout::create): Deleted.
2869
2870         Deleted unneeded GPUBindGroupLayout.cpp:
2871         * Sources.txt:
2872         * WebCore.xcodeproj/project.pbxproj:
2873         * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
2874
2875 2018-12-21  Alejandro G. Castro  <alex@igalia.com>
2876
2877         [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
2878         https://bugs.webkit.org/show_bug.cgi?id=190466
2879
2880         Reviewed by Youenn Fablet.
2881
2882         Added persistency to the DeviceIdHashSaltStorage.
2883
2884         * platform/glib/FileSystemGlib.cpp:
2885         (WebCore::FileSystem::getFileSize): Implemented this function to
2886         allow sharing code with the statistics storage class.
2887         * platform/glib/KeyedDecoderGlib.cpp:
2888         (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
2889         condition to control situations where the key is empty, it can
2890         happen if the user modifies the file in the disk.
2891         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
2892         to make work compilation with debug, unified builds.
2893
2894 2018-12-21  Zalan Bujtas  <zalan@apple.com>
2895
2896         Synchronous media query evaluation could destroy current Frame/FrameView.
2897         https://bugs.webkit.org/show_bug.cgi?id=192781
2898         <rdar://problem/34416793>
2899
2900         Reviewed by Chris Dumez.
2901
2902         Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
2903
2904         Test: printing/print-with-media-query-destory.html
2905
2906         * loader/DocumentLoader.cpp:
2907         (WebCore::DocumentLoader::finishedLoading):
2908         * page/Frame.cpp:
2909         (WebCore::Frame::setPrinting):
2910         * page/FrameView.cpp:
2911         (WebCore::FrameView::forceLayoutForPagination):
2912         * page/PrintContext.cpp:
2913         (WebCore::PrintContext::PrintContext):
2914         (WebCore::PrintContext::computePageRects):
2915         (WebCore::PrintContext::computePageRectsWithPageSizeInternal):
2916         (WebCore::PrintContext::begin):
2917         (WebCore::PrintContext::computeAutomaticScaleFactor):
2918         (WebCore::PrintContext::spoolPage):
2919         (WebCore::PrintContext::spoolRect):
2920         (WebCore::PrintContext::end):
2921         * page/PrintContext.h:
2922         (WebCore::PrintContext::frame const): Deleted.
2923
2924 2018-12-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2925
2926         Setting the file wrapper and content type of an attachment to a PDF should update its image
2927         https://bugs.webkit.org/show_bug.cgi?id=192984
2928         <rdar://problem/46798028>
2929
2930         Reviewed by Tim Horton.
2931
2932         Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
2933         Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
2934
2935         * html/HTMLAttachmentElement.cpp:
2936         (WebCore::mimeTypeIsSuitableForInlineImageAttachment):
2937         (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
2938
2939 2018-12-21  Justin Michaud  <justin_michaud@apple.com>
2940
2941         Repeated background images with zero size should display the background color
2942         https://bugs.webkit.org/show_bug.cgi?id=192962
2943
2944         Reviewed by Antti Koivisto.
2945
2946         Test: fast/backgrounds/background-repeat-with-zero-size.html
2947
2948         * platform/LengthSize.h:
2949         (WebCore::LengthSize::isEmpty const):
2950         * rendering/RenderBoxModelObject.cpp:
2951         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
2952         * rendering/style/FillLayer.h:
2953         (WebCore::FillLayer::isEmpty const):
2954
2955 2018-12-21  Manuel Rego Casasnovas  <rego@igalia.com>
2956
2957         [css-grid] Fix percentages in relative offsets for grid items
2958         https://bugs.webkit.org/show_bug.cgi?id=190492
2959
2960         Reviewed by Sergio Villar Senin.
2961
2962         The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
2963         where the containing block is the grid area.
2964         The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
2965
2966         Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
2967
2968         * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
2969         (WebCore::RenderBox::overrideContainingBlockContentWidth const):
2970         (WebCore::RenderBox::overrideContainingBlockContentHeight const):
2971         (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
2972         (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
2973         * rendering/RenderBox.h:
2974         * rendering/RenderBoxModelObject.cpp:
2975         (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
2976         to take into account overrideContainingBlockContentWidth|Height for grid items.
2977         * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
2978         that will be overridden in RenderBox.
2979         (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
2980         (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
2981         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
2982         (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
2983
2984 2018-12-20  Justin Fan  <justin_fan@apple.com>
2985
2986         [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
2987         https://bugs.webkit.org/show_bug.cgi?id=192956
2988
2989         Reviewed by Myles Maxfield.
2990
2991         No testable behavior change. Existing tests cover possible crashing.
2992
2993         Add GPUBindGroupLayoutMetal.mm:
2994         * SourcesCocoa.txt:
2995         * WebCore.xcodeproj/project.pbxproj:
2996
2997         Flesh out GPUBindGroupLayout::create:
2998         * platform/graphics/gpu/GPUBindGroupLayout.cpp:
2999         * platform/graphics/gpu/GPUBindGroupLayout.h:
3000         * platform/graphics/gpu/GPUDevice.cpp:
3001         (WebCore::GPUDevice::createBindGroupLayout const):
3002         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
3003         (WebCore::appendArgumentToArrayInMap): Added.
3004         (WebCore::GPUBindGroupLayout::create):
3005         (WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
3006         (WebCore::MTLDataTypeForBindingType): Added.
3007
3008 2018-12-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3009
3010         Unreviewed, remove stray #pragma once added to .cpp file
3011
3012         * svg/properties/SVGAttributeOwnerProxy.cpp:
3013
3014 2018-12-20  Justin Michaud  <justin_michaud@apple.com>
3015
3016         Adding runtime-enabled attribute to Element prevents inlining property access
3017         https://bugs.webkit.org/show_bug.cgi?id=192901
3018
3019         Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
3020
3021         Reviewed by Ryosuke Niwa.
3022
3023         * bindings/scripts/CodeGeneratorJS.pm:
3024         (GenerateImplementation):
3025         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
3026         (WebCore::JSTestEnabledBySettingPrototype::finishCreation):
3027         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3028         (WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
3029         * bindings/scripts/test/JS/JSTestNode.cpp:
3030         (WebCore::JSTestNodePrototype::finishCreation):
3031         * bindings/scripts/test/JS/JSTestObj.cpp:
3032         (WebCore::JSTestObjPrototype::finishCreation):
3033
3034 2018-12-20  Chris Dumez  <cdumez@apple.com>
3035
3036         Use Optional::hasValue() instead of Optional::has_value()
3037         https://bugs.webkit.org/show_bug.cgi?id=192948
3038
3039         Reviewed by Tim Horton.
3040
3041         * bindings/js/DOMPromiseProxy.h:
3042         (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
3043         (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
3044         (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
3045         * dom/DataTransferItemList.h:
3046         (WebCore::DataTransferItemList::hasItems const):
3047         * dom/EventTarget.cpp:
3048         (WebCore::EventTarget::addEventListener):
3049         * html/HTMLMediaElement.cpp:
3050         (WebCore::HTMLMediaElement::captionDisplayMode):
3051         * platform/graphics/MediaPlayer.cpp:
3052         (WebCore::MediaPlayer::wouldTaintOrigin const):
3053         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3054         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3055         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3056         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
3057         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3058         (webKitMediaSrcUpdatePresentationSize):
3059         * platform/mac/NSScrollerImpDetails.mm:
3060         (WebCore::ScrollerStyle::recommendedScrollerStyle):
3061         * rendering/RenderListItem.cpp:
3062         (WebCore::RenderListItem::setExplicitValue):
3063
3064 2018-12-20  Chris Dumez  <cdumez@apple.com>
3065
3066         Move HTTPS_UPGRADE code behind a runtime flag, off by default
3067         https://bugs.webkit.org/show_bug.cgi?id=192937
3068
3069         Reviewed by Youenn Fablet.
3070
3071         Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
3072
3073         * page/Settings.yaml:
3074
3075 2018-12-20  Youenn Fablet  <youenn@apple.com>
3076
3077         Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
3078         https://bugs.webkit.org/show_bug.cgi?id=192838
3079
3080         Reviewed by Chris Dumez.
3081
3082         Generate constructor code in case of a Private but not Public constructor.
3083         Make sure this is correctly exposed in global objects.
3084         Add JS built-in constructor implementations for those two objects.
3085
3086         Also add JS built-in constructors for controller and byob request.
3087         To keep existing behavior, JS built-ins calling these constructors need to pass
3088         an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
3089         In the latter case, the constructor will throw.
3090
3091         Covered by existing tests, no observable change of behavior.
3092
3093         * Modules/streams/ReadableByteStreamController.idl:
3094         * Modules/streams/ReadableByteStreamController.js:
3095         (initializeReadableByteStreamController):
3096         (getter.byobRequest):
3097         * Modules/streams/ReadableByteStreamInternals.js:
3098         (privateInitializeReadableByteStreamController): Deleted.
3099         (privateInitializeReadableStreamBYOBRequest): Deleted.
3100         * Modules/streams/ReadableStream.js:
3101         (initializeReadableStream):
3102         * Modules/streams/ReadableStreamBYOBReader.js:
3103         (initializeReadableStreamBYOBReader):
3104         * Modules/streams/ReadableStreamBYOBRequest.idl:
3105         * Modules/streams/ReadableStreamBYOBRequest.js:
3106         (initializeReadableStreamBYOBRequest):
3107         * Modules/streams/ReadableStreamDefaultController.idl:
3108         * Modules/streams/ReadableStreamDefaultController.js:
3109         (initializeReadableStreamDefaultController):
3110         (enqueue):
3111         * Modules/streams/ReadableStreamDefaultReader.js:
3112         (initializeReadableStreamDefaultReader):
3113         * Modules/streams/ReadableStreamInternals.js:
3114         (readableStreamDefaultControllerError): Deleted.
3115         * Sources.txt:
3116         * UnifiedSources-input.xcfilelist:
3117         * WebCore.xcodeproj/project.pbxproj:
3118         * bindings/js/JSDOMBuiltinConstructor.h:
3119         * bindings/js/JSDOMGlobalObject.cpp:
3120         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
3121         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
3122         * bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
3123         * bindings/scripts/CodeGeneratorJS.pm:
3124         (GeneratePropertiesHashTable):
3125         * bindings/scripts/preprocess-idls.pl:
3126         (shouldExposeInterface):
3127
3128 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
3129
3130         [WebAuthN] Remove hash from Client Data
3131         https://bugs.webkit.org/show_bug.cgi?id=192727
3132         <rdar://problem/46746673>
3133
3134         Reviewed by Brent Fulgham.
3135
3136         The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
3137         https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
3138
3139         Covered by existing tests.
3140
3141         * Modules/webauthn/AuthenticatorCoordinator.cpp:
3142         (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
3143
3144 2018-12-20  Jiewen Tan  <jiewen_tan@apple.com>
3145
3146         [WebAuthN] Add a runtime flag for local authenticator
3147         https://bugs.webkit.org/show_bug.cgi?id=192792
3148         <rdar://problem/46798738>
3149
3150         Reviewed by Brent Fulgham.
3151
3152         No tests.
3153
3154         This patch adds a runtime flag for local authenticator and removes ways to
3155         set the runtime flag for web authentication in LegacyWebKit.
3156
3157         * page/RuntimeEnabledFeatures.h:
3158         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
3159         (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
3160
3161 2018-12-20  Jeremy Jones  <jeremyj@apple.com>
3162
3163         Pointer lock causes abandoned documents
3164         https://bugs.webkit.org/show_bug.cgi?id=188727
3165         rdar://problem/44248197
3166         
3167         Reviewed by Simon Fraser.
3168
3169         Fixes --world-leaks in these tests:
3170
3171         pointer-lock/locked-element-removed-from-dom.html
3172         pointer-lock/mouse-event-delivery.html
3173         fast/shadow-dom/pointerlockelement-in-slot.html
3174
3175         PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
3176
3177         * page/PointerLockController.cpp:
3178         (WebCore::PointerLockController::elementRemoved):
3179         (WebCore::PointerLockController::documentDetached):
3180         (WebCore::PointerLockController::didAcquirePointerLock):
3181         * page/PointerLockController.h:
3182
3183 2018-12-20  Chris Dumez  <cdumez@apple.com>
3184
3185         Use Optional::valueOr() instead of Optional::value_or()
3186         https://bugs.webkit.org/show_bug.cgi?id=192933
3187
3188         Reviewed by Geoffrey Garen.
3189
3190         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3191         (WebCore::convert):
3192         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
3193         * Modules/encryptedmedia/MediaKeySession.cpp:
3194         (WebCore::MediaKeySession::load):
3195         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3196         (WebCore::IDBDatabaseIdentifier::hash const):
3197         * Modules/indexeddb/IDBFactory.cpp:
3198         (WebCore::IDBFactory::open):
3199         * Modules/mediastream/MediaStreamTrack.cpp:
3200         (WebCore::MediaStreamTrack::applyConstraints):
3201         * Modules/mediastream/RTCDTMFSender.cpp:
3202         (WebCore::RTCDTMFSender::insertDTMF):
3203         * Modules/webdatabase/SQLTransaction.cpp:
3204         (WebCore::SQLTransaction::executeSql):
3205         * Modules/webvr/VRFrameData.cpp:
3206         (WebCore::VRFrameData::update):
3207         * animation/AnimationTimeline.cpp:
3208         (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
3209         * animation/DeclarativeAnimation.cpp:
3210         (WebCore::DeclarativeAnimation::cancel):
3211         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
3212         * animation/KeyframeEffect.cpp:
3213         (WebCore::computeMissingKeyframeOffsets):
3214         (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
3215         * animation/WebAnimation.cpp:
3216         (WebCore::WebAnimation::runPendingPlayTask):
3217         (WebCore::WebAnimation::runPendingPauseTask):
3218         * bindings/js/SerializedScriptValue.cpp:
3219         (WebCore::CloneSerializer::write):
3220         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3221         (WebCore::CryptoAlgorithmHMAC::generateKey):
3222         (WebCore::CryptoAlgorithmHMAC::importKey):
3223         * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
3224         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
3225         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
3226         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
3227         (WebCore::CryptoKeyRSA::importSpki):
3228         (WebCore::CryptoKeyRSA::importPkcs8):
3229         * crypto/keys/CryptoKeyRSA.cpp:
3230         (WebCore::CryptoKeyRSA::importJwk):
3231         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
3232         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
3233         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
3234         * crypto/mac/CryptoKeyRSAMac.cpp:
3235         (WebCore::CryptoKeyRSA::importSpki):
3236         (WebCore::CryptoKeyRSA::importPkcs8):
3237         * css/CSSComputedStyleDeclaration.cpp:
3238         (WebCore::counterToCSSValue):
3239         * css/CSSFontFace.cpp:
3240         (WebCore::calculateItalicRange):
3241         * css/CSSPrimitiveValue.cpp:
3242         (WebCore::CSSPrimitiveValue::doubleValue const):
3243         * css/CSSStyleSheet.cpp:
3244         (WebCore::CSSStyleSheet::addRule):
3245         * css/DOMMatrix.cpp:
3246         (WebCore::DOMMatrix::rotateSelf):
3247         * css/DOMMatrixReadOnly.cpp:
3248         (WebCore::DOMMatrixReadOnly::validateAndFixup):
3249         * css/StyleBuilderCustom.h:
3250         (WebCore::StyleBuilderCustom::applyValueCounter):
3251         * css/parser/MediaQueryParser.cpp:
3252         (WebCore::MediaQueryParser::commitMediaQuery):
3253         * dom/Document.h:
3254         (WebCore::Document::referrerPolicy const):
3255         * dom/Element.cpp:
3256         (WebCore::toScrollAlignment):
3257         * dom/EventTarget.cpp:
3258         (WebCore::EventTarget::addEventListener):
3259         * dom/MutationObserver.cpp:
3260         (WebCore::MutationObserver::observe):
3261         * editing/cocoa/FontAttributeChangesCocoa.mm:
3262         (WebCore::FontChanges::platformFontFamilyNameForCSS const):
3263         * fileapi/File.cpp:
3264         (WebCore::File::File):
3265         * html/DOMTokenList.cpp:
3266         (WebCore::DOMTokenList::toggle):
3267         * html/HTMLOListElement.h:
3268         * html/ImageBitmap.cpp:
3269         (WebCore::croppedSourceRectangleWithFormatting):
3270         * html/canvas/CanvasPattern.cpp:
3271         (WebCore::CanvasPattern::setTransform):
3272         * html/canvas/CanvasRenderingContext2DBase.cpp:
3273         (WebCore::CanvasRenderingContext2DBase::setTransform):
3274         (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
3275         (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
3276         * html/canvas/Path2D.cpp:
3277         (WebCore::Path2D::addPath):
3278         * inspector/InspectorCanvas.cpp:
3279         (WebCore::InspectorCanvas::buildAction):
3280         * inspector/InspectorFrontendHost.cpp:
3281         (WebCore::populateContextMenu):
3282         * layout/FormattingContext.cpp:
3283         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
3284         * layout/FormattingContextGeometry.cpp:
3285         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3286         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3287         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3288         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3289         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
3290         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3291         (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
3292         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3293         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3294         * layout/FormattingContextQuirks.cpp:
3295         (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
3296         * layout/MarginTypes.h:
3297         (WebCore::Layout::VerticalMargin::usedValues const):
3298         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3299         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3300         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3301         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
3302         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
3303         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
3304         * layout/displaytree/DisplayBox.h:
3305         (WebCore::Display::Box::width const):
3306         (WebCore::Display::Box::height const):
3307         (WebCore::Display::Box::contentBoxTop const):
3308         (WebCore::Display::Box::contentBoxLeft const):
3309         * layout/floats/FloatingContext.cpp:
3310         (WebCore::Layout::Iterator::set):
3311         * layout/inlineformatting/InlineFormattingContext.cpp:
3312         (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
3313         (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
3314         * loader/FrameLoader.cpp:
3315         (WebCore::FrameLoader::urlSelected):
3316         * loader/NavigationAction.cpp:
3317         * page/FrameView.cpp:
3318         (WebCore::FrameView::setLayoutViewportOverrideRect):
3319         (WebCore::FrameView::documentToAbsoluteScaleFactor const):
3320         (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
3321         * page/Page.cpp:
3322         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
3323         * page/SecurityOriginData.cpp:
3324         (WebCore::SecurityOriginData::databaseIdentifier const):
3325         * page/SecurityOriginData.h:
3326         (WebCore::SecurityOriginDataHash::hash):
3327         * page/SecurityOriginHash.h:
3328         (WebCore::SecurityOriginHash::hash):
3329         * page/ViewportConfiguration.cpp:
3330         (WebCore::ViewportConfiguration::setViewLayoutSize):
3331         * page/WindowFeatures.cpp:
3332         (WebCore::parseDialogFeatures):
3333         * page/animation/AnimationBase.cpp:
3334         (WebCore::AnimationBase::updateStateMachine):
3335         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
3336         (WebCore::AnimationBase::getTimeToNextEvent const):
3337         (WebCore::AnimationBase::freezeAtTime):
3338         (WebCore::AnimationBase::getElapsedTime const):
3339         * page/animation/CSSAnimationController.cpp:
3340         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
3341         * page/cocoa/ResourceUsageThreadCocoa.mm:
3342         (WebCore::ResourceUsageThread::platformThreadBody):
3343         * page/linux/ResourceUsageThreadLinux.cpp:
3344         (WebCore::ResourceUsageThread::platformThreadBody):
3345         * platform/graphics/ComplexTextController.cpp:
3346         (WebCore::ComplexTextController::offsetForPosition):
3347         * platform/graphics/FontCache.h:
3348         (WebCore::FontDescriptionKey::computeHash const):
3349         * platform/graphics/FontCascade.cpp:
3350         (WebCore::FontCascade::drawText const):
3351         (WebCore::FontCascade::drawEmphasisMarks const):
3352         (WebCore::FontCascade::displayListForTextRun const):
3353         (WebCore::FontCascade::adjustSelectionRectForText const):
3354         (WebCore::FontCascade::codePath const):
3355         * platform/graphics/FontSelectionAlgorithm.cpp:
3356         (WebCore::FontSelectionAlgorithm::styleDistance const):
3357         * platform/graphics/FontSelectionAlgorithm.h:
3358         (WebCore::operator<<):
3359         (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
3360         (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
3361         (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
3362         * platform/graphics/ShadowBlur.cpp:
3363         (WebCore::ShadowBlur::calculateLayerBoundingRect):
3364         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3365         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3366         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3367         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
3368         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3369         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
3370         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3371         (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
3372         * platform/graphics/ca/GraphicsLayerCA.cpp:
3373         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
3374         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3375         (WebCore::preparePlatformFont):
3376         * platform/graphics/filters/FETurbulence.cpp:
3377         (WebCore::FETurbulence::fillRegion const):
3378         * platform/graphics/gstreamer/GStreamerCommon.cpp:
3379         (WebCore::initializeGStreamer):
3380         * platform/graphics/texmap/TextureMapperLayer.cpp:
3381         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
3382         (WebCore::TextureMapperLayer::replicaTransform):
3383         (WebCore::TextureMapperLayer::syncAnimations):
3384         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3385         (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
3386         (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
3387         * platform/graphics/transforms/TransformState.cpp:
3388         (WebCore::TransformState::mappedPoint const):
3389         (WebCore::TransformState::mapQuad const):
3390         (WebCore::TransformState::flattenWithTransform):
3391         * platform/network/CacheValidation.cpp:
3392         (WebCore::computeCurrentAge):
3393         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3394         * platform/network/NetworkStateNotifier.cpp:
3395         (WebCore::NetworkStateNotifier::onLine)