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