Add a way to check if a host is an IP address
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         Add a way to check if a host is an IP address
4         https://bugs.webkit.org/show_bug.cgi?id=182427
5
6         Reviewed by Alex Christensen.
7
8         There are several places where this is needed. We currently just assume that any host ending in a digit is an IP
9         address, except in PublicSuffix where platform specific code is used. This patch adds URL::hostIsIPAddress()
10         platform specific implementations, falling back to current assumption if there isn't an implementation for the
11         platform.
12
13         * page/OriginAccessEntry.cpp:
14         (WebCore::OriginAccessEntry::OriginAccessEntry): Use URL::hostIsIPAddress().
15         * platform/URL.cpp:
16         (WebCore::URL::hostIsIPAddress): Fallback implementation.
17         * platform/URL.h:
18         * platform/mac/PublicSuffixMac.mm:
19         (WebCore::topPrivatelyControlledDomain): Use URL::hostIsIPAddress().
20         * platform/mac/URLMac.mm:
21         (WebCore::URL::hostIsIPAddress): Move implementation from PublicSuffixMac.mm.
22         * platform/network/curl/CookieUtil.cpp:
23         (WebCore::CookieUtil::isIPAddress): Use URL::hostIsIPAddress().
24         * platform/soup/URLSoup.cpp:
25         (WebCore::URL::hostIsIPAddress): Use g_hostname_is_ip_address().
26
27 2018-02-04  Zan Dobersek  <zdobersek@igalia.com>
28
29         [Cairo] Correctly calculate stride in GraphicsContext3D::paintToCanvas()
30         https://bugs.webkit.org/show_bug.cgi?id=182466
31
32         Reviewed by Michael Catanzaro.
33
34         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
35         (WebCore::GraphicsContext3D::paintToCanvas):
36         Use cairo_format_stride_for_width() to obtain stride that Cairo thinks
37         is appropriate for the given width, taking into account internal
38         alignment requirements.
39
40 2018-02-04  Zan Dobersek  <zdobersek@igalia.com>
41
42         [Cairo] Split TexMap functionality out of GraphicsContext3DCairo
43         https://bugs.webkit.org/show_bug.cgi?id=182465
44
45         Reviewed by Michael Catanzaro.
46
47         Take the Non-Cairo GraphicsContext3D functionality that's stashed in
48         GraphicsContext3DCairo and move it into the GraphicsContext3DTextureMapper
49         file.
50
51         In GraphicsContext3DCairo.cpp, only the Cairo-specific GraphicsContext3D
52         functionality remains, specifically ImageExtractor and paintToCanvas().
53
54         Everything else is moved into GraphicsContext3DTextureMapper.cpp. This
55         filename and its location under platform/graphics/texmap/ was chosen
56         since all the ports using this file (GTK, WPE, WinCairo) are also using
57         the TextureMapper module. Various #if-guards are simplified in the
58         moved-over code to reflect this.
59
60         GraphicsContext3DCairo.cpp now better reflects GraphicsContext3DCG.cpp,
61         with both implementing functionality specific to a 2D painting library,
62         whereas GraphicsContext3DTextureMapper.cpp reflects
63         GraphicsContext3DCocoa.cpp in covering functionality needed to integrate
64         the GraphicsContext3D output into the platform-specific composition
65         system.
66
67         No new tests -- no change in behavior.
68
69         * platform/TextureMapper.cmake:
70         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
71         (WebCore::activeContexts): Deleted.
72         (WebCore::GraphicsContext3D::create): Deleted.
73         (WebCore::GraphicsContext3D::GraphicsContext3D): Deleted.
74         (WebCore::GraphicsContext3D::~GraphicsContext3D): Deleted.
75         (WebCore::GraphicsContext3D::setContextLostCallback): Deleted.
76         (WebCore::GraphicsContext3D::setErrorMessageCallback): Deleted.
77         (WebCore::GraphicsContext3D::makeContextCurrent): Deleted.
78         (WebCore::GraphicsContext3D::checkGPUStatus): Deleted.
79         (WebCore::GraphicsContext3D::platformGraphicsContext3D): Deleted.
80         (WebCore::GraphicsContext3D::platformTexture const): Deleted.
81         (WebCore::GraphicsContext3D::isGLES2Compliant const): Deleted.
82         (WebCore::GraphicsContext3D::platformLayer const): Deleted.
83         (WebCore::GraphicsContext3D::getExtensions): Deleted.
84         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Copied from Source/WebCore/platform/graphics/cairo/GraphicsContext3DCairo.cpp.
85         (WebCore::activeContexts):
86         (WebCore::GraphicsContext3D::create):
87         (WebCore::GraphicsContext3D::GraphicsContext3D):
88         (WebCore::GraphicsContext3D::~GraphicsContext3D):
89         (WebCore::GraphicsContext3D::setContextLostCallback):
90         (WebCore::GraphicsContext3D::setErrorMessageCallback):
91         (WebCore::GraphicsContext3D::makeContextCurrent):
92         (WebCore::GraphicsContext3D::checkGPUStatus):
93         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
94         (WebCore::GraphicsContext3D::platformTexture const):
95         (WebCore::GraphicsContext3D::isGLES2Compliant const):
96         (WebCore::GraphicsContext3D::platformLayer const):
97         (WebCore::GraphicsContext3D::getExtensions):
98
99 2018-02-04  Zan Dobersek  <zdobersek@igalia.com>
100
101         Simplify GraphicsContext3D::paintToCanvas()
102         https://bugs.webkit.org/show_bug.cgi?id=182459
103
104         Reviewed by Michael Catanzaro.
105
106         Cairo-specific paintToCanvas() method is dropped in favor of the more
107         common one that operates on a GraphicsContext object. The platform
108         context object is then retrieved inside the Cairo-speficic
109         paintToCanvas() implementation, and not at the call site in
110         GraphicsContext3D::paintRenderingResultsToCanvas().
111
112         GraphicsContext3D::paintToCanvas() is also modified so that the image
113         and canvas sizes are passed through IntSize objects, and not through
114         a width-and-height pair of integer values.
115
116         No new tests -- no change in behavior.
117
118         * platform/graphics/GraphicsContext3D.h:
119         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
120         (WebCore::GraphicsContext3D::paintToCanvas):
121         * platform/graphics/cg/GraphicsContext3DCG.cpp:
122         (WebCore::GraphicsContext3D::paintToCanvas):
123         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
124         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
125
126 2018-02-03  Alexey Proskuryakov  <ap@apple.com>
127
128         Tweak availability macros for CAN_DISALLOW_USER_INSTALLED_FONTS
129
130         Rubber-stamped by Maciej Stachowiak.
131
132         * platform/graphics/cocoa/FontCacheCoreText.cpp:
133
134 2018-02-02  Daniel Bates  <dabates@apple.com>
135
136         Clean up FrameLoader::receivedFirstData()
137         https://bugs.webkit.org/show_bug.cgi?id=182361
138
139         Reviewed by Andy Estes.
140
141         * loader/FrameLoader.cpp:
142         (WebCore::FrameLoader::receivedFirstData):
143
144 2018-02-02  Myles C. Maxfield  <mmaxfield@apple.com>
145
146         Test fix after r227995
147         https://bugs.webkit.org/show_bug.cgi?id=180951
148
149         Unreviewed.
150
151         Webfonts shouldn't be run through CTFontDescriptorCreateMatchingFontDescriptor().
152         Also, unify macOS's and iOS's implementation of FontCache::lastResortFallbackFont().
153
154         Covered by existing tests.
155
156         * platform/graphics/cocoa/FontCacheCoreText.cpp:
157         (WebCore::FontDatabase::collectionForFamily):
158         (WebCore::FontDatabase::fontForPostScriptName):
159         (WebCore::addAttributesForInstalledFonts):
160         (WebCore::addAttributesForWebFonts):
161         (WebCore::installedFontMandatoryAttributes):
162         (WebCore::FontCache::lastResortFallbackFont):
163         (WebCore::addAttributesForUserInstalledFonts): Deleted.
164         (WebCore::mandatoryAttributesForUserInstalledFonts): Deleted.
165         * platform/graphics/cocoa/FontCacheCoreText.h:
166         * platform/graphics/ios/FontCacheIOS.mm:
167         (WebCore::FontCache::lastResortFallbackFont): Deleted.
168         * platform/graphics/mac/FontCacheMac.mm:
169         (WebCore::FontCache::lastResortFallbackFont): Deleted.
170         * platform/graphics/mac/FontCustomPlatformData.cpp:
171         (WebCore::FontCustomPlatformData::fontPlatformData):
172
173 2018-02-02  Basuke Suzuki  <Basuke.Suzuki@sony.com>
174
175         Fix build error after r 227457 with VIDEO and WEB_AUDIO disabled
176         https://bugs.webkit.org/show_bug.cgi?id=182395
177
178         Reviewed by Eric Carlson
179
180         * platform/audio/PlatformMediaSessionManager.cpp:
181         (WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
182
183 2018-02-02  Don Olmstead  <don.olmstead@sony.com>
184
185         Remove WebCore/ForwardingHeaders directory
186         https://bugs.webkit.org/show_bug.cgi?id=182347
187
188         Reviewed by Alex Christensen.
189
190         Baseline tests updated.
191
192         * bindings/scripts/CodeGeneratorJS.pm:
193         (AddToIncludesForIDLType):
194         (GenerateEnumerationImplementationContent):
195         (GenerateDictionaryImplementationContent):
196         (GenerateHeader):
197         (GenerateOverloadDispatcher):
198         (addUnscopableProperties):
199         (GenerateImplementation):
200         (GenerateOperationDefinition):
201         (GenerateSerializerDefinition):
202         (GenerateConstructorHelperMethods):
203         * bindings/scripts/test/JS/JSInterfaceName.cpp:
204         * bindings/scripts/test/JS/JSMapLike.cpp:
205         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
206         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
207         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
208         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
209         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
210         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
211         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
212         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
213         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
214         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
215         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
216         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
217         * bindings/scripts/test/JS/JSTestDOMJIT.h:
218         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
219         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
220         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
221         * bindings/scripts/test/JS/JSTestException.cpp:
222         * bindings/scripts/test/JS/JSTestException.h:
223         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
224         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
225         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
226         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
227         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
228         * bindings/scripts/test/JS/JSTestInterface.cpp:
229         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
230         * bindings/scripts/test/JS/JSTestIterable.cpp:
231         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
232         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
233         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
234         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
235         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
236         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
237         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
238         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
239         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
240         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
241         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
242         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
243         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
244         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
245         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
246         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
247         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
248         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
249         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
250         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
251         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
252         * bindings/scripts/test/JS/JSTestNode.cpp:
253         * bindings/scripts/test/JS/JSTestObj.cpp:
254         * bindings/scripts/test/JS/JSTestObj.h:
255         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
256         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
257         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
258         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
259         * bindings/scripts/test/JS/JSTestPluginInterface.h:
260         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
261         * bindings/scripts/test/JS/JSTestSerialization.cpp:
262         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
263         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
264         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
265         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
266         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
267         * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
268         * bindings/scripts/test/JS/JSTestStringifier.cpp:
269         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
270         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
271         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
272         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
273         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
274         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
275         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
276         * dom/make_event_factory.pl:
277         (generateImplementation):
278
279 2018-02-02  David Quesada  <david_quesada@apple.com>
280
281         WebAppManifest scope should default to the containing directory of start_url if 'scope' is not specified
282         https://bugs.webkit.org/show_bug.cgi?id=182363
283         rdar://problem/37093498
284
285         Reviewed by Ryosuke Niwa.
286
287         If an app manifest doesn't specify a scope, we should default to the "parent directory" of
288         the start URL, rather than leaving the app unbounded. This is more reasonable than using the
289         entire internet as the app scope.
290
291         No new tests, updates to the existing tests verify the new behavior.
292
293         * Modules/applicationmanifest/ApplicationManifestParser.cpp:
294         (WebCore::ApplicationManifestParser::parseScope):
295
296 2018-02-02  Youenn Fablet  <youenn@apple.com>
297
298         Clearing all service worker registrations should wait for importing service worker registration to finish
299         https://bugs.webkit.org/show_bug.cgi?id=182407
300         <rdar://problem/37167523>
301
302         Reviewed by Chris Dumez.
303
304         * workers/service/server/SWServer.cpp:
305         (WebCore::SWServer::clear): ensure completion handler is called on early exit case.
306
307 2018-02-02  Youenn Fablet  <youenn@apple.com>
308
309         Clearing all service worker registrations should wait for importing service worker registration to finish
310         https://bugs.webkit.org/show_bug.cgi?id=182407
311
312         Reviewed by Chris Dumez.
313
314         Covered by existing tests and the service worker API test being no longer flaky.
315
316         * workers/service/server/SWServer.cpp:
317         (WebCore::SWServer::registrationStoreImportComplete):
318         (WebCore::SWServer::clearAll):
319         (WebCore::SWServer::clear):
320         (WebCore::SWServer::getOriginsWithRegistrations):
321         * workers/service/server/SWServer.h:
322
323 2018-02-02  Chris Dumez  <cdumez@apple.com>
324
325         Clearing a registration should null out its workers before setting their state to "redundant"
326         https://bugs.webkit.org/show_bug.cgi?id=182418
327         <rdar://problem/37142874>
328
329         Reviewed by Youenn Fablet.
330
331         Clearing a registration should null out its workers before setting their state to "redundant".
332         This seems to match Firefox and Chrome.
333
334         No new tests, rebaselined existing test.
335
336         * workers/service/server/SWServerRegistration.cpp:
337         (WebCore::SWServerRegistration::clear):
338         (WebCore::clearRegistrationWorker): Deleted.
339
340 2018-02-02  Antoine Quint  <graouts@apple.com>
341
342         [Modern Media Controls] Turn media/modern-media-controls/tracks-panel and media/modern-media-controls/tracks-support back on
343         https://bugs.webkit.org/show_bug.cgi?id=182426
344
345         Reviewed by Dean Jackson.
346
347         Ensure that the tracks panel isn't dismissed by updating the layout.
348
349         * Modules/modern-media-controls/controls/inline-media-controls.js:
350         (InlineMediaControls.prototype.layout):
351
352 2018-02-02  Commit Queue  <commit-queue@webkit.org>
353
354         Unreviewed, rolling out r227964.
355         https://bugs.webkit.org/show_bug.cgi?id=182423
356
357         It broke several unit tests (Requested by KaL on #webkit).
358
359         Reverted changeset:
360
361         "[SOUP] Ensure domain is valid when converting a WebCore
362         Cookie to Soup"
363         https://bugs.webkit.org/show_bug.cgi?id=182328
364         https://trac.webkit.org/changeset/227964
365
366 2018-02-01  Chris Dumez  <cdumez@apple.com>
367
368         When SW install fails, null out registration.installing before setting worker state to "redundant"
369         https://bugs.webkit.org/show_bug.cgi?id=182416
370         <rdar://problem/37141997>
371
372         Reviewed by Youenn Fablet.
373
374         When SW install fails, null out registration.installing before setting worker state to "redundant".
375         This does not match the spec but this is what Firefox and Chrome do. This is also what the
376         web-platform-tests expect.
377
378         Test: http/tests/workers/service/install-fails.html
379
380         * workers/service/server/SWServerJobQueue.cpp:
381         (WebCore::SWServerJobQueue::didFinishInstall):
382
383 2018-02-01  Myles C. Maxfield  <mmaxfield@apple.com>
384
385         Test fix after r227848.
386         https://bugs.webkit.org/show_bug.cgi?id=180951
387
388         Unreviewed.
389
390         Using kCTFontNameAttribute on an in-memory font causes CTFontDescriptorCreateMatchingFontDescriptor()
391         to return nullptr. Luckily, we weren't using that attribute anyway.
392
393         Covered by existing tests.
394
395         * platform/graphics/cocoa/FontCacheCoreText.cpp:
396         (WebCore::mandatoryAttributesForUserInstalledFonts):
397
398 2018-02-01  Youenn Fablet  <youenn@apple.com>
399
400         Delay service worker process creation until actually needed by SWServer
401         https://bugs.webkit.org/show_bug.cgi?id=182301
402
403         Reviewed by Chris Dumez.
404
405         Rename SWServer::Connection::scheduleJobInServer to scheduleJob.
406         Add sessionID getter from an SWServer.
407
408         * workers/service/server/SWServer.h:
409         (WebCore::SWServer::sessionID const):
410
411 2018-02-01  Fujii Hironori  <Hironori.Fujii@sony.com>
412
413         REGRESSION(r227594) [WinCairo] NULL pointer crash in GraphicsContext::getWindowsContext
414         https://bugs.webkit.org/show_bug.cgi?id=182282
415
416         Reviewed by Žan Doberšek.
417
418         ImageBufferCairo has been changed to use GraphicsContextImplCairo
419         in r227594. But, GraphicsContext::getWindowsContext doesn't care
420         the case of using GraphicsContextImpl and crashes due to null
421         dereference of GraphicsContext::m_data.
422
423         GraphicsContext::getWindowsContext should create a HDC in that case.
424
425         Remove the argument mayCreateBitmap because it is always
426         true at the moment.
427
428         No new tests (Covered by the existing tests)
429
430         * platform/graphics/GraphicsContext.h:
431         Removed a argument mayCreateBitmap of getWindowsContext and releaseWindowsContext.
432         * platform/graphics/win/GraphicsContextCGWin.cpp:
433         (WebCore::GraphicsContext::releaseWindowsContext): Ditto.
434         * platform/graphics/win/GraphicsContextCairoWin.cpp:
435         (WebCore::GraphicsContext::releaseWindowsContext): Ditto.
436         * platform/graphics/win/GraphicsContextDirect2D.cpp:
437         (WebCore::GraphicsContext::releaseWindowsContext): Ditto.
438         * platform/graphics/win/GraphicsContextWin.cpp:
439         (WebCore::GraphicsContext::getWindowsContext):
440         Create a HDC if m_impl is null. Removed a argument mayCreateBitmap.
441         * platform/graphics/win/LocalWindowsContext.h:
442         (WebCore::LocalWindowsContext::LocalWindowsContext):
443         Removed m_mayCreateBitmap.
444         (WebCore::LocalWindowsContext::~LocalWindowsContext): Ditto.
445
446 2018-02-01  Christopher Reid  <chris.reid@sony.com>
447
448         [Curl] Use SQLite database in cookie jar implementation for Curl port
449         https://bugs.webkit.org/show_bug.cgi?id=174942
450
451         Reviewed by Alex Christensen.
452
453         No new tests, Set-Cookie is already tested in Layout tests.
454
455         Adding an initial SQLite CookieJar implementation to the curl network layer.
456         WebCore will now parse and handle both HTTP and DOM cookies instead of using libcurl.
457         This currently supports cookie storage and retrieval.
458         Cookie deletion is not yet implemented.
459
460         * platform/Curl.cmake:
461         * platform/network/NetworkStorageSession.h: Added cookieDB storage in curl.
462         * platform/network/curl/CookieJarCurl.cpp: Removed the old curl cookie handling.
463         * platform/network/curl/CookieJarCurl.h:
464         * platform/network/curl/CookieJarCurlDatabase.cpp: Added.
465         * platform/network/curl/CookieJarCurlDatabase.h: Added.
466         * platform/network/curl/CookieJarDB.cpp: Added.
467         * platform/network/curl/CookieJarDB.h: Added.
468         * platform/network/curl/CookieUtil.cpp: Added.
469         * platform/network/curl/CookieUtil.h: Added.
470         * platform/network/curl/CurlContext.cpp: Removed the old curl cookie handling.
471         * platform/network/curl/CurlContext.h:
472         * platform/network/curl/CurlRequest.cpp: Added handlers for HTTP response cookies.
473         * platform/network/curl/NetworkStorageSessionCurl.cpp:
474         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
475
476 2018-02-01  Chris Dumez  <cdumez@apple.com>
477
478         Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
479         https://bugs.webkit.org/show_bug.cgi?id=182392
480         <rdar://problem/37119215>
481
482         Reviewed by Geoffrey Garen.
483
484         Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
485         given that getting the property from the object can throw an exception.
486
487         No new tests, rebaselined existing test.
488
489         * bindings/scripts/CodeGeneratorJS.pm:
490         (GenerateDictionaryImplementationContent):
491         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
492         (WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
493         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
494         (WebCore::convertDictionary<TestEventConstructor::Init>):
495         * bindings/scripts/test/JS/JSTestObj.cpp:
496         (WebCore::convertDictionary<TestObj::Dictionary>):
497         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
498         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
499         (WebCore::convertDictionary<AlternateDictionaryName>):
500         (WebCore::convertDictionary<TestObj::ParentDictionary>):
501         (WebCore::convertDictionary<TestObj::ChildDictionary>):
502         (WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
503         (WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
504         (WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
505         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
506         (WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
507         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
508         (WebCore::convertDictionary<DictionaryImplName>):
509
510 2018-02-01  Ryosuke Niwa  <rniwa@webkit.org>
511
512         Some test cases in accessibility/mac/selection-notification-focus-change.html fail
513         https://bugs.webkit.org/show_bug.cgi?id=182212
514         <rdar://problem/36937147>
515
516         Reviewed by Antti Koivisto and Wenson Hsieh.
517
518         The failure was caused by the async update of the selection appearance not preserving selection reveal intent.
519         Fixed the bug by storing the intent in a member variable and using it later.
520
521         * dom/Element.cpp:
522         (WebCore::Element::focus): Removed an unnecessary synchronous layout update.
523         * editing/FrameSelection.cpp:
524         (WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior.
525         (WebCore::FrameSelection::respondToNodeModification): Ditto.
526         (WebCore::FrameSelection::setSelection): Save the selection reveal intent.
527         (WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent.
528         * editing/FrameSelection.h:
529         * page/FocusController.cpp:
530         (WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking
531         nodeRectInAbsoluteCoordinates.
532
533 2018-02-01  Zalan Bujtas  <zalan@apple.com>
534
535         [RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
536         https://bugs.webkit.org/show_bug.cgi?id=182306
537         <rdar://problem/37041440>
538
539         Reviewed by Darin Adler.
540
541         Addressing post-review comment.
542
543         * rendering/updating/RenderTreeBuilderRuby.cpp:
544         (WebCore::RenderTreeBuilder::Ruby::insertChild):
545         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
546         * rendering/updating/RenderTreeBuilderRuby.h:
547
548 2018-02-01  Zalan Bujtas  <zalan@apple.com>
549
550         [RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild()
551         https://bugs.webkit.org/show_bug.cgi?id=182373
552         <rdar://problem/37101484>
553
554         Reviewed by Antti Koivisto.
555         
556         This is in preparation for moving mutation code out of takeChild. 
557
558         No change in functionality.
559
560         * rendering/RenderBlock.cpp:
561         (WebCore::RenderBlock::takeChild):
562         * rendering/RenderBlock.h:
563         * rendering/RenderBlockFlow.cpp:
564         (WebCore::RenderBlockFlow::takeChild):
565         * rendering/RenderBlockFlow.h:
566         * rendering/RenderButton.cpp:
567         (WebCore::RenderButton::takeChild):
568         * rendering/RenderButton.h:
569         * rendering/RenderElement.cpp:
570         (WebCore::RenderElement::takeChild):
571         (WebCore::RenderElement::removeAndDestroyChild):
572         (WebCore::RenderElement::destroyLeftoverChildren):
573         * rendering/RenderElement.h:
574         * rendering/RenderFullScreen.cpp:
575         (WebCore::RenderFullScreen::wrapExistingRenderer):
576         (WebCore::RenderFullScreen::unwrapRenderer):
577         * rendering/RenderGrid.cpp:
578         (WebCore::RenderGrid::takeChild):
579         * rendering/RenderGrid.h:
580         * rendering/RenderMenuList.cpp:
581         (RenderMenuList::takeChild):
582         * rendering/RenderMenuList.h:
583         * rendering/RenderMultiColumnFlow.cpp:
584         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
585         * rendering/RenderObject.cpp:
586         (WebCore::RenderObject::removeFromParentAndDestroy):
587         * rendering/RenderRuby.cpp:
588         (WebCore::RenderRubyAsInline::takeChild):
589         (WebCore::RenderRubyAsBlock::takeChild):
590         * rendering/RenderRuby.h:
591         * rendering/RenderRubyRun.cpp:
592         (WebCore::RenderRubyRun::takeChild):
593         * rendering/RenderRubyRun.h:
594         * rendering/RenderTableRow.cpp:
595         (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
596         * rendering/RenderTableRow.h:
597         * rendering/svg/RenderSVGContainer.cpp:
598         (WebCore::RenderSVGContainer::takeChild):
599         * rendering/svg/RenderSVGContainer.h:
600         * rendering/svg/RenderSVGInline.cpp:
601         (WebCore::RenderSVGInline::takeChild):
602         * rendering/svg/RenderSVGInline.h:
603         * rendering/svg/RenderSVGRoot.cpp:
604         (WebCore::RenderSVGRoot::takeChild):
605         * rendering/svg/RenderSVGRoot.h:
606         * rendering/svg/RenderSVGText.cpp:
607         (WebCore::RenderSVGText::takeChild):
608         * rendering/svg/RenderSVGText.h:
609         * rendering/updating/RenderTreeBuilder.cpp:
610         (WebCore::RenderTreeBuilder::collapseAndDestroyAnonymousSiblingRows):
611         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
612         * rendering/updating/RenderTreeBuilder.h:
613         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
614         (WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
615         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
616         * rendering/updating/RenderTreeBuilderList.cpp:
617         (WebCore::RenderTreeBuilder::List::updateItemMarker):
618         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
619         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
620         (WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
621         * rendering/updating/RenderTreeBuilderRuby.cpp:
622         (WebCore::RenderTreeBuilder::Ruby::insertChild):
623
624 2018-02-01  Dean Jackson  <dino@apple.com>
625
626         REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
627         https://bugs.webkit.org/show_bug.cgi?id=182394
628         <rdar://problem/34840816>
629
630         Reviewed by Simon Fraser.
631
632         If a scale < 1 is applied to the page, then the visual viewport will be bigger
633         than the layout viewport. Our hit testing code would then ignore any hits
634         that were outside the layout viewport.
635
636         The fix is to only apply a hit testing clip if the page is scaling up, not down.
637
638         Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.
639
640         * page/FrameView.cpp:
641         (WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
642         no longer used, and it would have probably been more confusing to have it accept
643         a flag to ignore the scale if it is less than 1.
644         * page/FrameView.h:
645         * rendering/RenderLayer.cpp:
646         (WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
647         and pass it to a helper that added the origin back. The only thing the helper was
648         doing for us was applying a scale factor, which we only want to do if it was
649         scaling up.
650
651 2018-02-01  Yusuke Suzuki  <utatane.tea@gmail.com>
652
653         Structured cloning a Symbol should throw
654         https://bugs.webkit.org/show_bug.cgi?id=182380
655
656         Reviewed by Darin Adler.
657
658         Test: js/dom/post-message-symbol.html
659
660         * bindings/js/SerializedScriptValue.cpp:
661         (WebCore::CloneSerializer::dumpIfTerminal):
662         Structured cloning should throw "DataCloneError" DOMException if it finds Symbol.
663         Remove unused `isNumber()` case. It is done in dumpImmediate.
664         (WebCore::CloneSerializer::serializeUndefined): Deleted.
665         (WebCore::CloneSerializer::serializeBoolean): Deleted.
666         (WebCore::CloneSerializer::serializeNumber): Deleted.
667         Remove unused functions.
668
669 2018-02-01  Chris Dumez  <cdumez@apple.com>
670
671         We no longer need to queue service worker jobs until the connection to the service worker process has been established
672         https://bugs.webkit.org/show_bug.cgi?id=182375
673
674         Reviewed by Youenn Fablet.
675
676         We no longer need to queue service worker jobs until the connection to the service worker process
677         has been established. We initially did this to work around the fact that registrations restored
678         from disk would not have an active worker until the service worker process had been established. 
679         However, this issue has been fixed in r227696.
680
681         This is basically a revert of r227220, which is no longer needed after r227696.
682
683         No new tests, initial fix was covered by an API test that still passes.
684
685         * workers/service/server/SWServer.cpp:
686         (WebCore::SWServer::clearAll):
687         (WebCore::SWServer::clear):
688         (WebCore::SWServer::scheduleJob):
689         (WebCore::SWServer::serverToContextConnectionCreated):
690         * workers/service/server/SWServer.h:
691
692 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
693
694         [GTK] Shift + mouse scroll should scroll horizontally
695         https://bugs.webkit.org/show_bug.cgi?id=181629
696
697         Reviewed by Michael Catanzaro.
698
699         We currently turn vertical scroll into horizontal when scrolling over the horizontal scrollbar. When Shift key is
700         pressed, we still want to scroll in the scrollbar direction when scrolling over a scrollbar, so we need to swap
701         directions in both scrollbars depending on whther the Shift key is pressed or not.
702
703         * page/EventHandler.cpp:
704         (WebCore::EventHandler::shouldSwapScrollDirection const): Renamed.
705         (WebCore::EventHandler::handleWheelEvent): Use the new name.
706         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
707         * page/EventHandler.h:
708         * platform/PlatformWheelEvent.h:
709         (WebCore::PlatformWheelEvent::copySwappingDirection const): Swap the direction of the event.
710         (WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks const): Deleted.
711         * platform/glib/EventHandlerGLib.cpp:
712         (WebCore::EventHandler::shouldSwapScrollDirection const): Take into account whether the Shift key is present.
713         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
714
715 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
716
717         [GTK] Problem with Washington Post images
718         https://bugs.webkit.org/show_bug.cgi?id=181421
719
720         Reviewed by Carlos Alberto Lopez Perez.
721
722         This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
723         chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
724         it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
725         washingtonpost.com.
726
727         * platform/UserAgentQuirks.cpp:
728         (WebCore::urlRequiresChromeBrowser):
729
730 2018-02-01  Carlos Garcia Campos  <cgarcia@igalia.com>
731
732         [SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
733         https://bugs.webkit.org/show_bug.cgi?id=182328
734
735         Reviewed by Michael Catanzaro.
736
737         soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but
738         soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore
739         Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to
740         prepend the '.' if missing.
741
742         Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
743
744         * platform/network/soup/CookieSoup.cpp:
745         (WebCore::Cookie::toSoupCookie const):
746
747 2018-02-01  Zalan Bujtas  <zalan@apple.com>
748
749         [RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder
750         https://bugs.webkit.org/show_bug.cgi?id=182374
751         <rdar://problem/37102005>
752
753         Reviewed by Antti Koivisto.
754
755         It's only called from RenderTreeBuilder.
756
757         No change in functionality.
758
759         * rendering/RenderTableRow.cpp:
760         (WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
761         * rendering/RenderTableRow.h:
762         * rendering/updating/RenderTreeBuilder.cpp:
763         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
764         * rendering/updating/RenderTreeBuilderTable.cpp:
765         (WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
766         * rendering/updating/RenderTreeBuilderTable.h:
767
768 2018-02-01  Chris Dumez  <cdumez@apple.com>
769
770         Queue a microtask when a waitUntil() promise is settled
771         https://bugs.webkit.org/show_bug.cgi?id=182372
772         <rdar://problem/37101019>
773
774         Reviewed by Mark Lam.
775
776         Queue a microtask when a waitUntil() promise is settled, as per:
777         - https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil (step 5)
778
779         Otherwise, we decrement m_pendingPromiseCount too quickly and it may cause
780         following calls to waitUntil() to throw when they shouldn't.
781
782         No new tests, rebaselined existing test.
783
784         * workers/service/ExtendableEvent.cpp:
785         (WebCore::ExtendableEvent::addExtendLifetimePromise):
786
787 2018-02-01  Antti Koivisto  <antti@apple.com>
788
789         Invalidate style for sibling combinators accurately on class change
790         https://bugs.webkit.org/show_bug.cgi?id=182336
791
792         Reviewed by Zalan Bujtas.
793
794         Use Style::Invalidator to invalidate only those elements that may be affected by a class
795         change for sibling combinators and nth pseudo classes.
796
797         * css/RuleFeature.cpp:
798
799         Add new AllSiblings MatchElement to use for nth pseudo classes with subselectors.
800
801         (WebCore::isSiblingOrSubject):
802
803         Add a helper.
804
805         (WebCore::RuleFeatureSet::computeNextMatchElement):
806         (WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
807
808         Compute and propage MatchElement::AllSiblings.
809
810         * css/RuleFeature.h:
811         * dom/Node.cpp:
812         (WebCore::Node::updateAncestorsForStyleRecalc):
813
814         Don't need to test for childrenAffectedByPropertyBasedBackwardPositionalRules anymore (an oddly named bit for nth pseudo classes).
815
816         * style/StyleInvalidator.cpp:
817         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
818
819         Invalidate only the potentially affected elements.
820         The old code would just unconditionally invalidate the current element. This would propagate to descedants of siblings via
821         affectedByPreviousSibling bits. That mechanism can be removed when everything has been switched to accurate invalidation.
822
823 2018-01-31  Simon Fraser  <simon.fraser@apple.com>
824
825         Use different debug red colors for different contexts
826         https://bugs.webkit.org/show_bug.cgi?id=182362
827
828         Reviewed by Tim Horton.
829
830         Pure red is used elsehwere in the system as a debug color indicator, so use different
831         shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
832         so they are identifiable.
833
834         * page/FrameView.cpp:
835         (WebCore::FrameView::paintContents):
836
837 2018-01-31  Don Olmstead  <don.olmstead@sony.com>
838
839         [CMake] Make JavaScriptCore headers copies
840         https://bugs.webkit.org/show_bug.cgi?id=182303
841
842         Reviewed by Alex Christensen.
843
844         No new tests. No change in behavior.
845
846         * CMakeLists.txt:
847         * PlatformMac.cmake:
848         * PlatformWPE.cmake:
849         * PlatformWin.cmake:
850         * PlatformWinCairo.cmake:
851
852 2018-01-31  Per Arne Vollan  <pvollan@apple.com>
853
854         Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
855         https://bugs.webkit.org/show_bug.cgi?id=181204
856         <rdar://problem/36256274>
857
858         Reviewed by Ryosuke Niwa.
859
860         When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
861         the frame will be detached when removed from its previous position in the DOM tree. When being
862         detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
863         However, this method will return early when executed in a beforeunload handler, since navigation
864         is not allowed then. The end result is a detached frame which will continue to load, and hitting
865         asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
866         possible to stop a frame load, even when executing a beforeunload handler.
867
868         No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
869
870         * history/PageCache.cpp:
871         (WebCore::PageCache::addIfCacheable): Fix a failing API test by allowing scripts to be executed
872         under the PageCache::prune method.
873         * loader/FrameLoader.cpp:
874         (WebCore::FrameLoader::isStopLoadingAllowed const):
875         (WebCore::FrameLoader::stopAllLoaders):
876         * loader/FrameLoader.h:
877         * svg/graphics/SVGImage.cpp:
878         (WebCore::SVGImage::~SVGImage): Disable scripts disallowed assertions in this scope, since it is
879         safe in this context.
880
881 2018-01-31  Javier Fernandez  <jfernandez@igalia.com>
882
883         inline-block baseline not computed correctly for vertical-lr
884         https://bugs.webkit.org/show_bug.cgi?id=170176
885
886         Reviewed by Manuel Rego Casasnovas.
887
888         When computing the baseline position of inline-block elements we use the
889         InlineFlow logicalTop and the FontMetrics ascent. The issue comes from
890         the fact that these units are incompatible. The logicalTop of a
891         vertical-lr element is offset to the left edge, while the ascent is the
892         distance from the right edge.
893
894         We need to either use logical value for the FontMetrics ascent so we can
895         compute the correctly the baselines of vertical-lr elements, or just using
896         the logicalBottom for these cases.
897
898         The approach based on a logicalAscent API for FontMetrics would require
899         a lot of work because inline-block logic assumes everything is vertical-rl
900         and at some point, flips the elements along the block-axis in case of
901         vertical-lr mode.
902
903         While it'd be desirable to get rid of this flipping logic, this patch tries
904         first the simpler approach of using logicalBottom, which aligns with the
905         currently implemented logic.
906
907         Tests: fast/inline-block/baseline-vertical-01.html
908                fast/inline-block/baseline-vertical-02.html
909                fast/inline-block/baseline-vertical-03.html
910                fast/inline-block/baseline-vertical-04.html
911                fast/inline-block/baseline-vertical-05.html
912                fast/inline-block/baseline-vertical-06.html
913                fast/inline-block/baseline-vertical-07.html
914                fast/inline-block/baseline-vertical-08.html
915
916         * rendering/InlineFlowBox.cpp:
917         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
918         * rendering/RenderBlockFlow.cpp:
919         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
920
921 2018-01-31  Said Abou-Hallawa  <sabouhallawa@apple.com>
922
923         BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
924         https://bugs.webkit.org/show_bug.cgi?id=182277
925
926         Reviewed by Simon Fraser.
927
928         BitmapImage::drawPattern() needs to destroy the incomplete decoded frame
929         before trying to draw it as a pattern.
930
931         Test: http/tests/images/draw-pattern-slow-load-large-image.html
932
933         * loader/cache/CachedImage.cpp:
934         (WebCore::CachedImage::updateBufferInternal): We need to disable CachedImage
935         data buffering for testing. This simulates slow network where intervals
936         between data chunks can last for seconds.
937         * loader/cache/CachedImage.h:
938         * platform/graphics/BitmapImage.cpp:
939         (WebCore::BitmapImage::drawPattern): Destroy the incomplete decoded frame
940         before drawing this frame as a pattern. We do not destroy incomplete decoded
941         frame once new data is received because it may be drawn by async image
942         drawing while waiting for the newer frame to finish decoding.
943         * testing/Internals.cpp:
944         (WebCore::Internals::setForceUpdateImageDataEnabledForTesting):
945         * testing/Internals.h:
946         * testing/Internals.idl:
947
948 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
949
950         Add a release assertion to ensure timers are deleted in the right thread
951         https://bugs.webkit.org/show_bug.cgi?id=182351
952
953         Reviewed by David Kilzer.
954
955         Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
956
957         We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
958         when WebThread is being used.
959
960         * platform/Timer.cpp:
961         (WebCore::TimerBase::~TimerBase): Added the assertion.
962         * platform/Timer.h:
963         (WebCore::TimerBase::m_thread): Always store the current thread in a timer.
964
965 2018-01-31  Youenn Fablet  <youenn@apple.com>
966
967         Change SWServer::claim to set the iterator value as soon as possible
968         https://bugs.webkit.org/show_bug.cgi?id=182337
969
970         Reviewed by Chris Dumez.
971
972         No change of behavior, this is a "let's go safe way" fix.
973
974         * workers/service/server/SWServer.cpp:
975         (WebCore::SWServer::claim):
976
977 2018-01-31  Zalan Bujtas  <zalan@apple.com>
978
979         [RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder.
980         https://bugs.webkit.org/show_bug.cgi?id=182348
981         <rdar://problem/37082837>
982
983         Reviewed by Antti Koivisto.
984
985         All the callsites are in the RenderTreeUpdater by now.
986
987         No change in functionality.
988
989         * rendering/RenderObject.cpp:
990         (WebCore::isAnonymousAndSafeToDelete): Deleted.
991         (WebCore::findDestroyRootIncludingAnonymous): Deleted.
992         (WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
993         * rendering/RenderObject.h:
994         * rendering/updating/RenderTreeBuilder.cpp:
995         (WebCore::isAnonymousAndSafeToDelete):
996         (WebCore::findDestroyRootIncludingAnonymous):
997         (WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
998         * rendering/updating/RenderTreeBuilder.h:
999         * rendering/updating/RenderTreeUpdater.cpp:
1000         (WebCore::RenderTreeUpdater::tearDownRenderers):
1001         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
1002
1003 2018-01-31  Ryosuke Niwa  <rniwa@webkit.org>
1004
1005         Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk
1006         https://bugs.webkit.org/show_bug.cgi?id=182319
1007         <rdar://problem/36904312>
1008
1009         Reviewed by Chris Dumez.
1010
1011         The crash was caused by a wrong release assertion. Handle author scripts shrinking the resource timing buffer
1012         while resourcetimingbufferfull event is being dispatched.
1013
1014         Also fixed a bug that a superflous resourcetimingbufferfull event will be fired when new resource timing entries
1015         are queued while resourcetimingbufferfull event is being dispatched.
1016
1017         Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html
1018               http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html
1019
1020         * page/Performance.cpp:
1021         (WebCore::Performance::resourceTimingBufferFullTimerFired): 
1022
1023 2018-01-31  Youenn Fablet  <youenn@apple.com>
1024
1025         com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration
1026         https://bugs.webkit.org/show_bug.cgi?id=182316
1027         <rdar://problem/37025976>
1028
1029         Reviewed by Chris Dumez.
1030
1031         SWServer.m_clientToControllingWorker and SWServerRegistration.m_clientsUsingRegistration might currently get out of sync.
1032         This is a defensive fix to ensure storage process will not crash in Release.
1033         We keep the ASSERT as this probably means there is an abnormal situation that other patches might fix.
1034
1035         * workers/service/server/SWServerRegistration.cpp:
1036         (WebCore::SWServerRegistration::removeClientUsingRegistration):
1037
1038 2018-01-31  Antoine Quint  <graouts@apple.com>
1039
1040         [Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
1041         https://bugs.webkit.org/show_bug.cgi?id=182297
1042
1043         Reviewed by Jon Lee and Eric Carlson.
1044
1045         We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
1046         cases where the play/pause button would never actually become visible because we would first set it as one of
1047         the buttons in the left container in the bottom controls bar before we would identify that we should show the
1048         prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
1049         because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
1050         remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
1051         though it wasn't visible.
1052
1053         Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
1054         patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
1055         will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
1056         when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
1057         layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
1058         the "x" and "visible" properties which we set while performing layout.
1059         
1060         This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
1061         other modern-media-controls tests that could have been affected by this unexpected behavior.
1062
1063         * Modules/modern-media-controls/controls/buttons-container.js:
1064         (ButtonsContainer.prototype.willRemoveChild):
1065         (ButtonsContainer.prototype.didChangeChildren):
1066         (ButtonsContainer.prototype.layout):
1067         (ButtonsContainer.prototype.get buttons): Deleted.
1068         (ButtonsContainer.prototype.set buttons): Deleted.
1069         * Modules/modern-media-controls/controls/inline-media-controls.js:
1070         (InlineMediaControls.prototype.layout):
1071         (InlineMediaControls.prototype._updateBottomControlsBarLabel):
1072         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
1073         (InlineMediaControls):
1074         * Modules/modern-media-controls/controls/layout-node.js:
1075         (LayoutNode.prototype.set children):
1076         (LayoutNode.prototype.addChild):
1077         (LayoutNode.prototype.removeChild):
1078         (LayoutNode.prototype.willRemoveChild):
1079         (LayoutNode.prototype.didChangeChildren):
1080         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1081         (MacOSFullscreenMediaControls.prototype.layout):
1082         * Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
1083         data-auto-hide-delay on a <video> element.
1084
1085 2018-01-31  Zalan Bujtas  <zalan@apple.com>
1086
1087         [RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
1088         https://bugs.webkit.org/show_bug.cgi?id=182315
1089         <rdar://problem/37048160>
1090
1091         Reviewed by Antti Koivisto.
1092
1093         resolveMovedChild() is only called from RenderTreeBuilder.
1094
1095         No change in functionality.
1096
1097         * rendering/RenderFragmentedFlow.h:
1098         * rendering/RenderMultiColumnFlow.cpp:
1099         (WebCore::RenderMultiColumnFlow::resolveMovedChild const): Deleted.
1100         * rendering/RenderMultiColumnFlow.h:
1101         * rendering/updating/RenderTreeBuilder.cpp:
1102         (WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow):
1103         * rendering/updating/RenderTreeBuilder.h:
1104         * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
1105         (WebCore::RenderTreeBuilder::BlockFlow::insertChild):
1106         * rendering/updating/RenderTreeBuilderInline.cpp:
1107         (WebCore::RenderTreeBuilder::Inline::insertChild):
1108         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
1109         (WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
1110         * rendering/updating/RenderTreeBuilderMultiColumn.h:
1111
1112 2018-01-31  Philippe Normand  <pnormand@igalia.com>
1113
1114         [GStreamer] Silent WebAudio buffers support
1115         https://bugs.webkit.org/show_bug.cgi?id=143869
1116
1117         Reviewed by Carlos Garcia Campos.
1118
1119         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1120         (webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
1121         enables downstream elements to optimize the buffer processing.
1122
1123 2018-01-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1124
1125         [EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
1126         https://bugs.webkit.org/show_bug.cgi?id=182324
1127
1128         Reviewed by Žan Doberšek.
1129
1130         * Modules/encryptedmedia/NavigatorEME.cpp:
1131         (WebCore::tryNextSupportedConfiguration): Fix
1132         candidateCofiguration typo.
1133
1134 2018-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1135
1136         [WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
1137         https://bugs.webkit.org/show_bug.cgi?id=182093
1138
1139         Reviewed by Alex Christensen.
1140
1141         WebKit draws texts doubly by shifting 1px for fonts without bold
1142         fonts but bold font is desired. This synthetic bold method draws
1143         fonts with embedded bitmap fonts look like double strike in HiDPI.
1144
1145         No new tests (Covered by the existing tests).
1146
1147         * platform/graphics/win/FontCacheWin.cpp:
1148         (WebCore::createGDIFont): Overwrite lfWeight if the desired weight
1149         is bold and matched font weight is't bold and in WinCairo port.
1150         Fix wrong indentation.
1151
1152 2018-01-30  Youenn Fablet  <youenn@apple.com> and Oleksandr Skachkov  <gskachkov@gmail.com>
1153
1154         FetchResponse should support ConsumeData callback on chunk data is received
1155         https://bugs.webkit.org/show_bug.cgi?id=181600
1156         <rdar://problem/36932547>
1157
1158         Reviewed by Alex Christensen.
1159
1160         Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
1161
1162         Apply same read-by-chunk strategy for body coming from network as for body coming from ReadableStream.
1163         Refactor to have one consumeBodyReceivedByChunk method for both cases.
1164         This allows streaming data from a service worker to WebProcess as would be done by NetworkProcess.
1165
1166         * Modules/cache/DOMCache.cpp:
1167         (WebCore::DOMCache::addAll):
1168         (WebCore::DOMCache::put):
1169         * Modules/fetch/FetchResponse.cpp:
1170         (WebCore::FetchResponse::BodyLoader::didSucceed):
1171         (WebCore::FetchResponse::BodyLoader::didReceiveData):
1172         (WebCore::FetchResponse::BodyLoader::consumeDataByChunk):
1173         (WebCore::FetchResponse::consumeBody):
1174         (WebCore::FetchResponse::consumeBodyReceivedByChunk):
1175         * Modules/fetch/FetchResponse.h:
1176         * workers/service/context/ServiceWorkerFetch.cpp:
1177         (WebCore::ServiceWorkerFetch::processResponse):
1178
1179 2018-01-30  Don Olmstead  <don.olmstead@sony.com>
1180
1181         JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
1182         https://bugs.webkit.org/show_bug.cgi?id=182312
1183
1184         Reviewed by Michael Catanzaro.
1185
1186         No new tests. No change in behavior.
1187
1188         * config.h:
1189
1190 2018-01-30  Chris Nardi  <cnardi@chromium.org>
1191
1192         Use double-quotes when serializing font-feature-settings
1193         https://bugs.webkit.org/show_bug.cgi?id=182201
1194
1195         According to the CSSOM spec, all strings should be serialized with double-quotes. The feature
1196         tag value was previously serialized with single-quotes; change this to double-quotes to match
1197         the spec and non-WebKit browsers.
1198
1199         Reviewed by Myles C. Maxfield.
1200
1201         Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
1202         and fast/text/font-face-javascript.html.
1203
1204         * css/CSSFontFeatureValue.cpp:
1205         (WebCore::CSSFontFeatureValue::customCSSText const):
1206
1207 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
1208
1209         Add telemetry to track storage access API adoption
1210         https://bugs.webkit.org/show_bug.cgi?id=182197
1211         <rdar://problem/35803309>
1212
1213         Reviewed by Chris Dumez.
1214
1215         Part 2: Add telemetry for the Storage Access API case
1216
1217         Adds a new convenience method to identify origin/page/frame combinations that
1218         have been granted access to the Storage Access API. This is used for debug
1219         logging in the NetworkProcess. It is not used in production builds.
1220
1221         * platform/network/NetworkStorageSession.h:
1222         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1223         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Added.
1224
1225 2018-01-30  Ryosuke Niwa  <rniwa@webkit.org>
1226
1227         Release assert in updateLayout() via AXObjectCache::childrenChanged
1228         https://bugs.webkit.org/show_bug.cgi?id=182279
1229         <rdar://problem/36994456>
1230
1231         Reviewed by Antti Koivisto.
1232
1233         Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it
1234         would require a large architectural refactoring of the accessibility code.
1235
1236         Test: accessibility/accessibility-object-update-during-style-resolution-crash.html
1237
1238         * accessibility/AXObjectCache.cpp:
1239         (WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here.
1240         * dom/Document.cpp:
1241         (WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable.
1242         * dom/ScriptDisallowedScope.h:
1243         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added.
1244         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added.
1245         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added.
1246         (WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added.
1247         * page/LayoutContext.cpp:
1248         (WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable.
1249
1250 2018-01-30  Zalan Bujtas  <zalan@apple.com>
1251
1252         [RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
1253         https://bugs.webkit.org/show_bug.cgi?id=182306
1254         <rdar://problem/37041440>
1255
1256         Reviewed by Antti Koivisto.
1257
1258         With all the ruby mutation code moving, only RenderTreeBuilder calls RenderRubyRun::rubyBaseSafe.
1259
1260         No change in functionality.
1261
1262         * rendering/RenderRubyRun.cpp:
1263         (WebCore::RenderRubyRun::rubyText const):
1264         (WebCore::RenderRubyRun::rubyBase const):
1265         (WebCore::RenderRubyRun::firstLineBlock const):
1266         (WebCore::RenderRubyRun::takeChild):
1267         (WebCore::RenderRubyRun::rubyBaseSafe): Deleted.
1268         * rendering/RenderRubyRun.h:
1269         * rendering/updating/RenderTreeBuilderRuby.cpp:
1270         (WebCore::RenderTreeBuilder::Ruby::insertChild):
1271         (WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
1272         * rendering/updating/RenderTreeBuilderRuby.h:
1273
1274 2018-01-30  Fujii Hironori  <Hironori.Fujii@sony.com>
1275
1276         Unified sources for FEMorphology.cpp seems to break the windows build.
1277         https://bugs.webkit.org/show_bug.cgi?id=178847
1278
1279         Reviewed by Yusuke Suzuki.
1280
1281         Fix a compilation error.
1282         platform/graphics/filters/SpotLightSource.cpp(45): error C2027: use of undefined type 'WebCore::FilterEffect'
1283
1284         No new tests (No behavior change)
1285
1286         * Sources.txt: Removed @no-unify for FEMorphology.cpp.
1287         * platform/graphics/filters/SpotLightSource.cpp: Added #include "FilterEffect.h".
1288
1289 2018-01-30  Myles C. Maxfield  <mmaxfield@apple.com>
1290
1291         Test fix after r227776
1292         https://bugs.webkit.org/show_bug.cgi?id=180951
1293
1294         Unreviewed.
1295
1296         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1297         (WebCore::mandatoryAttributesForUserInstalledFonts):
1298
1299 2018-01-30  Dean Jackson  <dino@apple.com>
1300
1301         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
1302         https://bugs.webkit.org/show_bug.cgi?id=182299
1303         <rdar://problem/36853088>
1304
1305         Removing a misleading comment based on Zalan Bujtas's feedback.
1306
1307         * rendering/RenderElement.cpp:
1308         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
1309
1310 2018-01-30  Dean Jackson  <dino@apple.com>
1311
1312         CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
1313         https://bugs.webkit.org/show_bug.cgi?id=182299
1314         <rdar://problem/36853088>
1315
1316         Reviewed by Simon Fraser.
1317
1318         Mostly speculative fix for the case where a scrollTo moves an
1319         animated SVG image into view, causing its animation to restart during
1320         a paint operation. This was causing a release ASSERT, so we now defer
1321         the resumption of the animation into a timer.
1322
1323         Test: svg/animated-svgImage-scroll.html
1324
1325         * rendering/RenderElement.cpp:
1326         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
1327         animation if it is an SVGImage.
1328         * svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
1329         (WebCore::SVGImage::SVGImage):
1330         (WebCore::SVGImage::startAnimationTimerFired):
1331         (WebCore::SVGImage::enqueueStartAnimation):
1332         (WebCore::SVGImage::stopAnimation):
1333         * svg/graphics/SVGImage.h:
1334
1335 2018-01-30  Chris Dumez  <cdumez@apple.com>
1336
1337         Service worker registration soft updates happen too frequently
1338         https://bugs.webkit.org/show_bug.cgi?id=182296
1339         <rdar://problem/37031862>
1340
1341         Reviewed by Youenn Fablet.
1342
1343         Move code that updates the registration's last update check time from after
1344         the script bytecheck to before, as per:
1345         - https://w3c.github.io/ServiceWorker/#update (step 7.19)
1346
1347         This way, the last update check time gets updated even if the newly fetched
1348         script is identical to the previous one, which is the common case.
1349
1350         * workers/service/server/SWServer.cpp:
1351         (WebCore::SWServer::updateWorker):
1352         * workers/service/server/SWServerJobQueue.cpp:
1353         (WebCore::SWServerJobQueue::scriptFetchFinished):
1354
1355 2018-01-30  Zalan Bujtas  <zalan@apple.com>
1356
1357         [RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
1358         https://bugs.webkit.org/show_bug.cgi?id=182265
1359         <rdar://problem/37004459>
1360
1361         Reviewed by Antti Koivisto.
1362
1363         Move the mutation code that wraps/unwraps a child element when its flow state changes
1364         from(to) in-flow to(from) floating/out-of-flow.
1365
1366         No change in functionality.
1367
1368         * rendering/RenderBlock.cpp:
1369         (WebCore::RenderBlock::childBecameNonInline): Deleted.
1370         * rendering/RenderBlock.h:
1371         * rendering/RenderBoxModelObject.h:
1372         (WebCore::RenderBoxModelObject::childBecameNonInline): Deleted.
1373         * rendering/RenderElement.cpp:
1374         (WebCore::RenderElement::styleDidChange):
1375         (WebCore::RenderElement::handleDynamicFloatPositionChange): Deleted.
1376         * rendering/RenderInline.cpp:
1377         (WebCore::RenderInline::childBecameNonInline): Deleted.
1378         * rendering/RenderInline.h:
1379         * rendering/updating/RenderTreeBuilder.cpp:
1380         (WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
1381         (WebCore::RenderTreeBuilder::splitFlow): Deleted.
1382         * rendering/updating/RenderTreeBuilder.h:
1383         * rendering/updating/RenderTreeBuilderBlock.cpp:
1384         (WebCore::RenderTreeBuilder::Block::childBecameNonInline):
1385         * rendering/updating/RenderTreeBuilderBlock.h:
1386         * rendering/updating/RenderTreeBuilderInline.cpp:
1387         (WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
1388         * rendering/updating/RenderTreeBuilderInline.h:
1389
1390 2018-01-30  Brent Fulgham  <bfulgham@apple.com>
1391
1392         Add telemetry to track storage access API adoption
1393         https://bugs.webkit.org/show_bug.cgi?id=182197
1394         <rdar://problem/35803309>
1395
1396         Reviewed by Chris Dumez.
1397         
1398         Partial roll-out of r227755.
1399
1400         The original patch assumed the WebContent process kept track of user interaction. This is
1401         only tracked in the UIProcess, so we can get rid of some of the logging code adding in
1402         r227755.
1403
1404         * loader/ResourceLoadObserver.cpp:
1405         (WebCore::ResourceLoadObserver::logFrameNavigation):
1406         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1407         (WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Deleted.
1408         (WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Deleted.
1409         * loader/ResourceLoadObserver.h:
1410
1411 2018-01-30  Chris Dumez  <cdumez@apple.com>
1412
1413         Make sure we never create a WebSWClientConnection with an invalid sessionID
1414         https://bugs.webkit.org/show_bug.cgi?id=182276
1415         <rdar://problem/36582633>
1416
1417         Reviewed by Alex Christensen.
1418
1419         Make sure we never create a WebSWClientConnection with an invalid sessionID as this
1420         could corrupt our hash tables.
1421
1422         * dom/Document.cpp:
1423         (WebCore::Document::privateBrowsingStateDidChange):
1424         * workers/service/ServiceWorker.cpp:
1425         (WebCore::ServiceWorker::postMessage):
1426         * workers/service/ServiceWorkerContainer.cpp:
1427         (WebCore::ServiceWorkerContainer::ready):
1428         (WebCore::ServiceWorkerContainer::getRegistration):
1429         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
1430         (WebCore::ServiceWorkerContainer::getRegistrations):
1431         (WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
1432         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
1433         (WebCore::ServiceWorkerContainer::ensureSWClientConnection):
1434
1435 2018-01-30  Antti Koivisto  <antti@apple.com>
1436
1437         Avoid traversing too much when doing class change invalidation
1438         https://bugs.webkit.org/show_bug.cgi?id=181604
1439
1440         Reviewed by Zalan Bujtas.
1441
1442         We are now collecting information about which part of the tree a change in class can potentially affect.
1443         Use the information to traverse only the required elements in Style::Invalidator.
1444
1445         The same mechanism can be later used for attribute and id change invalidation.
1446
1447         * css/DocumentRuleSets.cpp:
1448         (WebCore::DocumentRuleSets::collectFeatures const):
1449         (WebCore::DocumentRuleSets::classInvalidationRuleSets const):
1450         (WebCore::DocumentRuleSets::subjectClassRules const): Deleted.
1451         (WebCore::DocumentRuleSets::ancestorClassRules const): Deleted.
1452
1453             Remove separate subject and ancestor invalidation RuleSets. Instead collect all invalidation rulesets
1454             to a vector along with their MatchElements.
1455
1456         * css/DocumentRuleSets.h:
1457         * css/RuleFeature.cpp:
1458         (WebCore::RuleFeatureSet::computeNextMatchElement):
1459         (WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
1460         (WebCore::RuleFeatureSet::collectFeatures):
1461
1462             Similarly collect all class invalidation RuleFeatures to a general HashMap along with the MatchElement.
1463
1464         (WebCore::RuleFeatureSet::add):
1465         (WebCore::RuleFeatureSet::clear):
1466         (WebCore::RuleFeatureSet::shrinkToFit):
1467         * css/RuleFeature.h:
1468         (WebCore::RuleFeature::RuleFeature):
1469         * style/ClassChangeInvalidation.cpp:
1470         (WebCore::Style::ClassChangeInvalidation::computeInvalidation):
1471
1472             Find out InvalidationRuleSets to use.
1473
1474         (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
1475
1476             Pass them to Style::Invalidator.
1477
1478         * style/ClassChangeInvalidation.h:
1479         * style/StyleInvalidator.cpp:
1480         (WebCore::Style::Invalidator::invalidateStyleForTree):
1481         (WebCore::Style::Invalidator::invalidateStyleForDescendants):
1482         (WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
1483
1484             Traverse only the part of the tree needed by the given MatchElement.
1485
1486         * style/StyleInvalidator.h:
1487         * style/StyleSharingResolver.cpp:
1488         (WebCore::Style::SharingResolver::classNamesAffectedByRules const):
1489
1490 2018-01-30  Javier Fernandez  <jfernandez@igalia.com>
1491
1492         [css-align] The 'baseline' value must be invalid for the 'justify-content' property
1493         https://bugs.webkit.org/show_bug.cgi?id=181794
1494
1495         Reviewed by Antti Koivisto.
1496
1497         The CSS WG has resolved that it doesn't make sense to define Baseline
1498         Content-Alignment in the inline/main axis.
1499
1500         https://github.com/w3c/csswg-drafts/issues/1184
1501
1502         The spec has been updated so that <baseline-postion> is not valid for
1503         the 'justify-content' property's syntax. This CL updates our parsing
1504         logic to match the new spec, including the parsing logic of the
1505         place-content shorthand.
1506
1507         Additionally, this CL updates the computed value of the
1508         <baseline-position> values to match other browsers.
1509
1510         We don't implement support for <baseline-position> values in the
1511         Content Distribution properties (align-content and justify-content),
1512         so I don't expect this change to break content of sites using the CSS
1513         Box Alignment feature.
1514
1515         No new tests, just adapt the Web Platform Tests we already have to the new CSS syntax.
1516
1517         * css/parser/CSSPropertyParser.cpp:
1518         (WebCore::getBaselineKeyword):
1519         (WebCore::consumeBaselineKeyword):
1520         (WebCore::consumeContentDistributionOverflowPosition):
1521         (WebCore::consumeSelfPositionOverflowPosition):
1522         (WebCore::CSSPropertyParser::parseSingleValue):
1523         (WebCore::consumeSimplifiedContentPosition):
1524         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
1525         (WebCore::consumeSimplifiedItemPosition):
1526
1527 2018-01-30  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1528
1529         [WinCairo] Fix forwarding header conflict of WebKit on WinCairo
1530         https://bugs.webkit.org/show_bug.cgi?id=177202
1531
1532         Reviewed by Alex Christensen.
1533
1534         * PlatformWin.cmake:
1535
1536 2018-01-30  Myles C. Maxfield  <mmaxfield@apple.com>
1537
1538         A disallowed user-installed font may be used if its PostScript name is specified
1539         https://bugs.webkit.org/show_bug.cgi?id=180951
1540
1541         Reviewed by Brent Fulgham.
1542
1543         This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
1544         fonts which WebKit creates. It also adds this attribute to web fonts, so that font
1545         fallback will happen according to our rules about user-installed fonts. It also marks
1546         these font attributes as "mandatory" so CoreText will be guaranteed to follow the
1547         policy.
1548
1549         Test: fast/text/user-installed-fonts/disable.html
1550
1551         * platform/graphics/FontCache.h:
1552         (WebCore::FontDescriptionKey::makeFlagsKey):
1553         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1554         (WebCore::FontDatabase::collectionForFamily):
1555         (WebCore::FontDatabase::fontForPostScriptName):
1556         (WebCore::addAttributesForUserInstalledFonts):
1557         (WebCore::mandatoryAttributesForUserInstalledFonts):
1558         * platform/graphics/mac/FontCustomPlatformData.cpp:
1559         (WebCore::FontCustomPlatformData::fontPlatformData):
1560
1561 2018-01-29  Youenn Fablet  <youenn@apple.com>
1562
1563         Cache API should make sure to resolve caches.open promises in the same order as called
1564         https://bugs.webkit.org/show_bug.cgi?id=182193
1565         <rdar://problem/36930363>
1566
1567         Reviewed by Chris Dumez.
1568
1569         Covered by LayoutTests/http/wpt/cache-storage/cache-open-delete-in-parallel.https.html.
1570
1571         * Modules/cache/DOMCacheStorage.cpp:
1572         (WebCore::DOMCacheStorage::doRemove): Removed optimization consisting in removing the cache from DOMCacheStorage object synchronously.
1573         This optimization prevents going to the network process to try deleting the cache.
1574
1575 2018-01-29  Jiewen Tan  <jiewen_tan@apple.com>
1576
1577         [WebAuthN] Add a compile-time feature flag
1578         https://bugs.webkit.org/show_bug.cgi?id=182211
1579         <rdar://problem/36936365>
1580
1581         Reviewed by Brent Fulgham.
1582
1583         Add a compile-time feature flag for WebAuthN as most of the functionality is platform
1584         dependent.
1585
1586         No tests.
1587
1588         * Configurations/FeatureDefines.xcconfig:
1589         * Modules/credentialmanagement/BasicCredential.cpp:
1590         * Modules/credentialmanagement/BasicCredential.h:
1591         * Modules/credentialmanagement/BasicCredential.idl:
1592         * Modules/credentialmanagement/CredentialCreationOptions.h:
1593         * Modules/credentialmanagement/CredentialCreationOptions.idl:
1594         * Modules/credentialmanagement/CredentialRequestOptions.h:
1595         * Modules/credentialmanagement/CredentialRequestOptions.idl:
1596         * Modules/credentialmanagement/CredentialsContainer.cpp:
1597         * Modules/credentialmanagement/CredentialsContainer.h:
1598         * Modules/credentialmanagement/CredentialsContainer.idl:
1599         * Modules/credentialmanagement/NavigatorCredentials.cpp:
1600         * Modules/credentialmanagement/NavigatorCredentials.h:
1601         * Modules/credentialmanagement/NavigatorCredentials.idl:
1602         * Modules/webauthn/Authenticator.cpp:
1603         * Modules/webauthn/Authenticator.h:
1604         * Modules/webauthn/AuthenticatorAssertionResponse.cpp:
1605         * Modules/webauthn/AuthenticatorAssertionResponse.h:
1606         * Modules/webauthn/AuthenticatorAssertionResponse.idl:
1607         * Modules/webauthn/AuthenticatorAttestationResponse.cpp:
1608         * Modules/webauthn/AuthenticatorAttestationResponse.h:
1609         * Modules/webauthn/AuthenticatorAttestationResponse.idl:
1610         * Modules/webauthn/AuthenticatorResponse.cpp:
1611         * Modules/webauthn/AuthenticatorResponse.h:
1612         * Modules/webauthn/AuthenticatorResponse.idl:
1613         * Modules/webauthn/PublicKeyCredential.cpp:
1614         * Modules/webauthn/PublicKeyCredential.h:
1615         * Modules/webauthn/PublicKeyCredential.idl:
1616         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1617         * Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
1618         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
1619         * Modules/webauthn/PublicKeyCredentialDescriptor.idl:
1620         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
1621         * Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
1622         * Modules/webauthn/PublicKeyCredentialType.h:
1623         * Modules/webauthn/PublicKeyCredentialType.idl:
1624         * bindings/js/JSAuthenticatorResponseCustom.cpp:
1625         * bindings/js/JSBasicCredentialCustom.cpp:
1626
1627 2018-01-29  John Wilander  <wilander@apple.com>
1628
1629         Resource Load Statistics: Introduce debug mode as experimental feature
1630         https://bugs.webkit.org/show_bug.cgi?id=182199
1631         <rdar://problem/36930364>
1632
1633         Reviewed by Alex Christensen.
1634
1635         No new tests. This adds an experimental feature.
1636
1637         The only changes to default behavior are:
1638         - Increased resolution on timestamps which is needed to be able to set shorter
1639           timeouts in debug mode.
1640         - Only update partitioning and blocking table when needed. This is an optimization
1641           which pays off in less XPC with shorter timeouts.
1642
1643         * loader/ResourceLoadObserver.cpp:
1644         (WebCore::reduceTimeResolution):
1645         (WebCore::ResourceLoadObserver::logFrameNavigation):
1646         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1647         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1648         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1649         (WebCore::reduceToHourlyTimeResolution): Deleted.
1650         * page/RuntimeEnabledFeatures.h:
1651         (WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode):
1652         (WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const):
1653         * page/Settings.yaml:
1654
1655 2018-01-29  Oleksandr Skachkov  <gskachkov@gmail.com>
1656
1657         FetchResponse should support ConsumeData callback on chunk data is received: handling ReadableStream bodies
1658         https://bugs.webkit.org/show_bug.cgi?id=182008
1659
1660         Reviewed by Youenn Fablet.
1661
1662         Modify FetchResponse to support ConsumeData callback with 
1663         handling of ReadableStream by chunks
1664
1665         * Modules/cache/DOMCache.cpp:
1666         (WebCore::DOMCache::put):
1667         * Modules/fetch/FetchBodyConsumer.cpp:
1668         (WebCore::FetchBodyConsumer::resolve):
1669         * Modules/fetch/FetchResponse.cpp:
1670         (WebCore::FetchResponse::consumeBodyFromReadableStream):
1671         * Modules/fetch/FetchResponse.h:
1672         * Modules/streams/ReadableStreamChunk.h: Added.
1673         * Modules/streams/ReadableStreamSink.cpp:
1674         (WebCore::ReadableStreamToSharedBufferSink::enqueue):
1675         (WebCore::ReadableStreamToSharedBufferSink::close):
1676         * Modules/streams/ReadableStreamSink.h:
1677         * WebCore.xcodeproj/project.pbxproj:
1678         * workers/service/context/ServiceWorkerFetch.cpp:
1679         (WebCore::ServiceWorkerFetch::processResponse):
1680
1681 2018-01-29  Andy Estes  <aestes@apple.com>
1682
1683         [iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
1684         https://bugs.webkit.org/show_bug.cgi?id=182252
1685         <rdar://problem/21555881>
1686
1687         Reviewed by Tim Horton.
1688
1689         Test: http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https.html
1690
1691         * dom/Document.h:
1692         (WebCore::Document::handlingTouchEvent const):
1693         * page/EventHandler.h:
1694         (WebCore::EventHandler::touchEventTargetSubframe const):
1695         (WebCore::EventHandler::touches const):
1696
1697         Exposed some information needed by WebPage::updatePotentialTapSecurityOrigin().
1698
1699         * page/Frame.h:
1700         * page/ios/FrameIOS.mm:
1701         (WebCore::Frame::betterApproximateNode):
1702         (WebCore::Frame::qualifyingNodeAtViewportLocation):
1703
1704         Changed NodeQualifier from a function pointer to a WTF::Function.
1705
1706         (WebCore::Frame::nodeRespondingToClickEvents):
1707
1708         Turned ancestorRespondingToClickEvents() into a lambda that captures originRestriction. In
1709         the lambda, if there is an origin restriction, return nullptr if the hit test result's inner
1710         Node is not in the restricted origin.
1711
1712         (WebCore::Frame::nodeRespondingToScrollWheelEvents):
1713
1714         Turned ancestorRespondingToScrollWheelEvents() into a lambda.
1715
1716         (WebCore::ancestorRespondingToScrollWheelEvents):
1717
1718         Moved to lambda in nodeRespondingToScrollWheelEvents().
1719
1720         (WebCore::ancestorRespondingToClickEvents):
1721
1722         Moved to lambda in nodeRespondingToClickEvents().
1723
1724 2018-01-29  Emilio Cobos Álvarez  <emilio@crisal.io>
1725
1726         Trivially cleanup std::optional usage in RenderBlockFlow.
1727         https://bugs.webkit.org/show_bug.cgi?id=182142
1728
1729         Reviewed by Antti Koivisto.
1730
1731         No new tests, no behavior change.
1732
1733         * rendering/RenderBlockFlow.cpp:
1734         (WebCore::RenderBlockFlow::firstLineBaseline const):
1735         (WebCore::RenderBlockFlow::inlineBlockBaseline const):
1736
1737 2018-01-29  Brent Fulgham  <bfulgham@apple.com>
1738
1739         Add telemetry to track storage access API adoption
1740         https://bugs.webkit.org/show_bug.cgi?id=182197
1741         <rdar://problem/35803309>
1742
1743         Reviewed by Chris Dumez.
1744         
1745         Part 1: Add telemetry for the user interaction case
1746         
1747         This patch adds telemetry to track how frequently third-party cookies are
1748         used in a first party context due to user interaction. This will help
1749         understand cases where the new Storage Access API can help, and to help
1750         us understand if we have considered relevant use cases in its design.
1751
1752         * loader/ResourceLoadObserver.cpp:
1753         (WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Let the observer
1754         know the first party interaction duration.
1755         (WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Added.
1756         (WebCore::ResourceLoadObserver::logFrameNavigation): Note when a third party 
1757         resource is accessed as a first party due to user interaction. 
1758         (WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
1759         * loader/ResourceLoadObserver.h:
1760         * loader/ResourceLoadStatistics.cpp:
1761         (WebCore::ResourceLoadStatistics::encode const): Handle new fields.
1762         (WebCore::ResourceLoadStatistics::decode): Ditto.
1763         * loader/ResourceLoadStatistics.h:
1764
1765 2018-01-29  Antti Koivisto  <antti@apple.com>
1766
1767         CalcExpressionBlendLength::evaluate hits stack limit
1768         https://bugs.webkit.org/show_bug.cgi?id=182243
1769
1770         Reviewed by Zalan Bujtas.
1771
1772         Speculative fix to prevent nesting of CalcExpressionBlendLength.
1773
1774         No test, don't know how to make one.
1775
1776         * platform/CalculationValue.cpp:
1777         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
1778
1779         CalcExpressionBlendLength is only used in Length values of animated style. Normally such styles are not used
1780         as input for further blending but there are some paths where this could in principle happen. Repeated
1781         application (for each animation frame) could construct CalcExpressionBlendLength expression that blows
1782         the stack when evaluated.
1783
1784         Speculatively fix by flattening any nesting.
1785
1786         * platform/CalculationValue.h:
1787         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength): Deleted.
1788
1789 2018-01-29  Chris Dumez  <cdumez@apple.com>
1790
1791         Drop unnecessary "ServiceWorker Task Thread" in SWServer
1792         https://bugs.webkit.org/show_bug.cgi?id=182253
1793
1794         Reviewed by Youenn Fablet.
1795
1796         Drop unnecessary "ServiceWorker Task Thread" in SWServer. We're spinning a thread for
1797         each SWServer that is never used.
1798
1799         * workers/service/server/SWServer.cpp:
1800         (WebCore::SWServer::~SWServer):
1801         (WebCore::SWServer::SWServer):
1802         (WebCore::SWServer::taskThreadEntryPoint): Deleted.
1803         (WebCore::SWServer::postTask): Deleted.
1804         (WebCore::SWServer::postTaskReply): Deleted.
1805         (WebCore::SWServer::handleTaskRepliesOnMainThread): Deleted.
1806         * workers/service/server/SWServer.h:
1807
1808 2018-01-29  Matt Lewis  <jlewis3@apple.com>
1809
1810         Unreviewed, rolling out r227731.
1811
1812         This caused and assertion failure in API tests.
1813
1814         Reverted changeset:
1815
1816         "Layout Test fast/events/beforeunload-dom-manipulation-
1817         crash.html is crashing"
1818         https://bugs.webkit.org/show_bug.cgi?id=181204
1819         https://trac.webkit.org/changeset/227731
1820
1821 2018-01-29  Brady Eidson  <beidson@apple.com>
1822
1823         Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
1824         https://bugs.webkit.org/show_bug.cgi?id=182229
1825
1826         Reviewed by Chris Dumez.
1827
1828         Covered by existing LayoutTests and a new API test.
1829
1830         * dom/messageports/MessagePortChannel.cpp:
1831         (WebCore::MessagePortChannel::checkRemotePortForActivity): Don't use the global singleton
1832           provider. Instead use the provider that belongs to the owning registry.
1833
1834         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1835         (WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl): Pass a reference
1836           to *this to the Registry.
1837         * dom/messageports/MessagePortChannelProviderImpl.h:
1838
1839         * dom/messageports/MessagePortChannelRegistry.cpp:
1840         (WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry): Keep a Provider member so
1841           MessagePortChannels can get to it instead of relying on the global singleton provider.
1842         * dom/messageports/MessagePortChannelRegistry.h:
1843         (WebCore::MessagePortChannelRegistry::provider):
1844
1845 2018-01-29  Per Arne Vollan  <pvollan@apple.com>
1846
1847         Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
1848         https://bugs.webkit.org/show_bug.cgi?id=181204
1849         <rdar://problem/36256274>
1850
1851         Reviewed by Ryosuke Niwa.
1852
1853         When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
1854         the frame will be detached when removed from its previous position in the DOM tree. When being
1855         detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
1856         However, this method will return early when executed in a beforeunload handler, since navigation
1857         is not allowed then. The end result is a detached frame which will continue to load, and hitting
1858         asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
1859         possible to stop a frame load, even when executing a beforeunload handler.
1860
1861         No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
1862
1863         * loader/FrameLoader.cpp:
1864         (WebCore::FrameLoader::isStopLoadingAllowed const):
1865         (WebCore::FrameLoader::stopAllLoaders):
1866         * loader/FrameLoader.h:
1867
1868 2018-01-29  Miguel Gomez  <magomez@igalia.com>
1869
1870         [CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
1871         https://bugs.webkit.org/show_bug.cgi?id=181080
1872
1873         Reviewed by Žan Doberšek.
1874
1875         Check whether the applied clipping area is empty before drawing the children of a TextureMapperLayer. If
1876         the area is empty no children will be drawn, so we can avoid drawing them.
1877
1878         No new tests -- no change in behavior.
1879
1880         * platform/graphics/texmap/TextureMapperLayer.cpp:
1881         (WebCore::TextureMapperLayer::paintSelfAndChildren):
1882
1883 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1884
1885         [Cairo] Add GraphicsContextImplCairo::createFactory() helpers
1886         https://bugs.webkit.org/show_bug.cgi?id=182238
1887
1888         Reviewed by Carlos Garcia Campos.
1889
1890         Instead of duplicating lambdas that return a newly-created
1891         GraphicsContextImplCairo object, provide static createFactory() helpers
1892         on that class that produce GraphicsContextImplFactory wrappers which are
1893         then invoked in the GraphicsContext constructor. The static functions
1894         accept either the PlatformContextCairo reference or the cairo_t pointer,
1895         invoking the proper GraphicsContextImplCairo constructor in the returned
1896         lambda wrapper.
1897
1898         No new tests -- no change in functionality.
1899
1900         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1901         (WebCore::GraphicsContextImplCairo::createFactory):
1902         * platform/graphics/cairo/GraphicsContextImplCairo.h:
1903         * platform/graphics/cairo/ImageBufferCairo.cpp:
1904         (WebCore::ImageBuffer::ImageBuffer):
1905         * platform/graphics/cairo/PathCairo.cpp:
1906         (WebCore::Path::strokeBoundingRect const):
1907         (WebCore::Path::strokeContains const):
1908         * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
1909         (Nicosia::PaintingContextCairo::PaintingContextCairo):
1910         * platform/graphics/win/ImageCairoWin.cpp:
1911         (WebCore::BitmapImage::getHBITMAPOfSize):
1912
1913 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1914
1915         Construct GraphicsContext with NonPaintingReasons::NoReason in FrameView::adjustPageHeightDeprecated()
1916         https://bugs.webkit.org/show_bug.cgi?id=182235
1917
1918         Reviewed by Carlos Garcia Campos.
1919
1920         Pass the NonPaintingReasons::NoReason value to the GraphicsContext
1921         constructor in FrameView::adjustPageHeightDeprecated(). This has the
1922         same effect as when passing a null PlatformGraphicsContext to the
1923         constructor, which effectively disables any painting through that
1924         GraphicsContext, but doesn't have a platform-specific connotation.
1925
1926         No new tests -- no change in functionality.
1927
1928         * page/FrameView.cpp:
1929         (WebCore::FrameView::adjustPageHeightDeprecated):
1930
1931 2018-01-29  Zan Dobersek  <zdobersek@igalia.com>
1932
1933         [Cairo] Remove the GraphicsContext(cairo_t*) constructor
1934         https://bugs.webkit.org/show_bug.cgi?id=182234
1935
1936         Reviewed by Carlos Garcia Campos.
1937
1938         Instead of using the GraphicsContext(cairo_t*) constructor, leverage the
1939         GraphicsContextImplCairo class and work with an existing Cairo context
1940         through that GraphicsContextImpl implementation.
1941
1942         A new GraphicsContextImplCairo constructor is added, expecting pointer
1943         to the cairo_t object. With that, a PlatformContextCairo object is
1944         created, with ownership of that object now being handled by the
1945         GraphicsContextImplCairo class.
1946
1947         Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
1948         instead provide a factory function that returns a fresh
1949         GraphicsContextImplCairo object, passing that cairo_t object to its
1950         constructor.
1951
1952         No new tests -- no change in behavior.
1953
1954         * platform/graphics/GraphicsContext.h:
1955         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1956         (WebCore::GraphicsContext::GraphicsContext): Deleted.
1957         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1958         (WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo):
1959         (WebCore::m_private):
1960         * platform/graphics/cairo/GraphicsContextImplCairo.h:
1961         * platform/graphics/cairo/PathCairo.cpp:
1962         (WebCore::Path::strokeBoundingRect const):
1963         (WebCore::Path::strokeContains const):
1964         * platform/graphics/win/ImageCairoWin.cpp:
1965         (WebCore::BitmapImage::getHBITMAPOfSize):
1966
1967 2018-01-28  Minsheng Liu  <lambda@liu.ms>
1968
1969         Overflow of formulas is hidden for display mathematics
1970         https://bugs.webkit.org/show_bug.cgi?id=160547
1971
1972         Reviewed by Frédéric Wang.
1973
1974         Previously, <math> with display="block" uses its container's logical width as logical width.
1975         However, that behavior will truncate overflowed contents. The patch fixes it by setting
1976         the logical width as its content width rather than its container's logical width
1977         if the former is wider than the latter.
1978
1979         Test: mathml/presentation/display-math-horizontal-overflow.html
1980
1981         * rendering/mathml/RenderMathMLRow.cpp:
1982         (WebCore::RenderMathMLRow::layoutBlock):
1983
1984 2018-01-26  Antoine Quint  <graouts@apple.com>
1985
1986         [Web Animations] Distinguish between an omitted and a null timeline argument to the Animation constructor
1987         https://bugs.webkit.org/show_bug.cgi?id=179065
1988         <rdar://problem/36869046>
1989
1990         Reviewed by Dean Jackson.
1991
1992         The Web Animations specification requires that a missing or undefined "timeline" parameter means that the
1993         document's timeline should be used, but a null value should be supported. To support this, we need to provide
1994         a custom Animation constructor where we can check on the ExecState whether the second argument passed is
1995         undefined, which is true if an explicit "undefined" value is passed or if the argument does not exist.
1996
1997         * Sources.txt: Add the new JSWebAnimationCustom.cpp file.
1998         * WebCore.xcodeproj/project.pbxproj: Add the new JSWebAnimationCustom.cpp file.
1999         * animation/WebAnimation.cpp:
2000         (WebCore::WebAnimation::create): Add a create() variant that doesn't provide an AnimationTimeline parameter
2001         to clearly indicate that the provided Document's timeline should be used.
2002         * animation/WebAnimation.h:
2003         * animation/WebAnimation.idl:
2004         * bindings/js/JSWebAnimationCustom.cpp: Added.
2005         (WebCore::constructJSWebAnimation): Provide a custom Animation constructor where we check whether the second
2006         argument, the timeline, is undefined.
2007         * dom/Element.cpp:
2008         (WebCore::Element::animate): Use the new create() variant since passing "nullptr" now means a null timeline.
2009
2010 2018-01-26  Ricky Mondello  <rmondello@apple.com>
2011
2012         Use the standard -webkit-autofill color on iOS
2013         https://bugs.webkit.org/show_bug.cgi?id=182182
2014
2015         Reviewed by Tim Horton.
2016
2017         * css/html.css:
2018         (input:-webkit-autofill, input:-webkit-autofill-strong-password):
2019
2020 2018-01-26  Dean Jackson  <dino@apple.com>
2021
2022         REGRESSION (r222961): Clear function not clearing whole screen when antialias is set to false
2023         https://bugs.webkit.org/show_bug.cgi?id=179368
2024         <rdar://problem/36111549>
2025
2026         Reviewed by Sam Weinig.
2027
2028         When we changed from using a CAOpenGLLayer to a regular CALayer, we should
2029         have also swapped the "opaque" property to "contentsOpaque".
2030
2031         Covered by the existing test: fast/canvas/webgl/context-attributes-alpha.html
2032         (when run on some hardware!)
2033
2034         * platform/graphics/cocoa/WebGLLayer.mm:
2035         (-[WebGLLayer initWithGraphicsContext3D:]):
2036
2037 2018-01-26  Mark Lam  <mark.lam@apple.com>
2038
2039         Add infrastructure for pointer preparation.
2040         https://bugs.webkit.org/show_bug.cgi?id=182191
2041         <rdar://problem/36889194>
2042
2043         Reviewed by JF Bastien.
2044
2045         No new tests because this patch does not introduce any behavior change.
2046
2047         * bindings/scripts/CodeGeneratorJS.pm:
2048         (GenerateImplementation):
2049         * bindings/scripts/test/JS/JSInterfaceName.cpp:
2050         (WebCore::toJSNewlyCreated):
2051         * bindings/scripts/test/JS/JSMapLike.cpp:
2052         (WebCore::toJSNewlyCreated):
2053         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
2054         (WebCore::toJSNewlyCreated):
2055         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2056         (WebCore::toJSNewlyCreated):
2057         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2058         (WebCore::toJSNewlyCreated):
2059         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2060         (WebCore::toJSNewlyCreated):
2061         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
2062         (WebCore::toJSNewlyCreated):
2063         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2064         (WebCore::toJSNewlyCreated):
2065         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2066         (WebCore::toJSNewlyCreated):
2067         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2068         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
2069         (WebCore::toJSNewlyCreated):
2070         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2071         (WebCore::toJSNewlyCreated):
2072         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2073         (WebCore::toJSNewlyCreated):
2074         * bindings/scripts/test/JS/JSTestException.cpp:
2075         (WebCore::toJSNewlyCreated):
2076         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2077         (WebCore::toJSNewlyCreated):
2078         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2079         (WebCore::toJSNewlyCreated):
2080         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
2081         (WebCore::toJSNewlyCreated):
2082         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
2083         (WebCore::toJSNewlyCreated):
2084         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
2085         (WebCore::toJSNewlyCreated):
2086         * bindings/scripts/test/JS/JSTestInterface.cpp:
2087         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
2088         * bindings/scripts/test/JS/JSTestIterable.cpp:
2089         (WebCore::toJSNewlyCreated):
2090         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2091         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2092         (WebCore::toJSNewlyCreated):
2093         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
2094         (WebCore::toJSNewlyCreated):
2095         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
2096         (WebCore::toJSNewlyCreated):
2097         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
2098         (WebCore::toJSNewlyCreated):
2099         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2100         (WebCore::toJSNewlyCreated):
2101         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
2102         (WebCore::toJSNewlyCreated):
2103         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
2104         (WebCore::toJSNewlyCreated):
2105         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
2106         (WebCore::toJSNewlyCreated):
2107         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
2108         (WebCore::toJSNewlyCreated):
2109         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
2110         (WebCore::toJSNewlyCreated):
2111         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
2112         (WebCore::toJSNewlyCreated):
2113         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
2114         (WebCore::toJSNewlyCreated):
2115         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
2116         (WebCore::toJSNewlyCreated):
2117         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
2118         (WebCore::toJSNewlyCreated):
2119         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
2120         (WebCore::toJSNewlyCreated):
2121         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
2122         (WebCore::toJSNewlyCreated):
2123         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
2124         (WebCore::toJSNewlyCreated):
2125         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
2126         (WebCore::toJSNewlyCreated):
2127         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
2128         (WebCore::toJSNewlyCreated):
2129         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
2130         (WebCore::toJSNewlyCreated):
2131         * bindings/scripts/test/JS/JSTestNode.cpp:
2132         (WebCore::toJSNewlyCreated):
2133         * bindings/scripts/test/JS/JSTestObj.cpp:
2134         (WebCore::toJSNewlyCreated):
2135         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2136         (WebCore::toJSNewlyCreated):
2137         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2138         (WebCore::toJSNewlyCreated):
2139         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2140         (WebCore::toJSNewlyCreated):
2141         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
2142         (WebCore::toJSNewlyCreated):
2143         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
2144         (WebCore::toJSNewlyCreated):
2145         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2146         (WebCore::toJSNewlyCreated):
2147         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
2148         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2149         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2150         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2151         (WebCore::toJSNewlyCreated):
2152         * bindings/scripts/test/JS/JSTestStringifier.cpp:
2153         (WebCore::toJSNewlyCreated):
2154         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
2155         (WebCore::toJSNewlyCreated):
2156         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
2157         (WebCore::toJSNewlyCreated):
2158         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
2159         (WebCore::toJSNewlyCreated):
2160         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
2161         (WebCore::toJSNewlyCreated):
2162         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
2163         (WebCore::toJSNewlyCreated):
2164         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
2165         (WebCore::toJSNewlyCreated):
2166         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2167         (WebCore::toJSNewlyCreated):
2168
2169 2018-01-26  Simon Fraser  <simon.fraser@apple.com>
2170
2171         REGRESSiON (r226492): Crash under Element::absoluteEventBounds() on a SVGPathElement which has not been laid out yet
2172         https://bugs.webkit.org/show_bug.cgi?id=182185
2173         rdar://problem/36836262
2174
2175         Reviewed by Zalan Bujtas.
2176
2177         Document::absoluteRegionForEventTargets() can fire when layout is dirty, and SVGPathElement's path() can be null if it
2178         hasn't been laid out yet. So protect against a null path in getBBox().
2179
2180         Not easily testable because internals.nonFastScrollableRects() forces layout, and the crash depends on the timing of
2181         absoluteRegionForEventTargets().
2182
2183         * svg/SVGPathElement.cpp:
2184         (WebCore::SVGPathElement::getBBox):
2185
2186 2018-01-26  Chris Dumez  <cdumez@apple.com>
2187
2188         Offlined content does not work for apps on home screen
2189         https://bugs.webkit.org/show_bug.cgi?id=182070
2190         <rdar://problem/36843906>
2191
2192         Reviewed by Youenn Fablet.
2193
2194         Already registered service workers were unable to intercept the very first
2195         load because registration matching was happening after the registration
2196         was loaded from disk, but *before* its active worker was populated.
2197
2198         We now initialize the registrations' active worker as soon as we load
2199         them from disk. We do not necessarily have a SW Context process connection
2200         identifier yet at this point so I made it optional on the SWServerWorker.
2201         This identifier gets set on the SWServerWorker when the worker is actually
2202         launched and gets cleared when the SWServerWorker gets terminated.
2203
2204         Covered by new API test.
2205
2206         * workers/service/server/SWServer.cpp:
2207         (WebCore::SWServer::addRegistrationFromStore):
2208         (WebCore::SWServer::installContextData):
2209         (WebCore::SWServer::terminateWorkerInternal):
2210         (WebCore::SWServer::workerContextTerminated):
2211         (WebCore::SWServer::fireInstallEvent):
2212         (WebCore::SWServer::fireActivateEvent):
2213         * workers/service/server/SWServerWorker.cpp:
2214         (WebCore::SWServerWorker::SWServerWorker):
2215         * workers/service/server/SWServerWorker.h:
2216         (WebCore::SWServerWorker::contextConnectionIdentifier const):
2217         (WebCore::SWServerWorker::setContextConnectionIdentifier):
2218
2219 2018-01-26  Chris Nardi  <cnardi@chromium.org>
2220
2221         Addressing post-review comments after r226614
2222         https://bugs.webkit.org/show_bug.cgi?id=182151
2223
2224         Reviewed by Myles C. Maxfield.
2225
2226         * html/HTMLTextAreaElement.cpp:
2227         (WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
2228         * html/TextFieldInputType.cpp:
2229         (WebCore::limitLength):
2230         * platform/LocalizedStrings.cpp:
2231         (WebCore::truncatedStringForLookupMenuItem):
2232         * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
2233         (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2234
2235 2018-01-26  Antoine Quint  <graouts@apple.com>
2236
2237         [iOS] prefers-reduced-motion media query is not working
2238         https://bugs.webkit.org/show_bug.cgi?id=182169
2239         <rdar://problem/36801631>
2240
2241         Reviewed by Dean Jackson.
2242
2243         The code that would eventually query UIKit for the system setting was not run since USE(NEW_THEME) is off on iOS.
2244         Adding a PLATFORM(IOS) flag here allows the code to run.
2245
2246         * css/MediaQueryEvaluator.cpp:
2247         (WebCore::prefersReducedMotionEvaluate):
2248
2249 2018-01-26  Youenn Fablet  <youenn@apple.com>
2250
2251         CSP post checks should be done for service worker responses
2252         https://bugs.webkit.org/show_bug.cgi?id=182160
2253
2254         Reviewed by Daniel Bates.
2255
2256         Covered by updated test.
2257
2258         Add security checks when receiving a service worker response.
2259
2260         * loader/SubresourceLoader.cpp:
2261         (WebCore::SubresourceLoader::didReceiveResponse):
2262         * loader/cache/CachedResourceLoader.h:
2263
2264 2018-01-26  Manuel Rego Casasnovas  <rego@igalia.com>
2265
2266         [css-multicol] Support percentages in column-gap
2267         https://bugs.webkit.org/show_bug.cgi?id=182004
2268
2269         Reviewed by Javier Fernandez.
2270
2271         This patch adds percentage support to column-gap property.
2272
2273         Most of the changes are related to the parsing logic,
2274         the column-gap property now accepts both length and percentages,
2275         on top of the "normal" initial value.
2276         A new utility class GapLength has been added, as it'll be useful
2277         to implement row-gap in the future.
2278
2279         Apart from that the muticolumn layout code has been modified
2280         to resolve the percentage gaps (treating them as zero while computing
2281         preferred widths) and resolving them during layout.
2282         This doesn't follow the current text on the spec, but there is an
2283         ongoing discussion that might cause the text is changed:
2284         https://github.com/w3c/csswg-drafts/issues/509#issuecomment-355242101
2285         We could update the implementation once we have a definitive answer
2286         from the CSS WG.
2287
2288         Test: web-platform-tests/css/css-multicol/multicol-gap-percentage-001.html
2289
2290         * Sources.txt:
2291         * WebCore.xcodeproj/project.pbxproj:
2292         * css/CSSComputedStyleDeclaration.cpp:
2293         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2294         * css/CSSProperties.json:
2295         * css/StyleBuilderConverter.h:
2296         (WebCore::StyleBuilderConverter::convertGapLength):
2297         * css/StyleBuilderCustom.h:
2298         (WebCore::forwardInheritedValue):
2299         * css/parser/CSSPropertyParser.cpp:
2300         (WebCore::consumeGapLength):
2301         (WebCore::CSSPropertyParser::parseSingleValue):
2302         * page/FrameView.cpp:
2303         (WebCore::FrameView::applyPaginationToViewport):
2304         * page/animation/CSSPropertyAnimation.cpp:
2305         (WebCore::blendFunc):
2306         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2307         * rendering/RenderBlockFlow.cpp:
2308         (WebCore::RenderBlockFlow::columnGap const):
2309         * rendering/RenderMultiColumnSet.cpp:
2310         (WebCore::RenderMultiColumnSet::columnGap const):
2311         * rendering/style/GapLength.cpp: Added.
2312         (WebCore::operator<<):
2313         * rendering/style/GapLength.h: Added.
2314         (WebCore::GapLength::GapLength):
2315         (WebCore::GapLength::isNormal const):
2316         (WebCore::GapLength::length const):
2317         (WebCore::GapLength::operator== const):
2318         * rendering/style/RenderStyle.h:
2319         (WebCore::RenderStyle::columnGap const):
2320         (WebCore::RenderStyle::setColumnGap):
2321         (WebCore::RenderStyle::initialColumnGap):
2322         * rendering/style/StyleMultiColData.cpp:
2323         (WebCore::StyleMultiColData::StyleMultiColData):
2324         (WebCore::StyleMultiColData::operator== const):
2325         * rendering/style/StyleMultiColData.h:
2326         * style/StyleResolveForDocument.cpp:
2327         (WebCore::Style::resolveForDocument):
2328
2329 2018-01-26  Emilio Cobos Álvarez  <emilio@crisal.io>
2330
2331         Remove unused RenderFragmentedFlow::createFragmentedFlowStyle.
2332         https://bugs.webkit.org/show_bug.cgi?id=182138
2333
2334         Reviewed by Manuel Rego Casasnovas.
2335
2336         Has no callers.
2337
2338         No new tests, just removes unused code so no behavior change.
2339
2340         * rendering/RenderFragmentedFlow.cpp:
2341         * rendering/RenderFragmentedFlow.h:
2342
2343 2018-01-26  Emilio Cobos Álvarez  <emilio@crisal.io>
2344
2345         Remove useless RenderBlockFlow overrides.
2346         https://bugs.webkit.org/show_bug.cgi?id=182139
2347
2348         Reviewed by Manuel Rego Casasnovas.
2349
2350         I think these are leftovers from the CSS regions removal, looking at
2351         blame.
2352
2353         No new tests, no behavior change.
2354
2355         * rendering/RenderBlockFlow.cpp:
2356         * rendering/RenderBlockFlow.h:
2357
2358 2018-01-25  Joseph Pecoraro  <pecoraro@apple.com>
2359
2360         Web Inspector: Add InspectorShaderProgram to Unified Sources build
2361         https://bugs.webkit.org/show_bug.cgi?id=182084
2362
2363         Reviewed by Dan Bernstein.
2364
2365         * CMakeLists.txt:
2366         * WebCore.xcodeproj/project.pbxproj:
2367         * Sources.txt:
2368         Move to Sources.txt always.
2369
2370         * inspector/InspectorShaderProgram.cpp:
2371         Add ENABLE(WEBGL) guard to contents.
2372
2373 2018-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2374
2375         Make scrolling to the focused element async
2376         https://bugs.webkit.org/show_bug.cgi?id=181575
2377         <rdar://problem/36459767>
2378
2379         Reviewed by Simon Fraser.
2380
2381         Made the revealing of the focused element asynchronous in Element::focus. Like selection, schedule a timer when
2382         a new element is focused, and only scroll to the focused element when the timer fires. If any other scrolling
2383         happens meanwhile, we cancel this timer.
2384
2385         There are two Web exposed behavioral changes:
2386         1. The scrolling position doesn't change immediately when calling Element::focus.
2387         2. Only the last focused element will be revealed.
2388
2389         Both behavioral changes pose its own compatibility risks but we're making a conscious decision here since
2390         the scrolling asynchronous has a clear performance benefit.
2391
2392         There is one edge case to cosnider: when the history controller restores the scrolling position, canceling the
2393         timer results in a focused element in an overflow: hidden element to be never revealed. Expediate revealing of
2394         the focused element in this one case instead of canceling.
2395
2396         Tests: fast/scrolling/scroll-to-focused-element-asynchronously.html
2397                fast/scrolling/scroll-to-focused-element-canceled-by-fragment-navigation.html
2398
2399         * dom/Element.cpp:
2400         (WebCore::Element::focus): Call updateFocusAppearance on focusAppearanceUpdateTarget to handle HTMLAreaElement
2401         which delegates the focus appearance update to its image element.
2402         (WebCore::Element::focusAppearanceUpdateTarget): Extracted. Returns "this" element for all but HTMLAreaElement.
2403         (WebCore::Element::updateFocusAppearance): Schedule the revealing of the focused element in FrameView instead of
2404         synchronously scrolling to the focused element.
2405         * dom/Element.h:
2406         (WebCore::Element::defaultFocusTextStateChangeIntent):
2407         * html/HTMLAreaElement.cpp:
2408         (WebCore::HTMLAreaElement::focusAppearanceUpdateTarget): Extracted from updateFocusAppearance.
2409         (WebCore::HTMLAreaElement::updateFocusAppearance): Deleted.
2410         * html/HTMLAreaElement.h:
2411         * loader/HistoryController.cpp:
2412         (WebCore::HistoryController::restoreScrollPositionAndViewState): Reveal the focused element
2413         prior to restoring the scrolling location of the fragment navigation. This is needed to reveal a focused element
2414         inside overflow: hidden element which got focused.
2415         * page/FrameView.cpp:
2416         (WebCore::FrameView::FrameView): Added a boolean flag and a timer for scrolling to the focused element.
2417         (WebCore::FrameView::reset): Stop the timer and clear the flag.
2418         (WebCore::FrameView::maintainScrollPositionAtAnchor): Ditto when scrolling to an anchor.
2419         (WebCore::FrameView::setScrollPosition): Ditto when some other programatic scroll or the user scrolls the view.
2420         (WebCore::FrameView::scheduleScrollToFocusedElement): Added.
2421         (WebCore::FrameView::scrollToFocusedElementImmediatelyIfNeeded): Added.
2422         (WebCore::FrameView::scrollToFocusedElementTimerFired): Added.
2423         (WebCore::FrameView::scrollToAnchor): Stop the timer and clear the flag when scrolling to an achor.
2424         (WebCore::FrameView::setWasScrolledByUser): Ditto when the user scrolls.
2425         * page/FrameView.h:
2426
2427 2018-01-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
2428
2429         REGRESSION(r217236): [iOS] PDFDocumentImage does not update its cached ImageBuffer if it has a sub-rectangle of the image
2430         https://bugs.webkit.org/show_bug.cgi?id=182083
2431
2432         Reviewed by Simon Fraser.
2433
2434         Test: fast/images/pdf-as-image-dest-rect-change.html
2435
2436         Revert the change r217236 back. Fix the issue of throwing out the cached
2437         ImageBuffer of the PDF document image when moving its rectangle.
2438
2439         * platform/graphics/cg/PDFDocumentImage.cpp:
2440         (WebCore::PDFDocumentImage::cacheParametersMatch): Return the if-statement
2441         which was deleted in r217236 back but intersect it with dstRect. The context
2442         clipping rectangle can be more than the dstRect.
2443         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
2444         -- Remove a wrong optimization which used to work for Mac only if the context
2445            interpolation quality is not set to low or none quality. This optimization
2446            does not consider the case when srcRect or destRect change after caching
2447            the ImageBuffer. Or even if m_cachedImageRect does not include the
2448            whole clipping rectangle.
2449         -- Move back the call to cacheParametersMatch() before changing the
2450            m_cachedImageRect.
2451         -- Always intersect the clipping rectangle with the dstRect to ensure we
2452            only look at the dirty rectangle inside the image boundary.
2453         -- If cacheParametersMatch() returns true, set m_cachedDestinationRect to
2454            dstRect and move m_cachedImageRect by the difference between the new
2455            and the old dstRects since no re-caching will happen.
2456         * platform/graphics/cg/PDFDocumentImage.h:
2457         * testing/Internals.cpp:
2458         (WebCore::pdfDocumentImageFromImageElement):
2459         (WebCore::Internals::pdfDocumentCachingCount):
2460         * testing/Internals.h:
2461         * testing/Internals.idl:
2462         Add an internal API which returns the number of drawing the PDF into an
2463         ImageBuffer.
2464
2465 2018-01-25  Joseph Pecoraro  <pecoraro@apple.com>
2466
2467         Web Inspector: Remove unnecessary developerExtrasEnabled checks
2468         https://bugs.webkit.org/show_bug.cgi?id=182156
2469
2470         Reviewed by Matt Baker.
2471
2472         * inspector/InspectorInstrumentation.cpp:
2473         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
2474         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2475         (WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
2476         These checks should not be needed. The step above bails if there is
2477         no inspector frontend, and there can be no inspector frontend unless
2478         developer extras enabled are enabled.
2479
2480 2018-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2481
2482         Add localizable strings for extra-zoomed form controls
2483         https://bugs.webkit.org/show_bug.cgi?id=182080
2484
2485         Reviewed by Tim Horton.
2486
2487         Add new localizable strings. Additionally, run `update-webkit-localizable-strings` to re-sort
2488         Localizable.strings.
2489
2490         * English.lproj/Localizable.strings:
2491         * platform/LocalizedStrings.cpp:
2492         (WebCore::formControlCancelButtonTitle):
2493         (WebCore::formControlHideButtonTitle):
2494         (WebCore::formControlGoButtonTitle):
2495         (WebCore::formControlSearchButtonTitle):
2496         (WebCore::textInputModeWriteButton):
2497         (WebCore::textInputModeSpeechButton):
2498         * platform/LocalizedStrings.h:
2499
2500 2018-01-25  Chris Dumez  <cdumez@apple.com>
2501
2502         Access to service workers / Cache API should be disabled in sandboxed frames without allow-same-origin flag
2503         https://bugs.webkit.org/show_bug.cgi?id=182140
2504         <rdar://problem/36879952>
2505
2506         Reviewed by Youenn Fablet.
2507
2508         Throw a SecurityError when accessing navigator.serviceWorker or window.caches inside a sandboxed iframe
2509         without the allow-same-origin flag. This behavior is consistent with Chrome. Firefox, however, seems
2510         to return these objects but have their API reject promises with a SecurityError instead.
2511
2512         No new tests, rebaselined existing tests.
2513
2514         * Modules/cache/DOMWindowCaches.cpp:
2515         (WebCore::DOMWindowCaches::caches): Deleted.
2516         * Modules/cache/DOMWindowCaches.h:
2517         * Modules/cache/DOMWindowCaches.idl:
2518         * page/NavigatorBase.cpp:
2519         * page/NavigatorBase.h:
2520         * page/NavigatorServiceWorker.idl:
2521
2522 2018-01-25  Chris Dumez  <cdumez@apple.com>
2523
2524         Clients.get(id) should only returns clients in the service worker's origin
2525         https://bugs.webkit.org/show_bug.cgi?id=182149
2526         <rdar://problem/36882310>
2527
2528         Reviewed by Youenn Fablet.
2529
2530         When looking for SW clients with a given identifier, only look in the list of
2531         clients that have the same origin as the service worker.
2532
2533         No new tests, rebaselined existing test.
2534
2535         * workers/service/server/SWServer.cpp:
2536         (WebCore::SWServer::serviceWorkerClientWithOriginByID const):
2537         (WebCore::SWServer::serviceWorkerClientByID const): Deleted.
2538         * workers/service/server/SWServer.h:
2539         * workers/service/server/SWServerWorker.cpp:
2540         (WebCore::SWServerWorker::findClientByIdentifier const):
2541         * workers/service/server/SWServerWorker.h:
2542
2543 2018-01-25  Youenn Fablet  <youenn@apple.com>
2544
2545         WebPluginInfoProvider should handle null host queries
2546         https://bugs.webkit.org/show_bug.cgi?id=182112
2547
2548         Reviewed by Chris Dumez.
2549
2550         No change of behavior.
2551
2552         Removed assertion that is not always true, as shown by API tests.
2553
2554         * loader/DocumentLoader.cpp:
2555         (WebCore::DocumentLoader::responseReceived):
2556
2557 2018-01-25  Youenn Fablet  <youenn@apple.com>
2558
2559         ShapeOutside should use same origin credentials mode
2560         https://bugs.webkit.org/show_bug.cgi?id=182141
2561
2562         Reviewed by Chris Dumez.
2563
2564         Covered by updated test.
2565         As per https://drafts.csswg.org/css-shapes/#shape-outside-property, ShapeOutside images
2566         should be fetched with anonymous cors mode, meaning credentials should be set to same-origin.
2567
2568         * style/StylePendingResources.cpp:
2569         (WebCore::Style::loadPendingImage):
2570
2571 2018-01-25  John Wilander  <wilander@apple.com>
2572
2573         Make sure we have a frame as we iterate in ResourceLoadObserver::nonNullOwnerURL()
2574         https://bugs.webkit.org/show_bug.cgi?id=182116
2575         <rdar://problem/36210134>
2576
2577         Reviewed by Alex Christensen.
2578
2579         No new tests. No known repro case, just crash logs.
2580
2581         * loader/ResourceLoadObserver.cpp:
2582         (WebCore::ResourceLoadObserver::nonNullOwnerURL const):
2583
2584 2018-01-25  Jer Noble  <jer.noble@apple.com>
2585
2586         Move ImageDecoderAVFObjC from using AVSampleBufferGenerator to AVAssetReaderOutput for parsing
2587         https://bugs.webkit.org/show_bug.cgi?id=182091
2588
2589         Reviewed by Eric Carlson.
2590
2591         No new tests; should be covered by existing tests.
2592
2593         AVSampleBufferGenerator is not available on iOS, so in order to enable ImageDecoderAVFObjC there,
2594         we must adopt a similar API which is available both on iOS and macOS: AVAssetReaderOutput. Unlike
2595         the generator, AVAssetReaderOutput doesn't necessarily generate samples in decode order, so we'll
2596         repurpose the SampleMap from EME to hold the decoded samples as well as their generated images.
2597
2598         * Modules/mediasource/SampleMap.cpp:
2599         * Modules/mediasource/SampleMap.h:
2600         (WebCore::SampleMap::size const):
2601         * platform/MIMETypeRegistry.cpp:
2602         (WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
2603         * platform/MediaSample.h:
2604         (WebCore::MediaSample::hasAlpha const):
2605         * platform/graphics/ImageDecoder.cpp:
2606         (WebCore::ImageDecoder::create):
2607         (WebCore::ImageDecoder::supportsMediaType):
2608         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Make non-final.
2609         (WebCore::MediaSampleAVFObjC::sampleBuffer const):
2610         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
2611         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
2612         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2613         (WebCore::ImageDecoderAVFObjCSample::create):
2614         (WebCore::ImageDecoderAVFObjCSample::sampleBuffer const):
2615         (WebCore::ImageDecoderAVFObjCSample::image const):
2616         (WebCore::ImageDecoderAVFObjCSample::setImage):
2617         (WebCore::ImageDecoderAVFObjCSample::ImageDecoderAVFObjCSample):
2618         (WebCore::ImageDecoderAVFObjCSample::cacheMetadata):
2619         (WebCore::toSample):
2620         (WebCore::ImageDecoderAVFObjC::readSamples):
2621         (WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
2622         (WebCore::ImageDecoderAVFObjC::advanceCursor):
2623         (WebCore::ImageDecoderAVFObjC::setTrack):
2624         (WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
2625         (WebCore::ImageDecoderAVFObjC::repetitionCount const):
2626         (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
2627         (WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const):
2628         (WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const):
2629         (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
2630         (WebCore::ImageDecoderAVFObjC::setData):
2631         (WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):
2632         (WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
2633         (WebCore::ImageDecoderAVFObjC::readSampleMetadata): Deleted.
2634
2635 2018-01-25  Youenn Fablet  <youenn@apple.com>
2636
2637         DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
2638         https://bugs.webkit.org/show_bug.cgi?id=182137
2639
2640         Reviewed by Chris Dumez.
2641
2642         Covered by rebased test.
2643         In case redirection does not come from memory cache or service worker, disable service worker interception when following the redirection.
2644
2645         * loader/DocumentThreadableLoader.cpp:
2646         (WebCore::DocumentThreadableLoader::redirectReceived):
2647
2648 2018-01-25  Youenn Fablet  <youenn@apple.com>
2649
2650         DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
2651         https://bugs.webkit.org/show_bug.cgi?id=182115
2652
2653         Reviewed by Alex Christensen.
2654
2655         Covered by rebased test.
2656
2657         In case a navigation load is going to the network process,
2658         we need to interrupt it if having a redirection that leads to a new request going to a service worker.
2659
2660         * loader/DocumentLoader.cpp:
2661         (WebCore::DocumentLoader::redirectReceived):
2662
2663 2018-01-25  Chris Dumez  <cdumez@apple.com>
2664
2665         Registering same scope as the script directory without the last slash should fail
2666         https://bugs.webkit.org/show_bug.cgi?id=182122
2667         <rdar://problem/36877167>
2668
2669         Reviewed by Youenn Fablet.
2670
2671         This aligns our behavior with Firefox and Chrome.
2672
2673         No new tests, rebaselined existing test.
2674
2675         * workers/service/ServiceWorkerJob.cpp:
2676         (WebCore::ServiceWorkerJob::didReceiveResponse):
2677
2678 2018-01-25  Antoine Quint  <graouts@apple.com>
2679
2680         [Web Animations] Expose the reverse() method
2681         https://bugs.webkit.org/show_bug.cgi?id=182100
2682         <rdar://problem/36867117>
2683
2684         Reviewed by Dean Jackson.
2685
2686         We expose and implement the reverse() method on Animation as specified.
2687
2688         * animation/WebAnimation.cpp:
2689         (WebCore::WebAnimation::setPlaybackRate):
2690         (WebCore::WebAnimation::reverse):
2691         * animation/WebAnimation.h:
2692         * animation/WebAnimation.idl:
2693
2694 2018-01-25  Antoine Quint  <graouts@apple.com>
2695
2696         [Web Animations] Account for provided easings when computing progress and resolving keyframe effect values
2697         https://bugs.webkit.org/show_bug.cgi?id=182098
2698         <rdar://problem/36866149>
2699
2700         Reviewed by Dean Jackson.
2701
2702         We now account for the timing functions provided through the "easing" propreties on whole animation effects
2703         and individual keyframes. Exposing those exposed shortcomings of our keyframe resolution in general through
2704         WPT tests so we now implement the "effect value of a keyframe effect" procedure from the spec to correctly
2705         resolve keyframes in KeyframeEffect::setAnimatedPropertiesInStyle(). The tests also showed some shortcomings
2706         in our TimingFunction code where our step() function resolution wasn't fully compliant and our cubic-bezier()
2707         resolution not accurate enough. We now have microsecond accuracy when resolving cubic-bezier() timing functions
2708         and identify cubic-bezier(0, 0, 0, 0), cubic-bezier(0, 0, 1, 1) and cubic-bezier(1, 1, 1, 1) as linear timing
2709         functions, as called out by the WPT tests.
2710
2711         * animation/AnimationEffect.cpp:
2712         (WebCore::AnimationEffect::transformedProgress const): Account for the effect-wide timing function when computing
2713         the progress.
2714         (WebCore::AnimationEffect::iterationProgress const): Use the transformed progress now that we support this procedure.
2715         * animation/AnimationEffect.h:
2716         * animation/KeyframeEffect.cpp:
2717         (WebCore::KeyframeEffect::apply): We now use the computed progress from AnimationEffect rather than compute based
2718         on the provided time, which we've dropped as an argument.
2719         (WebCore::KeyframeEffect::getAnimatedStyle):
2720         (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Implement the "effect value of a keyframe effect" procedure
2721         in full as specified (save for composite operations).
2722         (WebCore::KeyframeEffect::applyAtLocalTime): Deleted.
2723         * animation/KeyframeEffect.h:
2724         * animation/WebAnimation.cpp:
2725         (WebCore::WebAnimation::resolve):
2726         * css/CSSTimingFunctionValue.h: Fix a small error made in a previous patch where we used "int" instead of "unsigned".
2727         * platform/animation/TimingFunction.cpp:
2728         (WebCore::TimingFunction::transformTime const):
2729         * platform/animation/TimingFunction.h:
2730
2731 2018-01-25  Antoine Quint  <graouts@apple.com>
2732
2733         [Web Animations] Avoid querying the current time multiple time when resolving the play state
2734         https://bugs.webkit.org/show_bug.cgi?id=182099
2735
2736         Reviewed by Dean Jackson.
2737
2738         No test change since this shouldn't cause any change in behavior.
2739
2740         * animation/WebAnimation.cpp:
2741         (WebCore::WebAnimation::playState const):
2742
2743 2018-01-25  Youenn Fablet  <youenn@apple.com>
2744
2745         Set integrity fetch options for loading scripts and CSS
2746         https://bugs.webkit.org/show_bug.cgi?id=182077
2747
2748         Reviewed by Chris Dumez.
2749
2750         Covered by updated test.
2751
2752         Set integrity fetch option in script and CSS loading.
2753
2754         * bindings/js/CachedModuleScriptLoader.cpp:
2755         (WebCore::CachedModuleScriptLoader::load):
2756         * bindings/js/CachedScriptFetcher.cpp:
2757         (WebCore::CachedScriptFetcher::requestModuleScript const):
2758         (WebCore::CachedScriptFetcher::requestScriptWithCache const):
2759         * bindings/js/CachedScriptFetcher.h:
2760         * dom/LoadableClassicScript.cpp:
2761         (WebCore::LoadableClassicScript::load):
2762         * dom/ScriptElementCachedScriptFetcher.cpp:
2763         (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
2764         * dom/ScriptElementCachedScriptFetcher.h:
2765         * html/HTMLLinkElement.cpp:
2766         (WebCore::HTMLLinkElement::process):
2767
2768 2018-01-25  Zan Dobersek  <zdobersek@igalia.com>
2769
2770         [Cairo] Use GraphicsContextImplCairo in Nicosia::PaintingContextCairo
2771         https://bugs.webkit.org/show_bug.cgi?id=182094
2772
2773         Reviewed by Carlos Garcia Campos.
2774
2775         Have Nicosia::PaintingContextCairo create a GraphicsContext object that
2776         utilizes a factory function which returns a freshly-allocated
2777         GraphicsContextImplCairo through which all the painting is then done.
2778         This moves GraphicsLayer painting over to using the GraphicsContextImpl
2779         infrastructure.
2780
2781         No new tests -- no changes in behavior.
2782
2783         * platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
2784         (Nicosia::PaintingContextCairo::PaintingContextCairo):
2785
2786 2018-01-24  Frederic Wang  <fwang@igalia.com>
2787
2788         ScrollingStateNode::reconcileLayerPositionForViewportRect is only called on direct children of the root
2789         https://bugs.webkit.org/show_bug.cgi?id=179946
2790
2791         Reviewed by Simon Fraser.
2792
2793         ScrollingStateNode::reconcileLayerPositionForViewportRect is currently only called on the
2794         direct children of root of the scrolling tree. Hence nodes like "position: fixed" will not
2795         update their layers after scrolling when they are deeper in the tree. This is already
2796         possible on iOS with overflow nodes and will happen with subframes when async scrolling is
2797         implemented. This commit fixes that issue by recursively calling the function
2798         ScrollingStateNode::reconcileLayerPositionForViewportRect on the scrolling tree.
2799
2800         Test: fast/scrolling/ios/reconcile-layer-position-recursive.html
2801
2802         * page/scrolling/AsyncScrollingCoordinator.cpp:
2803         (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Just call
2804         reconcileLayerPositionForViewportRect on the root node.
2805         * page/scrolling/ScrollingStateNode.cpp:
2806         (WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): By default, this
2807         function now recursively calls reconcileLayerPositionForViewportRect on the children.
2808         * page/scrolling/ScrollingStateNode.h:
2809         * page/scrolling/ScrollingStateFixedNode.cpp:
2810         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect): Call the function
2811         on children.
2812         * page/scrolling/ScrollingStateStickyNode.cpp:
2813         (WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): Ditto.
2814
2815 2018-01-24  Zan Dobersek  <zdobersek@igalia.com>
2816
2817         [Cairo] Use GraphicsContextImplCairo for ImageBuffer context
2818         https://bugs.webkit.org/show_bug.cgi?id=181977
2819
2820         Reviewed by Carlos Garcia Campos.
2821
2822         Enhance the GraphicsContextImpl interface to the point of enabling the
2823         Cairo-based implementation to be used for GraphicsContext construction
2824         in ImageBufferCairo.cpp.
2825
2826         In order to enable GraphicsContextImpl implementations to properly
2827         manage PlatformGraphicsContext objects, the hasPlatformContext() and
2828         platformContext() methods are added. Cairo implementation returns true
2829         in the first method, and returns pointer to the PlatformContextCairo
2830         object in the second. The DisplayList::Recorder, due to its recording
2831         nature, doesn't manage such an object, so it returns false and nullptr,
2832         respectively.
2833
2834         GraphicsContextImpl also gains the setCTM(), getCTM(), clipBounds() and
2835         roundToDevicePixels() methods, corresponding to the GraphicsContext
2836         methods that now invoke these new methods on any existing m_impl object.
2837         GraphicsContextImplCairo implementations mimic the existing behavior in
2838         the Cairo-specific GraphicsContext methods, but DisplayList::Recorder
2839         implementations remain no-op, logging the invocation but doing nothing
2840         otherwise.
2841
2842         drawImage() and drawTiledImage() methods on the GraphicsContextImpl
2843         interface are changed to return the ImageDrawResult value, corresponding
2844         to what's been done in the method. In DisplayList::Recorder, the methods
2845         return ImageDrawResult::DidRecord, while in GraphicsContextImplCairo the
2846         methods return the return result of Image::draw() or Image::drawTiled()
2847         call.
2848
2849         To make the protected Image::draw() and Image::drawTiled() methods
2850         accessible, invocations of those are packed into static drawImageImpl()
2851         and drawTiledImageImpl() functions on the GraphicsContextImpl class.
2852         This makes it possible to simply declare GraphicsContextImpl class as a
2853         friend class of Image, and not every specific GraphicsContextImpl
2854         derivation. Implementations of these functions mirror behavior of the
2855         drawImage() and drawTiledImage() methods on the GraphicsContext class,
2856         when an m_impl object isn't present, constructing a scope-tied
2857         InterpolationQualityMaintainer object and invoking the relevant Image
2858         method.
2859
2860         To make immediate use of the new GraphicsContextImplCairo functionality,
2861         the GraphicsContext construction in Cairo-specific ImageBuffer
2862         implementation now uses a factory function that returns a new
2863         GraphicsContextImplCairo object through which the given
2864         PlatformContextCairo is used for painting.
2865
2866         No new tests -- no change in functionality.
2867
2868         * platform/graphics/GraphicsContext.cpp:
2869         (WebCore::GraphicsContext::hasPlatformContext const):
2870         (WebCore::GraphicsContext::drawImage):
2871         (WebCore::GraphicsContext::drawTiledImage):
2872         * platform/graphics/GraphicsContext.h:
2873         (WebCore::GraphicsContext::hasPlatformContext const): Deleted.
2874         * platform/graphics/GraphicsContextImpl.cpp:
2875         (WebCore::GraphicsContextImpl::drawImageImpl):
2876         (WebCore::GraphicsContextImpl::drawTiledImageImpl):
2877         * platform/graphics/GraphicsContextImpl.h:
2878         * platform/graphics/Image.h:
2879         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2880         (WebCore::GraphicsContext::getCTM const):
2881         (WebCore::GraphicsContext::platformContext const):
2882         (WebCore::GraphicsContext::clipBounds const):
2883         (WebCore::GraphicsContext::roundToDevicePixels):
2884         (WebCore::GraphicsContext::setCTM):
2885         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
2886         (WebCore::m_private):
2887         (WebCore::GraphicsContextImplCairo::~GraphicsContextImplCairo):
2888         (WebCore::GraphicsContextImplCairo::hasPlatformContext const):
2889         (WebCore::GraphicsContextImplCairo::platformContext const):
2890         (WebCore::GraphicsContextImplCairo::updateState):
2891         (WebCore::GraphicsContextImplCairo::setLineCap):
2892         (WebCore::GraphicsContextImplCairo::setLineDash):
2893         (WebCore::GraphicsContextImplCairo::setLineJoin):
2894         (WebCore::GraphicsContextImplCairo::setMiterLimit):
2895         (WebCore::GraphicsContextImplCairo::fillRect):
2896         (WebCore::GraphicsContextImplCairo::fillRoundedRect):
2897         (WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
2898         (WebCore::GraphicsContextImplCairo::fillPath):
2899         (WebCore::GraphicsContextImplCairo::fillEllipse):
2900         (WebCore::GraphicsContextImplCairo::strokeRect):
2901         (WebCore::GraphicsContextImplCairo::strokePath):
2902         (WebCore::GraphicsContextImplCairo::strokeEllipse):
2903         (WebCore::GraphicsContextImplCairo::clearRect):
2904         (WebCore::GraphicsContextImplCairo::drawGlyphs):
2905         (WebCore::GraphicsContextImplCairo::drawImage):
2906         (WebCore::GraphicsContextImplCairo::drawTiledImage):
2907         (WebCore::GraphicsContextImplCairo::drawNativeImage):
2908         (WebCore::GraphicsContextImplCairo::drawPattern):
2909         (WebCore::GraphicsContextImplCairo::drawRect):
2910         (WebCore::GraphicsContextImplCairo::drawLine):
2911         (WebCore::GraphicsContextImplCairo::drawLinesForText):
2912         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
2913         (WebCore::GraphicsContextImplCairo::drawEllipse):
2914         (WebCore::GraphicsContextImplCairo::drawFocusRing):
2915         (WebCore::GraphicsContextImplCairo::save):
2916         (WebCore::GraphicsContextImplCairo::restore):
2917         (WebCore::GraphicsContextImplCairo::translate):
2918         (WebCore::GraphicsContextImplCairo::rotate):
2919         (WebCore::GraphicsContextImplCairo::scale):
2920         (WebCore::GraphicsContextImplCairo::concatCTM):
2921         (WebCore::GraphicsContextImplCairo::setCTM):
2922         (WebCore::GraphicsContextImplCairo::getCTM):
2923         (WebCore::GraphicsContextImplCairo::beginTransparencyLayer):
2924         (WebCore::GraphicsContextImplCairo::endTransparencyLayer):
2925         (WebCore::GraphicsContextImplCairo::clip):
2926         (WebCore::GraphicsContextImplCairo::clipOut):
2927         (WebCore::GraphicsContextImplCairo::clipPath):
2928         (WebCore::GraphicsContextImplCairo::clipBounds):
2929         (WebCore::GraphicsContextImplCairo::roundToDevicePixels):
2930         (WebCore::m_platformContext): Deleted.
2931         * platform/graphics/cairo/GraphicsContextImplCairo.h:
2932         * platform/graphics/cairo/ImageBufferCairo.cpp:
2933         (WebCore::ImageBuffer::ImageBuffer):
2934         * platform/graphics/cg/GraphicsContextCG.cpp:
2935         (WebCore::GraphicsContext::clipBounds const):
2936         (WebCore::GraphicsContext::setCTM):
2937         (WebCore::GraphicsContext::getCTM const):
2938         (WebCore::GraphicsContext::roundToDevicePixels):
2939         * platform/graphics/displaylists/DisplayListRecorder.cpp:
2940         (WebCore::DisplayList::Recorder::drawImage):
2941         (WebCore::DisplayList::Recorder::drawTiledImage):
2942         (WebCore::DisplayList::Recorder::drawNativeImage):
2943         (WebCore::DisplayList::Recorder::setCTM):
2944         (WebCore::DisplayList::Recorder::getCTM):
2945         (WebCore::DisplayList::Recorder::clipBounds):
2946         (WebCore::DisplayList::Recorder::roundToDevicePixels):
2947         * platform/graphics/displaylists/DisplayListRecorder.h:
2948
2949 2018-01-24  Christopher Reid  <chris.reid@sony.com>
2950
2951         Linker error in ShareableBitmapCairo.cpp  undefined reference to WebCore::Cairo::ShadowState::ShadowState
2952         https://bugs.webkit.org/show_bug.cgi?id=182060
2953
2954         Reviewed by Žan Doberšek.
2955
2956         No new tests, no change in behavior.
2957
2958         Added exports to WebCore::Cairo::ShadowState::ShadowState.
2959
2960         * platform/graphics/cairo/CairoOperations.h:
2961
2962 2018-01-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2963
2964         [Curl] Implement didSendData client callback.
2965         https://bugs.webkit.org/show_bug.cgi?id=182063
2966
2967         Reviewed by Alex Christensen.
2968
2969         No new tests (covered by existing tests).
2970
2971         * platform/network/curl/CurlDownload.h:
2972         * platform/network/curl/CurlRequest.cpp:
2973         (WebCore::CurlRequest::willSendData):
2974         * platform/network/curl/CurlRequestClient.h:
2975         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
2976         (WebCore::ResourceHandleCurlDelegate::curlDidSendData):
2977         * platform/network/curl/ResourceHandleCurlDelegate.h:
2978
2979 2018-01-24  Jiewen Tan  <jiewen_tan@apple.com>
2980
2981         [WebAuthN] Implement PublicKeyCredential’s [[DiscoverFromExternalSource]] with a dummy authenticator
2982         https://bugs.webkit.org/show_bug.cgi?id=182032
2983         <rdar://problem/36459922>
2984
2985         Reviewed by Brent Fulgham.
2986
2987         This patch implements PublicKeyCredential's [[DiscoverFromExternalSource]] from
2988         https://www.w3.org/TR/webauthn/#getAssertion as of 5 December 2017. In order to
2989         do testing, a dummy authenticator is implemented to exercise a failure and a
2990         pass path. A number of dependencies need to be resolved later in order to comply
2991         with the spec, which are marked by FIXME in the patch and tracked by proper
2992         bugs. Those dependencies will be addressed once the first prototype is finshed.
2993
2994         Tests: http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html
2995                http/wpt/credential-management/credentialscontainer-store-basics.https.html
2996                http/wpt/webauthn/public-key-credential-get-failure.https.html
2997                http/wpt/webauthn/public-key-credential-get-success.https.html
2998
2999         * Modules/credentialmanagement/CredentialsContainer.cpp:
3000         (WebCore::CredentialsContainer::get):
3001         (WebCore::CredentialsContainer::isCreate):
3002         Fixes some minor issues.
3003         * Modules/webauthn/Authenticator.cpp:
3004         (WebCore::Authenticator::getAssertion const):
3005         * Modules/webauthn/Authenticator.h:
3006         (WebCore::Authenticator::AssertionReturnBundle::AssertionReturnBundle):
3007         * Modules/webauthn/PublicKeyCredential.cpp:
3008         (WebCore::PublicKeyCredential::collectFromCredentialStore):
3009         Changed a parameter type.
3010         (WebCore::PublicKeyCredential::discoverFromExternalSource):
3011         (WebCore::PublicKeyCredential::create):
3012         Improved some comments.
3013         * Modules/webauthn/PublicKeyCredential.h:
3014         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
3015         (): Deleted.
3016         * bindings/js/JSAuthenticatorResponseCustom.cpp:
3017         (WebCore::toJSNewlyCreated):
3018
3019 2018-01-24  Dean Jackson  <dino@apple.com>
3020
3021         Move WebGL's colorspace code into IOSurface
3022         https://bugs.webkit.org/show_bug.cgi?id=182076
3023         <rdar://problem/36846863>
3024
3025         Reviewed by Simon Fraser, with assistance from Tim Horton.
3026
3027         Rather than have WebGLLayer talk directly to an IOSurfaceRef,
3028         use a helper function on WebCore::IOSurface.
3029
3030         No behaviour change.
3031
3032         * platform/graphics/cocoa/IOSurface.h:
3033         * platform/graphics/cocoa/IOSurface.mm:
3034         (WebCore::IOSurface::migrateColorSpaceToProperties): Add new helper.
3035         * platform/graphics/cocoa/WebGLLayer.mm:
3036         (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): The
3037         newly created IOSurfaces call the helper to set up their colorspace.
3038
3039 2018-01-24  Dean Jackson  <dino@apple.com>
3040
3041         Add a note about not implementing these functions without discussion.
3042         <rdar://problem/36666458>
3043
3044         * html/canvas/WebGL2RenderingContext.cpp:
3045         (WebCore::WebGL2RenderingContext::clientWaitSync):
3046         (WebCore::WebGL2RenderingContext::getSyncParameter):
3047
3048 2018-01-24  Youenn Fablet  <youenn@apple.com>
3049
3050         Opaque being-loaded responses should clone their body
3051         https://bugs.webkit.org/show_bug.cgi?id=182056
3052
3053         Reviewed by Brady Eidson.
3054
3055         Test: http/wpt/service-workers/clone-opaque-being-loaded-response.https.html
3056
3057         When cloning a being-loaded response, make sure we create a ReadableStream.
3058         Before the patch, the readableStream was not created in that case for opaque responses.
3059
3060         * Modules/fetch/FetchBodyOwner.cpp:
3061         (WebCore::FetchBodyOwner::readableStream):
3062         (WebCore::FetchBodyOwner::createReadableStream):
3063         * Modules/fetch/FetchBodyOwner.h:
3064         * Modules/fetch/FetchResponse.cpp:
3065         (WebCore::FetchResponse::clone):
3066
3067 2018-01-24  Chris Dumez  <cdumez@apple.com>
3068
3069         close() operation should not be exposed inside a ServiceWorkerGlobalScope
3070         https://bugs.webkit.org/show_bug.cgi?id=182057
3071
3072         Reviewed by Youenn Fablet.
3073
3074         Move close() from WorkerGlobalScope to DedicatedWorkerGlobalScope as per:
3075         - https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope
3076
3077         This change to the specification was made to avoid exposing this deprecated
3078         features to service workers (which are new).
3079
3080         No new tests, rebaselined existing test.
3081
3082         * workers/DedicatedWorkerGlobalScope.idl:
3083         * workers/WorkerGlobalScope.idl:
3084
3085 2018-01-24  David Hyatt  <hyatt@apple.com>
3086
3087         Implement line clamp for mail.
3088         https://bugs.webkit.org/show_bug.cgi?id=180818
3089
3090         Reviewed by Dean Jackson.
3091
3092         This patch implements a form of clamping that can clamp lines at both the top
3093         and the bottom, and the interior can be replaced with a DOM element (identified
3094         by id) that replaces the middle section.
3095
3096         The implementation derives from the multicolumn classes, but ultimately the
3097         clamp should derive from the fragmentset classes instead (with most of the current
3098         multicolumn code moving into base classes).
3099
3100         The virtualization of many of the multicolumn functions is something that would happen
3101         once we move pages/printing over to this pagination model anyway.
3102
3103         * Sources.txt:
3104         * WebCore.xcodeproj/project.pbxproj:
3105         Add the new clamp classes.
3106
3107         * css/CSSComputedStyleDeclaration.cpp:
3108         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3109         * css/CSSProperties.json:
3110         * css/StyleBuilderCustom.h:
3111         (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp):
3112         * css/parser/CSSParser.cpp:
3113         (WebCore::CSSParserContext::CSSParserContext):
3114         * css/parser/CSSParserMode.h:
3115         (WebCore::CSSParserContextHash::hash):
3116         * css/parser/CSSPropertyParser.cpp:
3117         (WebCore::consumeLinesClamp):
3118         (WebCore::CSSPropertyParser::parseSingleValue):
3119         Implement the new CSS property, webkit-lines-clamp. This is only exposed if a preference
3120         is set, so it is not exposed to the Web.
3121
3122         * page/Settings.yaml:
3123         Add a new setting to control allowing access to the new CSS property.
3124
3125         * rendering/RenderBlockFlow.cpp:
3126         (WebCore::RenderBlockFlow::willCreateColumns const):
3127         Make sure columns are created when lines clamp is set.
3128
3129         (WebCore::getHeightForLineCount):
3130         (WebCore::RenderBlockFlow::logicalHeightForLineCount):
3131         (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount):
3132         (WebCore::RenderBlockFlow::layoutExcludedChildren):
3133         (WebCore::RenderBlockFlow::heightForLineCount): Deleted.
3134         * rendering/RenderBlockFlow.h:
3135         Re-use the same clamping logic as the old line clamp code, but modernize it to work
3136         with writing modes and to be able to go backwards from the end of the block.
3137
3138         * rendering/RenderDeprecatedFlexibleBox.cpp:
3139         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
3140         The line count method got renamed to have the word "logical" in it, since it now
3141         works with vertical writing.
3142
3143         * rendering/RenderFragmentContainer.cpp:
3144         (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const):
3145         * rendering/RenderFragmentContainer.h:
3146         Since line clamp sets have variable page heights, this new method takes the offset
3147         as an argument so that it can return the appropriate page for the given offset.
3148         This method will eventually be used by printing/page sets as well, since pages
3149         can have variable heights.
3150
3151         * rendering/RenderFragmentedFlow.cpp:
3152         (WebCore::RenderFragmentedFlow::validateFragments):
3153         (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
3154         (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
3155         * rendering/RenderFragmentedFlow.h:
3156         Support for variable page heights in a fragment set.
3157
3158         * rendering/RenderLinesClampFlow.cpp: Added.
3159         (WebCore::RenderLinesClampFlow::RenderLinesClampFlow):
3160         (WebCore::RenderLinesClampFlow::renderName const):
3161         (WebCore::RenderLinesClampFlow::layout):
3162         (WebCore::RenderLinesClampFlow::createMultiColumnSet):
3163         (WebCore::RenderLinesClampFlow::isChildAllowedInFragmentedFlow const):
3164         (WebCore::RenderLinesClampFlow::layoutFlowExcludedObjects):
3165         * rendering/RenderLinesClampFlow.h: Added.
3166         * rendering/RenderLinesClampSet.cpp: Added.
3167         (WebCore::RenderLinesClampSet::RenderLinesClampSet):
3168         (WebCore::RenderLinesClampSet::recalculateColumnHeight):
3169         (WebCore::RenderLinesClampSet::computeLogicalHeight const):
3170         (WebCore::RenderLinesClampSet::columnCount const):
3171         (WebCore::RenderLinesClampSet::columnRectAt const):
3172         (WebCore::RenderLinesClampSet::columnIndexAtOffset const):
3173         (WebCore::RenderLinesClampSet::pageLogicalTopForOffset const):
3174         (WebCore::RenderLinesClampSet::pageLogicalHeightForOffset const):
3175         (WebCore::RenderLinesClampSet::fragmentedFlowPortionRectAt const):
3176         (WebCore::RenderLinesClampSet::fragmentedFlowPortionOverflowRect):
3177         (WebCore::RenderLinesClampSet::customBlockProgressionAdjustmentForColumn const):
3178         (WebCore::RenderLinesClampSet::renderName const):
3179         * rendering/RenderLinesClampSet.h: Added.
3180         The new classes. They subclass all the methods necessary to do multi-pass layout,
3181         and to determine the page heights of each section.
3182
3183         * rendering/RenderMultiColumnFlow.cpp:
3184         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
3185         (WebCore::isValidColumnSpanner):
3186         (WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
3187         (WebCore::RenderMultiColumnFlow::createMultiColumnSet):
3188         * rendering/RenderMultiColumnFlow.h:
3189         * rendering/RenderMultiColumnSet.cpp:
3190         (WebCore::RenderMultiColumnSet::collectLayerFragments):
3191         (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
3192         * rendering/RenderMultiColumnSet.h:
3193         (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const):
3194         (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const):
3195         Virtualized methods so that lines clamp can subclass and change behavior.
3196
3197         * rendering/RenderObject.h:
3198         (WebCore::RenderObject::isRenderLinesClampFlow const):
3199         (WebCore::RenderObject::isRenderLinesClampSet const):
3200         Add new functions for type checking.
3201
3202         * rendering/RenderRubyText.cpp:
3203         Include adjustment.
3204
3205         * rendering/style/LineClampValue.h:
3206         (WebCore::LinesClampValue::LinesClampValue):
3207         (WebCore::LinesClampValue::isNone const):
3208         (WebCore::LinesClampValue::operator== const):
3209         (WebCore::LinesClampValue::operator!= const):
3210         (WebCore::LinesClampValue::start const):
3211         (WebCore::LinesClampValue::end const):
3212         (WebCore::LinesClampValue::center const):
3213         * rendering/style/RenderStyle.h:
3214         (WebCore::RenderStyle::linesClamp const):
3215         (WebCore::RenderStyle::hasLinesClamp const):
3216         (WebCore::RenderStyle::setLinesClamp):
3217         (WebCore::RenderStyle::initialLinesClamp):
3218         (WebCore::RenderStyle::hasInlineColumnAxis const):
3219         * rendering/style/StyleRareNonInheritedData.cpp:
3220         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3221         (WebCore::StyleRareNonInheritedData::operator== const):
3222         * rendering/style/StyleRareNonInheritedData.h:
3223         The front end style implementation of the new property.
3224
3225         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3226         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
3227         Make sure to build the correct renderer when lines clamp is set.
3228
3229 2018-01-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3230
3231         [Curl] Allocate CurlSSLVerifier only when it is required.
3232         https://bugs.webkit.org/show_bug.cgi?id=182061
3233
3234         CurlSSLVerifier was a member function of CurlRequest. This patch do
3235         lazy initialization of it only when actually it is required.
3236         Also configuration method is not required by moving those stuff to
3237         constructor of SSLVerifier which makes much safer because there's
3238         no change to change its behavior from outside.
3239
3240         Reviewed by Alex Christensen.
3241
3242         * platform/network/curl/CurlRequest.cpp:
3243         (WebCore::CurlRequest::willSetupSslCtx):
3244         (WebCore::CurlRequest::didCompleteTransfer):
3245         (WebCore::CurlRequest::finalizeTransfer):
3246         * platform/network/curl/CurlRequest.h:
3247         * platform/network/curl/CurlSSLVerifier.cpp:
3248         (WebCore::CurlSSLVerifier::CurlSSLVerifier):
3249         (WebCore::CurlSSLVerifier::setSslCtx): Deleted.
3250         * platform/network/curl/CurlSSLVerifier.h:
3251         (WebCore::CurlSSLVerifier::setCurlHandle): Deleted.
3252         (WebCore::CurlSSLVerifier::setHostName): Deleted.
3253
3254 2018-01-24  Antti Koivisto  <antti@apple.com>
3255
3256         Assertion failure in RenderMultiColumnSet::requiresBalancing() on fast/multicol/spanner-crash-when-adding-summary.html
3257         https://bugs.webkit.org/show_bug.cgi?id=179308
3258         <rdar://problem/34592771>
3259
3260         Reviewed by Zalan Bujtas.
3261
3262         The issue here is that we fail to tear down render tree for a summary element because adding another summary element
3263         takes it out of the composed tree. This leaves behind renderers that break some multicolumn assumptions.
3264
3265         * rendering/updating/RenderTreeUpdater.cpp:
3266         (WebCore::RenderTreeUpdater::tearDownRenderers):
3267         (WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
3268
3269         When tearing down renderers go through the real children of the shadow hosts at the end and see if we left any renderers behind.
3270         If so, tear them down too.
3271
3272         * rendering/updating/RenderTreeUpdater.h:
3273
3274 2018-01-24  Daniel Bates  <dabates@apple.com>
3275
3276         [CSP] Check policy for targeted windows when navigating to a JavaScript URL
3277         https://bugs.webkit.org/show_bug.cgi?id=182018
3278         <rdar://problem/36795781>
3279
3280         Reviewed by Brent Fulgham.
3281
3282         Move the CSP check to be earlier in the function.
3283
3284         Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked.html
3285
3286         * loader/FrameLoader.cpp:
3287         (WebCore::createWindow):
3288
3289 2018-01-24  Chris Dumez  <cdumez@apple.com>
3290
3291         Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
3292         https://bugs.webkit.org/show_bug.cgi?id=182021
3293         <rdar://problem/21629943>
3294
3295         Reviewed by Ryosuke Niwa.
3296
3297         Add layout testing infrastructure for the new flag.
3298
3299         Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
3300
3301         * page/ChromeClient.h:
3302         * testing/Internals.cpp:
3303         (WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
3304         * testing/Internals.h:
3305         * testing/Internals.idl:
3306
3307 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3308
3309         Remove pre-Sierra-OS-specific code in WebCore
3310         https://bugs.webkit.org/show_bug.cgi?id=182026
3311
3312         Reviewed by Tim Horton.
3313
3314         * page/cocoa/UserAgent.mm:
3315         (WebCore::systemMarketingVersionForUserAgentString):
3316         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
3317         (WebCore::ScrollingMomentumCalculatorMac::retargetedScrollOffsetDidChange):
3318         * platform/cocoa/PasteboardCocoa.mm:
3319         (WebCore::bitmapPNGFileType):
3320         * platform/graphics/FontPlatformData.cpp:
3321         * platform/graphics/FontPlatformData.h:
3322         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
3323         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
3324         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3325         (layerContentsFormat):
3326         (PlatformCALayerCocoa::updateContentsFormat):
3327         (PlatformCALayerCocoa::backingStoreBytesPerPixel const):
3328         * platform/graphics/cg/GraphicsContextCG.cpp:
3329         (WebCore::linearRGBColorSpaceRef):
3330         (WebCore::extendedSRGBColorSpaceRef):
3331         * platform/graphics/cg/PDFDocumentImage.cpp:
3332         (WebCore::PDFDocumentImage::drawPDFPage):
3333         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3334         (WebCore::getCSSAttribute):
3335         (WebCore::capabilitiesForFontDescriptor):
3336         (WebCore::findClosestFont):
3337         (WebCore::platformFontLookupWithFamily):
3338         (WebCore::lookupFallbackFont):
3339         (WebCore::fontWeightFromCoreText): Deleted.
3340         * platform/graphics/cocoa/FontCocoa.mm:
3341         (WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
3342         (WebCore::Font::platformWidthForGlyph const):
3343         (WebCore::advanceForColorBitmapFont): Deleted.
3344         (WebCore::canUseFastGlyphAdvanceGetter): Deleted.
3345         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3346         (WebCore::FontPlatformData::FontPlatformData):
3347         (WebCore::FontPlatformData::hash const):
3348         (WebCore::FontPlatformData::platformIsEqual const):
3349         (WebCore::FontPlatformData::ctFont const):
3350         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
3351         (WebCore::linearRGBColorSpaceRef): Deleted.
3352         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
3353         (WebCore::WebCoreDecompressionSession::setTimebase):
3354         * platform/graphics/mac/FontCustomPlatformData.cpp:
3355         (WebCore::FontCustomPlatformData::supportsFormat):
3356         * platform/mac/PlatformScreenMac.mm:
3357         (WebCore::screenSupportsExtendedColor):
3358         * platform/mac/ScrollbarThemeMac.mm:
3359         (WebCore::ScrollbarThemeMac::didCreateScrollerImp):
3360         (WebCore::ScrollbarThemeMac::isLayoutDirectionRTL):
3361         * platform/mac/ThemeMac.mm:
3362         (WebCore::ThemeMac::userPrefersReducedMotion const):
3363         * platform/network/cocoa/ResourceRequestCocoa.mm:
3364         (WebCore::ResourceRequest::doUpdatePlatformRequest):
3365         * platform/text/mac/TextBoundaries.mm:
3366         (WebCore::findNextWordFromIndex):
3367         * rendering/RenderLayerModelObject.cpp:
3368         (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
3369         * testing/Internals.mm:
3370         (WebCore::Internals::userPrefersReducedMotion const):
3371
3372 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3373
3374         Remove WebProcess authentication code
3375         https://bugs.webkit.org/show_bug.cgi?id=182020
3376
3377         Reviewed by Brady Eidson.
3378
3379         We were keeping it around for pre-NetworkSession media loading, which is gone now.
3380
3381         * html/HTMLMediaElement.cpp:
3382         (WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
3383         * html/HTMLMediaElement.h:
3384         * loader/ResourceLoader.cpp:
3385         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
3386         * loader/ResourceLoader.h:
3387         * platform/graphics/MediaPlayer.cpp:
3388         (WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): Deleted.
3389         * platform/graphics/MediaPlayer.h:
3390         (WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
3391         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3392         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3393         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
3394         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Deleted.
3395
3396 2018-01-24  Joanmarie Diggs  <jdiggs@igalia.com>
3397
3398         AX: SVG AAM mapping trumps ARIA role attribute in the case of SVG root
3399         https://bugs.webkit.org/show_bug.cgi?id=181994
3400
3401         Reviewed by Chris Fleizach.
3402
3403         Only return AccessibilityRole::Group if we have no author-provided
3404         ARIA role attribute value.
3405
3406         Test: accessibility/svg-element-with-aria-role.html
3407
3408         * accessibility/AccessibilitySVGRoot.cpp:
3409         (WebCore::AccessibilitySVGRoot::roleValue const):
3410         * accessibility/AccessibilitySVGRoot.h:
3411
3412 2018-01-24  Alex Christensen  <achristensen@webkit.org>
3413
3414         Remove unused QTKit preference
3415         https://bugs.webkit.org/show_bug.cgi?id=181968
3416
3417         Reviewed by Alexey Proskuryakov.
3418
3419         They weren't used and didn't do anything.
3420
3421         * page/DeprecatedGlobalSettings.cpp:
3422         (WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
3423         * page/DeprecatedGlobalSettings.h:
3424         (WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
3425
3426 2018-01-24  Antoine Quint  <graouts@apple.com>
3427
3428         [Web Animations] Compute the progress and currentIteration properties on getComputedTiming()
3429         https://bugs.webkit.org/show_bug.cgi?id=182039
3430         <rdar://problem/36813568>
3431
3432         Reviewed by Dean Jackson.
3433
3434         Compute the "progress" and "currentIteration" properties on the dictionary returned by getComputedTiming().
3435         To support this we implement several procedures from the specification implemented separately with links