15cacc5a6a84f400a242859382856051dccfeaeb
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-04-10  Chris Dumez  <cdumez@apple.com>
2
3         Unreviewed build fix.
4
5         Those enum value names were too generic and would cause conflicts.
6
7         * Modules/webvr/VRDisplayCapabilities.h:
8         (WebCore::VRDisplayCapabilities::hasPosition const):
9         (WebCore::VRDisplayCapabilities::hasOrientation const):
10         (WebCore::VRDisplayCapabilities::hasExternalDisplay const):
11         (WebCore::VRDisplayCapabilities::canPresent const):
12         * platform/vr/VRPlatformDisplay.h:
13         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
14         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
15
16 2018-04-10  Chris Dumez  <cdumez@apple.com>
17
18         Avoid constructing a service worker RegistrationStore for private sessions
19         https://bugs.webkit.org/show_bug.cgi?id=184463
20         <rdar://problem/36613948>
21
22         Reviewed by Youenn Fablet.
23
24         Avoid constructing a service worker RegistrationStore for private sessions since there
25         is no need for persistence and the registrationDatabaseDirectory is the empty string in
26         such cases.
27
28         * workers/service/server/SWServer.cpp:
29         (WebCore::SWServer::removeRegistration):
30         (WebCore::SWServer::clearAll):
31         (WebCore::SWServer::clear):
32         (WebCore::SWServer::SWServer):
33         (WebCore::SWServer::didFinishActivation):
34         * workers/service/server/SWServer.h:
35
36 2018-04-10  Chris Dumez  <cdumez@apple.com>
37
38         Unreviewed build fix.
39
40         * page/LayoutContext.cpp:
41         (WebCore::LayoutContext::~LayoutContext):
42         * page/LayoutContext.h:
43
44 2018-04-10  Jeremy Jones  <jeremyj@apple.com>
45
46         MediaSessionManageriOS should defer creation of MPVolumeView until it needs to monitor AirPlay routes
47         https://bugs.webkit.org/show_bug.cgi?id=184373
48         <rdar://problem/35177606>
49
50         Reviewed by Eric Carlson.
51
52         No change of behavior.
53
54         This delays the creation of MPVolumeView until airplay routes are monitored.
55         MPVolumeView is now also released when monitoring ends. 
56         This makes sure the MP* objects are only accessed from a UI safe thread. WebCore's "MainThread" may be different that the UI thread.
57         Since this state change is necessarily asynchronous, starting and stopping must prevent races to keep state coherent.
58
59         * platform/audio/ios/MediaSessionManagerIOS.mm:
60         (-[WebMediaSessionHelper initWithCallback:]):
61         (-[WebMediaSessionHelper dealloc]):
62         (-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
63         (-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
64         (-[WebMediaSessionHelper allocateVolumeView]): Deleted.
65         (-[WebMediaSessionHelper setVolumeView:]): Deleted.
66
67 2018-04-10  Sihui Liu  <sihui_liu@apple.com>
68
69         Loading of multipart response was cancelled because of content policy set in WebFrameLoaderClient::dispatchDecidePolicyForResponse
70         https://bugs.webkit.org/show_bug.cgi?id=184268
71         <rdar://problem/39144446>
72
73         Reviewed by Chris Dumez.
74
75         The assertion is no longer true after the change, because multiple resources could have same
76         url. Used if condition here to make sure we only delete specified resource.
77
78         No new tests. Updated an existing test to test the stop loading case by not using injected 
79         bundle policy: http/tests/multipart/multipart-html.php.
80
81         * loader/cache/CachedResourceLoader.cpp:
82         (WebCore::CachedResourceLoader::removeCachedResource):
83
84 2018-04-10  Zalan Bujtas  <zalan@apple.com>
85
86         Do not layout images when we only need the overflow information.
87         https://bugs.webkit.org/show_bug.cgi?id=175331
88
89         Reviewed by Simon Fraser.
90
91         This improves MotionMark's Simple Leaves by ~10%. 
92
93         Covered by existing tests.
94
95         * rendering/RenderImage.cpp:
96         (WebCore::RenderImage::layout):
97
98 2018-04-10  Zan Dobersek  <zdobersek@igalia.com>
99
100         [TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform
101         https://bugs.webkit.org/show_bug.cgi?id=183868
102
103         Reviewed by Carlos Garcia Campos.
104
105         Drop the GraphicsLayerTransform member variable from TextureMapperLayer
106         and instead compute all the required transform information in the
107         computeTransformsRecursive() method. These computations are not too
108         expensive, and in turn we can drop an object from this class' state that
109         was only duplicating a bunch of state variables.
110
111         No new tests -- no change in functionality.
112
113         * platform/graphics/texmap/TextureMapperLayer.cpp:
114         (WebCore::TextureMapperLayer::computeTransformsRecursive):
115         (WebCore::TextureMapperLayer::paintSelf):
116         (WebCore::TextureMapperLayer::paintSelfAndChildren):
117         (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
118         (WebCore::TextureMapperLayer::replicaTransform):
119         (WebCore::TextureMapperLayer::computeOverlapRegions):
120         (WebCore::TextureMapperLayer::setPosition):
121         (WebCore::TextureMapperLayer::setSize):
122         (WebCore::TextureMapperLayer::setAnchorPoint):
123         (WebCore::TextureMapperLayer::setPreserves3D):
124         (WebCore::TextureMapperLayer::setTransform):
125         (WebCore::TextureMapperLayer::setChildrenTransform):
126         (WebCore::TextureMapperLayer::syncAnimations):
127         (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded):
128         * platform/graphics/texmap/TextureMapperLayer.h:
129
130 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
131
132         Add ProcessPrivilege assertions to places that access NSApp
133         https://bugs.webkit.org/show_bug.cgi?id=184322
134         <rdar://problem/39194560>
135
136         Reviewed by Per Arne Vollan.
137
138         Add ProcessPrivilege assertions to places where we interact with NSApp so
139         that we can prevent accidentally using them in the WebContent process.
140
141         * page/mac/EventHandlerMac.mm:
142         (WebCore::lastEventIsMouseUp):
143         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
144         * platform/mac/EventLoopMac.mm:
145         (WebCore::EventLoop::cycle):
146         * platform/mac/PasteboardMac.mm:
147         (WebCore::Pasteboard::setDragImage):
148
149 2018-04-09  John Wilander  <wilander@apple.com>
150
151         Refactor Ignore HSTS code
152         https://bugs.webkit.org/show_bug.cgi?id=184433
153         <rdar://problem/39298238>
154
155         Reviewed by Darin Adler.
156
157         This patch refactors our ignore HSTS code. The convenience functions are moved
158         out of CFNetwork SPI in PAL, and into where they are used. It also switches
159         from performSelector: calls to straight function calls, after checking that
160         there is a responder.
161
162         * platform/network/mac/WebCoreURLResponse.mm:
163         (WebCore::schemeWasUpgradedDueToDynamicHSTS):
164             Add convenience function here since it was moved out of
165             CFNetworkSPI.h.
166
167 2018-04-09  Brady Eidson  <beidson@apple.com>
168
169         Expand WebCore policy concept of "shouldContinue" to allow for more than true/false
170         https://bugs.webkit.org/show_bug.cgi?id=184424
171
172         Reviewed by Alex Christensen.
173
174         No new tests (No behavior change, refactor only)
175
176         Specifically this expands the "shouldContinue" bool to be an enum class with:
177         -Yes
178         -No
179         -ForSuspension
180
181         * loader/DocumentLoader.cpp:
182         (WebCore::DocumentLoader::willSendRequest):
183         * loader/FrameLoader.cpp:
184         (WebCore::FrameLoader::loadURL):
185         (WebCore::FrameLoader::load):
186         (WebCore::FrameLoader::loadWithDocumentLoader):
187         (WebCore::FrameLoader::loadPostRequest):
188         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
189         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
190         * loader/FrameLoader.h:
191         * loader/PolicyChecker.cpp:
192         (WebCore::PolicyChecker::checkNavigationPolicy):
193         (WebCore::PolicyChecker::checkNewWindowPolicy):
194         * loader/PolicyChecker.h:
195
196 2018-04-09  Sihui Liu  <sihui_liu@apple.com>
197
198         REGRESSION(r229929): localStorage is broken for WebInspector
199         https://bugs.webkit.org/show_bug.cgi?id=184382
200         <rdar://problem/39257355>
201
202         Reviewed by Chris Dumez.
203
204         Removed an if condition that caused false positive cases of database error. As per 
205         https://www.sqlite.org/c3ref/errcode.html, return value of sqlite3_errcode() is undefined
206         on successful API call, so we should not use the code to check if there is an error. We
207         should only use it when there is an error.
208         After moving this condition, LocalStorage might return empty string instead of NULL on
209         sqlite3_column_blob() error.
210
211         Modified a test to cover this case: 
212         TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm.
213
214         * platform/sql/SQLiteStatement.cpp:
215         (WebCore::SQLiteStatement::getColumnBlobAsString):
216
217 2018-04-09  Brent Fulgham  <bfulgham@apple.com>
218
219         WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll is directly accessing NSScreen
220         https://bugs.webkit.org/show_bug.cgi?id=184344
221         <rdar://problem/39224969>
222
223         Reviewed by Per Arne Vollan.
224
225         The implementation of targetPositionInWindowForSelectionAutoscroll uses the display ID to get the
226         screen boundaries of the current display. This causes a bunch of interaction with NSScreen that
227         we do not want to allow in the WebContent process.
228
229         Instead, we should just use the cached screen information the WebContent process already possesses.
230
231         This patch makes the following changes:
232         1. We now retrieve the screen rect of the page's display from the cache, rather than interacting with
233            the WindowServer directly.
234         2. Add a new 'toUserSpaceForPrimaryScreen' so we don't have to deal with a nil NSWindow when computing
235            the user space version of the coordinates. A nil Window just means we want to get coordinates in
236            terms of the primary display.
237         3. Keep track of the primary display so we can refer to it later.
238         4. Modify the IPC messages to include the primary display's ID so we can easily access it later.
239         5. Modify the PlatformScreen methods to actually use the primary display when appropriate, rather
240            than whichever screen happened to hash to the lowest value.
241
242         * page/mac/EventHandlerMac.mm:
243         (WebCore::EventHandler::targetPositionInWindowForSelectionAutoscroll const): Use new methods that
244         don't require WindowServer access.
245         * platform/PlatformScreen.h:
246         * platform/mac/PlatformScreenMac.mm:
247         (WebCore::displayID): Assert if we hit this code in the WebContent process.
248         (WebCore::firstScreen): Ditto.
249         (WebCore::window): Ditto.
250         (WebCore::screen): Ditto.
251         (WebCore::primaryScreenID): Added.
252         (WebCore::getScreenProperties): Modify to return a pair consisting of the primary display ID and
253         the HashSet of screen settings.
254         (WebCore::setScreenProperties): Update to also track the primary display ID.
255         (WebCore::screenProperties): Update to use the primary display ID.
256         (WebCore::screenHasInvertedColors): Ditto.
257         (WebCore::toUserSpaceForPrimaryScreen): Added.
258
259 2018-04-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
260
261         Make InlineTextBox::createTextRun() take a const lvalue reference String
262         https://bugs.webkit.org/show_bug.cgi?id=184182
263
264         Reviewed by Zalan Bujtas.
265
266         InlineTextBox::createTextRun() takes a non-const lvalue reference String.
267         It is tempting to change the signature of this method to take a const lvalue 
268         reference. But this was done intentionally. TextRun is effectively a StringView:
269         it does not own the passed string. Having the argument a non-const lvalue
270         reference makes the compiler prevent calls like createTextRun("abc").
271
272         To have a better way to express the lifetime of TextRun, this patch does
273         the following:
274
275         -- It makes TextRun::m_text of type String instead of StringView.
276         -- It adds a new constructor which takes const String&. This constructor
277            will addRef the underlying StringImpl when assigning it to m_text.
278         -- It keeps the constructor which takes a StringView. The caller of this
279            constructor still has to make sure the underlying String outlives the
280            TextRun. To avoid copying the underlying buffer of the StringView, we
281            will not use  StringView::toString(). Instead we will use
282            StringView::toStringWithoutCopying() which makes the returned String 
283            accesses the same buffer the StringView uses. In this case, the returned
284            String is effectively a StringView.
285
286         * page/DebugPageOverlays.cpp:
287         (WebCore::drawRightAlignedText):
288         * platform/graphics/TextRun.cpp:
289         * platform/graphics/TextRun.h:
290         (WebCore::TextRun::TextRun):
291         (WebCore::TextRun::subRun const):
292         (WebCore::TextRun::length const):
293         (WebCore::TextRun::setText):
294         (WebCore::TextRun::string const): Deleted.
295         * rendering/InlineTextBox.cpp:
296         (WebCore::InlineTextBox::localSelectionRect const):
297         (WebCore::InlineTextBox::paint):
298         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
299         (WebCore::InlineTextBox::paintMarkedTextBackground):
300         (WebCore::InlineTextBox::paintMarkedTextForeground):
301         (WebCore::InlineTextBox::paintMarkedTextDecoration):
302         (WebCore::InlineTextBox::offsetForPosition const):
303         (WebCore::InlineTextBox::positionForOffset const):
304         (WebCore::InlineTextBox::createTextRun const):
305         There is no need for this function to take a String argument anymore. The
306         reason for passing the String was to guarantee its lifetime by keeping
307         a copy of it in the caller side. Now there is no need for that. The TextRun
308         itself will keep this copy.
309
310         * rendering/InlineTextBox.h:
311         * rendering/RenderText.cpp:
312         (WebCore::RenderText::computeCanUseSimplifiedTextMeasuring const):
313         RenderText::text() returns StringImpl. The compiler wants us to be more
314         explicit about which constructor of TextRun to call.
315
316         * rendering/SimpleLineLayout.cpp:
317         (WebCore::SimpleLineLayout::canUseForFontAndText):
318         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
319         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
320         RenderStyle::hyphenString() returns an AtomicString.
321
322 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
323
324         Unreviewed, rolling out r230390.
325
326         Broke accelerated compositing
327
328         Reverted changeset:
329
330         "[GTK] WaylandCompositorDisplay leaks its wl_display"
331         https://bugs.webkit.org/show_bug.cgi?id=184406
332         https://trac.webkit.org/changeset/230390
333
334 2018-04-03  Sergio Villar Senin  <svillar@igalia.com>
335
336         [OpenVR][WebVR] Retrieve FrameData in WebVR's rAF
337         https://bugs.webkit.org/show_bug.cgi?id=184265
338
339         Reviewed by Žan Doberšek.
340
341         VRFrameData contains all the required information to properly render a VR scene like view
342         and projection matrices, pose data (position & orientation) and linear & angular velocity
343         among others. The getFrameData() call must be issued inside a WebVR's own
344         requestAnimationFrame.
345
346         * Modules/webvr/VRDisplay.cpp:
347         (WebCore::VRDisplay::getFrameData const):
348         (WebCore::VRDisplay::getPose const):
349         (WebCore::VRDisplay::requestAnimationFrame):
350         (WebCore::VRDisplay::cancelAnimationFrame):
351         * Modules/webvr/VRDisplay.h:
352         * Modules/webvr/VREyeParameters.h:
353         (WebCore::VREyeParameters::rawOffset const): Required to compute view matrices.
354         * Modules/webvr/VRFrameData.cpp:
355         (WebCore::matrixToArray):
356         (WebCore::VRFrameData::leftProjectionMatrix const):
357         (WebCore::VRFrameData::leftViewMatrix const):
358         (WebCore::VRFrameData::rightProjectionMatrix const):
359         (WebCore::VRFrameData::rightViewMatrix const):
360         (WebCore::projectionMatrixFromFieldOfView):
361         (WebCore::rotationMatrixFromQuaternion):
362         (WebCore::applyHeadToEyeTransform):
363         (WebCore::VRFrameData::update):
364         (WebCore::VRFrameData::timestamp const): Deleted.
365         * Modules/webvr/VRFrameData.h:
366         (WebCore::VRFrameData::timestamp const):
367         * Modules/webvr/VRPose.cpp:
368         (WebCore::optionalFloat3ToJSCArray):
369         (WebCore::VRPose::position const):
370         (WebCore::VRPose::linearVelocity const):
371         (WebCore::VRPose::linearAcceleration const):
372         (WebCore::VRPose::orientation const):
373         (WebCore::VRPose::angularVelocity const):
374         (WebCore::VRPose::angularAcceleration const):
375         * Modules/webvr/VRPose.h:
376         (WebCore::VRPose::create):
377         (WebCore::VRPose::update):
378         (WebCore::VRPose::VRPose):
379         * platform/vr/VRPlatformDisplay.h:
380         (WebCore::VRPlatformTrackingInfo::Quaternion::Quaternion):
381         (WebCore::VRPlatformTrackingInfo::Quaternion::conjugate):
382         (WebCore::VRPlatformTrackingInfo::Quaternion::operator*):
383         (WebCore::VRPlatformTrackingInfo::Float3::Float3): Just a group of 3 floats used to store
384         both velocity and acceleration in a format which is very convenient to later generate JSC
385         arrays.
386         (WebCore::VRPlatformTrackingInfo::clear):
387         * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
388         (WebCore::VRPlatformDisplayOpenVR::VRPlatformDisplayOpenVR):
389         (WebCore::rotationMatrixToQuaternion):
390         (WebCore::VRPlatformDisplayOpenVR::getTrackingInfo):
391         * platform/vr/openvr/VRPlatformDisplayOpenVR.h:
392
393 2018-04-09  Michael Catanzaro  <mcatanzaro@igalia.com>
394
395         [GTK] WaylandCompositorDisplay leaks its wl_display
396         https://bugs.webkit.org/show_bug.cgi?id=184406
397
398         Reviewed by Carlos Garcia Campos.
399
400         Remove the protected default constructor, for good measure.
401
402         * platform/graphics/wayland/PlatformDisplayWayland.h:
403
404 2018-04-08  Fujii Hironori  <Hironori.Fujii@sony.com>
405
406         [CMake] WebKit should link to WebCore as a PRIVATE library if WebCore is a static library
407         https://bugs.webkit.org/show_bug.cgi?id=184127
408
409         Reviewed by Konstantin Tokarev.
410
411         No new tests (No behaviour changes).
412
413         * CMakeLists.txt: Added a interface library WebCoreHeaderInterface.
414
415 2018-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
416
417         Use alignas instead of compiler-specific attributes
418         https://bugs.webkit.org/show_bug.cgi?id=183508
419
420         Reviewed by Mark Lam.
421
422         Use alignas instead of aligned.
423
424         * platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
425         * platform/graphics/cpu/arm/filters/FELightingNEON.h:
426         (WebCore::FELighting::platformApplyNeon):
427
428 2018-04-08  Michael Catanzaro  <mcatanzaro@igalia.com>
429
430         [WPE][GTK] Remove applicationDirectoryPath() and sharedResourcePath()
431         https://bugs.webkit.org/show_bug.cgi?id=184381
432
433         Reviewed by Carlos Garcia Campos.
434
435         These are unused.
436
437         * platform/FileSystem.h:
438         * platform/glib/FileSystemGlib.cpp:
439         (WebCore::FileSystem::applicationDirectoryPath): Deleted.
440         (WebCore::FileSystem::sharedResourcesPath): Deleted.
441
442 2018-04-07  Daniel Bates  <dabates@apple.com>
443
444         Have WorkerScriptLoader::loadAsynchronously() take a FetchOptions
445         https://bugs.webkit.org/show_bug.cgi?id=184385
446
447         Reviewed by Youenn Fablet.
448
449         Currently we pass various FetchOptions to WorkerScriptLoader::loadAsynchronously()
450         so that it can build up a ThreadableLoaderOptions structure to pass to the loader.
451         Each time we want to set another FetchOptions option we need to add a new parameter.
452         Instead we should have WorkerScriptLoader::loadAsynchronously() take a FetchOptions.
453         This will make it straightforward for a caller to set new loader options as needed.
454         In particular, this will make it straightforward to support setting the request's
455         destination flag (i.e. FetchOptions::destination) to support blocking scripts with
456         a non-JavaScript MIME type in a subsequent commit.
457
458         No functionality changed. So, no new tests.
459
460         * loader/ResourceLoaderOptions.h:
461         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Modified to take a FetchOptions
462         by value so as to support both move and copy semantics.
463         * loader/ThreadableLoader.cpp:
464         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):  Added helper constructor
465         that takes a FetchOptions.
466         * loader/ThreadableLoader.h:
467         * workers/Worker.cpp:
468         (WebCore::Worker::create): Instantiate and pass a FetchOptions to the loader for the mode,
469         cache policy, and redirect policy.
470         * workers/WorkerScriptLoader.cpp:
471         (WebCore::WorkerScriptLoader::loadAsynchronously): Modified to take a FetchOptions and
472         instantiate a ThreadableLoaderOptions from it.
473         * workers/WorkerScriptLoader.h:
474         * workers/WorkerScriptLoaderClient.h:
475         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const): Deleted. This function
476         is no longer needed because the Service Worker client now passes the service worker mode
477         directly to the loader.
478         * workers/service/ServiceWorkerJob.cpp:
479         (WebCore::ServiceWorkerJob::fetchScriptWithContext): Instantiate and pass a FetchOptions
480         to the loader.
481         * workers/service/ServiceWorkerJob.h:
482
483 2018-04-07  Timothy Hatcher  <timothy@apple.com>
484
485         Use the system's link color when system appearance is desired for a WebView.
486
487         https://bugs.webkit.org/show_bug.cgi?id=184353
488         rdar://problem/9420053
489
490         Reviewed by Wenson Hsieh.
491
492         Have Document consult RenderTheme via StyleColor for the various link colors.
493         This allows the system to have different colors than the standard hardcoded ones.
494         This adds StyleColor::Options, to avoid multiple booleans being passed around,
495         since the "for visited link" state is now needed in RenderTheme.
496
497         * WebCore.xcodeproj/project.pbxproj: Made StyleColor.h private, since RenderTheme.h includes it.
498         * css/StyleColor.cpp:
499         (WebCore::StyleColor::colorFromKeyword): Use options instead of a bool.
500         (WebCore::StyleColor::isSystemColor): Consider CSSValueWebkitLink the start of system colors.
501         * css/StyleColor.h:
502         * css/StyleResolver.cpp:
503         (WebCore::StyleResolver::colorFromPrimitiveValue const): Use StyleColor::Options.
504         * css/parser/CSSParser.cpp:
505         (WebCore::CSSParser::parseSystemColor): Use StyleColor::Options.
506         * dom/Document.cpp:
507         (WebCore::Document::resetLinkColor): Ask StyleColor for the link color instead of hardcoding it.
508         (WebCore::Document::resetVisitedLinkColor): Ditto.
509         (WebCore::Document::resetActiveLinkColor): Ditto.
510         (WebCore::Document::styleColorOptions const): Added. Helper to get the options used.
511         * dom/Document.h:
512         * html/canvas/CanvasRenderingContext2D.cpp:
513         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Use StyleColor::Options.
514         * rendering/RenderTheme.cpp:
515         (WebCore::RenderTheme::systemColor const): Add default values here, moved from Document.
516         (WebCore::RenderTheme::focusRingColor): Use StyleColor::Options.
517         * rendering/RenderTheme.h:
518         (WebCore::RenderTheme::platformFocusRingColor const): Use StyleColor::Options.
519         * rendering/RenderThemeGtk.cpp:
520         (WebCore::RenderThemeGtk::systemColor const): Use StyleColor::Options.
521         * rendering/RenderThemeGtk.h:
522         * rendering/RenderThemeIOS.h:
523         * rendering/RenderThemeIOS.mm:
524         (WebCore::RenderThemeIOS::systemColor const): Use StyleColor::Options.
525         * rendering/RenderThemeMac.h:
526         * rendering/RenderThemeMac.mm:
527         (WebCore::RenderThemeMac::platformFocusRingColor const): Use StyleColor::Options.
528         (WebCore::RenderThemeMac::platformColorsDidChange): Clear m_systemVisitedLinkColor.
529         (WebCore::RenderThemeMac::systemColor const): Use StyleColor::Options.
530         (WebCore::RenderThemeMac::adjustMenuListStyle const): Ditto.
531         * rendering/RenderThemeWin.cpp:
532         (WebCore::RenderThemeWin::systemColor const): Use StyleColor::Options.
533         * rendering/RenderThemeWin.h:
534         * rendering/TextPaintStyle.cpp:
535         (WebCore::computeTextPaintStyle): Use StyleColor::Options.
536
537 2018-04-06  Youenn Fablet  <youenn@apple.com>
538
539         Response headers should be filtered when sent from NetworkProcess to WebProcess
540         https://bugs.webkit.org/show_bug.cgi?id=184310
541
542         Reviewed by Ryosuke Niwa.
543
544         Did some refactoring to allow ResourceResponse to use header value parsing routines.
545         We add sanitization levels for regular responses in case responses might be exposed to scripts or not.
546         If not exposed to scripts, additional filtering is done.
547
548         Add internal API to get unfiltered response headers from a fetch response.
549         Test: http/wpt/service-workers/header-filtering.https.html
550
551         * Modules/fetch/FetchResponse.h:
552         * loader/CrossOriginPreflightResultCache.cpp:
553         (WebCore::CrossOriginPreflightResultCacheItem::parse):
554         * platform/network/HTTPParsers.h:
555         (WebCore::addToAccessControlAllowList):
556         (WebCore::parseAccessControlAllowList):
557         * platform/network/ResourceResponseBase.cpp:
558         (WebCore::isSafeToKeepRedirectionResponseHeader):
559         (WebCore::isCrossOriginSafeToKeepResponseHeader):
560         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
561         * platform/network/ResourceResponseBase.h:
562         * testing/ServiceWorkerInternals.cpp:
563         (WebCore::ServiceWorkerInternals::fetchResponseHeaderList):
564         * testing/ServiceWorkerInternals.h:
565         * testing/ServiceWorkerInternals.idl:
566
567 2018-04-06  Michael Catanzaro  <mcatanzaro@igalia.com>
568
569         Unreviewed, fix unused parameter warning when credential storage is disabled
570
571         * platform/network/soup/NetworkStorageSessionSoup.cpp:
572         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
573
574 2018-04-06  Eric Carlson  <eric.carlson@apple.com>
575
576         [Extra zoom mode] Block playback until fullscreen begins
577         https://bugs.webkit.org/show_bug.cgi?id=184371
578         <rdar://problem/39250891>
579
580         Reviewed by Youenn Fablet.
581
582         * html/HTMLMediaElement.cpp:
583         (WebCore::HTMLMediaElement::updatePlayState): Return early when waiting to enter fullscreen.
584         (WebCore::HTMLMediaElement::enterFullscreen): Set m_waitingToEnterFullscreen.
585         (WebCore::HTMLMediaElement::exitFullscreen): Clear m_waitingToEnterFullscreen.
586         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Ditto.
587         * html/HTMLMediaElement.h:
588
589 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
590
591         WebCore::screenSupportsExtendedColor improperly calls NSScreen functions in the WebContent process
592         https://bugs.webkit.org/show_bug.cgi?id=184364
593         <rdar://problem/39246314>
594
595         Reviewed by Per Arne Vollan.
596
597         The WebContent process is interacting directly with NSScreen to determine if the current screen
598         has extended color support. This should be brokered from the UIProcess.
599         
600         Tested by fast/media/mq-color-gamut.html.
601
602         * platform/ScreenProperties.h:
603         (WebCore::ScreenProperties::encode const): Add screenSupportsExtendedColor.
604         (WebCore::ScreenProperties::decode): Ditto.
605         * platform/mac/PlatformScreenMac.mm:
606         (WebCore::getScreenProperties): Retrieve extended color support.
607         (WebCore::screenSupportsExtendedColor): Retrieve cached version when in the WebContent
608         process. Assert that NSScreen is not accessed in the WebContent process.
609
610 2018-04-06  Fujii Hironori  <Hironori.Fujii@sony.com>
611
612         [Win][WebCore] Expose a constant for scrollbar pixels per line (cScrollbarPixelsPerLine)
613         https://bugs.webkit.org/show_bug.cgi?id=184296
614
615         Reviewed by Alex Christensen.
616
617         No new tests (No behavior changes).
618
619         * platform/PlatformWheelEvent.h: Placed cScrollbarPixelsPerLine definition.
620         * platform/win/WheelEventWin.cpp:
621         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Removed cScrollbarPixelsPerLine definition.
622
623 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
624
625         Unreviewed test fix after r230323
626
627         * platform/mac/PlatformScreenMac.mm:
628         (WebCore::screenSupportsExtendedColor): Remove assertion hit during test runs.
629
630 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
631
632         WebCore::screenColorSpace is retrieving CGColorSpace from NSScreen directly
633         https://bugs.webkit.org/show_bug.cgi?id=184343
634         <rdar://problem/39224881>
635
636         Reviewed by Per Arne Vollan.
637
638         Revise ScreenProperties to serialize the screen's color space, and later
639         retrieve that in the WebContent process. This allows us to close off
640         the CGSWindowServer connection.
641
642         * platform/ScreenProperties.h:
643         (WebCore::ScreenProperties::encode const): Add CGColorSpaceRef support.
644         (WebCore::ScreenProperties::decode): Ditto.
645         * platform/mac/PlatformScreenMac.mm:
646         (WebCore::displayID): Add assertion to prevent use in WebContent process.
647         (WebCore::firstScreen): Ditto.
648         (WebCore::getScreenProperties): Add support for CGColorSpaceRef.
649         (WebCore::screenColorSpace): Retrieve cached version when in WebContent process.
650         Assert that NSScreen is not accessed in WebContent process.
651
652 2018-04-06  Ms2ger  <Ms2ger@igalia.com>
653
654         Implement createImageBitmap(Blob)
655         https://bugs.webkit.org/show_bug.cgi?id=183247
656
657         Reviewed by Dean Jackson.
658
659         Tests:
660             - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
661             - imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
662
663         * fileapi/FileReaderLoader.h:
664         (WebCore::FileReaderLoader::url): expose the Blob's URL.
665         * html/ImageBitmap.cpp: implement createImageBitmap(Blob).
666         * html/ImageBitmap.h: allow the BlobImageObserver class access to the creation function.
667         * loader/cache/CachedImage.cpp: reuse extracted code.
668         (WebCore::CachedImage::isPDFResource const):
669         (WebCore::CachedImage::isPostScriptResource const):
670         (WebCore::CachedImage::createImage):
671         * platform/graphics/Image.cpp: extract some code from CachedImage to reuse.
672         (WebCore::Image::create):
673         (WebCore::Image::isPDFResource):
674         (WebCore::Image::isPostScriptResource):
675         * platform/graphics/Image.h: add declarations.
676
677 2018-04-06  Zalan Bujtas  <zalan@apple.com>
678
679         Flex child does not get repainted when it is inserted back to the render tree.
680         https://bugs.webkit.org/show_bug.cgi?id=184361
681         <rdar://problem/34528716>
682
683         Reviewed by Antti Koivisto.
684
685         As with any regular block children, we should issue full repaint for flexbox items on their
686         first layout (see RenderBlockFlow::layoutBlockChild()).
687
688         Test: fast/flexbox/missing-repaint-when-flext-item-never-had-layout.html
689
690         * rendering/RenderFlexibleBox.cpp:
691         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
692
693 2018-04-06  Ms2ger  <Ms2ger@igalia.com>
694
695         Support transferring ImageBitmap objects
696         https://bugs.webkit.org/show_bug.cgi?id=183131
697
698         Reviewed by Dean Jackson.
699
700         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer.html
701
702         * bindings/js/SerializedScriptValue.cpp:
703         (WebCore::CloneSerializer::serialize): thread through ImageBitmaps.
704         (WebCore::CloneSerializer::CloneSerializer): thread through ImageBitmaps.
705         (WebCore::CloneSerializer::fillTransferMap): don't require a mutable reference.
706         (WebCore::CloneSerializer::dumpImageBitmap): add.
707         (WebCore::CloneSerializer::dumpIfTerminal): check for ImageBitmap.
708         (WebCore::CloneDeserializer::deserialize): thread through ImageBitmaps.
709         (WebCore::CloneDeserializer::CloneDeserializer): thread through ImageBitmaps.
710         (WebCore::CloneDeserializer::readImageBitmap): add.
711         (WebCore::CloneDeserializer::readTerminal): check for ImageBitmap.
712         (WebCore::SerializedScriptValue::SerializedScriptValue): thread through ImageBitmaps.
713         (WebCore::SerializedScriptValue::create): thread through ImageBitmaps.
714         (WebCore::containsDuplicates): add.
715         (WebCore::SerializedScriptValue::deserialize): handle ImageBitmap arguments.
716         * bindings/js/SerializedScriptValue.h: update signatures, add member.
717         * html/ImageBitmap.cpp:
718         (WebCore::ImageBitmap::create): add.
719         (WebCore::ImageBitmap::detachBitmaps): add.
720         * html/ImageBitmap.h: add signatures.
721
722 2018-04-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
723
724         When recording the drawing, the DisplayList should be initialized with the GraphicsContextState of the underlying GraphicsContext
725         https://bugs.webkit.org/show_bug.cgi?id=184336
726
727         Reviewed by Antti Koivisto.
728
729         The state of the drawing context has to be transfered to the recording 
730         DisplayList before recording. Many recording GraphicsContext functions 
731         will behave wrongly if it gets the default state.
732
733         * html/canvas/CanvasRenderingContext2DBase.cpp:
734         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
735         (WebCore::CanvasRenderingContext2DBase::drawingContext const):
736         * platform/graphics/ca/GraphicsLayerCA.cpp:
737         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
738         * platform/graphics/displaylists/DisplayListRecorder.cpp:
739         (WebCore::DisplayList::Recorder::Recorder):
740         * platform/graphics/displaylists/DisplayListRecorder.h:
741         (WebCore::DisplayList::Recorder::ContextState::ContextState):
742         (WebCore::DisplayList::Recorder::ContextState::cloneForSave const):
743         * platform/graphics/displaylists/DisplayListReplayer.cpp:
744         (WebCore::DisplayList::Replayer::replay):
745         * platform/graphics/displaylists/DisplayListReplayer.h:
746         (WebCore::DisplayList::Replayer::replay): If we do not have a clipping
747         rectangle and we want to record all the drawing, we need a default value
748         for the clipping rectangle and we want no clipping to happen.
749
750 2018-04-06  Daniel Bates  <dabates@apple.com>
751
752         Emit a more informative message when a script is blocked due to "X-Content-Type: nosniff"
753         https://bugs.webkit.org/show_bug.cgi?id=184359
754
755         Reviewed by Per Arne Vollan.
756
757         Emphasize in the message that the script was blocked from executing.
758
759         Test: http/tests/security/contentTypeOptions/nosniff-importScript-blocked.html
760
761         * dom/LoadableClassicScript.cpp:
762         (WebCore::LoadableClassicScript::notifyFinished):
763         * workers/WorkerScriptLoader.cpp:
764         (WebCore::WorkerScriptLoader::didReceiveResponse):
765
766 2018-04-06  Daniel Bates  <dabates@apple.com>
767
768         importScripts() should throw exception with a reason when it fails to load a script from the network
769         https://bugs.webkit.org/show_bug.cgi?id=184345
770
771         Reviewed by Alexey Proskuryakov.
772
773         Currently importScripts() throws a NetworkError exception without a reason when
774         it fails to load a script from the network. It is ambiguous whether the load failed
775         due to an access control failure or some other error. Instead we should include
776         the reason the load failed in the thrown exception.
777
778         * workers/WorkerGlobalScope.cpp:
779         (WebCore::WorkerGlobalScope::importScripts):
780
781 2018-04-06  Daniel Bates  <dabates@apple.com>
782
783         Attempt to fix the build after <https://trac.webkit.org/changeset/230338>
784         (https://bugs.webkit.org/show_bug.cgi?id=184360)
785
786         Make lambdas mutable so that we can WTFMove() their captured arguments.
787
788         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
789         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
790         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
791         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
792
793 2018-04-06  Daniel Bates  <dabates@apple.com>
794
795         Have class Exception take String by value instead of a String&&
796         https://bugs.webkit.org/show_bug.cgi?id=184360
797
798         Reviewed by Alexey Proskuryakov.
799
800         For convenience support instantiating an Exception with either an lvalue String or
801         rvalue String.
802
803         Although it can be argued that having Exception take a String by value instead of String&&
804         can lead to missed opportunities to WTFMove() a String object into Exception such mistakes
805         are just that, missed opportunities. That is, correctness is not affected and we may perform
806         an unnecessary ref/deref of the underlying StringImpl when instantiating an Exception. If
807         such missed opportunities show up in profiles and such mistakes happen often then we can
808         re-evaluate the decision to have Exception take a String by value.
809
810         * Modules/cache/DOMCache.cpp:
811         (WebCore::DOMCache::put): Simplify code now that Exception takes a String by value.
812         * Modules/fetch/FetchResponse.cpp:
813         (WebCore::FetchResponse::BodyLoader::didFail): Ditto.
814         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
815         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): Move String into Exception to avoid an
816         unnecessary ref/de-ref.
817         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): Ditto.
818         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): Ditto.
819         * dom/Exception.h:
820         (WebCore::Exception::Exception): Take String by value. Also use uniform initializer syntax.
821
822 2018-04-06  Antti Koivisto  <antti@apple.com>
823
824         Tighten ImageSource to have BitmapImage pointer instead of Image
825         https://bugs.webkit.org/show_bug.cgi?id=184356
826
827         Reviewed by Said Abou-Hallawa.
828
829         ImageSource is an implementation detail of BitmapImage, not a generic type.
830
831         * loader/ImageLoader.cpp:
832         (WebCore::ImageLoader::decode):
833         * platform/graphics/BitmapImage.h:
834         * platform/graphics/Image.h:
835         (WebCore::Image::decode): Deleted.
836         (WebCore::Image::imageFrameAvailableAtIndex): Deleted.
837
838         Also make some BitmapImage specific functions non-virtual and remove them from Image.
839
840         * platform/graphics/ImageSource.cpp:
841         (WebCore::ImageSource::ImageSource):
842         * platform/graphics/ImageSource.h:
843         (WebCore::ImageSource::create):
844
845         Make constructors private.
846
847         * platform/graphics/cg/GraphicsContext3DCG.cpp:
848         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
849
850 2018-04-06  Brent Fulgham  <bfulgham@apple.com>
851
852         Unreviewed test fix after r230323
853
854         * platform/mac/PlatformScreenMac.mm:
855         (WebCore::screen): Remove assertion we still hit due to event handling code.
856
857 2018-04-05  Youenn Fablet  <youenn@apple.com>
858
859         REGRESSION (r230223): LayoutTest http/tests/contentextensions/css-display-none-overflows-rule-data-1.html is crashing
860         https://bugs.webkit.org/show_bug.cgi?id=184306
861
862         Reviewed by Ryosuke Niwa.
863
864         Add an option to not compile CSS rules since they are not useful in NetworkProcess.
865         Covered by tests no longer crashing in Debug WK2 bots.
866
867         * contentextensions/ContentExtension.cpp:
868         (WebCore::ContentExtensions::ContentExtension::create):
869         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
870         * contentextensions/ContentExtension.h:
871         * contentextensions/ContentExtensionsBackend.cpp:
872         (WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
873         * contentextensions/ContentExtensionsBackend.h:
874
875 2018-04-05  Brent Fulgham  <bfulgham@apple.com>
876
877         WebContent process is calling CGDisplayUsesInvertedPolarity
878         https://bugs.webkit.org/show_bug.cgi?id=184337
879         <rdar://problem/39215702>
880
881         Reviewed by Zalan Bujtas.
882
883         The PlatformScreenMac code is still calling display-related routines directly, specifically
884         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray. These should be brokered from
885         the UIProcess.
886         
887         There's also no reason to avoid the brokering behavior on current WebKit builds. Remove
888         the compile guards so all macOS builds use this behavior.
889         
890         Finally, add some ProcessPrivilege assertions to guard against accidentally calling these
891         routines in the future.
892
893         Tested by existing regression tests.
894
895         * platform/PlatformScreen.h:
896         * platform/ScreenProperties.h:
897         (WebCore::ScreenProperties::encode const): Add new values.
898         (WebCore::ScreenProperties::decode):
899         * platform/mac/PlatformScreenMac.mm:
900         (WebCore::displayID): Add assertion that this is not calling display-related routines in
901         the WebContent process.
902         (WebCore::firstScreen): Ditto.
903         (WebCore::screenProperties): Moved higher in the file so it can be reused. Add calls to
904         CGDisplayUsesInvertedPolarity and CGDisplayUsesForceToGray.
905         (WebCore::getScreenProperties): Moved higher in the file so it can be reused. Stop
906         double-hashing displayID.
907         (WebCore::screenIsMonochrome): Use cached values in WebContent process. Assert if this
908         code attempts a display-related routine in the WebContent process.
909         (WebCore::screenHasInvertedColors): Ditto.
910         (WebCore::screenDepth): Add assertion that this is not calling display-related routines in
911         the WebContent process.
912         (WebCore::screenDepthPerComponent): Ditto.
913         (WebCore::screenRect): Ditto.
914         (WebCore::screenAvailableRect): Ditto.
915         (WebCore::screen): Ditto.
916         (WebCore::screenColorSpace): Ditto.
917         (WebCore::screenSupportsExtendedColor): Ditto.
918
919 2018-04-05  John Wilander  <wilander@apple.com>
920
921         Resource Load Statistics: Apply cookie blocking to setCookiesFromDOM()
922         https://bugs.webkit.org/show_bug.cgi?id=184346
923         <rdar://problem/39226036>
924
925         Reviewed by Brent Fulgham.
926
927         Since these cookies can't be seen and are not sent in requests, I
928         can't write an automated test for them. This really should have been
929         done as part of: https://bugs.webkit.org/show_bug.cgi?id=180682.
930         That said, I have tested this manually.
931
932         * platform/network/mac/CookieJarMac.mm:
933         (WebCore::setCookiesFromDOM):
934
935 2018-04-05  Zalan Bujtas  <zalan@apple.com>
936
937         Folding anonymous blocks should not result in deleting content.
938         https://bugs.webkit.org/show_bug.cgi?id=184339
939         <rdar://problem/37327428>
940
941         Reviewed by Antti Koivisto.
942
943         While folding multiple anonymous blocks (moving the children from next sibling over to previous sibling)
944         we should ensure that the block we are about to destroy does not gain new descendants.
945         In case of 4 sibling anonymous blocks (A B C D), while destroying B
946         1. we move C's children to A and destroy C.
947         2. While destroying C, we notice B and C as sibling anonymous blocks and we move
948         D's children over to B (even though B is going to be destroyed as we climb back on the stack).
949         
950         In this patch, B is detached from the tree before we start moving renderers around so that a subsequent folding won't
951         find B anymore as a candidate.
952
953         Test: fast/block/crash-while-folding-anonymous-blocks.html
954
955         * rendering/updating/RenderTreeBuilderBlock.cpp:
956         (WebCore::RenderTreeBuilder::Block::detach):
957
958 2018-04-05  Andy Estes  <aestes@apple.com>
959
960         Mark Payment Request as "Supported" in features.json
961         https://bugs.webkit.org/show_bug.cgi?id=184338
962
963         Reviewed by Anders Carlsson.
964
965         * features.json:
966
967 2018-04-05  Chris Dumez  <cdumez@apple.com>
968
969         Unreviewed, rolling out r230042.
970
971         It is no longer needed now that it is safe to construct a
972         SecurityOrigin from an on-main thread
973
974         Reverted changeset:
975
976         "WebSocket::didReceiveMessage() may construct a SecurityOrigin
977         object on a non-main thread"
978         https://bugs.webkit.org/show_bug.cgi?id=184068
979         https://trac.webkit.org/changeset/230042
980
981 2018-04-05  Yusuke Suzuki  <utatane.tea@gmail.com>
982
983         [WTF] Remove StaticLock
984         https://bugs.webkit.org/show_bug.cgi?id=184332
985
986         Reviewed by Mark Lam.
987
988         No behavior change.
989
990         * Modules/webdatabase/Database.cpp:
991         (WebCore::Database::Database):
992         (WebCore::Database::performOpenAndVerify):
993         (WebCore::Database::closeDatabase):
994         (WebCore::Database::getCachedVersion const):
995         (WebCore::Database::setCachedVersion):
996         * Modules/webdatabase/DatabaseTracker.cpp:
997         (WebCore::DatabaseTracker::openDatabaseMutex):
998         * Modules/webdatabase/DatabaseTracker.h:
999         * Modules/websockets/WebSocket.cpp:
1000         (WebCore::WebSocket::allActiveWebSocketsMutex):
1001         * Modules/websockets/WebSocket.h:
1002         * bridge/objc/WebScriptObject.mm:
1003         * crypto/CryptoAlgorithmRegistry.cpp:
1004         (WebCore::CryptoAlgorithmRegistry::identifier):
1005         (WebCore::CryptoAlgorithmRegistry::name):
1006         (WebCore::CryptoAlgorithmRegistry::create):
1007         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm):
1008         * dom/Node.cpp:
1009         * platform/URL.cpp:
1010         * platform/graphics/FontCache.cpp:
1011         * platform/graphics/MediaPlayer.cpp:
1012         * platform/ios/QuickLook.mm:
1013         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
1014         * platform/ios/wak/WebCoreThread.mm:
1015         * platform/ios/wak/WebCoreThreadRun.cpp:
1016         * platform/network/cf/LoaderRunLoopCF.cpp:
1017         (WebCore::loaderRunLoop):
1018         * platform/network/curl/CurlContext.cpp:
1019         (WebCore::CurlShareHandle::mutexFor):
1020         * platform/network/curl/CurlContext.h:
1021         * platform/sql/SQLiteDatabaseTracker.cpp:
1022         (WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
1023         (WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
1024         * platform/text/TextEncodingRegistry.cpp:
1025         (WebCore::buildBaseTextCodecMaps):
1026         (WebCore::newTextCodec):
1027         (WebCore::atomicCanonicalTextEncodingName):
1028         * workers/WorkerThread.cpp:
1029         (WebCore::WorkerThread::workerThreadCount):
1030         (WebCore::WorkerThread::WorkerThread):
1031         (WebCore::WorkerThread::~WorkerThread):
1032         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
1033
1034 2018-04-04  Youenn Fablet  <youenn@apple.com>
1035
1036         WebRTC data channel only applications require capture permissions for direct connections
1037         https://bugs.webkit.org/show_bug.cgi?id=174500
1038         <rdar://problem/34134281>
1039
1040         Reviewed by Eric Carlson.
1041
1042         Test: webrtc/datachannel/mdns-ice-candidates.html
1043
1044         Add support at PeerConnectionBackend to obfuscate any gathered host candidate
1045         by replacing the IP address with an opaque name that can be resolved by MDNS.
1046         An opaque name is generated for each IP address and is scoped by the document owning the peer connection object.
1047
1048         Add support to resolve any such MDNS ICE candidate.
1049         A limit of 250 ms is fixed for the resolution to happen.
1050         After 250 ms, the candidate is discarded.
1051
1052         Add an experimental flag around this feature, off by default.
1053
1054         * Modules/mediastream/PeerConnectionBackend.cpp:
1055         (WebCore::extractIPAddres):
1056         (WebCore::PeerConnectionBackend::addIceCandidate):
1057         (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
1058         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
1059         (WebCore::PeerConnectionBackend::newICECandidate):
1060         (WebCore::PeerConnectionBackend::doneGatheringCandidates):
1061         (WebCore::PeerConnectionBackend::registerMDNSName):
1062         (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
1063         * Modules/mediastream/PeerConnectionBackend.h:
1064         * Modules/mediastream/RTCIceCandidate.h:
1065         (WebCore::RTCIceCandidate::setCandidate):
1066         * Modules/mediastream/RTCPeerConnection.h:
1067         * dom/Document.cpp:
1068         (WebCore::Document::prepareForDestruction):
1069         (WebCore::Document::suspend):
1070         * page/RuntimeEnabledFeatures.h:
1071         (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const):
1072         (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled):
1073         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1074
1075 2018-04-04  Brian Burg  <bburg@apple.com>
1076
1077         [Cocoa] WebDriver: test imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_non_session_cookie fails
1078         https://bugs.webkit.org/show_bug.cgi?id=184314
1079         <rdar://problem/39186578>
1080
1081         Reviewed by Timothy Hatcher.
1082
1083         Covered by several tests in add_cookie.py per the bug title.
1084
1085         * platform/network/cocoa/CookieCocoa.mm:
1086         (WebCore::Cookie::operator NSHTTPCookie * const):
1087         By converting an integral UNIX timestamp to |maxAge| fractional seconds into the future, we introduce unwanted
1088         precision that is truncated when switching back to a UNIX timestamp later. Always round up maxAge so that
1089         the truncated value and actual value are the same.
1090
1091 2018-04-04  Alex Christensen  <achristensen@webkit.org>
1092
1093         Move PingHandle to WebKitLegacy
1094         https://bugs.webkit.org/show_bug.cgi?id=184145
1095
1096         Reviewed by Youenn Fablet.
1097
1098         * WebCore.xcodeproj/project.pbxproj:
1099         * platform/network/PingHandle.h: Removed.
1100
1101 2018-04-04  Per Arne Vollan  <pvollan@apple.com>
1102
1103         The layout test fast/canvas/canvas-blending-global-alpha.html is failing when the WebContent process does not have WindowServer access.
1104         https://bugs.webkit.org/show_bug.cgi?id=183752
1105         <rdar://problem/38635731>
1106
1107         The test is failing because the system is only providing software rendering when there is no access
1108         to the WindowServer, and software rendering is producing slightly different results than hardware
1109         rendering. To enable accelerated rendering, the GPU to be used for IOSurface rendering needs to be
1110         selected by handing over the OpenGL display mask to the IOSurface CGContext.
1111
1112         Reviewed by Brent Fulgham.
1113
1114         No new tests, covered by existing tests.
1115
1116         * platform/graphics/GraphicsContext3D.h:
1117         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1118         (WebCore::GraphicsContext3D::getOpenGLDisplayMask):
1119         * platform/graphics/cocoa/IOSurface.mm:
1120         (WebCore::IOSurface::ensurePlatformContext):
1121
1122 2018-04-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1123
1124         Track the paint frequency through a new class named PaintFrequencyTracker
1125         https://bugs.webkit.org/show_bug.cgi?id=184311
1126
1127         Reviewed by Antti Koivisto.
1128
1129         PaintFrequencyTracker is a class which detects when a layer is painted 
1130         frequently. SinglePaintFrequencyTracking is used in conjunction with
1131         PaintFrequencyTracker to recored a single paint timing.
1132
1133         * rendering/PaintFrequencyTracker.h: Added.
1134         (WebCore::PaintFrequencyTracker::begin):
1135         (WebCore::PaintFrequencyTracker::end):
1136         (WebCore::PaintFrequencyTracker::paintingFrequently const):
1137         Simplify the logic for tracking the paint frequency and move it from
1138         RenderLayer.cpp.
1139
1140         (WebCore::SinglePaintFrequencyTracking::SinglePaintFrequencyTracking):
1141         (WebCore::SinglePaintFrequencyTracking::~SinglePaintFrequencyTracking):
1142         A convenient way to bracket the begin() and the end() methods of
1143         PaintFrequencyTracker.
1144
1145         * rendering/RenderLayer.cpp:
1146         (WebCore::RenderLayer::paintLayerContents):
1147         (WebCore::RenderLayer::calculateClipRects const):
1148         (WebCore::PaintFrequencyInfo::PaintFrequencyInfo): Deleted.
1149         (WebCore::PaintFrequencyInfo::setPaintedCacheableResource): Deleted.
1150         (WebCore::PaintFrequencyInfo::paintingFrequently const): Deleted.
1151         (WebCore::PaintFrequencyInfo::updatePaintFrequency): Deleted.
1152         (WebCore::PaintFrequencyInfo::paintingCacheableResource): Deleted.
1153         * rendering/RenderLayer.h:
1154         Rename PaintFrequencyInfo to PaintFrequencyTracker and move it a separate
1155         header file.
1156
1157 2018-04-04  Jer Noble  <jer.noble@apple.com>
1158
1159         RELEASE_ASSERT in CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF() when MediaToolbox.framework missing
1160         https://bugs.webkit.org/show_bug.cgi?id=184247
1161         <rdar://problem/39007591>
1162
1163         Rubber-stamped by Eric Carlson.
1164
1165         Use SOFT_LINK_FRAMEWORK_OPTIONAL for frameworks which are not guaranteed to be present.
1166
1167         * page/CaptionUserPreferencesMediaAF.cpp:
1168         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF):
1169
1170 2018-04-04  Brent Fulgham  <bfulgham@apple.com>
1171
1172         Failures from mach port reference handling should be fatal
1173         https://bugs.webkit.org/show_bug.cgi?id=184202
1174         <rdar://problem/37771114>
1175
1176         Reviewed by Anders Carlsson.
1177
1178         We may corrupt the Mach port space by improperly matching the equivalent of reference counting
1179         retains (mach_port_mod_refs) with releases (mach_port_deallocate).
1180
1181         Our current implementation of MachSendRights::create does not grab a reference if the passed
1182         port is MACH_PORT_DEAD, but we unconditionally call mach_port_deallocate on the port, which
1183         could lead to a reference count mismatch.
1184
1185         Likewise, our MachSendRight destructor does not release the port if it has changed to MACH_PORT_DEAD
1186         (e.g., if a child process dies), again leading to a mismatch in retain/releases.
1187
1188         Finally, failures in mach_port_deallocate should be fatal because they indicate that the
1189         application was attempting to remove an unowned right. This is a fatal condition for Mach, and
1190         should lead to an abort. 
1191
1192         This patch does the following:
1193
1194         1. It creates a helper function that does the right thing for safely deallocating a mach port.
1195         2. It uses it in multiple places.
1196         3. It revises 'MachSendRight::create" so that it properly handles the condition of a dead port.
1197         4. It revises the MachSendRight destructor to properly handle the condition of a dead port.
1198
1199         No new tests, no change in behavior expected.
1200
1201         * SourcesCocoa.txt: Update for move of MachSendRight files.
1202         * WebCore.xcodeproj/project.pbxproj: Ditto.
1203         * page/cocoa/ResourceUsageThreadCocoa.mm:
1204         (WebCore::getMachThreads): Added.
1205         (WebCore::cpuUsage): Use the new cleanup helper function.
1206         * platform/cocoa/MachSendRight.cpp: Removed.
1207         * platform/cocoa/MachSendRight.h: Removed.
1208         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
1209         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
1210         * platform/graphics/cocoa/IOSurface.h:
1211         * platform/graphics/cocoa/IOSurface.mm:
1212
1213 2018-04-04  Youenn Fablet  <youenn@apple.com>
1214
1215         Remove unused HTTP header names
1216         https://bugs.webkit.org/show_bug.cgi?id=184272
1217
1218         Reviewed by Alex Christensen.
1219
1220         No change of behavior.
1221         Removed some names that are not used in the code base.
1222         This allows to strengthen filtering of responses sent to WebProcess.
1223         Added two headers used by web inspector.
1224         Updated existing code to use indexed HTTP header names.
1225
1226         * html/parser/XSSAuditor.cpp:
1227         (WebCore::XSSAuditor::init):
1228         * inspector/agents/InspectorPageAgent.cpp:
1229         (WebCore::InspectorPageAgent::sourceMapURLForResource):
1230         * platform/network/HTTPHeaderNames.in:
1231
1232 2018-04-04  Beth Dakin  <bdakin@apple.com>
1233
1234         Fix the !HAVE(AVFOUNDATION_VIDEO_OUTPUT) build
1235         https://bugs.webkit.org/show_bug.cgi?id=184309
1236         -and corresponding-
1237         rdar://problem/39179126
1238
1239         Reviewed by Jer Noble.
1240
1241         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1242         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
1243         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1244
1245 2018-04-04  Youenn Fablet  <youenn@apple.com>
1246
1247         MockRealtimeVideoSourceMac should produce kCVPixelFormatType_420YpCbCr8Planar buffers
1248         https://bugs.webkit.org/show_bug.cgi?id=184304
1249
1250         Reviewed by Eric Carlson.
1251
1252         Allows covering RealtimeOutgoingVideoSourceMac code path handling native buffers produced by capture video sources.
1253         ARGB buffer coverage is done through canvas capture streams.
1254
1255         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
1256         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1257         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
1258
1259 2018-04-04  Youenn Fablet  <youenn@apple.com>
1260
1261         Introduce a ThreadSafeRefCounted parameter to ensure being destroyed on the main thread
1262         https://bugs.webkit.org/show_bug.cgi?id=183988
1263
1264         Reviewed by Darin Adler.
1265
1266         No change of behavior, TrackPrivate remains destroyed on the main thread.
1267
1268         * platform/graphics/TrackPrivateBase.h:
1269         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1270         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1271         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
1272
1273 2018-04-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1274
1275         Unreviewed. Fix the build with libsoup < 2.49.91 after r230251.
1276
1277         Stop using ResourceHandle in SoupNetworkSession.
1278
1279         * platform/network/soup/SoupNetworkSession.cpp:
1280         (WebCore::SoupNetworkSession::SoupNetworkSession):
1281         (WebCore::authenticateCallback): Deleted.
1282         (WebCore::requestStartedCallback): Deleted.
1283
1284 2018-04-03  Alex Christensen  <achristensen@webkit.org>
1285
1286         Remove unused libsoup ResourceHandle implementation
1287         https://bugs.webkit.org/show_bug.cgi?id=184048
1288
1289         Reviewed by Michael Catanzaro.
1290
1291         This code is unused since r228901 so let's remove it!
1292
1293         * platform/network/ResourceHandle.h:
1294         * platform/network/ResourceHandleInternal.h:
1295         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
1296         * platform/network/soup/ResourceHandleSoup.cpp:
1297         (WebCore::ResourceHandle::~ResourceHandle):
1298         (WebCore::ResourceHandleInternal::soupSession):
1299         (WebCore::ResourceHandle::cancelledOrClientless):
1300         (WebCore::ResourceHandle::ensureReadBuffer):
1301         (WebCore::ResourceHandle::currentStreamPosition const):
1302         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
1303         (WebCore::ResourceHandle::didStartRequest):
1304         (WebCore::ResourceHandle::start):
1305         (WebCore::ResourceHandle::releaseForDownload):
1306         (WebCore::ResourceHandle::sendPendingRequest):
1307         (WebCore::ResourceHandle::cancel):
1308         (WebCore::ResourceHandle::shouldUseCredentialStorage):
1309         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
1310         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
1311         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
1312         (WebCore::ResourceHandle::receivedCredential):
1313         (WebCore::ResourceHandle::receivedCancellation):
1314         (WebCore::ResourceHandle::receivedChallengeRejection):
1315         (WebCore::ResourceHandle::platformSetDefersLoading):
1316         (WebCore::sessionFromContext): Deleted.
1317         (WebCore::ResourceHandle::create): Deleted.
1318         (WebCore::ResourceHandle::ResourceHandle): Deleted.
1319         (WebCore::isAuthenticationFailureStatusCode): Deleted.
1320         (WebCore::tlsErrorsChangedCallback): Deleted.
1321         (WebCore::gotHeadersCallback): Deleted.
1322         (WebCore::applyAuthenticationToRequest): Deleted.
1323         (WebCore::restartedCallback): Deleted.
1324         (WebCore::shouldRedirect): Deleted.
1325         (WebCore::shouldRedirectAsGET): Deleted.
1326         (WebCore::continueAfterWillSendRequest): Deleted.
1327         (WebCore::doRedirect): Deleted.
1328         (WebCore::redirectSkipCallback): Deleted.
1329         (WebCore::wroteBodyDataCallback): Deleted.
1330         (WebCore::cleanupSoupRequestOperation): Deleted.
1331         (WebCore::nextMultipartResponsePartCallback): Deleted.
1332         (WebCore::sendRequestCallback): Deleted.
1333         (WebCore::continueAfterDidReceiveResponse): Deleted.
1334         (WebCore::startingCallback): Deleted.
1335         (WebCore::networkEventCallback): Deleted.
1336         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
1337         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
1338         (WebCore::ResourceHandle::timeoutFired): Deleted.
1339         (WebCore::waitingToSendRequest): Deleted.
1340         (WebCore::readCallback): Deleted.
1341
1342 2018-04-03  Ross Kirsling  <ross.kirsling@sony.com>
1343
1344         Add missing WEBCORE_EXPORTs (for Windows shared library build)
1345         https://bugs.webkit.org/show_bug.cgi?id=184279
1346
1347         Reviewed by Alex Christensen.
1348
1349         * dom/Element.h:
1350         * dom/Node.h:
1351         * editing/FrameSelection.h:
1352         * html/DOMURL.h:
1353         * html/HTMLFormElement.h:
1354         * html/canvas/CanvasRenderingContext.h:
1355         * platform/graphics/GraphicsContext.h:
1356         * platform/graphics/PlatformDisplay.h:
1357         * platform/graphics/cairo/CairoOperations.h:
1358         * platform/graphics/cairo/GraphicsContextImplCairo.h:
1359         * platform/graphics/texmap/TextureMapperLayer.h:
1360         * platform/network/HTTPHeaderMap.h:
1361         * platform/network/ResourceRequestBase.h:
1362         * platform/network/ResourceResponseBase.h:
1363         * platform/network/curl/AuthenticationChallenge.h:
1364         * platform/network/curl/CurlFormDataStream.h:
1365         * platform/network/curl/CurlRequest.h:
1366         * platform/network/curl/CurlSSLHandle.h:
1367         * platform/network/curl/ResourceError.h:
1368         * platform/network/curl/ResourceResponse.h:
1369
1370 2018-04-03  Youenn Fablet  <youenn@apple.com>
1371
1372         RealtimeOutgoingVideoSourceMac should pass a ObjCFrameBuffer buffer
1373         https://bugs.webkit.org/show_bug.cgi?id=184281
1374         rdar://problem/39153262
1375
1376         Reviewed by Jer Noble.
1377
1378         Covered by manual testing by going to WebRTC web sites.
1379
1380         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
1381         (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
1382
1383 2018-04-03  Filip Pizlo  <fpizlo@apple.com>
1384
1385         GC shouldn't do object distancing
1386         https://bugs.webkit.org/show_bug.cgi?id=184195
1387
1388         Reviewed by Saam Barati.
1389
1390         No new tests because no change in behavior.
1391
1392         * Sources.txt:
1393         * WebCore.xcodeproj/project.pbxproj:
1394         * bindings/js/JSDOMGlobalObject.cpp:
1395         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
1396         * bindings/js/JSDOMGlobalObject.h:
1397         * bindings/js/JSDOMWindowBase.cpp:
1398         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
1399         * dom/Document.cpp:
1400         (WebCore::Document::threadLocalCache): Deleted.
1401         * dom/Document.h:
1402         * page/OriginThreadLocalCache.cpp: Removed.
1403         * page/OriginThreadLocalCache.h: Removed.
1404
1405 2018-04-03  Brent Fulgham  <bfulgham@apple.com>
1406
1407         Guard against keychain/certificate access outside the network process
1408         https://bugs.webkit.org/show_bug.cgi?id=184214
1409         <rdar://problem/38734795>
1410
1411         Reviewed by Youenn Fablet.
1412
1413         Use the ProcessPrivilege assertions to guard against accessing the Keychain from
1414         a non-Networking process.
1415
1416         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
1417         (WebCore::LocalAuthenticator::makeCredential): Assert if we access the keychain from
1418         a proces other than the Network or UI process.
1419         (WebCore::LocalAuthenticator::getAssertion): Ditto.
1420         (WebCore::LocalAuthenticator::issueClientCertificate const): Ditto.
1421         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1422         (WebCore::createAndStoreMasterKey): Ditto.
1423         (WebCore::findMasterKey): Ditto.
1424         (WebCore::deleteDefaultWebCryptoMasterKey): Ditto.
1425         * platform/mac/SSLKeyGeneratorMac.mm:
1426         (WebCore::signedPublicKeyAndChallengeString): Ditto.
1427         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
1428         (WebCore::createPrivateStorageSession): Ditto.
1429         * platform/network/mac/ResourceHandleMac.mm:
1430         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Ditto.
1431
1432 2018-04-03  Youenn Fablet  <youenn@apple.com>
1433
1434         NetworkResourceLoader does not need to expose all redirect response headers
1435         https://bugs.webkit.org/show_bug.cgi?id=184114
1436         <rdar://problem/39010557>
1437
1438         Reviewed by Ryosuke Niwa.
1439
1440         No JS observable change of behavior.
1441         Behavior change is observable for injected bundles since they will no longer get access to the full response.
1442         List of response headers correspond to the one currently being used/exposed for redirections.
1443
1444         Test: http/wpt/loading/redirect-headers.html
1445
1446         * page/RuntimeEnabledFeatures.h:
1447         (WebCore::RuntimeEnabledFeatures::setRestrictedHTTPResponseAccess):
1448         (WebCore::RuntimeEnabledFeatures::restrictedHTTPResponseAccess const):
1449         * platform/network/ResourceResponseBase.cpp:
1450         (WebCore::isSafeToKeepRedirectionHeader):
1451         (WebCore::ResourceResponseBase::sanitizeRedirectionHTTPHeaderFields):
1452         * platform/network/ResourceResponseBase.h:
1453
1454 2018-04-03  Andy Estes  <aestes@apple.com>
1455
1456         [Mac] Prioritize file promises over filenames during drag and drop
1457         https://bugs.webkit.org/show_bug.cgi?id=184237
1458         <rdar://problem/38278076>
1459
1460         Reviewed by Wenson Hsieh.
1461
1462         When performing a drag operation where the pasteboard contains both a file path and a file
1463         promise, we have historically preferred to accept the file path. Some versions of Photos.app
1464         will provide both a low-resolution thumbnail as a file path and its high-resolution
1465         counterpart as a file promise when dragging a photo, and our current logic leads us to
1466         choose the low-quality thumbnail.
1467
1468         This patch changes our logic to prefer file promises over file paths. This matches the
1469         behavior of Finder and ensures we accept high-resolution assets from Photos.app.
1470
1471         Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
1472         write a bogus file path to the pasteboard along with the legitimate file promise.
1473
1474         * platform/mac/DragDataMac.mm:
1475         (WebCore::DragData::asFilenames const):
1476         * platform/mac/PasteboardMac.mm:
1477         (WebCore::Pasteboard::read):
1478         (WebCore::Pasteboard::readFilePaths):
1479         * platform/mac/PlatformPasteboardMac.mm:
1480         (WebCore::PlatformPasteboard::numberOfFiles const):
1481
1482 2018-04-03  Mark Lam  <mark.lam@apple.com>
1483
1484         Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
1485         https://bugs.webkit.org/show_bug.cgi?id=184276
1486         <rdar://problem/39109543>
1487
1488         Rubber-stamped by Michael Saboff.
1489
1490         * bindings/scripts/CodeGeneratorJS.pm:
1491         (GenerateImplementation):
1492         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1493         (WebCore::toJSNewlyCreated):
1494         * bindings/scripts/test/JS/JSMapLike.cpp:
1495         (WebCore::toJSNewlyCreated):
1496         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1497         (WebCore::toJSNewlyCreated):
1498         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1499         (WebCore::toJSNewlyCreated):
1500         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1501         (WebCore::toJSNewlyCreated):
1502         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1503         (WebCore::toJSNewlyCreated):
1504         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
1505         (WebCore::toJSNewlyCreated):
1506         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1507         (WebCore::toJSNewlyCreated):
1508         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1509         (WebCore::toJSNewlyCreated):
1510         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
1511         (WebCore::toJSNewlyCreated):
1512         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1513         (WebCore::toJSNewlyCreated):
1514         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1515         (WebCore::toJSNewlyCreated):
1516         * bindings/scripts/test/JS/JSTestException.cpp:
1517         (WebCore::toJSNewlyCreated):
1518         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1519         (WebCore::toJSNewlyCreated):
1520         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1521         (WebCore::toJSNewlyCreated):
1522         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1523         (WebCore::toJSNewlyCreated):
1524         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1525         (WebCore::toJSNewlyCreated):
1526         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1527         (WebCore::toJSNewlyCreated):
1528         * bindings/scripts/test/JS/JSTestIterable.cpp:
1529         (WebCore::toJSNewlyCreated):
1530         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1531         (WebCore::toJSNewlyCreated):
1532         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1533         (WebCore::toJSNewlyCreated):
1534         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1535         (WebCore::toJSNewlyCreated):
1536         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1537         (WebCore::toJSNewlyCreated):
1538         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1539         (WebCore::toJSNewlyCreated):
1540         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1541         (WebCore::toJSNewlyCreated):
1542         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1543         (WebCore::toJSNewlyCreated):
1544         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1545         (WebCore::toJSNewlyCreated):
1546         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1547         (WebCore::toJSNewlyCreated):
1548         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1549         (WebCore::toJSNewlyCreated):
1550         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1551         (WebCore::toJSNewlyCreated):
1552         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1553         (WebCore::toJSNewlyCreated):
1554         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1555         (WebCore::toJSNewlyCreated):
1556         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1557         (WebCore::toJSNewlyCreated):
1558         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1559         (WebCore::toJSNewlyCreated):
1560         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
1561         (WebCore::toJSNewlyCreated):
1562         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
1563         (WebCore::toJSNewlyCreated):
1564         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1565         (WebCore::toJSNewlyCreated):
1566         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1567         (WebCore::toJSNewlyCreated):
1568         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1569         (WebCore::toJSNewlyCreated):
1570         * bindings/scripts/test/JS/JSTestNode.cpp:
1571         (WebCore::toJSNewlyCreated):
1572         * bindings/scripts/test/JS/JSTestObj.cpp:
1573         (WebCore::toJSNewlyCreated):
1574         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1575         (WebCore::toJSNewlyCreated):
1576         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1577         (WebCore::toJSNewlyCreated):
1578         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1579         (WebCore::toJSNewlyCreated):
1580         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
1581         (WebCore::toJSNewlyCreated):
1582         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1583         (WebCore::toJSNewlyCreated):
1584         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1585         (WebCore::toJSNewlyCreated):
1586         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1587         (WebCore::toJSNewlyCreated):
1588         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1589         (WebCore::toJSNewlyCreated):
1590         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1591         (WebCore::toJSNewlyCreated):
1592         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1593         (WebCore::toJSNewlyCreated):
1594         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1595         (WebCore::toJSNewlyCreated):
1596         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1597         (WebCore::toJSNewlyCreated):
1598         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1599         (WebCore::toJSNewlyCreated):
1600         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1601         (WebCore::toJSNewlyCreated):
1602         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1603         (WebCore::toJSNewlyCreated):
1604
1605 2018-04-03  Yousuke Kimoto  <yousuke.kimoto@sony.com>
1606
1607         [CMake] gperf path should be given when WebCore/css/makevalues.pl is executed
1608         https://bugs.webkit.org/show_bug.cgi?id=184224
1609
1610         Reviewed by Konstantin Tokarev.
1611
1612         When a building evironment doens't include a path to gperf,
1613         WebCore/css/makevalue.pl failes due to failing to execute gperf,
1614         so the full path to gperf should be given like WebCore/css/makeprop.pl.
1615
1616         No new tests, no Web-facing behavior change.
1617
1618         * CMakeLists.txt: gperf path is given to css/makevalues.pl.
1619         * css/makevalues.pl: Add an argument to handle a given gperf path.
1620
1621 2018-04-03  Chris Dumez  <cdumez@apple.com>
1622
1623         Drop MainFrame class
1624         https://bugs.webkit.org/show_bug.cgi?id=184191
1625
1626         Reviewed by Darin Adler.
1627
1628         Drop MainFrame class and move contents into Page / Frame since there is a 1:1
1629         relationship between the Page and the MainFrame.
1630
1631         This is ground work for introducing LocalFrame / RemoteFrame concepts.
1632
1633         * Modules/applepay/ApplePaySession.cpp:
1634         (WebCore::ApplePaySession::create):
1635         (WebCore::ApplePaySession::supportsVersion):
1636         (WebCore::ApplePaySession::canMakePayments):
1637         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
1638         (WebCore::ApplePaySession::openPaymentSetup):
1639         (WebCore::ApplePaySession::paymentCoordinator const):
1640         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1641         (WebCore::paymentCoordinator):
1642         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
1643         * Modules/mediastream/UserMediaRequest.cpp:
1644         * Modules/plugins/QuickTimePluginReplacement.mm:
1645         * Sources.txt:
1646         * WebCore.xcodeproj/project.pbxproj:
1647         * accessibility/AccessibilityObject.cpp:
1648         (WebCore::AccessibilityObject::mainFrame const):
1649         (WebCore::AccessibilityObject::visiblePositionForBounds const):
1650         * accessibility/AccessibilityObject.h:
1651         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1652         * bindings/js/ScriptController.cpp:
1653         * bindings/js/ScriptState.cpp:
1654         * contentextensions/ContentExtensionsBackend.cpp:
1655         * css/MediaQueryEvaluator.cpp:
1656         (WebCore::displayModeEvaluate):
1657         * dom/DOMImplementation.cpp:
1658         * dom/Document.cpp:
1659         * dom/DocumentMarkerController.cpp:
1660         * dom/Element.cpp:
1661         (WebCore::Element::removedFromAncestor):
1662         * dom/EventDispatcher.cpp:
1663         * dom/ScriptedAnimationController.cpp:
1664         * editing/Editor.cpp:
1665         (WebCore::Editor::scanSelectionForTelephoneNumbers):
1666         * editing/EditorCommand.cpp:
1667         * editing/SelectionRectGatherer.cpp:
1668         (WebCore::SelectionRectGatherer::Notifier::~Notifier):
1669         * editing/cocoa/WebContentReaderCocoa.mm:
1670         * editing/markup.cpp:
1671         * history/CachedFrame.cpp:
1672         * history/CachedPage.cpp:
1673         * history/PageCache.cpp:
1674         (WebCore::destroyRenderTree):
1675         * html/HTMLMediaElement.cpp:
1676         * html/HTMLPlugInImageElement.cpp:
1677         * html/ImageDocument.cpp:
1678         * html/MediaElementSession.cpp:
1679         (WebCore::isMainContentForPurposesOfAutoplay):
1680         * html/canvas/WebGLRenderingContextBase.cpp:
1681         * inspector/InspectorClient.cpp:
1682         * inspector/InspectorController.cpp:
1683         * inspector/InspectorFrontendClientLocal.cpp:
1684         * inspector/InspectorFrontendHost.cpp:
1685         * inspector/InspectorInstrumentation.cpp:
1686         * inspector/InspectorOverlay.cpp:
1687         * inspector/PageScriptDebugServer.cpp:
1688         * inspector/agents/InspectorApplicationCacheAgent.cpp:
1689         * inspector/agents/InspectorCanvasAgent.cpp:
1690         * inspector/agents/InspectorDOMAgent.cpp:
1691         * inspector/agents/InspectorPageAgent.cpp:
1692         (WebCore::InspectorPageAgent::mainFrame):
1693         * inspector/agents/InspectorPageAgent.h:
1694         * inspector/agents/page/PageDebuggerAgent.cpp:
1695         * inspector/agents/page/PageRuntimeAgent.cpp:
1696         * loader/DocumentLoader.cpp:
1697         * loader/DocumentWriter.cpp:
1698         * loader/FrameLoader.cpp:
1699         (WebCore::FrameLoader::loadWithDocumentLoader):
1700         (WebCore::FrameLoader::setState):
1701         * loader/HistoryController.cpp:
1702         * loader/NavigationDisabler.h:
1703         * loader/ProgressTracker.cpp:
1704         * loader/ResourceLoadObserver.cpp:
1705         * loader/ResourceLoader.cpp:
1706         * loader/SubframeLoader.cpp:
1707         * loader/SubresourceLoader.cpp:
1708         * loader/appcache/ApplicationCacheHost.cpp:
1709         * loader/archive/mhtml/MHTMLArchive.cpp:
1710         * loader/cache/CachedResource.cpp:
1711         * loader/cache/CachedResourceLoader.cpp:
1712         * page/AutoscrollController.cpp:
1713         * page/Chrome.cpp:
1714         * page/ContextMenuController.cpp:
1715         * page/DOMWindow.cpp:
1716         * page/DebugPageOverlays.cpp:
1717         (WebCore::MouseWheelRegionOverlay::updateRegion):
1718         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
1719         (WebCore::RegionOverlay::create):
1720         (WebCore::RegionOverlay::RegionOverlay):
1721         (WebCore::RegionOverlay::~RegionOverlay):
1722         (WebCore::DebugPageOverlays::ensureRegionOverlayForPage):
1723         (WebCore::DebugPageOverlays::showRegionOverlay):
1724         (WebCore::DebugPageOverlays::hideRegionOverlay):
1725         (WebCore::DebugPageOverlays::regionChanged):
1726         (WebCore::DebugPageOverlays::regionOverlayForPage const):
1727         (WebCore::DebugPageOverlays::updateOverlayRegionVisibility):
1728         (WebCore::DebugPageOverlays::settingsChanged):
1729         * page/DebugPageOverlays.h:
1730         (WebCore::DebugPageOverlays::hasOverlaysForPage const):
1731         (WebCore::DebugPageOverlays::hasOverlays):
1732         (WebCore::DebugPageOverlays::didLayout):
1733         (WebCore::DebugPageOverlays::didChangeEventHandlers):
1734         * page/DragController.cpp:
1735         (WebCore::DragController::performDragOperation):
1736         (WebCore::DragController::tryDHTMLDrag):
1737         (WebCore::DragController::beginDrag):
1738         (WebCore::DragController::doSystemDrag):
1739         * page/EventHandler.cpp:
1740         (WebCore::EventHandler::handleMousePressEvent):
1741         (WebCore::EventHandler::mouseMoved):
1742         (WebCore::EventHandler::handleMouseReleaseEvent):
1743         (WebCore::EventHandler::handleWheelEvent):
1744         (WebCore::EventHandler::clearLatchedState):
1745         (WebCore::EventHandler::defaultWheelEventHandler):
1746         * page/FocusController.cpp:
1747         * page/Frame.cpp:
1748         (WebCore::Frame::Frame):
1749         (WebCore::Frame::dropChildren):
1750         (WebCore::Frame::selfOnlyRef):
1751         (WebCore::Frame::selfOnlyDeref):
1752         * page/Frame.h:
1753         (WebCore::Frame::mainFrame const):
1754         * page/FrameTree.cpp:
1755         * page/FrameView.cpp:
1756         (WebCore::FrameView::setFrameRect):
1757         (WebCore::FrameView::setContentsSize):
1758         (WebCore::FrameView::didChangeScrollOffset):
1759         (WebCore::FrameView::setViewExposedRect):
1760         * page/History.cpp:
1761         * page/MainFrame.cpp: Removed.
1762         * page/MainFrame.h: Removed.
1763         * page/MemoryRelease.cpp:
1764         * page/Page.cpp:
1765         (WebCore::Page::Page):
1766         (WebCore::m_applicationManifest):
1767         (WebCore::Page::setDeviceScaleFactor):
1768         (WebCore::Page::latchingState):
1769         (WebCore::Page::pushNewLatchingState):
1770         (WebCore::Page::resetLatchingState):
1771         (WebCore::Page::popLatchingState):
1772         (WebCore::Page::removeLatchingStateForTarget):
1773         (WebCore::Page::setPaymentCoordinator):
1774         * page/Page.h:
1775         (WebCore::Page::mainFrame):
1776         (WebCore::Page::mainFrame const):
1777         (WebCore::Page::wheelEventDeltaFilter):
1778         (WebCore::Page::pageOverlayController):
1779         (WebCore::Page::servicesOverlayController):
1780         (WebCore::Page::paymentCoordinator const):
1781         (WebCore::Page::applicationManifest const):
1782         (WebCore::Page::performanceLogging const):
1783         * page/PageConsoleClient.cpp:
1784         * page/PageDebuggable.cpp:
1785         * page/PageGroup.cpp:
1786         * page/PageGroupLoadDeferrer.cpp:
1787         * page/PageOverlay.cpp:
1788         (WebCore::PageOverlay::controller const):
1789         * page/PageOverlayController.cpp:
1790         (WebCore::PageOverlayController::PageOverlayController):
1791         (WebCore::PageOverlayController::createRootLayersIfNeeded):
1792         (WebCore::PageOverlayController::layerWithDocumentOverlays):
1793         (WebCore::PageOverlayController::layerWithViewOverlays):
1794         (WebCore::PageOverlayController::installPageOverlay):
1795         (WebCore::PageOverlayController::updateForceSynchronousScrollLayerPositionUpdates):
1796         (WebCore::PageOverlayController::didChangeViewExposedRect):
1797         (WebCore::PageOverlayController::updateSettingsForLayer):
1798         (WebCore::PageOverlayController::deviceScaleFactor const):
1799         (WebCore::PageOverlayController::notifyFlushRequired):
1800         (WebCore::PageOverlayController::tiledBackingUsageChanged):
1801         * page/PageOverlayController.h:
1802         * page/PageSerializer.cpp:
1803         * page/PerformanceLogging.cpp:
1804         (WebCore::PerformanceLogging::PerformanceLogging):
1805         (WebCore::PerformanceLogging::didReachPointOfInterest):
1806         * page/PerformanceLogging.h:
1807         * page/PerformanceMonitor.cpp:
1808         * page/ResourceUsageOverlay.cpp:
1809         (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay):
1810         (WebCore::ResourceUsageOverlay::initialize):
1811         * page/SettingsBase.cpp:
1812         * page/SpatialNavigation.cpp:
1813         * page/UserContentProvider.cpp:
1814         * page/ios/FrameIOS.mm:
1815         * page/mac/DragControllerMac.mm:
1816         * page/mac/EventHandlerMac.mm:
1817         (WebCore::latchingIsLockedToPlatformFrame):
1818         (WebCore::latchingIsLockedToAncestorOfThisFrame):
1819         (WebCore::EventHandler::clearOrScheduleClearingLatchedStateIfNeeded):
1820         (WebCore::EventHandler::platformPrepareForWheelEvents):
1821         (WebCore::EventHandler::platformRecordWheelEvent):
1822         (WebCore::EventHandler::platformCompleteWheelEvent):
1823         (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent):
1824         * page/mac/PageMac.mm:
1825         * page/mac/ServicesOverlayController.h:
1826         (WebCore::ServicesOverlayController::page const):
1827         * page/mac/ServicesOverlayController.mm:
1828         (WebCore::ServicesOverlayController::Highlight::Highlight):
1829         (WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
1830         (WebCore::ServicesOverlayController::Highlight::deviceScaleFactor const):
1831         (WebCore::ServicesOverlayController::ServicesOverlayController):
1832         (WebCore::ServicesOverlayController::invalidateHighlightsOfType):
1833         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
1834         (WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown const):
1835         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
1836         (WebCore::ServicesOverlayController::buildSelectionHighlight):
1837         (WebCore::ServicesOverlayController::hasRelevantSelectionServices):
1838         (WebCore::ServicesOverlayController::createOverlayIfNeeded):
1839         (WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame):
1840         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
1841         (WebCore::ServicesOverlayController::mouseEvent):
1842         (WebCore::ServicesOverlayController::handleClick):
1843         (WebCore::ServicesOverlayController::mainFrame const):
1844         * page/scrolling/AsyncScrollingCoordinator.cpp:
1845         * page/scrolling/ScrollingCoordinator.cpp:
1846         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
1847         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1848         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1849         * plugins/DOMMimeType.cpp:
1850         * plugins/PluginInfoProvider.cpp:
1851         (WebCore::PluginInfoProvider::refresh):
1852         * rendering/RenderBox.cpp:
1853         * rendering/RenderLayer.cpp:
1854         * rendering/RenderLayerBacking.cpp:
1855         * rendering/RenderLayerCompositor.cpp:
1856         (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const):
1857         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1858         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
1859         (WebCore::RenderLayerCompositor::attachRootLayer):
1860         (WebCore::RenderLayerCompositor::detachRootLayer):
1861         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
1862         * rendering/RenderObject.cpp:
1863         * replay/UserInputBridge.cpp:
1864         * storage/StorageEventDispatcher.cpp:
1865         * style/StyleTreeResolver.cpp:
1866         (WebCore::Style::suspendMemoryCacheClientCalls):
1867         * svg/SVGSVGElement.cpp:
1868         * svg/graphics/SVGImage.cpp:
1869         * testing/InternalSettings.cpp:
1870         * testing/Internals.cpp:
1871         (WebCore::Internals::Internals):
1872         (WebCore::Internals::installMockPageOverlay):
1873         (WebCore::Internals::pageOverlayLayerTreeAsText const):
1874         * testing/MockPageOverlay.cpp:
1875         * testing/MockPageOverlay.h:
1876         * testing/MockPageOverlayClient.cpp:
1877         (WebCore::MockPageOverlayClient::installOverlay):
1878         (WebCore::MockPageOverlayClient::layerTreeAsText):
1879         * testing/MockPageOverlayClient.h:
1880         * testing/MockPaymentCoordinator.cpp:
1881         (WebCore::MockPaymentCoordinator::MockPaymentCoordinator):
1882         (WebCore::MockPaymentCoordinator::showPaymentUI):
1883         (WebCore::MockPaymentCoordinator::completeMerchantValidation):
1884         (WebCore::MockPaymentCoordinator::changeShippingOption):
1885         (WebCore::MockPaymentCoordinator::changePaymentMethod):
1886         (WebCore::MockPaymentCoordinator::acceptPayment):
1887         (WebCore::MockPaymentCoordinator::cancelPayment):
1888         * testing/MockPaymentCoordinator.h:
1889         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1890
1891 2018-04-03  Sihui Liu  <sihui_liu@apple.com>
1892
1893         The referer header is not set after redirect
1894         https://bugs.webkit.org/show_bug.cgi?id=182644
1895         <rdar://problem/37479048>
1896
1897         Reviewed by Youenn Fablet.
1898
1899         Update referrer policy and recompute referrer in redirection check, so Referer header would be set after it's removed from cross-origin request.
1900
1901         Add support for Referrer-Policy header, so referrer policy would be changed based on redirect response. 
1902
1903         * Sources.txt:
1904         * WebCore.xcodeproj/project.pbxproj:
1905         * dom/Document.cpp:
1906         (WebCore::Document::processReferrerPolicy):
1907         * loader/CrossOriginAccessControl.cpp:
1908         (WebCore::updateRequestReferrer):
1909         * loader/CrossOriginAccessControl.h:
1910         * loader/ResourceLoader.h:
1911         (WebCore::ResourceLoader::setReferrerPolicy):
1912         (WebCore::ResourceLoader::referrerPolicy const):
1913         * loader/SubresourceLoader.cpp:
1914         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
1915         (WebCore::SubresourceLoader::updateReferrerPolicy):
1916         * loader/SubresourceLoader.h:
1917         * loader/cache/CachedResourceRequest.cpp:
1918         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
1919         (WebCore::CachedResourceRequest::updateForAccessControl):
1920         (WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
1921         * platform/ReferrerPolicy.cpp: Added.
1922         (WebCore::parseReferrerPolicy):
1923         * platform/ReferrerPolicy.h:
1924         * platform/network/HTTPHeaderNames.in:
1925
1926 2018-04-03  Chris Dumez  <cdumez@apple.com>
1927
1928         Make SecurityOrigin safe to create and use from any thread
1929         https://bugs.webkit.org/show_bug.cgi?id=184216
1930
1931         Reviewed by Youenn Fablet.
1932
1933         We found that we have a decent amount of code constructing and using SecurityOrigin
1934         objects from non-main threads. Unfortunately, this was not safe, mostly due to
1935         SecurityOrigin's reliance on the SchemeRegistry.
1936
1937         This patch makes it safe to construct a SecurityOrigin on any thread A and use
1938         it later on the same thread A. However, developers still need to call isolatedCopy()
1939         if they want to pass such object to another thread B.
1940
1941         * page/SecurityOrigin.cpp:
1942         (WebCore::SecurityOrigin::canDisplay const):
1943         * page/SecurityOrigin.h:
1944         * page/SecurityPolicy.cpp:
1945         (WebCore::originAccessMapLock):
1946         (WebCore::originAccessMap):
1947         (WebCore::SecurityPolicy::isAccessWhiteListed):
1948         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
1949         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
1950         (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
1951         * platform/SchemeRegistry.cpp:
1952         (WebCore::schemeRegistryLock):
1953         (WebCore::allBuiltinSchemes):
1954         (WebCore::builtinLocalURLSchemes):
1955         (WebCore::localURLSchemes):
1956         (WebCore::displayIsolatedURLSchemes):
1957         (WebCore::builtinSecureSchemes):
1958         (WebCore::secureSchemes):
1959         (WebCore::builtinSchemesWithUniqueOrigins):
1960         (WebCore::schemesWithUniqueOrigins):
1961         (WebCore::builtinEmptyDocumentSchemes):
1962         (WebCore::emptyDocumentSchemes):
1963         (WebCore::schemesForbiddenFromDomainRelaxation):
1964         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
1965         (WebCore::canDisplayOnlyIfCanRequestSchemes):
1966         (WebCore::notAllowingJavascriptURLsSchemes):
1967         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
1968         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
1969         (WebCore::schemesAllowingLocalStorageAccessInPrivateBrowsing):
1970         (WebCore::schemesAllowingDatabaseAccessInPrivateBrowsing):
1971         (WebCore::builtinCORSEnabledSchemes):
1972         (WebCore::CORSEnabledSchemes):
1973         (WebCore::ContentSecurityPolicyBypassingSchemes):
1974         (WebCore::cachePartitioningSchemes):
1975         (WebCore::serviceWorkerSchemes):
1976         (WebCore::alwaysRevalidatedSchemes):
1977         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
1978         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
1979         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
1980         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
1981         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
1982         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
1983         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
1984         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
1985         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
1986         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
1987         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
1988         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
1989         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
1990         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
1991         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
1992         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
1993         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
1994         * platform/SchemeRegistry.h:
1995
1996 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1997
1998         [SOUP] Stop using ResourceHandle to load GResources
1999         https://bugs.webkit.org/show_bug.cgi?id=184259
2000
2001         Reviewed by Sergio Villar Senin.
2002
2003         GResources are loaded in the WebProcess using ResourceHandle because soup handles them transparently. But now
2004         that we no longer use ResourceHandle, we can add a simple loader for GResources, similar to the one used for
2005         data URLS, since loading a GResource is a matter of calling g_resources_lookup_data() in the end.
2006
2007         * SourcesGTK.txt:
2008         * SourcesWPE.txt:
2009         * loader/ResourceLoader.cpp:
2010         (WebCore::ResourceLoader::start): Check if resource to load is a GResource and call loadGResource().
2011         * loader/ResourceLoader.h:
2012         * loader/soup/ResourceLoaderSoup.cpp: Added.
2013         (WebCore::ResourceLoader::loadGResource): Load the GResource in a GTask thread.
2014         * platform/SharedBuffer.cpp:
2015         (WebCore::SharedBuffer::DataSegment::data const):
2016         (WebCore::SharedBuffer::DataSegment::size const):
2017         * platform/SharedBuffer.h:
2018         * platform/glib/SharedBufferGlib.cpp:
2019         (WebCore::SharedBuffer::SharedBuffer):
2020         (WebCore::SharedBuffer::create):
2021
2022 2018-04-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2023
2024         [Enchant] Clean up TextCheckerEnchant
2025         https://bugs.webkit.org/show_bug.cgi?id=184233
2026
2027         Reviewed by Michael Catanzaro.
2028
2029         Several cleanups and improvements:
2030
2031         * platform/text/enchant/TextCheckerEnchant.cpp:
2032         (WebCore::TextCheckerEnchant::singleton): Make TextCheckerEnchant a singleton since it's always used as a
2033         singleton.
2034         (WebCore::TextCheckerEnchant::EnchantDictDeleter::operator() const):
2035         (WebCore::TextCheckerEnchant::TextCheckerEnchant):
2036         (WebCore::TextCheckerEnchant::ignoreWord): Convert to utf8 once instead of on every loop iteration.
2037         (WebCore::TextCheckerEnchant::learnWord): Ditton.
2038         (WebCore::TextCheckerEnchant::checkSpellingOfWord): m_enchantDictionaries is now a Vector of std::unique_ptr.
2039         (WebCore::TextCheckerEnchant::getGuessesForWord): Convert to utf8 once instead of on every loop iteration.
2040         (WebCore::TextCheckerEnchant::updateSpellCheckingLanguages): Get only the first language instead of building a
2041         vector to get its first item. Use WTFMove to replace m_enchantDictionaries with the new Vector.
2042         (WebCore::TextCheckerEnchant::loadedSpellCheckingLanguages const): Use a lambda to get the list of languages
2043         already converted to String and iterate only once.
2044         (WebCore::TextCheckerEnchant::availableSpellCheckingLanguages const): Ditto.
2045         (WebCore::enchantDictDescribeCallback): Deleted.
2046         (WebCore::TextCheckerEnchant::~TextCheckerEnchant): Deleted.
2047         (WebCore::TextCheckerEnchant::freeEnchantBrokerDictionaries): Deleted.
2048         * platform/text/enchant/TextCheckerEnchant.h:
2049
2050 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2051
2052         [GTK] Segfaults in enchant_broker_free_dict()
2053         https://bugs.webkit.org/show_bug.cgi?id=183738
2054
2055         Reviewed by Michael Catanzaro.
2056
2057         Check enchant_broker_request_dict() didn't return nullptr before adding it to the m_enchantDictionaries vector.
2058
2059         * platform/text/enchant/TextCheckerEnchant.cpp:
2060         (WebCore::TextCheckerEnchant::updateSpellCheckingLanguages):
2061
2062 2018-04-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2063
2064         [GTK] NetworkProcess from WebKitGtk+ 2.19.9x SIGSEVs in NetworkStorageSession (secret search callback)
2065         https://bugs.webkit.org/show_bug.cgi?id=183346
2066
2067         Reviewed by Michael Catanzaro.
2068
2069         This might happen if a request is cancelled right after the password request starts and before it finishes. We
2070         should cancel the password search when the network request is cancelled, not only when the NetworkStorageSession
2071         is destroyed.
2072
2073         * platform/network/NetworkStorageSession.h:
2074         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2075         (WebCore::NetworkStorageSession::~NetworkStorageSession):
2076         (WebCore::SecretServiceSearchData::SecretServiceSearchData): Helper struct to keep the request cancellable and
2077         completion handler.
2078         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage): Create a SecretServiceSearchData for the
2079         request.
2080         * platform/network/soup/ResourceHandleSoup.cpp:
2081         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Pass the request cancellable to
2082         NetworkStorageSession::getCredentialFromPersistentStorage().
2083
2084 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
2085
2086         [Extra zoom mode] Replace video with a placeholder image during fullscreen transition
2087         https://bugs.webkit.org/show_bug.cgi?id=184188
2088         <rdar://problem/38940307>
2089
2090         Reviewed by Youenn Fablet.
2091
2092         * html/HTMLMediaElement.cpp:
2093         (WebCore::HTMLMediaElement::willExitFullscreen):
2094         * html/HTMLMediaElement.h:
2095         * platform/cocoa/VideoFullscreenChangeObserver.h:
2096         * platform/cocoa/VideoFullscreenModelVideoElement.h:
2097         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
2098         (VideoFullscreenModelVideoElement::willExitFullscreen):
2099         * platform/graphics/MediaPlayer.cpp:
2100         (WebCore::MediaPlayer::updateVideoFullscreenInlineImage):
2101         * platform/graphics/MediaPlayer.h:
2102         * platform/graphics/MediaPlayerPrivate.h:
2103         (WebCore::MediaPlayerPrivateInterface::updateVideoFullscreenInlineImage):
2104         * platform/graphics/VideoFullscreenLayerManager.h:
2105         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2106         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2107         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2108         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoFullscreenInlineImage):
2109         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
2110         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastPixelBuffer):
2111         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
2112         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
2113         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2114         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
2115         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2116         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
2117         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
2118         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
2119         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
2120         (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage):
2121         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
2122         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2123         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2124         (VideoFullscreenInterfaceAVKit::exitFullscreen):
2125         (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
2126         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2127         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2128         (VideoFullscreenControllerContext::willExitFullscreen):
2129
2130 2018-04-02  Eric Carlson  <eric.carlson@apple.com>
2131
2132         Define AVKit softlink macro
2133         https://bugs.webkit.org/show_bug.cgi?id=184241
2134
2135         Reviewed by Jer Noble.
2136
2137         No new tests, no functional change.
2138
2139         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2140         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
2141         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2142         * platform/ios/WebAVPlayerController.mm:
2143         * platform/mac/PlaybackSessionInterfaceMac.mm:
2144         * platform/mac/VideoFullscreenInterfaceMac.mm:
2145
2146 2018-04-02  Wenson Hsieh  <wenson_hsieh@apple.com>
2147
2148         [Extra zoom mode] Update date picker UI to latest specifications
2149         https://bugs.webkit.org/show_bug.cgi?id=184234
2150         <rdar://problem/38804760>
2151
2152         Reviewed by Timothy Hatcher.
2153
2154         Tweak localizable strings. Day, month and year labels should be fully capitalized, and there needs to be a
2155         string for the "Set" button title.
2156
2157         * English.lproj/Localizable.strings:
2158         * platform/LocalizedStrings.cpp:
2159         (WebCore::datePickerSetButtonTitle):
2160         (WebCore::datePickerDayLabelTitle):
2161         (WebCore::datePickerMonthLabelTitle):
2162         (WebCore::datePickerYearLabelTitle):
2163         * platform/LocalizedStrings.h:
2164
2165 2018-04-02  Ryosuke Niwa  <rniwa@webkit.org>
2166
2167         REGRESSION(r228260):WebHTMLView beeps at every keydown for Chinese/Japanese/Korean Input Method
2168         https://bugs.webkit.org/show_bug.cgi?id=184231
2169
2170         Reviewed by Alexey Proskuryakov.
2171
2172         The bug was caused by EventHandler::internalKeyEvent calling setDefaultHandled and expecting it to stay true
2173         after dispatching the event even though m_defaultHandled is always cleared after r228260. This results in
2174         EventHandler::internalKeyEvent returning false, and resulting in a beep.
2175
2176         Unfortunately, no new tests since there is no facility to detect this case in layout tests, and we can't
2177         easily emulate or trigger a real input method in API tests.
2178
2179         * page/EventHandler.cpp:
2180         (WebCore::EventHandler::internalKeyEvent):
2181
2182 2018-04-02  Jer Noble  <jer.noble@apple.com>
2183
2184         AudioBufferSourceNode start method causes OfflineAudioContext to start running
2185         https://bugs.webkit.org/show_bug.cgi?id=181939
2186         <rdar://problem/36755393>
2187
2188         Reviewed by Eric Carlson.
2189
2190         Test: webaudio/offlineaudiocontext-restriction.html
2191
2192         Don't respect playback restrictions for offline AudioContexts.
2193
2194         * Modules/webaudio/AudioContext.cpp:
2195         (WebCore::AudioContext::constructCommon):
2196         * Modules/webaudio/AudioContext.h:
2197         (WebCore::AudioContext::isOfflineContext const):
2198         (WebCore::AudioContext::userGestureRequiredForAudioStart const):
2199         (WebCore::AudioContext::pageConsentRequiredForAudioStart const):
2200         (WebCore::AudioContext::isOfflineContext): Deleted.
2201
2202 2018-04-02  Alejandro G. Castro  <alex@igalia.com>
2203
2204         [GTK] Make libwebrtc backend buildable for GTK  port
2205         https://bugs.webkit.org/show_bug.cgi?id=178860
2206
2207         Reviewed by Youenn Fablet.
2208
2209         This is the first step to add webrtc support to the GTK port using
2210         the libwebrtc backend.
2211
2212         No new tests, no new feature added, it should be tested by current
2213         tests.
2214
2215         * CMakeLists.txt: Add the new files to the compilation and set the
2216         new includes in the libwebrtc library.
2217         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2218         Reorder the includes alphabetically and add some that are missing.
2219         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2220         Ditto.
2221         * Sources.txt: Add new file to the compilation.
2222         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
2223         Added. Initial implementation for GTK and WPE.
2224         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h:
2225         Added. Ditto.
2226         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
2227         Added. Ditto.
2228         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h:
2229         Added. Ditto.
2230         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
2231         Added. Ditto.
2232         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
2233         Added. Ditto.
2234         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
2235         Added. Ditto.
2236         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
2237         Added. Ditto.
2238         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Added includes
2239         for the compilation.
2240         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Added, inherit from
2241         the LibWebRTCProvider to adapt for glib.
2242
2243 2018-04-01  Yusuke Suzuki  <utatane.tea@gmail.com>
2244
2245         Use WTF::Lock instead of GMutex
2246         https://bugs.webkit.org/show_bug.cgi?id=184227
2247
2248         Reviewed by Saam Barati.
2249
2250         Prefer WTF::Lock over GMutex since these locks are just protecting WebKit C++ fields.
2251
2252         No behavior change.
2253
2254         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
2255         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
2256         (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
2257         (WebCore::AudioSourceProviderGStreamer::provideInput):
2258         (WebCore::AudioSourceProviderGStreamer::handleAudioBuffer):
2259         (WebCore::AudioSourceProviderGStreamer::clearAdapters):
2260         * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
2261         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2262         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
2263         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2264         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
2265         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
2266         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
2267         (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
2268         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2269         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
2270         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2271         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2272         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2273         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
2274
2275 2018-03-31  Brent Fulgham  <bfulgham@apple.com>
2276
2277         Show punycode if URL contains hyphen character
2278         https://bugs.webkit.org/show_bug.cgi?id=184221
2279         <rdar://problem/38044633>
2280
2281         Reviewed by Darin Adler.
2282
2283         Revise our "lookalike character" logic to include the hyphen,
2284         non-breaking hyphen, and minus sign.
2285
2286         Test: fast/url/host.html
2287
2288         * platform/mac/WebCoreNSURLExtras.mm:
2289         (WebCore::isLookalikeCharacter):
2290
2291 2018-03-31  Filip Pizlo  <fpizlo@apple.com>
2292
2293         JSObject shouldn't do index masking
2294         https://bugs.webkit.org/show_bug.cgi?id=184194
2295
2296         Reviewed by Yusuke Suzuki.
2297
2298         No new tests because no new behavior.
2299
2300         * bindings/js/JSDOMConvertSequences.h:
2301         (WebCore::Detail::NumericSequenceConverter::convertArray):
2302         (WebCore::Detail::SequenceConverter::convertArray):
2303
2304 2018-03-30  Chris Dumez  <cdumez@apple.com>
2305
2306         REGRESSION (r229828): Facebook login popup is blank
2307         https://bugs.webkit.org/show_bug.cgi?id=184206
2308         <rdar://problem/39057006>
2309
2310         Reviewed by Wenson Hsieh.
2311
2312         Since r229828, we freeze the layer tree during the navigation policy check.
2313         We freeze in WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction()
2314         and unfreeze in WebFrameLoaderClient::didDecidePolicyForNavigationAction().
2315
2316         WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction() gets called
2317         from PolicyChecker::checkNavigationPolicy() which has 3 call sites in
2318         FrameLoader and one in DocumentLoader for redirects. The call sites in
2319         FrameLoader were taking care of calling didDecidePolicyForNavigationAction()
2320         on the FrameLoaderClient in their completion handler, but the DocumentLoader
2321         call site was failing to do so. As a result, the layer tree would stay frozen.
2322
2323         To make this a lot less error prone, I moved the call to
2324         WebFrameLoaderClient::didDecidePolicyForNavigationAction() to
2325         PolicyChecker::checkNavigationPolicy(), inside the completion handler passed
2326         to WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(). This way,
2327         even if new code starts calling PolicyChecker::checkNavigationPolicy(), we
2328         do not need to worry about letting the client know when the policy decision
2329         is made.
2330
2331         No new tests, covered by existing redirection tests with the
2332         new assertion I added.
2333
2334         * loader/FrameLoader.cpp:
2335         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
2336         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2337         * loader/PolicyChecker.cpp:
2338         (WebCore::PolicyChecker::checkNavigationPolicy):
2339
2340 2018-03-30  Devin Rousso  <webkit@devinrousso.com>
2341
2342         Web Inspector: tint all pixels drawn by shader program when hovering ShaderProgramTreeElement
2343         https://bugs.webkit.org/show_bug.cgi?id=175223
2344
2345         Reviewed by Matt Baker.
2346
2347         Test: inspector/canvas/setShaderProgramHighlighted.html
2348
2349         * html/canvas/InspectorShaderProgram.h:
2350         (WebCore::InspectorShaderProgram::highlighted):
2351         (WebCore::InspectorShaderProgram::setHighlighted):
2352
2353         * html/canvas/WebGLRenderingContextBase.cpp:
2354         (WebCore::InspectorScopedShaderProgramHighlight::InspectorScopedShaderProgramHighlight):
2355         (WebCore::InspectorScopedShaderProgramHighlight::~InspectorScopedShaderProgramHighlight):
2356         (WebCore::InspectorScopedShaderProgramHighlight::showHighlight):
2357         (WebCore::InspectorScopedShaderProgramHighlight::hideHighlight):
2358         (WebCore::InspectorScopedShaderProgramHighlight::saveBlendValue):
2359         (WebCore::InspectorScopedShaderProgramHighlight::hasBufferBinding):
2360         (WebCore::InspectorScopedShaderProgramHighlight::hasFramebufferParameterAttachment):
2361         (WebCore::WebGLRenderingContextBase::drawArrays):
2362         (WebCore::WebGLRenderingContextBase::drawElements):
2363         If the current shader program has been marked as highlighted, apply a blend right before
2364         `drawArrays` and `drawElements` is called, tinting the resulting pixels so that they are
2365         visually distinguished from pixels drawn by other shader programs.
2366
2367         * inspector/InspectorCanvasAgent.h:
2368         * inspector/InspectorCanvasAgent.cpp:
2369         (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
2370         (WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
2371
2372         * inspector/InspectorInstrumentation.h:
2373         * inspector/InspectorInstrumentation.cpp:
2374         (WebCore::InspectorInstrumentation::isShaderProgramHighlighted):
2375         (WebCore::InspectorInstrumentation::isShaderProgramHighlightedImpl):
2376
2377 2018-03-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2378
2379         [Extra zoom mode] Adopt list view controller UI for numeric input types
2380         https://bugs.webkit.org/show_bug.cgi?id=184184
2381         <rdar://problem/37238916>
2382
2383         Reviewed by Timothy Hatcher.
2384
2385         Add a localized string for the OK button shown on number pads in extra zoomed form controls.
2386
2387         * English.lproj/Localizable.strings:
2388         * platform/LocalizedStrings.cpp:
2389         (WebCore::numberPadOKButtonTitle):
2390         * platform/LocalizedStrings.h:
2391
2392 2018-03-30  Ryosuke Niwa  <rniwa@webkit.org>
2393
2394         Copying a list from Microsoft Word to TinyMCE fails when mso-list is the first property
2395         https://bugs.webkit.org/show_bug.cgi?id=182938
2396         <rdar://problem/37683007>
2397
2398         Reviewed by Wenson Hsieh.
2399
2400         Made the logic to detect Microsoft Word's mso-list CSS property more generic by detecting
2401         inline styles which start with "mso-list:" and one which line-break right before it: "\nmso-list:"
2402
2403         Tests: PasteHTML.PreservesMSOList
2404
2405         * editing/markup.cpp:
2406         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
2407
2408 2018-03-30  Youenn Fablet  <youenn@apple.com>
2409
2410         NetworkLoadChecker should upgrade redirects if needed
2411         https://bugs.webkit.org/show_bug.cgi?id=184098
2412
2413         Reviewed by Chris Dumez.
2414
2415         Test: imported/w3c/web-platform-tests/beacon/upgrade-beacon.https.html
2416
2417         * page/csp/ContentSecurityPolicy.h:
2418
2419 2018-03-30  Daniel Bates  <dabates@apple.com>
2420
2421         ASSERTION FAILED: ASSERT(!containsImage || MIMETypeRegistry::isSupportedImageResourceMIMEType([resource MIMEType])) in -[NSPasteboard(WebExtras) _web_writePromisedRTFDFromArchive:containsImage:]
2422         https://bugs.webkit.org/show_bug.cgi?id=184161
2423
2424         Reviewed by Per Arne Vollan.
2425
2426         Fixes an assertion failure when quiting an app that uses a Legacy WebKit web view
2427         after dragging-and-dropping a PDF embedded using an HTML image element into the
2428         same web view.
2429
2430         When performing a drag-and-drop of a PDF document image (WebCore::PDFDocumentImage) we create a WebArchive
2431         from the main frame's WebHTMLView and promise AppKit that will provide a Rich Text Format (RTF) document
2432         from this archive if needed. For some reason, on app termination AppKit requests that the WebHTMLView
2433         fullfill its RTF document promise for the WebArchive created at the start of the drag operation. WebKit
2434         expects that the created WebArchive is either for an inline image (e.g. <img>) or an image document that
2435         has a supported image resource MIME type (by querying MIMETypeRegistry::isSupportedImageResourceMIMEType())
2436         and checks for these cases in this order. PDF/PostScript are not listed in the set of supported image
2437         resource MIME types. So, the first check fails and WebKit assumes that the WebArchive was created from
2438         an image document of a supported image resource MIME type. However, the WebArchive was created from a
2439         WebHTMLView and has MIME type text/html. Therefore the assertion fails. We need to add PDF and PostScript
2440         to the set of supported image resource MIME types so that WebKit does not fall back to the WebHTMLView
2441         code path. Historically, PDF and PostScript were in the set supported image resource MIME types. Over time
2442         the set of MIME types for image resouces (images loaded as a document) became identical to the set of MIME
2443         types for images loaded inline (e.g. <img>) and this set omitted the MIME types for PDF and PostScript.
2444
2445         Additionally it is sufficient to implement MIMETypeRegistry::isSupportedImageResourceMIMEType() in terms
2446         of MIMETypeRegistry::isSupportedImageMIMEType() and MIMETypeRegistry::isPDFOrPostScriptMIMEType() instead
2447         of allocating a dedicated HashSet for the supported image resource MIME types (as we currently do).
2448
2449         * dom/DOMImplementation.cpp:
2450         (WebCore::DOMImplementation::createDocument): Assert that PDF is a supported image MIME type before
2451         instantiating an ImageDocument.
2452         * platform/MIMETypeRegistry.cpp:
2453         (WebCore::initializeSupportedImageMIMETypes): Remove unnecessary allocation of a HashSet for the support
2454         image resource MIME types.
2455         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Write in terms of MIMETypeRegistry::isSupportedImageMIMEType()
2456         and MIMETypeRegistry::isPDFOrPostScriptMIMEType().
2457         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
2458         * platform/MIMETypeRegistry.h:
2459
2460 2018-03-29  Antoine Quint  <graouts@apple.com>
2461
2462         [Web Animations] CSSTransition objects should have fill: backwards to allow seeking prior to start time
2463         https://bugs.webkit.org/show_bug.cgi?id=184129
2464
2465         Reviewed by Dean Jackson.
2466
2467         In order to allow a CSS Transition to be seeked prior to its start time, it needs to have its fill mode set
2468         to backwards. Adding code to set the fill mode in CSSTransition::initialize() yields early timing model
2469         invalidation and we could get in a situation where stylesWouldYieldNewCSSTransitionsBlendingKeyframes()
2470         was called before we had a chance to create blending keyframes for a CSS transitions, since the call
2471         to create blending keyframes is made after the call to initialize(), so we now cater for this case.
2472
2473         * animation/CSSTransition.cpp:
2474         (WebCore::CSSTransition::initialize):
2475         * animation/CSSTransition.h:
2476         * animation/KeyframeEffectReadOnly.cpp:
2477         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const):
2478
2479 2018-03-30  Daniel Bates  <dabates@apple.com>
2480
2481         Remove unused MIMETypeRegistry::getSupportedImageMIMETypesForEncoding()
2482         https://bugs.webkit.org/show_bug.cgi?id=184154
2483
2484         Reviewed by Per Arne Vollan.
2485
2486         * platform/MIMETypeRegistry.cpp:
2487         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Deleted.
2488         * platform/MIMETypeRegistry.h:
2489
2490 2018-03-30  Ryan Haddad  <ryanhaddad@apple.com>
2491
2492         Unreviewed, rolling out r230102.
2493
2494         Caused assertion failures on JSC bots.
2495
2496         Reverted changeset:
2497
2498         "A stack overflow in the parsing of a builtin (called by
2499         createExecutable) cause a crash instead of a catchable js
2500         exception"
2501         https://bugs.webkit.org/show_bug.cgi?id=184074
2502         https://trac.webkit.org/changeset/230102
2503
2504 2018-03-30  Robin Morisset  <rmorisset@apple.com>
2505
2506         A stack overflow in the parsing of a builtin (called by createExecutable) cause a crash instead of a catchable js exception
2507         https://bugs.webkit.org/show_bug.cgi?id=184074
2508         <rdar://problem/37165897>
2509
2510         Reviewed by Keith Miller.
2511
2512         I had to slightly change the type of some bindings between JSC and WebCore. No functional change intended on the WebCore side.
2513
2514         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2515         (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
2516         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
2517         (WebCore::JSBuiltinReadableByteStreamControllerPrivateConstructor::initializeExecutable):
2518         (WebCore::JSBuiltinReadableStreamBYOBReaderPrivateConstructor::initializeExecutable):
2519         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
2520         * bindings/scripts/CodeGeneratorJS.pm:
2521         (GenerateConstructorHelperMethods):
2522         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
2523         (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeExecutable):
2524         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
2525         (WebCore::JSTestJSBuiltinConstructorConstructor::initializeExecutable):
2526
2527 2018-03-29  Antoine Quint  <graouts@apple.com>
2528
2529         [Web Animations] Correctly obtain the timing function for a given keyframe
2530         https://bugs.webkit.org/show_bug.cgi?id=184146
2531
2532         Reviewed by Dean Jackson.
2533
2534         The way we would get the timing function for a given KeyframeValue stored in a KeyframeList was really suboptimal.
2535         When keyframes were created, we would set the animated element's style on each keyframe, and set keyframe-specific
2536         properties and values on top. When figuring out the timing function for a KeyframeValue, we would look at its render
2537         style, go through its list of animations, which could include animations that are irrelevant to this specific keyframe
2538         list since all animations from the animated element are referenced, and we would have to look up the correct animation
2539         by name and get the timing function, even though the timing function stored on the animation was now specific to this
2540         particular keyframe.
2541
2542         We now simply set a m_timingFunction member on a KeyframeValue, which is null if no explicit animation-timing-function
2543         was provided for this keyframe in CSS, and otherwise set to a valid TimingFunction.
2544
2545         This fixes our behavior for a 4 existing animation tests when opted into the CSS Animations and CSS Transitions as
2546         Web Animations feature.
2547
2548         * animation/KeyframeEffectReadOnly.cpp:
2549         (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
2550         * css/StyleResolver.cpp:
2551         (WebCore::StyleResolver::keyframeStylesForAnimation):
2552         * page/animation/KeyframeAnimation.cpp:
2553         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty const):
2554         * platform/animation/TimingFunction.cpp:
2555         (WebCore::TimingFunction::createFromCSSText):
2556         (WebCore::TimingFunction::createFromCSSValue):
2557         * platform/animation/TimingFunction.h:
2558         * rendering/RenderLayerBacking.cpp:
2559         (WebCore::RenderLayerBacking::startAnimation):
2560         * rendering/style/KeyframeList.cpp:
2561         (WebCore::KeyframeValue::timingFunction const): Deleted.
2562         * rendering/style/KeyframeList.h:
2563         (WebCore::KeyframeValue::timingFunction const):
2564         (WebCore::KeyframeValue::setTimingFunction):
2565
2566 2018-03-29  Ryosuke Niwa  <rniwa@webkit.org>
2567
2568         Copying a list from Microsoft Word to TinyMCE fails when mso-list is on tags other than P
2569         https://bugs.webkit.org/show_bug.cgi?id=182954
2570         <rdar://problem/37713141>
2571
2572         Reviewed by Wenson Hsieh.
2573
2574         Fixed the bug by relaxing the restriction that we only preserve mso-list on p.
2575
2576         Tests: PasteHTML.PreservesMSOListOnH4
2577
2578         * editing/markup.cpp:
2579         (WebCore::StyledMarkupAccumulator::shouldPreserveMSOListStyleForElement):
2580
2581 2018-03-29  JF Bastien  <jfbastien@apple.com>
2582
2583         Use Forward.h instead of forward-declaring WTF::String
2584         https://bugs.webkit.org/show_bug.cgi?id=184172
2585         <rdar://problem/39026146>
2586
2587         Reviewed by Yusuke Suzuki.
2588
2589         As part of #184164 I'm changing WTF::String, and the forward
2590         declarations are just wrong because I'm making it templated. We
2591         should use Forward.h anyways, so do that instead.
2592
2593         * css/makeprop.pl:
2594         * platform/cocoa/PlaybackSessionInterface.h:
2595         * platform/ios/Device.h:
2596         * platform/ios/PlaybackSessionInterfaceAVKit.h:
2597         * platform/ios/VideoFullscreenInterfaceAVKit.h:
2598         * platform/win/PathWalker.h:
2599         * testing/js/WebCoreTestSupport.h:
2600
2601 2018-03-29  Ross Kirsling  <ross.kirsling@sony.com>
2602
2603         MSVC __forceinline slows down JSC release build fivefold after r229391
2604         https://bugs.webkit.org/show_bug.cgi?id=184062
2605
2606         Reviewed by Alex Christensen.
2607
2608         * platform/graphics/FormatConverter.cpp:
2609         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
2610
2611 2018-03-29  Ryan Haddad  <ryanhaddad@apple.com>
2612
2613         Unreviewed, rolling out r230087.
2614
2615         Introduced LayoutTest failures.
2616
2617         Reverted changeset:
2618
2619         "FrameSelection::appearanceUpdateTimerFired should be robust
2620         against layout passes underneath it"
2621         https://bugs.webkit.org/show_bug.cgi?id=183395
2622         https://trac.webkit.org/changeset/230087
2623
2624 2018-03-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2625
2626         FrameSelection::appearanceUpdateTimerFired should be robust against layout passes underneath it
2627         https://bugs.webkit.org/show_bug.cgi?id=183395
2628         <rdar://problem/38055732>
2629
2630         Reviewed by Zalan Bujtas.
2631
2632         In the case where a FrameSelection updates its appearance when m_appearanceUpdateTimer is fired, the
2633         FrameSelection's Frame is unprotected, and can be removed by arbitrary script. This patch applies a simple
2634         mitigation by wrapping the Frame in a Ref when firing the appearance update timer, and ensuring that layout is
2635         really up to date before calling updateAppearanceAfterLayoutOrStyleChange() from the timer.
2636
2637         Test: editing/selection/iframe-update-selection-appearance.html
2638
2639         * editing/FrameSelection.cpp:
2640         (WebCore::FrameSelection::appearanceUpdateTimerFired):
2641
2642 2018-03-29  Daniel Bates  <dabates@apple.com>
2643
2644         Substitute ArchiveFactory::isArchiveMIMEType() for ArchiveFactory::isArchiveMimeType().
2645
2646         * loader/DocumentLoader.cpp:
2647         (WebCore::DocumentLoader::commitLoad):
2648         * loader/archive/ArchiveFactory.cpp:
2649         (WebCore::ArchiveFactory::isArchiveMIMEType):
2650         (WebCore::ArchiveFactory::isArchiveMimeType): Deleted.
2651         * loader/archive/ArchiveFactory.h:
2652         * platform/MIMETypeRegistry.h:
2653
2654 2018-03-29  Daniel Bates  <dabates@apple.com>
2655
2656         MIMETypeRegistry should return const HashSets
2657         https://bugs.webkit.org/show_bug.cgi?id=184150
2658
2659         Reviewed by Per Arne Vollan.
2660
2661         Only getSupportedNonImageMIMETypes() needs to return a non-const HashSet so that
2662         LegacyWebKit can modify the set of non-image MIME types.
2663
2664         * platform/MIMETypeRegistry.cpp:
2665         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
2666         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
2667         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
2668         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
2669         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
2670         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
2671         * platform/MIMETypeRegistry.h:
2672
2673 2018-03-29  Brady Eidson  <beidson@apple.com>
2674
2675         Update Service Worker feature status.
2676         https://bugs.webkit.org/show_bug.cgi?id=184139
2677
2678         Reviewed by Chris Dumez.
2679
2680         * features.json:
2681
2682 2018-03-29  Chris Dumez  <cdumez@apple.com>
2683
2684         Drop DOMWindow::frames() / DOMWindow::window() methods
2685         https://bugs.webkit.org/show_bug.cgi?id=184112
2686
2687         Reviewed by Daniel Bates.
2688
2689         Drop DOMWindow::frames() / DOMWindow::window() methods as they are just aliases for DOMWindow::self().
2690
2691         * page/DOMWindow.h:
2692         * page/DOMWindow.idl:
2693
2694 2018-03-29  Commit Queue  <commit-queue@webkit.org>
2695
2696         Unreviewed, rolling out r230062.
2697         https://bugs.webkit.org/show_bug.cgi?id=184128
2698
2699         Broke mac port. web content process crashes while loading any
2700         web page (Requested by rniwa on #webkit).
2701
2702         Reverted changeset:
2703
2704         "MSVC __forceinline slows down JSC release build fivefold
2705         after r229391"
2706         https://bugs.webkit.org/show_bug.cgi?id=184062
2707         https://trac.webkit.org/changeset/230062
2708
2709 2018-03-28  Antoine Quint  <graouts@apple.com>
2710
2711         [Web Animations] Implement more CSSPropertyBlendingClient methods
2712         https://bugs.webkit.org/show_bug.cgi?id=184077
2713
2714         Reviewed by Dean Jackson.
2715
2716         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
2717         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
2718         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
2719         CSS Transitions as Web Animations feature.
2720
2721         We also ensure we only run a CSSAnimationController assertion in FrameView::didDestroyRenderTree() if
2722         we're not using the CSS Animations and CSS Transitions as Web Animations feature.
2723
2724         * animation/KeyframeEffectReadOnly.cpp:
2725         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
2726         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
2727         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
2728         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
2729         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
2730         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
2731         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
2732         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
2733         * animation/KeyframeEffectReadOnly.h:
2734         * page/FrameView.cpp:
2735         (WebCore::FrameView::didDestroyRenderTree):
2736
2737 2018-03-28  Chris Dumez  <cdumez@apple.com>
2738
2739         Align XMLHttpRequest's open() / send() / abort() with the latest specification
2740         https://bugs.webkit.org/show_bug.cgi?id=184108
2741
2742         Reviewed by Youenn Fablet.
2743
2744         Align XMLHttpRequest's open() / send() / abort() with the latest specification:
2745         - https://xhr.spec.whatwg.org
2746
2747         No new tests, rebaselined existing layout tests.
2748
2749         * xml/XMLHttpRequest.cpp:
2750         (WebCore::XMLHttpRequest::open):
2751         Align with https://xhr.spec.whatwg.org/#the-open()-method:
2752         - Change the order of some steps to match the order in the spec. In particular,
2753           open() no longer resets the state to UNSENT or abort any existing load when it
2754           fails early due to being passed a bad method.
2755
2756         (WebCore::XMLHttpRequest::createRequest):
2757         Align with https://xhr.spec.whatwg.org/#the-send()-method:
2758         - Use the simpler "upload listener flag" logic from the spec instead of our more
2759           complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
2760           objects on a background thread when XHR is used inside Web Workers, which was
2761           not thread-safe.
2762         - Set the upload complete flag when the request has no body as per step 9.
2763         - After firing the loadstartEvent, return early if the state is no longer OPEN or
2764           if the send flag is unset, as per step 11.3.
2765
2766         (WebCore::XMLHttpRequest::abort):
2767         Align with https://xhr.spec.whatwg.org/#the-abort()-method:
2768         - Only set the state to UNSENT if the state is still DONE after firing the error
2769           events, as per step 3.
2770
2771         (WebCore::XMLHttpRequest::didSendData):
2772         Use new "upload listener flag".
2773
2774         (WebCore::XMLHttpRequest::dispatchErrorEvents):
2775         Align with https://xhr.spec.whatwg.org/#request-error-steps:
2776         - Stop firing a progress event in case of error as this is not as per specification
2777           and Firefox does not fire those either.
2778
2779         * xml/XMLHttpRequest.h:
2780
2781 2018-03-28  Timothy Hatcher  <timothy@apple.com>
2782
2783         Consolidate NSColor to WebCore::Color conversion and fix system colors.
2784
2785         https://bugs.webkit.org/show_bug.cgi?id=184096
2786         rdar://problem/38918925
2787
2788         Reviewed by Tim Horton.
2789
2790         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2791         (CreateCGColorIfDifferent): Use CGColor property on NSColor, don't manually create new CGColor.
2792         * platform/graphics/mac/ColorMac.h:
2793         * platform/graphics/mac/ColorMac.mm:
2794         (WebCore::makeRGBAFromNSColor): Move pattern code from RenderThemeMac's convertNSColorToColor.
2795         Also use nextafter for proper RGBA float conversion.
2796         * platform/mac/PlatformPasteboardMac.mm:
2797         (WebCore::PlatformPasteboard::color): Use colorFromNSColor.
2798         * rendering/RenderThemeMac.mm:
2799         (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Use colorFromNSColor.
2800         (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
2801         (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
2802         (WebCore::RenderThemeMac::systemColor const): Ditto.
2803         (WebCore::paintAttachmentTitleBackground): Ditto.
2804         (WebCore::convertNSColorToColor): Deleted.
2805
2806 2018-03-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2807
2808         The SVGAnimatedProperty wrappers have to be detached from the referenced values before the SVGAnimatedType is deleted
2809         https://bugs.webkit.org/show_bug.cgi?id=183972
2810
2811         Reviewed by Daniel Bates.
2812
2813         If the SVGAnimatedType is a list type, e.g. SVGLengthListValues, the wrappers
2814         of the animated properties have to be detached from the items in the list
2815         before it's deleted.
2816
2817         * svg/SVGAnimateElementBase.cpp:
2818         (WebCore::SVGAnimateElementBase::clearAnimatedType):
2819
2820 2018-03-28  Ross Kirsling  <ross.kirsling@sony.com>
2821
2822         MSVC __forceinline slows down JSC release build fivefold after r229391
2823         https://bugs.webkit.org/show_bug.cgi?id=184062
2824
2825         Reviewed by Alex Christensen.
2826
2827         * platform/graphics/FormatConverter.cpp:
2828         Factor ALWAYS_INLINE_EXCEPT_MSVC out to WTF.
2829
2830 2018-03-28  Zalan Bujtas  <zalan@apple.com>
2831
2832         Make it possible to override the screen size
2833         https://bugs.webkit.org/show_bug.cgi?id=184111
2834         <rdar://problem/38972181>
2835
2836         Reviewed by Tim Horton.
2837
2838         We just call screenSize() atm.
2839
2840         * page/Chrome.cpp:
2841         (WebCore::Chrome::overrideScreenSize const):
2842         * page/Chrome.h:
2843         * page/ChromeClient.h:
2844         * platform/HostWindow.h:
2845         * platform/PlatformScreen.h:
2846         * platform/ios/PlatformScreenIOS.mm:
2847         (WebCore::screenRect):
2848         (WebCore::overrideScreenSize):
2849
2850 2018-03-28  Timothy Hatcher  <timothy@apple.com>
2851
2852         Include the 'text' color keyword as a system color.
2853
2854         https://bugs.webkit.org/show_bug.cgi?id=184113
2855         rdar://problem/38779267
2856
2857         Reviewed by Tim Horton.
2858
2859         * css/StyleColor.cpp:
2860         (WebCore::StyleColor::isColorKeyword): Don't check CSSValueMenu, it is a system color and is included.
2861         (WebCore::StyleColor::isSystemColor): Include CSSValueText. Check CSSValueWebkitFocusRingColor in the range,
2862         since it is immediately after CSSValueAppleSystemYellow.
2863
2864 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2865
2866         [iOS] Multiple select appearance doesn't update when selecting or deselecting rows in the picker view
2867         https://bugs.webkit.org/show_bug.cgi?id=184110
2868         <rdar://problem/38796648>
2869
2870         Reviewed by Tim Horton.
2871
2872         HTMLSelectElement::optionSelectedByUser is invoked upon user interaction with a select menu. This currently
2873         takes two separate codepaths, depending on whether or not the menu list appearance is being used to render the
2874         select. If a menu list appearance is used, we call selectOption(), which updates validity, updates the element
2875         renderer, and then dispatches a `change` event if needed.
2876
2877         However, if updateSelectedState() is used, we only update form validity and then dispatch the `change` event
2878         without updating the renderer, leaving it stale.
2879
2880         Test: fast/forms/ios/ipad/multiple-select-updates-renderer.html
2881
2882         * html/HTMLSelectElement.cpp:
2883         (WebCore::HTMLSelectElement::optionSelectedByUser):
2884
2885         Update the renderer after updating the DOM to reflect the selected option.
2886
2887 2018-03-28  Daniel Bates  <dabates@apple.com>
2888
2889         Substitute "strong password confirmation auto fill" for "strong confirmation password auto fill"
2890         <rdar://problem/36518856>
2891
2892         * English.lproj/Localizable.strings:
2893         * platform/LocalizedStrings.cpp:
2894         (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
2895
2896 2018-03-28  Daniel Bates  <dabates@apple.com>
2897
2898         WebSocket cookie incorrectly stored
2899         https://bugs.webkit.org/show_bug.cgi?id=184100
2900         <rdar://problem/37928715>
2901
2902         Reviewed by Brent Fulgham.
2903
2904         A cookie received in a WebSocket response should be stored with respect to the
2905         origin of the WebSocket server in order for it to be sent in a subsequent request.
2906
2907         Also removed a FIXME about implementing support for the long since
2908         deprecated Set-Cookie2 header.
2909
2910         Test: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html
2911
2912         * Modules/websockets/WebSocketChannel.cpp:
2913         (WebCore::WebSocketChannel::processBuffer):
2914         * Modules/websockets/WebSocketHandshake.h:
2915
2916 2018-03-28  Chris Dumez  <cdumez@apple.com>
2917
2918         Do process swap when opening a cross-origin URL via window.open(url, '_blank', 'noopener')
2919         https://bugs.webkit.org/show_bug.cgi?id=183962
2920         <rdar://problem/38817833>
2921
2922         Reviewed by Brady Eidson.
2923
2924         Pass extra bits of information to the UIProcess via NavigationAction:
2925         - Is it a cross origin navigation caused by window.open()
2926         - Does the navigated frame have an opener
2927
2928         This information is useful to determine on UIProcess side if we want
2929         to swap WebProcess.
2930
2931         * loader/FrameLoadRequest.h:
2932         (WebCore::FrameLoadRequest::setIsCrossOriginWindowOpenNavigation):
2933         (WebCore::FrameLoadRequest::isCrossOriginWindowOpenNavigation const):
2934         * loader/FrameLoader.cpp:
2935         (WebCore::FrameLoader::loadURL):
2936         * loader/NavigationAction.h:
2937         (WebCore::NavigationAction::setIsCrossOriginWindowOpenNavigation):
2938         (WebCore::NavigationAction::isCrossOriginWindowOpenNavigation const):
2939         (WebCore::NavigationAction::setOpener):
2940         (WebCore::NavigationAction::opener const):
2941         * page/DOMWindow.cpp:
2942         (WebCore::DOMWindow::createWindow):
2943
2944 2018-03-28  Chris Dumez  <cdumez@apple.com>
2945
2946         Thread safety issue in IDBFactory' shouldThrowSecurityException()
2947         https://bugs.webkit.org/show_bug.cgi?id=184064
2948
2949         Reviewed by Ryosuke Niwa.
2950
2951         shouldThrowSecurityException() gets called on a non-main thread but
2952         it ended up using the SchemeRegistry via SecurityOrigin::canAccessDatabase()
2953         which calls SecurityOrigin::isLocal().
2954
2955         Since using the SchemeRegistry from the background thread is not safe
2956         (we recently added locks which we're trying to remove), and since SecurityOrigin
2957         methods are often called from background threads, this patch make SecurityOrigin::isLocal()
2958         safe to call from a background thread. To achieve this, we now query the SchemeRegistry
2959         in the SecurityOrigin constructor instead as SecurityOrigin objects are expected to be
2960         constructed on the main thread.
2961
2962         * page/SecurityOrigin.cpp:
2963         (WebCore::SecurityOrigin::SecurityOrigin):
2964         (WebCore::SecurityOrigin::isLocal const): Deleted.
2965         * page/SecurityOrigin.h:
2966         (WebCore::SecurityOrigin::isLocal const):
2967
2968 2018-03-28  Ryan Haddad  <ryanhaddad@apple.com>
2969
2970         Unreviewed, rolling out r230033.
2971
2972         The LayoutTests modified in this change fail an assertion on
2973         WK1.
2974
2975         Reverted changeset:
2976
2977         "[Web Animations] Implement more CSSPropertyBlendingClient
2978         methods"
2979         https://bugs.webkit.org/show_bug.cgi?id=184077
2980         https://trac.webkit.org/changeset/230033
2981
2982 2018-03-28  Chris Dumez  <cdumez@apple.com>
2983
2984         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread
2985         https://bugs.webkit.org/show_bug.cgi?id=184068
2986
2987         Reviewed by Youenn Fablet.
2988
2989         WebSocket::didReceiveMessage() may construct a SecurityOrigin object on a non-main thread,
2990         which is not safe. We now use SecurityOriginData since we only need an origin String and
2991         it is safe to construct a SecurityOriginData on any thread.
2992
2993         * Modules/websockets/WebSocket.cpp:
2994         (WebCore::WebSocket::didReceiveMessage):
2995
2996 2018-03-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2997
2998         [Extra zoom mode] Make boosted text autosizing values switchable at runtime
2999         https://bugs.webkit.org/show_bug.cgi?id=184092
3000         <rdar://problem/38939917>
3001
3002         Reviewed by Tim Horton.
3003
3004         In r228697, we introduced a new set of boosted text autosizing constants tuned for extra zoom mode, which are
3005         currently hard-coded as default values in SettingsBase. However, we've since identified cases where clients may
3006         want to opt in or out of boosted text autosizing values and just use the existing values.
3007
3008         This replaces settings to adjust text autosizing constants with a flag to enable or disable boosted text
3009         autosizing; when changed, we update all three text autosizing parameters to their default or boosted values, and
3010         then trigger style recalculation.
3011
3012         Test: TextAutosizingBoost.ChangeAutosizingBoostAtRuntime
3013
3014         * page/Settings.yaml:
3015         * page/SettingsBase.cpp:
3016         (WebCore::SettingsBase::shouldEnableTextAutosizingBoostChanged):
3017         (WebCore::SettingsBase::defaultOneLineTextMultiplierCoefficient): Deleted.
3018         (WebCore::SettingsBase::defaultMultiLineTextMultiplierCoefficient): Deleted.
3019         (WebCore::SettingsBase::defaultMaxTextAutosizingScaleIncrease): Deleted.
3020
3021         Changed these to constant values instead of helper functions, and also introduced boosted text autosizing
3022         constants for use in extra zoom mode.
3023
3024         * page/SettingsBase.h:
3025         (WebCore::SettingsBase::oneLineTextMultiplierCoefficient const):
3026         (WebCore::SettingsBase::multiLineTextMultiplierCoefficient const):
3027         (WebCore::SettingsBase::maxTextAutosizingScaleIncrease const):
3028         * rendering/RenderThemeIOS.mm:
3029         (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
3030
3031         Tweak the stylesheet to make `-webkit-text-size-adjust: auto` overridable by web content. Adding the !important
3032         is breaking many websites that positioned text such that it is positioned within layout viewport bounds without
3033         text autosizing.
3034
3035 2018-03-28  Brent Fulgham  <bfulgham@apple.com>
3036
3037         Avoid uninitialized mach ports
3038         https://bugs.webkit.org/show_bug.cgi?id=184090
3039         <rdar://problem/37261129>
3040
3041         Reviewed by Chris Dumez.
3042
3043         It is possible for mach_port_allocate to return an error, but we rarely check its return value. The value
3044         of the argument passed to mach_port_allocate is not guaranteed to be valid when it returns an error, so
3045         there is a potential for us to try to use invalid ports.
3046
3047         We should always check return values, and ensure that the mach port variables we seek to initialize are
3048         kept in a valid state.
3049
3050         No new tests, no Web-facing behavior change.
3051
3052         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3053         (WebCore::attachToAppleGraphicsControl): Initialize masterPort to a default value.
3054
3055 2018-03-28  Antoine Quint  <graouts@apple.com>
3056
3057         [Web Animations] Implement more CSSPropertyBlendingClient methods
3058         https://bugs.webkit.org/show_bug.cgi?id=184077
3059
3060         Reviewed by Dean Jackson.
3061
3062         We only had stubs for several of the CSSPropertyBlendingClient methods and thus always implied that we
3063         were animating non-matching transform, filter and backdrop-filter properties. We now implement those using
3064         the same code used in KeyframeAnimation. This allows for 31 new tests to opt into the CSS Animations and
3065         CSS Transitions as Web Animations feature.
3066
3067         * animation/KeyframeEffectReadOnly.cpp:
3068         (WebCore::KeyframeEffectReadOnly::copyPropertiesFromSource):
3069         (WebCore::KeyframeEffectReadOnly::updateBlendingKeyframes):
3070         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
3071         (WebCore::KeyframeEffectReadOnly::checkForMatchingTransformFunctionLists):
3072         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
3073         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
3074         (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes):
3075         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes):
3076         * animation/KeyframeEffectReadOnly.h:
3077
3078 2018-03-28  Antoine Quint  <graouts@apple.com>
3079
3080         [Web Animations] Comparing two matching FramesTimingFunction objects fails
3081         https://bugs.webkit.org/show_bug.cgi?id=184078
3082
3083         Reviewed by Jon Lee.
3084
3085         Fix a stupid mistake in the == operator for FramesTimingFunction. Without a correct check, we would mistakenly interrupt and
3086         restart any transition with a frames() timing function when we check that the Animation objects are similar.
3087
3088         * platform/animation/TimingFunction.h:
3089
3090 2018-03-28  Miguel Gomez  <magomez@igalia.com>
3091
3092         [GTK][WPE] Remove UpdateAtlas
3093         https://bugs.webkit.org/show_bug.cgi?id=184042
3094
3095         Reviewed by Žan Doberšek.
3096
3097         Remove UpdateAtlas and AreaAllocator classes. Instead of using UpdateAtlas as a cache
3098         of buffers to render tiles with cairo, allocate a new buffer for each tile instead.
3099
3100         Covered by existent tests.
3101
3102         * loader/EmptyClients.h:
3103         * page/ChromeClient.h:
3104         * platform/TextureMapper.cmake:
3105         * platform/graphics/texmap/coordinated/AreaAllocator.cpp: Removed.
3106         * platform/graphics/texmap/coordinated/AreaAllocator.h: Removed.
3107         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3108         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
3109         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3110         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3111         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
3112         (): Deleted.
3113         * platform/graphics/texmap/coordinated/UpdateAtlas.cpp: Removed.
3114         * platform/graphics/texmap/coordinated/UpdateAtlas.h: Removed.
3115         * testing/Internals.cpp:
3116         (WebCore::Internals::resetToConsistentState):
3117
3118 2018-03-27  Michael Catanzaro  <mcatanzaro@igalia.com>
3119
3120         Unreviewed, rolling out r230008.
3121
3122         Lots of HTTP test failures
3123
3124         Reverted changeset:
3125
3126         "Remove unused libsoup ResourceHandle implementation"
3127         https://bugs.webkit.org/show_bug.cgi?id=184048
3128         https://trac.webkit.org/changeset/230008
3129
3130 2018-03-27  Chris Dumez  <cdumez@apple.com>
3131
3132         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
3133         https://bugs.webkit.org/show_bug.cgi?id=184029
3134
3135         Reviewed by Youenn Fablet.
3136
3137         Make it possible to call ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() from non-main threads
3138         by having it use SecurityOriginData (which is safe to construct on non-main threads) instead of
3139         SecurityOrigin (which isn't).
3140
3141         ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() is already called from non-main thread in
3142         FetchLoader, XHR and WebSocket when used in workers. This wasn't safe.
3143
3144         * loader/DocumentWriter.cpp:
3145         (WebCore::DocumentWriter::begin):
3146         * page/csp/ContentSecurityPolicy.cpp:
3147         (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
3148         (WebCore::ContentSecurityPolicy::setUpgradeInsecureRequests):
3149         (WebCore::ContentSecurityPolicy::takeNavigationRequestsToUpgrade):
3150         (WebCore::ContentSecurityPolicy::setInsecureNavigationRequestsToUpgrade):
3151         * page/csp/ContentSecurityPolicy.h:
3152
3153 2018-03-27  Daniel Bates  <dabates@apple.com>
3154
3155         Attempt to fix media control layout tests after <https://trac.webkit.org/changeset/230006/>
3156         (https://bugs.webkit.org/show_bug.cgi?id=179983)
3157
3158         Exempt elements in user agent shadow DOM from having to perform a potentially CORS-
3159         enabled fetch for a mask image to try to fix the following tests from timing out:
3160             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-inline.html
3161             media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html
3162
3163         * style/StylePendingResources.cpp:
3164         (WebCore::Style::loadPendingImage):
3165
3166 2018-03-27  Per Arne Vollan  <pvollan@apple.com>
3167
3168         The layout test fast/canvas/webgl/read-pixels-test.html is timing out.
3169         https://bugs.webkit.org/show_bug.cgi?id=183923
3170         <rdar://problem/38756869>
3171
3172         Reviewed by Brent Fulgham.
3173
3174         The test is timing out when we do not interact directly with the WindowServer, causing
3175         OpenGL to fall back to software rendering. In this mode, any call to CGLChoosePixelFormat
3176         requesting an accelerated pixel format will fail because it cannot determine which GPU is
3177         connected to the display.
3178
3179         OpenGL treats all GPUs as if they were offline when used in a process (like the WebContent
3180         process) that does not directly control the display.
3181
3182         We can get correct behavior if we tell OpenGL which GPU is currently connected to the
3183         display, and if we instruct CGLChoosePixelFormat to create an offline renderer pixel format
3184         by including the 'kCGLPFAAllowOfflineRenderers' flag in its arguments.
3185
3186         We can use CGLSetVirtualScreen with an OpenGL display mask that tells the OpenGL framework
3187         which GPU it should use.
3188
3189         See https://developer.apple.com/library/content/technotes/tn2229/_index.html#//apple_ref/doc/uid/DTS40008924-CH1-SUBSECTION7
3190         for details on how the virtual screen is found from the OpenGL display mask.
3191
3192         No new tests, covered by existing tests.
3193
3194         * WebCore.xcodeproj/project.pbxproj:
3195         * platform/graphics/GraphicsContext3D.h:
3196         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
3197         (WebCore::setPixelFormat):
3198         (WebCore::identifyAndSetCurrentGPU):
3199         (WebCore::GraphicsContext3D::GraphicsContext3D):
3200         (WebCore::GraphicsContext3D::setOpenGLDisplayMask):
3201         (WebCore::GraphicsContext3D::allowOfflineRenderers):
3202
3203 2018-03-27  Jiewen Tan  <jiewen_tan@apple.com>
3204
3205         [WebAuthN] Implement authenticatorGetAssertion
3206         https://bugs.webkit.org/show_bug.cgi?id=183881
3207         <rdar://problem/37258628>
3208
3209         Reviewed by Brent Fulgham.
3210
3211         This patch does the following few things:
3212         1) It implements the spec: https://www.w3.org/TR/webauthn/#op-get-assertion as of 5 December 2017.
3213         2) It tweaks encoding/decoding of PublicKeyCredentialRequestOptions such that options can be passed
3214         between UI and Web processes.
3215         3) It refines the way how LocalAuthenticator::makeCredential find intersection between
3216         excludeCredentialDescriptorList and existing credentials in the authenticator, such that it is faster.
3217         Basically, it takes the CredentialID from the list and treat it as an ASCII string and put it into a
3218         HashSet<String>. It should not matter if a duplicated CredentialID is added. If the hash set is not
3219         empty, the algorithm then queries Keychain for all CredentialIDs related to the current RP ID once.
3220         For every queried CredentialID, the algorithm then treats it as an ASCII string as well and look for
3221         a match in the hash set to produce the intersetction. The new way is also employed in
3222         LocalAuthenticator::getAssertion as well.
3223         4) It abstracts the way to produce authData and thus reorders a bit of code in
3224         LocalAuthenticator::makeCredential.
3225
3226         Covered by API tests.
3227
3228         * Modules/webauthn/AuthenticatorManager.cpp:
3229         (WebCore::AuthenticatorManager::create const):
3230         (WebCore::AuthenticatorManager::discoverFromExternalSource const):
3231         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
3232         * Modules/webauthn/PublicKeyCredentialRequestOptions.h:
3233         (WebCore::PublicKeyCredentialRequestOptions::encode const):
3234         (WebCore::PublicKeyCredentialRequestOptions::decode):
3235         * Modules/webauthn/cocoa/LocalAuthenticator.h:
3236         * Modules/webauthn/cocoa/LocalAuthenticator.mm:
3237         (WebCore::LocalAuthenticatorInternal::buildAuthData):
3238         (WebCore::LocalAuthenticatorInternal::produceHashSet):
3239         (WebCore::LocalAuthenticator::makeCredential):
3240         (WebCore::LocalAuthenticator::getAssertion):
3241         (WebCore::LocalAuthenticator::issueClientCertificate const):
3242         * WebCore.xcodeproj/project.pbxproj:
3243
3244 2018-03-27  Chris Dumez  <cdumez@apple.com>
3245
3246         Avoid constructing SecurityOrigin objects from non-main threads
3247         https://bugs.webkit.org/show_bug.cgi?id=184024
3248
3249         Reviewed by Youenn Fablet.
3250
3251         Avoid constructing SecurityOrigin objects from non-main threads as much as possible
3252         as it is not safe. This patch gets rid of most offending cases but not all of them
3253         yet, which is why I haven't added a ASSERT(isMainThread()) to the SecurityOrigin
3254         constructor yet.
3255
3256         For example, ContentSecurityPolicy::upgradeInsecureRequestIfNeeded() currently
3257         gets called from non-main threads and construct a SecurityOrigin. Fixing this
3258         will require some refactoring that would have made this patch much larger.
3259
3260         * loader/DocumentLoader.cpp:
3261         (WebCore::DocumentLoader::matchRegistration):
3262         * page/EventSource.cpp:
3263         (WebCore::EventSource::didReceiveResponse):
3264         * page/SecurityOrigin.cpp:
3265         (WebCore::SecurityOrigin::SecurityOrigin):
3266         * page/SecurityOrigin.h:
3267         (WebCore::SecurityOrigin::isPotentiallyTrustworthy const):
3268         * testing/Internals.cpp:
3269         (WebCore::Internals::hasServiceWorkerRegistration):
3270         * workers/DedicatedWorkerGlobalScope.cpp:
3271         (WebCore::DedicatedWorkerGlobalScope::create):
3272         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
3273         * workers/DedicatedWorkerGlobalScope.h:
3274         * workers/DedicatedWorkerThread.cpp:
3275         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
3276         * workers/DedicatedWorkerThread.h:
3277         * workers/WorkerGlobalScope.cpp:
3278         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3279         * workers/WorkerGlobalScope.h:
3280         * workers/WorkerLocation.cpp:
3281         (WebCore::WorkerLocation::origin const):
3282         * workers/WorkerThread.cpp:
3283         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
3284         (WebCore::WorkerThread::workerThread):
3285         * workers/WorkerThread.h:
3286         * workers/service/SWClientConnection.h:
3287         * workers/service/ServiceWorkerContainer.cpp:
3288         (WebCore::ServiceWorkerContainer::getRegistration):
3289         (WebCore::ServiceWorkerContainer::getRegistrations):
3290         * workers/service/ServiceWorkerGlobalScope.cpp:
3291         (WebCore::ServiceWorkerGlobalScope::create):
3292         (WebCore::ServiceWorkerGlobalScope::ServiceWorkerGlobalScope):
3293         * workers/service/ServiceWorkerGlobalScope.h:
3294         * workers/service/ServiceWorkerProvider.cpp:
3295         (WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
3296         * workers/service/ServiceWorkerProvider.h:
3297         * workers/service/context/ServiceWorkerThread.cpp:
3298         (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
3299         (WebCore::fireMessageEvent):
3300         (WebCore::ServiceWorkerThread::postMessageToServiceWorker):
3301         * workers/service/context/ServiceWorkerThread.h:
3302
3303 2018-03-27  Alex Christensen  <achristensen@webkit.org>
3304
3305         Remove unused libsoup ResourceHandle implementation
3306         https://bugs.webkit.org/show_bug.cgi?id=184048
3307
3308         Reviewed by Michael Catanzaro.
3309
3310         This code is unused since r228901 so let's remove it!
3311
3312         * platform/network/ResourceHandle.h:
3313         * platform/network/ResourceHandleInternal.h:
3314         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
3315         * platform/network/soup/ResourceHandleSoup.cpp:
3316         (WebCore::ResourceHandle::~ResourceHandle):
3317         (WebCore::ResourceHandleInternal::soupSession):
3318         (WebCore::ResourceHandle::cancelledOrClientless):
3319         (WebCore::ResourceHandle::ensureReadBuffer):
3320         (WebCore::ResourceHandle::currentStreamPosition const):
3321         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
3322         (WebCore::ResourceHandle::didStartRequest):
3323         (WebCore::ResourceHandle::start):
3324         (WebCore::ResourceHandle::releaseForDownload):
3325         (WebCore::ResourceHandle::sendPendingRequest):
3326         (WebCore::ResourceHandle::cancel):
3327         (WebCore::ResourceHandle::shouldUseCredentialStorage):
3328         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
3329         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3330         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3331         (WebCore::ResourceHandle::receivedCredential):
3332         (WebCore::ResourceHandle::receivedCancellation):
3333         (WebCore::ResourceHandle::receivedChallengeRejection):
3334         (WebCore::ResourceHandle::platformSetDefersLoading):
3335         (WebCore::sessionFromContext): Deleted.
3336         (WebCore::ResourceHandle::create): Deleted.
3337         (WebCore::ResourceHandle::ResourceHandle): Deleted.
3338         (WebCore::isAuthenticationFailureStatusCode): Deleted.
3339         (WebCore::tlsErrorsChangedCallback): Deleted.
3340         (WebCore::gotHeadersCallback): Deleted.
3341         (WebCore::applyAuthenticationToRequest): Deleted.
3342         (WebCore::restartedCallback): Deleted.
3343         (WebCore::shouldRedirect): Deleted.
3344         (WebCore::shouldRedirectAsGET): Deleted.
3345         (WebCore::continueAfterWillSendRequest): Deleted.
3346         (WebCore::doRedirect): Deleted.
3347         (WebCore::redirectSkipCallback): Deleted.
3348         (WebCore::wroteBodyDataCallback): Deleted.
3349         (WebCore::cleanupSoupRequestOperation): Deleted.
3350         (WebCore::nextMultipartResponsePartCallback): Deleted.
3351         (WebCore::sendRequestCallback): Deleted.
3352         (WebCore::continueAfterDidReceiveResponse): Deleted.
3353         (WebCore::startingCallback): Deleted.
3354         (WebCore::networkEventCallback): Deleted.
3355         (WebCore::createSoupMessageForHandleAndRequest): Deleted.
3356         (WebCore::createSoupRequestAndMessageForHandle): Deleted.
3357         (WebCore::ResourceHandle::timeoutFired): Deleted.
3358         (WebCore::waitingToSendRequest): Deleted.
3359         (WebCore::readCallback): Deleted.
3360
3361 2018-03-27  Chris Dumez  <cdumez@apple.com>
3362
3363         Move online state detection from the WebProcess to the NetworkProcess
3364         https://bugs.webkit.org/show_bug.cgi?id=183989
3365         <rdar://problem/37093299>
3366
3367         Reviewed by Youenn Fablet.
3368
3369         Move online state detection from the WebProcess to the NetworkProcess. This avoid executing the same (expensive) code in
3370         EACH web process whenever a network interface's state changes. Now, the Network Process monitors network interfaces
3371         and determines the online state whenever an interface's state changes. If the onLine state changes, it notifies all
3372         its connected WebProcesses via IPC.
3373
3374         * inspector/agents/InspectorApplicationCacheAgent.cpp:
3375         (WebCore::InspectorApplicationCacheAgent::networkStateChanged):
3376         * loader/LoaderStrategy.h:
3377         * page/Navigator.cpp:
3378         (WebCore::Navigator::onLine const):
3379         * page/Page.cpp:
3380         * platform/network/NetworkStateNotifier.h:
3381         * workers/Worker.cpp:
3382         (WebCore::Worker::Worker):
3383         (WebCore::Worker::notifyFinished):
3384         * workers/service/context/ServiceWorkerThread.cpp:
3385         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
3386         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3387         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
3388
3389 2018-03-27  Daniel Bates  <dabates@apple.com>
3390
3391         CSS mask images should be retrieved using potentially CORS-enabled fetch
3392         https://bugs.webkit.org/show_bug.cgi?id=179983
3393         <rdar://problem/35678149>
3394
3395         Reviewed by Brent Fulgham.
3396
3397         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor’s Draft, 23 December 2017)
3398         we should fetch CSS mask images using a potentially CORS-enabled fetch.
3399
3400         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
3401         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
3402         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
3403         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
3404         closely align with the behavior in the spec.
3405
3406         Test: http/tests/security/css-mask-image.html
3407
3408         * page/Settings.yaml: Add a setting for toggle "Anonymous" mode fetching of mask images (defaults: true).
3409         We need this setting to avoid breaking the developer convenience feature that some modern media controls
3410         layout tests employ to load assets from the filesystem as opposed to using the hardcoded data URLs baked
3411         into the WebKit binary.
3412         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
3413         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
3414         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
3415         (WebCore::Style::loadPendingImage): Ditto.
3416         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
3417         a mask image or shape-outside image.
3418
3419 2018-03-27  Zalan Bujtas  <zalan@a