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