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