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