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