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