[Extra zoom mode] Fix some localizable strings after r229878
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-03-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         [Extra zoom mode] Fix some localizable strings after r229878
4         https://bugs.webkit.org/show_bug.cgi?id=183963
5
6         Reviewed by Tim Horton.
7
8         The WEB_UI_STRING macro was incorrectly used for certain localized strings pertaining to extra zoom mode. To
9         correct this, make the "Done" string use WEB_UI_STRING with actual UI-facing text; since day, year and month
10         labels in the date picker are less generalizable to other UI, leave these as unique keys, but change them to
11         use WEB_UI_STRING_KEY instead.
12
13         Additionally, remove now-unused localizable strings for the text input view controller.
14
15         * English.lproj/Localizable.strings:
16         * platform/LocalizedStrings.cpp:
17         (WebCore::formControlDoneButtonTitle):
18         (WebCore::datePickerDayLabelTitle):
19         (WebCore::datePickerMonthLabelTitle):
20         (WebCore::datePickerYearLabelTitle):
21
22 2018-03-23  Chris Dumez  <cdumez@apple.com>
23
24         NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
25         https://bugs.webkit.org/show_bug.cgi?id=183760
26         <rdar://problem/37093299>
27
28         Reviewed by Ryosuke Niwa.
29
30         Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
31         SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
32         expects its key parameter to be a regular expression and it can match several
33         keys. It is also unnecessary in our case since we already have an exact key.
34         We now call the more efficient SCDynamicStoreCopyValue() instead, which is
35         the right thing to call when we have an exact key.
36
37         This change was suggested by the SC team.
38
39         This was tested manually as there is no easy way to write an automated test
40         for this.
41
42         In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
43         to avoid calling it once per WebProcess.
44
45         * platform/network/mac/NetworkStateNotifierMac.cpp:
46         (WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
47
48 2018-03-23  Daniel Bates  <dabates@apple.com>
49
50         Unreviewed, rolling out r229868.
51
52         Caused media controls tests to timeout. Will investigate
53         offline.
54
55         Reverted changeset:
56
57         "CSS mask images should be retrieved using potentially CORS-
58         enabled fetch"
59         https://bugs.webkit.org/show_bug.cgi?id=179983
60         https://trac.webkit.org/changeset/229868
61
62 2018-03-23  Mark Lam  <mark.lam@apple.com>
63
64         Add pointer profiling hooks to the CSS JIT.
65         https://bugs.webkit.org/show_bug.cgi?id=183947
66         <rdar://problem/38803593>
67
68         Reviewed by JF Bastien.
69
70         No new tests needed.  Covered by existing tests.
71
72         * bindings/scripts/CodeGeneratorJS.pm:
73         (GenerateImplementation):
74         - Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().
75
76         * bindings/scripts/test/JS/JSInterfaceName.cpp:
77         (WebCore::toJSNewlyCreated):
78         * bindings/scripts/test/JS/JSMapLike.cpp:
79         (WebCore::toJSNewlyCreated):
80         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
81         (WebCore::toJSNewlyCreated):
82         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
83         (WebCore::toJSNewlyCreated):
84         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
85         (WebCore::toJSNewlyCreated):
86         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
87         (WebCore::toJSNewlyCreated):
88         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
89         (WebCore::toJSNewlyCreated):
90         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
91         (WebCore::toJSNewlyCreated):
92         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
93         (WebCore::toJSNewlyCreated):
94         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
95         (WebCore::toJSNewlyCreated):
96         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
97         (WebCore::toJSNewlyCreated):
98         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
99         (WebCore::toJSNewlyCreated):
100         * bindings/scripts/test/JS/JSTestException.cpp:
101         (WebCore::toJSNewlyCreated):
102         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
103         (WebCore::toJSNewlyCreated):
104         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
105         (WebCore::toJSNewlyCreated):
106         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
107         (WebCore::toJSNewlyCreated):
108         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
109         (WebCore::toJSNewlyCreated):
110         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
111         (WebCore::toJSNewlyCreated):
112         * bindings/scripts/test/JS/JSTestIterable.cpp:
113         (WebCore::toJSNewlyCreated):
114         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
115         (WebCore::toJSNewlyCreated):
116         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
117         (WebCore::toJSNewlyCreated):
118         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
119         (WebCore::toJSNewlyCreated):
120         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
121         (WebCore::toJSNewlyCreated):
122         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
123         (WebCore::toJSNewlyCreated):
124         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
125         (WebCore::toJSNewlyCreated):
126         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
127         (WebCore::toJSNewlyCreated):
128         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
129         (WebCore::toJSNewlyCreated):
130         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
131         (WebCore::toJSNewlyCreated):
132         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
133         (WebCore::toJSNewlyCreated):
134         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
135         (WebCore::toJSNewlyCreated):
136         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
137         (WebCore::toJSNewlyCreated):
138         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
139         (WebCore::toJSNewlyCreated):
140         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
141         (WebCore::toJSNewlyCreated):
142         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
143         (WebCore::toJSNewlyCreated):
144         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
145         (WebCore::toJSNewlyCreated):
146         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
147         (WebCore::toJSNewlyCreated):
148         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
149         (WebCore::toJSNewlyCreated):
150         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
151         (WebCore::toJSNewlyCreated):
152         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
153         (WebCore::toJSNewlyCreated):
154         * bindings/scripts/test/JS/JSTestNode.cpp:
155         (WebCore::toJSNewlyCreated):
156         * bindings/scripts/test/JS/JSTestObj.cpp:
157         (WebCore::toJSNewlyCreated):
158         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
159         (WebCore::toJSNewlyCreated):
160         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
161         (WebCore::toJSNewlyCreated):
162         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
163         (WebCore::toJSNewlyCreated):
164         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
165         (WebCore::toJSNewlyCreated):
166         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
167         (WebCore::toJSNewlyCreated):
168         * bindings/scripts/test/JS/JSTestSerialization.cpp:
169         (WebCore::toJSNewlyCreated):
170         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
171         (WebCore::toJSNewlyCreated):
172         * bindings/scripts/test/JS/JSTestStringifier.cpp:
173         (WebCore::toJSNewlyCreated):
174         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
175         (WebCore::toJSNewlyCreated):
176         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
177         (WebCore::toJSNewlyCreated):
178         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
179         (WebCore::toJSNewlyCreated):
180         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
181         (WebCore::toJSNewlyCreated):
182         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
183         (WebCore::toJSNewlyCreated):
184         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
185         (WebCore::toJSNewlyCreated):
186         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
187         (WebCore::toJSNewlyCreated):
188         * css/ElementRuleCollector.cpp:
189         (WebCore::ElementRuleCollector::ruleMatches):
190         * cssjit/SelectorCompiler.cpp:
191         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
192         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
193         * cssjit/SelectorCompiler.h:
194         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
195         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
196         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
197         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
198         * dom/SelectorQuery.cpp:
199         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
200         (WebCore::SelectorDataList::execute const):
201
202 2018-03-23  Sihui Liu  <sihui_liu@apple.com>
203
204         Local storage getItem() for an empty string returned UNDEFINED value.
205         https://bugs.webkit.org/show_bug.cgi?id=69138
206         <rdar://problem/13410974>
207
208         Reviewed by Brady Eidson.
209
210         * platform/sql/SQLiteStatement.cpp:
211         (WebCore::SQLiteStatement::getColumnBlobAsString):
212
213 2018-03-23  Chris Dumez  <cdumez@apple.com>
214
215         Promptly terminate service worker processes when they are no longer needed
216         https://bugs.webkit.org/show_bug.cgi?id=183873
217         <rdar://problem/38676995>
218
219         Reviewed by Youenn Fablet.
220
221         The StorageProcess now keeps track of service worker clients for each security
222         origin. When there is no longer any clients for a given security origin, the
223         StorageProcess asks the service worker process for the given origin to terminate
224         and severs its connection to it.
225
226         Change is covered by API test.
227
228         * workers/service/server/SWServer.cpp:
229         (WebCore::SWServer::markAllWorkersForOriginAsTerminated):
230         Pass the security origin since this is called when a service worker process
231         crashes. When a service worker process for origin A crashes, we only want
232         to mark service workers in origin A as terminated, not ALL of them.
233
234         (WebCore::SWServer::registerServiceWorkerClient):
235         (WebCore::SWServer::unregisterServiceWorkerClient):
236         (WebCore::SWServer::needsServerToContextConnectionForOrigin const):
237         Tweak logic so that we only relaunch a service worker process if we still
238         have clients for its security origin.
239
240         * workers/service/server/SWServer.h:
241         (WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
242         Add a way to disable the service worker termination delay to facilitate
243         testing.
244
245         * workers/service/server/SWServerToContextConnection.h:
246
247 2018-03-23  Brady Eidson  <beidson@apple.com>
248
249         Go to back/forward list items after a process-swapped navigation.
250         <rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920
251
252         Reviewed by Andy Estes.
253
254         Covered by new API test.
255
256         Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
257         do a policy check or not.
258
259         * WebCore.xcodeproj/project.pbxproj:
260
261         * history/BackForwardController.cpp:
262         (WebCore::BackForwardController::goBackOrForward):
263         (WebCore::BackForwardController::goBack):
264         (WebCore::BackForwardController::goForward):
265
266         * history/HistoryItem.cpp:
267         (WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
268           This was a long standing bug that made it difficult to effectively test this change.
269
270         * loader/FrameLoader.cpp:
271         (WebCore::FrameLoader::loadURLIntoChildFrame):
272         (WebCore::FrameLoader::loadDifferentDocumentItem):
273         (WebCore::FrameLoader::loadItem):
274         (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
275         * loader/FrameLoader.h:
276         * loader/FrameLoaderTypes.h:
277
278         * loader/HistoryController.cpp:
279         (WebCore::HistoryController::goToItem):
280         (WebCore::HistoryController::setDefersLoading):
281         (WebCore::HistoryController::recursiveGoToItem):
282         * loader/HistoryController.h:
283
284         * loader/NavigationPolicyCheck.h:
285
286         * page/Page.cpp:
287         (WebCore::Page::goToItem):
288         * page/Page.h:
289
290 2018-03-23  John Wilander  <wilander@apple.com>
291
292         Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
293         https://bugs.webkit.org/show_bug.cgi?id=183950
294         <rdar://problem/38806275>
295
296         Reviewed by Brent Fulgham.
297
298         * loader/ResourceLoadStatistics.cpp:
299         (WebCore::ResourceLoadStatistics::decode):
300             Now isVeryPrevalentResource is decoded to the correct field.
301
302 2018-03-23  Youenn Fablet  <youenn@apple.com>
303
304         WebProcessPool should not ask to register all clients for each service worker process creation
305         https://bugs.webkit.org/show_bug.cgi?id=183941
306
307         Reviewed by Chris Dumez.
308
309         Covered by existing unit tests.
310         Register all Documents of a process no matter its session ID when asked to.
311         Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
312         by calling setMayHaveRegisteredServiceWorkers().
313         This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
314         will actually register all its future clients.
315
316         Add some assertions to ensure that a client is not registered twice.
317
318         * workers/service/ServiceWorkerProvider.cpp:
319         (WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
320         * workers/service/ServiceWorkerProvider.h:
321         * workers/service/server/SWServer.cpp:
322         (WebCore::SWServer::registerServiceWorkerClient):
323
324 2018-03-23  Eric Carlson  <eric.carlson@apple.com>
325
326         HTMLElement factory doesn't need to call MediaPlayer::isAvailable
327         https://bugs.webkit.org/show_bug.cgi?id=183946
328         <rdar://problem/38802687>
329
330         Reviewed by Youenn Fablet.
331
332         Test: media/media-disabled.html
333
334         * dom/make_names.pl:
335         (printConstructorInterior):
336         * page/Settings.yaml:
337         * page/SettingsDefaultValues.h:
338
339 2018-03-23  David Kilzer  <ddkilzer@apple.com>
340
341         Stop using dispatch_set_target_queue()
342         <https://webkit.org/b/183908>
343         <rdar://problem/33553533>
344
345         Reviewed by Daniel Bates.
346
347         No new tests since no change in behavior.
348
349         * platform/mediastream/mac/AVMediaCaptureSource.mm:
350         (WebCore::globaVideoCaptureSerialQueue): Remove use of
351         dispatch_set_target_queue() by changing dispatch_queue_create()
352         to dispatch_queue_create_with_target().
353
354 2018-03-23  Youenn Fablet  <youenn@apple.com>
355
356         Use libwebrtc ObjectiveC H264 encoder and decoder
357         https://bugs.webkit.org/show_bug.cgi?id=183912
358
359         Reviewed by Eric Carlson.
360
361         No observable change of behavior.
362         Made use of libwebrtc WebKit utilities.
363         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
364
365         * Configurations/WebCore.xcconfig:
366         * SourcesCocoa.txt:
367         * WebCore.xcodeproj/project.pbxproj:
368         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
369         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
370         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
371         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
372         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
373         (WebCore::LibWebRTCProviderCocoa::setActive):
374         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
375         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
376         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
377         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
378         * testing/Internals.cpp: Removed commented out include.
379
380 2018-03-23  Youenn Fablet  <youenn@apple.com>
381
382         DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
383         https://bugs.webkit.org/show_bug.cgi?id=183928
384
385         Reviewed by Chris Dumez.
386
387         Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
388                imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html
389
390         In case mode is include, keep sending credentials even after redirection with preflight.
391
392         * loader/DocumentThreadableLoader.cpp:
393         (WebCore::DocumentThreadableLoader::redirectReceived):
394
395 2018-03-23  Tim Horton  <timothy_horton@apple.com>
396
397         Fix the build after r229858
398
399         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
400
401 2018-03-23  Youenn Fablet  <youenn@apple.com>
402
403         Allow fully whitelisted plug-ins to match non HTTP URLs
404         https://bugs.webkit.org/show_bug.cgi?id=183938
405         rdar://problem/38534312
406
407         Reviewed by Chris Dumez.
408
409         Covered by manual testing and unit testing.
410
411         * platform/URL.cpp:
412         (WebCore::URL::isMatchingDomain const):
413
414 2018-03-23  Youenn Fablet  <youenn@apple.com>
415
416         ActiveDOMObject should assert that they are destroyed in the thread they are created
417         https://bugs.webkit.org/show_bug.cgi?id=183671
418
419         Reviewed by Chris Dumez.
420
421         No change of behavior.
422         Moved MessagePort assertion to ActiveDOMObject.
423
424         * dom/ActiveDOMObject.cpp:
425         (WebCore::ActiveDOMObject::~ActiveDOMObject):
426         * dom/ActiveDOMObject.h:
427         * dom/MessagePort.cpp:
428         (WebCore::MessagePort::~MessagePort):
429         * dom/MessagePort.h:
430
431 2018-03-23  Youenn Fablet  <youenn@apple.com>
432
433         Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
434         https://bugs.webkit.org/show_bug.cgi?id=181180
435         <rdar://problem/36302375>
436
437         Reviewed by Eric Carlson.
438
439         Test: webrtc/video-update-often.html
440
441         AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
442         We can still ref it on a background thread but we always deref it on the main thread.
443
444         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
445         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
446         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
447
448 2018-03-23  Sergio Villar Senin  <svillar@igalia.com>
449
450         [css-grid] Fix auto repeat tracks computation with definite min sizes
451         https://bugs.webkit.org/show_bug.cgi?id=183933
452
453         Reviewed by Javier Fernandez.
454
455         Indefinitely sized containers use the specified definite min-size (if any) as available
456         space in order to compute the number of auto repeat tracks to create. A bug in that code was
457         causing the grid to be one track larger than expected. That was only happening in the case
458         of the free space being a multiple of the total size of the autorepeat tracks.
459
460         Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html
461
462         * rendering/RenderGrid.cpp:
463         (WebCore::RenderGrid::computeAutoRepeatTracksCount const):
464
465 2018-03-23  Miguel Gomez  <magomez@igalia.com>
466
467         [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
468         https://bugs.webkit.org/show_bug.cgi?id=183892
469
470         Reviewed by Žan Doberšek.
471
472         Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
473         the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
474         conversion during the painting. This way we don't need to swap the R and B components on the CPU.
475         Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
476         remove the UpdateContentsFlag as we never need to modify the original image data.
477
478         Covered by existent tests.
479
480         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
481         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
482         * platform/graphics/texmap/BitmapTexture.cpp:
483         (WebCore::BitmapTexture::updateContents):
484         * platform/graphics/texmap/BitmapTexture.h:
485         * platform/graphics/texmap/BitmapTextureGL.cpp:
486         (WebCore::BitmapTextureGL::BitmapTextureGL):
487         (WebCore::BitmapTextureGL::didReset):
488         (WebCore::BitmapTextureGL::updateContents):
489         (WebCore::BitmapTextureGL::applyFilters):
490         (WebCore::swizzleBGRAToRGBA): Deleted.
491         (WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
492         * platform/graphics/texmap/BitmapTextureGL.h:
493         (WebCore::BitmapTextureGL::colorConvertFlags const):
494         * platform/graphics/texmap/BitmapTexturePool.cpp:
495         (WebCore::BitmapTexturePool::acquireTexture):
496         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
497         * platform/graphics/texmap/BitmapTexturePool.h:
498         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
499         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
500         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
501         (WebCore::TextureMapperContextAttributes::get):
502         * platform/graphics/texmap/TextureMapperContextAttributes.h:
503         * platform/graphics/texmap/TextureMapperGL.cpp:
504         (WebCore::TextureMapperGL::drawNumber):
505         (WebCore::TextureMapperGL::drawTexture):
506         * platform/graphics/texmap/TextureMapperGL.h:
507         * platform/graphics/texmap/TextureMapperLayer.cpp:
508         (WebCore::TextureMapperLayer::paintIntoSurface):
509         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
510         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
511         * platform/graphics/texmap/TextureMapperTile.cpp:
512         (WebCore::TextureMapperTile::updateContents):
513         * platform/graphics/texmap/TextureMapperTile.h:
514         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
515         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
516         (WebCore::TextureMapperTiledBackingStore::updateContents):
517         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
518
519 2018-03-23  Yusuke Suzuki  <utatane.tea@gmail.com>
520
521         [WTF] Add standard containers with FastAllocator specialization
522         https://bugs.webkit.org/show_bug.cgi?id=183789
523
524         Reviewed by Darin Adler.
525
526         * Modules/indexeddb/IDBKeyData.h:
527         * Modules/mediasource/SampleMap.h:
528         * Modules/mediasource/SourceBuffer.cpp:
529         * Modules/webauthn/cbor/CBORValue.h:
530         It did not use FastAllocator for its container.
531
532         * page/WheelEventTestTrigger.h:
533         * platform/audio/PlatformMediaSessionManager.h:
534         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
535         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
536         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
537         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
538         * platform/graphics/cv/VideoTextureCopierCV.cpp:
539         (WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
540         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
541         * platform/wpe/PlatformPasteboardWPE.cpp:
542         * rendering/OrderIterator.h:
543
544 2018-03-23  Antoine Quint  <graouts@apple.com>
545
546         [Web Animations] infinite repeat counts aren't reflected for CSS Animations
547         https://bugs.webkit.org/show_bug.cgi?id=183932
548
549         Reviewed by Dean Jackson.
550
551         The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
552         for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.
553
554         * animation/CSSAnimation.cpp:
555         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
556
557 2018-03-22  Antoine Quint  <graouts@apple.com>
558
559         [Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
560         https://bugs.webkit.org/show_bug.cgi?id=183919
561
562         Reviewed by Dean Jackson.
563
564         The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
565         to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
566         We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
567         call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.
568
569         * animation/AnimationTimeline.cpp:
570         (WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
571         * animation/AnimationTimeline.h:
572         * animation/DocumentTimeline.cpp:
573         (WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
574         sure we don't create extra RefPtr<> objects.
575         * dom/Element.cpp:
576         (WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
577         element is removed.
578         * dom/PseudoElement.cpp:
579         (WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
580         a pseudo-element is removed.
581         * rendering/updating/RenderTreeUpdater.cpp:
582         (WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
583         for all children elements when an element gets a "display: none" style.
584
585 2018-03-23  Antoine Quint  <graouts@apple.com>
586
587         [Web Animations] Animated transform styles are ignored when calling getComputedStyle()
588         https://bugs.webkit.org/show_bug.cgi?id=183918
589
590         Reviewed by Dean Jackson.
591
592         Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
593         transform is applied for an element. Looking at the RenderStyle is preferable because in the case
594         of animations running on the compositor, such as a transform-only animation or transition, the
595         renderer doesn't necessarily have a transform style on it, since we don't blend properties in
596         software as the animation progresses. Instead, all of the blending is performed by the compositor,
597         and only the computed style object has the software-blended transform style on it.
598
599         We do need to account for inline renderers though as these do not support transforms.
600
601         * css/CSSComputedStyleDeclaration.cpp:
602         (WebCore::computedTransform):
603
604 2018-03-22  Antoine Quint  <graouts@apple.com>
605
606         [Web Animations] Support "transition: all" for CSS Transitions as Web Animations
607         https://bugs.webkit.org/show_bug.cgi?id=183917
608
609         Reviewed by Dean Jackson.
610
611         We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
612         of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
613         and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
614         provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
615         from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
616         property.
617
618         * animation/AnimationTimeline.cpp:
619         (WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
620         Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
621         or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
622         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
623         properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
624         all backing Animation objects found in the old style that match the conditions enforced by the new method
625         shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
626         in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
627         with a "transition: all" style. If we're dealing with a single property, we only process that single property.
628         * animation/CSSTransition.cpp:
629         (WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
630         we can no longer infer it from the backing Animation object.
631         (WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
632         since we can no longer infer it from the backing Animation object.
633         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
634         for backing Animation objects to determine whether their respective properties match since this would compare the
635         "property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
636         property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
637         which indicates that we don't care about matching the transition property itself.
638         * animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
639         * animation/KeyframeEffectReadOnly.cpp:
640         (WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
641         CSSTransition to get at the transition property.
642         * platform/animation/Animation.cpp:
643         (WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
644         whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
645         * platform/animation/Animation.h:
646
647 2018-03-22  Tim Horton  <timothy_horton@apple.com>
648
649         Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
650         https://bugs.webkit.org/show_bug.cgi?id=183930
651         <rdar://problem/38782249>
652
653         Reviewed by Dan Bernstein.
654
655         * Configurations/Base.xcconfig:
656         * Configurations/WebCore.xcconfig:
657         * Configurations/WebCoreTestSupport.xcconfig:
658
659 2018-03-22  Commit Queue  <commit-queue@webkit.org>
660
661         Unreviewed, rolling out r229876.
662         https://bugs.webkit.org/show_bug.cgi?id=183929
663
664         Some webrtc tests are timing out on iOS simulator (Requested
665         by youenn on #webkit).
666
667         Reverted changeset:
668
669         "Use libwebrtc ObjectiveC H264 encoder and decoder"
670         https://bugs.webkit.org/show_bug.cgi?id=183912
671         https://trac.webkit.org/changeset/229876
672
673 2018-03-22  Megan Gardner  <megan_gardner@apple.com>
674
675         Expose more system colors via CSS
676         https://bugs.webkit.org/show_bug.cgi?id=183764
677         <rdar://problem/36975898>
678
679         Reviewed by Tim Horton.
680
681         Test: fast/css/apple-system-control-colors.html
682
683         Expose Apple specific system colors via CSS.
684
685         * rendering/RenderThemeMac.mm:
686         (WebCore::RenderThemeMac::systemColor const):
687
688 2018-03-22  Nan Wang  <n_wang@apple.com>
689
690         AX: Web table row count is incorrect when role row is added to <tr> in DOM
691         https://bugs.webkit.org/show_bug.cgi?id=183922
692
693         Reviewed by Chris Fleizach.
694
695         Although the parent table for an ARIA grid row should be an ARIA table, we
696         should return the native table if the row is native <tr>.
697
698         Test: accessibility/row-with-aria-role-in-native-table.html
699
700         * accessibility/AccessibilityARIAGridRow.cpp:
701         (WebCore::AccessibilityARIAGridRow::parentTable const):
702
703 2018-03-22  Chris Dumez  <cdumez@apple.com>
704
705         Include security origin in the service worker process name
706         https://bugs.webkit.org/show_bug.cgi?id=183913
707
708         Reviewed by Youenn Fablet.
709
710         Updated localizable strings.
711
712         * English.lproj/Localizable.strings:
713
714 2018-03-22  Youenn Fablet  <youenn@apple.com>
715
716         Use libwebrtc ObjectiveC H264 encoder and decoder
717         https://bugs.webkit.org/show_bug.cgi?id=183912
718
719         Reviewed by Eric Carlson.
720
721         No observable change of behavior.
722         Made use of libwebrtc WebKit utilities.
723         Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.
724
725         * Configurations/WebCore.xcconfig:
726         * SourcesCocoa.txt:
727         * WebCore.xcodeproj/project.pbxproj:
728         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
729         (WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
730         (WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
731         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
732         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
733         (WebCore::LibWebRTCProviderCocoa::setActive):
734         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
735         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
736         (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
737         (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
738         * testing/Internals.cpp: Removed commented out include.
739
740 2018-03-22  Michael Catanzaro  <mcatanzaro@gnome.org>
741
742         Unreviewed, fix format string warnings in service worker code
743
744         On Linux x86_64, uint64_t is unsigned long, not unsigned long long.
745
746         * workers/service/ServiceWorkerContainer.cpp:
747         (WebCore::ServiceWorkerContainer::addRegistration):
748         (WebCore::ServiceWorkerContainer::removeRegistration):
749         (WebCore::ServiceWorkerContainer::updateRegistration):
750         (WebCore::ServiceWorkerContainer::jobFailedWithException):
751         (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
752         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
753         (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
754         (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
755         (WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
756
757 2018-03-22  Daniel Bates  <dabates@apple.com>
758
759         Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
760         https://bugs.webkit.org/show_bug.cgi?id=183907
761         <rdar://problem/38759127>
762
763         Reviewed by Alex Christensen.
764
765         Exports SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() so that we can use it from WebKit.
766
767         * platform/SchemeRegistry.h:
768
769 2018-03-22  Daniel Bates  <dabates@apple.com>
770
771         CSS mask images should be retrieved using potentially CORS-enabled fetch
772         https://bugs.webkit.org/show_bug.cgi?id=179983
773         <rdar://problem/35678149>
774
775         Reviewed by Brent Fulgham.
776
777         As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor's Draft, 23 December 2017)
778         we should fetch CSS mask images using a potentially CORS-enabled fetch.
779
780         Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
781         attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
782         For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
783         fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
784         closely align with the behavior in the spec.
785
786         Test: http/tests/security/css-mask-image.html
787
788         * style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
789         LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
790         in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
791         (WebCore::Style::loadPendingImage): Ditto.
792         (WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
793         a mask image or shape-outside image.
794
795 2018-03-22  Zalan Bujtas  <zalan@apple.com>
796
797         [Simple line layout] Text with letter spacing is not positioned properly.
798         https://bugs.webkit.org/show_bug.cgi?id=183079
799         <rdar://problem/38762569>
800
801         Reviewed by Antti Koivisto.
802
803         We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
804         since we might not be able to use the fast path anymore.
805
806         Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html
807
808         * rendering/RenderText.cpp:
809         (WebCore::RenderText::styleDidChange):
810
811 2018-03-21  Antoine Quint  <graouts@apple.com>
812
813         [Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
814         https://bugs.webkit.org/show_bug.cgi?id=183845
815
816         Reviewed by Dean Jackson.
817
818         Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.
819
820         * animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
821         WebAnimation::timeToNextRequiredTick().
822         * animation/AnimationTimeline.cpp:
823         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
824         for previous and current styles are a match.
825         * animation/CSSTransition.cpp:
826         (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
827         * animation/DeclarativeAnimation.cpp:
828         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
829         playState is set correctly and the animation is not idle.
830         * animation/DocumentTimeline.cpp:
831         (WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
832         been reworked to use the animation's current time, which is based on the timeline's current time.
833         (WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
834         * animation/KeyframeEffectReadOnly.cpp:
835         (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
836         old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
837         style value and the recorded target value differ to determine if new blending keyframes are necessary.
838         * animation/WebAnimation.cpp:
839         (WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
840         Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
841         correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
842         when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
843         needs to be scheduled.
844         * animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
845         * animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.
846
847 2018-03-22  Tim Horton  <timothy_horton@apple.com>
848
849         Improve readability of WebCore's OTHER_LDFLAGS
850         https://bugs.webkit.org/show_bug.cgi?id=183909
851         <rdar://problem/38760992>
852
853         Reviewed by Dan Bernstein.
854
855         * Configurations/Base.xcconfig:
856         * Configurations/FeatureDefines.xcconfig:
857         * Configurations/WebCore.xcconfig:
858
859 2018-03-22  Tim Horton  <timothy_horton@apple.com>
860
861         Adopt USE(OPENGL[_ES]) in more places
862         https://bugs.webkit.org/show_bug.cgi?id=183882
863         <rdar://problem/37912195>
864
865         Reviewed by Dan Bernstein.
866
867         * platform/graphics/GraphicsContext3D.h:
868         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
869         (WebCore::hasMuxableGPU):
870         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
871         (WebCore::GraphicsContext3D::GraphicsContext3D):
872         (WebCore::GraphicsContext3D::~GraphicsContext3D):
873         (WebCore::GraphicsContext3D::makeContextCurrent):
874         (WebCore::GraphicsContext3D::checkGPUStatus):
875         (WebCore::GraphicsContext3D::texImageIOSurface2D):
876         * platform/graphics/cocoa/WebGLLayer.h:
877         * platform/graphics/cocoa/WebGLLayer.mm:
878         (-[WebGLLayer initWithGraphicsContext3D:]):
879         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
880         (-[WebGLLayer display]):
881         * platform/graphics/ios/GraphicsContext3DIOS.h:
882         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
883         (WebCore::Extensions3DOpenGL::blitFramebuffer):
884         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
885         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
886         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
887         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
888         * platform/graphics/opengl/Extensions3DOpenGL.h:
889         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
890         (WebCore::GraphicsContext3D::reshapeFBOs):
891         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
892         (WebCore::GraphicsContext3D::renderbufferStorage):
893         (WebCore::GraphicsContext3D::getIntegerv):
894         (WebCore::GraphicsContext3D::texImage2D):
895         (WebCore::GraphicsContext3D::depthRange):
896         (WebCore::GraphicsContext3D::clearDepth):
897         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
898         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
899         Make it a bit more clear which code is platform-dependent and which code is GL/GLES-dependent.
900
901 2018-03-22  Zan Dobersek  <zdobersek@igalia.com>
902
903         [TexMap] Make TextureMapperContextAttributes thread-specific
904         https://bugs.webkit.org/show_bug.cgi?id=183895
905
906         Reviewed by Carlos Garcia Campos.
907
908         Store the TextureMapperContextAttributes in a thread-specific manner.
909         The TextureMapperContextAttributes::get() method is now used to retrieve
910         a reference to that thread-specific object. If it's not been initialized
911         yet, then the current GL context is used for the initialization, as it
912         used to be done in the now-removed initialize() method.
913
914         TextureMapperPlatformLayerBuffer::clone() method now doesn't need to
915         be passed a TextureMapperGL object, since the texture can be created
916         directly by calling BitmapTextureGL::create(), passing the
917         TextureMapperContextAttributes object that's retrieved from the
918         thread-specific storage. This further simplifies the
919         TextureMapperPlatformLayerProxy::Compositor interface, removing the
920         texmapGL() getter from it.
921
922         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
923         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
924         * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
925         (WebCore::threadSpecificAttributes):
926         (WebCore::TextureMapperContextAttributes::get):
927         (WebCore::TextureMapperContextAttributes::initialize): Deleted.
928         * platform/graphics/texmap/TextureMapperContextAttributes.h:
929         * platform/graphics/texmap/TextureMapperGL.cpp:
930         (WebCore::TextureMapperGL::TextureMapperGL):
931         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
932         (WebCore::TextureMapperPlatformLayerBuffer::clone):
933         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
934         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
935         (WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
936         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
937
938 2018-03-22  Zalan Bujtas  <zalan@apple.com>
939
940         SVG root is skipped while marking percentage height descendants dirty.
941         https://bugs.webkit.org/show_bug.cgi?id=183877
942
943         Reviewed by Antti Koivisto.
944
945         Calling continingBlock() to get to the correct container works as long as the ancestor inline element
946         renderers are wrapped in anonymous blocks (continuation for example).
947
948         While the SVG root renderer is an inline renderer, it is not wrapped or normalized in any way,
949         so containingBlock() will elegantly skip it and return an SVG root ancestor.
950         dirtyForLayoutFromPercentageHeightDescendants calls containingBlock() to walk up
951         on the ancestor chain to mark elements dirty. This fails when there's an SVG subtree in the block chain.
952         This patch marks the SVG subtree chain dirty to ensure that layout will get to all the dirty leaf renderers 
953         (note that the SVG subtree is supposed to have only statically positioned elements so parent == containing block).
954
955         Covered by existing tests.
956
957         * rendering/RenderBlock.cpp:
958         (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
959
960 2018-03-22  Adrian Perez de Castro  <aperez@igalia.com>
961
962         [WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled
963         https://bugs.webkit.org/show_bug.cgi?id=183896
964
965         Reviewed by Yusuke Suzuki.
966
967         No new tests needed.
968
969         * bindings/js/JSWebAnimationCustom.cpp: Add missing #include of Document.h
970
971 2018-03-21  Chris Dumez  <cdumez@apple.com>
972
973         Regression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
974         https://bugs.webkit.org/show_bug.cgi?id=183886
975
976         Reviewed by Wenson Hsieh.
977
978         Since r229828, the FrameLoader needs to call FrameLoaderClient::didDecidePolicyForNavigationAction()
979         whenever a navigation policy decision is made. I added such a call r229828 to
980         FrameLoader::continueLoadAfterNavigationPolicy() but forgot to add one to
981         FrameLoader::continueFragmentScrollAfterNavigationPolicy(), which is the equivalent
982         for fragment navigations.
983
984         * loader/FrameLoader.cpp:
985         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
986
987 2018-03-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
988
989         Disconnect the SVGPathSegList items from their SVGPathElement before rebuilding a new list
990         https://bugs.webkit.org/show_bug.cgi?id=183723
991         <rdar://problem/38517871>
992
993         Reviewed by Daniel Bates.
994
995         When setting the "d" attribute directly on a path, we rebuild the list
996         of path segments held for creating the property tear off. The old path
997         segments need to get disconnected from the path element. We already do 
998         that when a path segment is replaced or removed.
999
1000         Test: svg/dom/reuse-pathseg-after-changing-d.html
1001
1002         * svg/SVGPathElement.cpp:
1003         (WebCore::SVGPathElement::svgAttributeChanged):
1004         * svg/SVGPathSegList.cpp:
1005         (WebCore::SVGPathSegList::clear): SVGPathSegListValues::clearContextAndRoles()
1006         will now be called from SVGPathSegListValues::clear() via SVGListProperty::clearValues().
1007         (WebCore::SVGPathSegList::replaceItem):
1008         (WebCore::SVGPathSegList::removeItem):
1009         (WebCore::SVGPathSegList::clearContextAndRoles): Deleted.
1010         * svg/SVGPathSegList.h: SVGPathSegListValues::clearContextAndRoles() will
1011         now be called from SVGPathSegListValues::clear() via SVGListProperty::initializeValues().
1012         * svg/SVGPathSegListValues.cpp:
1013         (WebCore::SVGPathSegListValues::clearItemContextAndRole):
1014         (WebCore::SVGPathSegListValues::clearContextAndRoles):
1015         * svg/SVGPathSegListValues.h:
1016         (WebCore::SVGPathSegListValues::operator=):
1017         (WebCore::SVGPathSegListValues::clear):
1018
1019 2018-03-21  Antoine Quint  <graouts@apple.com>
1020
1021         [Web Animations] Ensure animationcancel and transitioncancel events are dispatched
1022         https://bugs.webkit.org/show_bug.cgi?id=183864
1023
1024         Reviewed by Dean Jackson.
1025
1026         In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
1027         objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
1028         to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
1029         invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
1030         animationcancel and transitioncancel events.
1031
1032         * animation/AnimationTimeline.cpp:
1033         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
1034         "display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
1035         for all animations that previously existed but are no longer listed in the current style.
1036         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
1037         Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
1038         a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
1039         like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
1040         outright, for all transitions that previously existed but are no longer listed in the current style.
1041         (WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
1042         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
1043         * animation/AnimationTimeline.h:
1044         * animation/DeclarativeAnimation.cpp:
1045         (WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
1046         such that an animationcancel or transitioncancel event can be dispatched.
1047         (WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
1048         so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
1049         code has run.
1050         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
1051         * animation/DeclarativeAnimation.h:
1052         * animation/WebAnimation.h:
1053
1054 2018-03-21  Chris Dumez  <cdumez@apple.com>
1055
1056         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates
1057         https://bugs.webkit.org/show_bug.cgi?id=183787
1058
1059         Reviewed by Wenson Hsieh.
1060
1061         * loader/FrameLoader.cpp:
1062         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1063         * loader/FrameLoaderClient.h:
1064
1065 2018-03-21  Eric Carlson  <eric.carlson@apple.com>
1066
1067         Clean up platform VideoFullscreenLayerManager
1068         https://bugs.webkit.org/show_bug.cgi?id=183859
1069         <rdar://problem/38715419>
1070
1071         Reviewed by Jer Noble.
1072
1073         No new tests, no functional change.
1074
1075         * WebCore.xcodeproj/project.pbxproj:
1076         * platform/graphics/VideoFullscreenLayerManager.h: Copied from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
1077         (WebCore::VideoFullscreenLayerManager::~VideoFullscreenLayerManager):
1078         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1079         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1080         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1081         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1082         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
1083         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer const):
1084         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
1085         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
1086         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
1087         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation const):
1088         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
1089         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
1090         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1091         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1092         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
1093         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformLayer const):
1094         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
1095         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
1096         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenLayer):
1097         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVideoFullscreenFrame):
1098         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::requiresTextTrackRepresentation const):
1099         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::syncTextTrackBounds):
1100         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setTextTrackRepresentation):
1101         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1102         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1103         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
1104         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
1105         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayers):
1106         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer const):
1107         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenLayer):
1108         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVideoFullscreenFrame):
1109         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h.
1110         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm.
1111         (-[WebVideoContainerLayer setBounds:]):
1112         (-[WebVideoContainerLayer setPosition:]):
1113         (WebCore::VideoFullscreenLayerManagerObjC::VideoFullscreenLayerManagerObjC):
1114         (WebCore::VideoFullscreenLayerManagerObjC::setVideoLayer):
1115         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
1116         (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenFrame):
1117         (WebCore::VideoFullscreenLayerManagerObjC::didDestroyVideoLayer):
1118         (WebCore::VideoFullscreenLayerManagerObjC::requiresTextTrackRepresentation const):
1119         (WebCore::VideoFullscreenLayerManagerObjC::syncTextTrackBounds):
1120         (WebCore::VideoFullscreenLayerManagerObjC::setTextTrackRepresentation):
1121
1122 2018-03-21  Antoine Quint  <graouts@apple.com>
1123
1124         [Web Animations] Dispatch DOM events for CSS Transitions and CSS Animations implemented as Web Animations
1125         https://bugs.webkit.org/show_bug.cgi?id=183781
1126
1127         Reviewed by Dean Jackson.
1128
1129         Now that we've implemented CSS Animations and CSS Transitions as Web Animations (webkit.org/b/183504) we can dispatch DOM events
1130         for targets of DeclarativeAnimation objects. To do that, we add a new invalidateDOMEvents() method on DeclarativeAnimations which
1131         is called when the timer scheduled after the timing model has been invalidated fires in DocumentTimeline::performInvalidationTask().
1132         When we check for DOM events to dispatch, we look at the last recorded phase and iteration and determine whether the state of the
1133         animation has changed. We use a GenericEventQueue to enqueue the events such that they are dispatched asynchronously at a moment
1134         when it is safe to evaluate script.
1135
1136         * animation/AnimationEffectReadOnly.h: Make currentIteration() public since we now need it in DeclarativeAnimation::invalidateDOMEvents().
1137         * animation/CSSAnimation.cpp:
1138         (WebCore::CSSAnimation::create): Pass the animation target to the constructor instead of its document.
1139         (WebCore::CSSAnimation::CSSAnimation): Pass the animation target to the superclass instead of its document.
1140         * animation/CSSAnimation.h:
1141         * animation/CSSTransition.cpp:
1142         (WebCore::CSSTransition::create): Pass the animation target to the constructor instead of its document.
1143         (WebCore::CSSTransition::CSSTransition): Pass the animation target to the superclass instead of its document.
1144         * animation/CSSTransition.h:
1145         * animation/DeclarativeAnimation.cpp:
1146         (WebCore::DeclarativeAnimation::DeclarativeAnimation): Expect an Element instead of a Document and use that element as the target of the
1147         GenericEventQueue that we initialize. We also register this element as our m_target.
1148         (WebCore::DeclarativeAnimation::~DeclarativeAnimation): Close the GenericEventQueue member upon destruction.
1149         (WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
1150         playState is set correctly and the animation is not idle.
1151         (WebCore::DeclarativeAnimation::phaseWithoutEffect const): Because we may need to get an animation's current phase in invalidateDOMEvents()
1152         after an animation's effect has been removed, we provide an alternate way to compute the phase just by looking at the animation's current time.
1153         (WebCore::DeclarativeAnimation::invalidateDOMEvents): Based on the previous and current pending state, iteration and phase, we enqueue animation
1154         and transition DOM events as specified by the CSS Animations Level 2 and CSS Transitions Level 2 specifications.
1155         (WebCore::DeclarativeAnimation::enqueueDOMEvent): Enqueue an event on the GenericEventQueue based on the animation type.
1156         * animation/DeclarativeAnimation.h:
1157         * animation/DocumentTimeline.cpp:
1158         (WebCore::DocumentTimeline::performInvalidationTask): We call invalidateDOMEvents() on all declarative animations registered with this timeline
1159         now that the timing model has been invalidated.
1160         * dom/EventNames.h: Add the names of newly-implemented events (animationcancel, transitioncancel, transitionrun and transitionstart).
1161         * dom/GlobalEventHandlers.idl: Add new attribute-based event handlers for the newly-implemented events.
1162         * html/HTMLAttributeNames.in: Add new attribute-based event handlers for the newly-implemented events.
1163         * html/HTMLElement.cpp:
1164         (WebCore::HTMLElement::createEventHandlerNameMap): Add new attribute-based event handlers for the newly-implemented events.
1165
1166 2018-03-21  Per Arne Vollan  <pvollan@apple.com>
1167
1168         Compile error when not using IOSurface canvas backing store.
1169         https://bugs.webkit.org/show_bug.cgi?id=183855
1170
1171         Reviewed by Brent Fulgham.
1172
1173         The method IOSurface::createFromImageBuffer is only referenced when IOSurface
1174         is used as canvas backing store.
1175
1176         * platform/graphics/cocoa/IOSurface.h:
1177         * platform/graphics/cocoa/IOSurface.mm:
1178
1179 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1180
1181         [CoordGraphics] Track dirty rects that need update in CoordinatedGraphicsLayer
1182         https://bugs.webkit.org/show_bug.cgi?id=175376
1183
1184         Reviewed by Carlos Garcia Campos.
1185
1186         Follow the GraphicsLayerCA class and track rectangles in need of display
1187         in a Vector object. In case the whole layer needs updating, it's marked
1188         separately, and further rects are ignored.
1189
1190         During layer flush, all the rects are used to invalidate the backing
1191         store, or a single layer-sized rect is used in case the whole layer has
1192         to be updated. We can also bail early from updateContentBuffers() if
1193         there are no dirty rects recorded and there's no pending visible rect
1194         adjustment.
1195
1196         At the end of updateContentBuffers() we now test for an existing
1197         previous backing store before inquiring the backing store if the visible
1198         area is already covered, enabling deletion of this backing store.
1199
1200         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1201         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
1202         (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
1203         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1204         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1205
1206 2018-03-21  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1207
1208         [WPE] Build failure with ENABLE_VIDEO=OFF when GStreamer is not available
1209         https://bugs.webkit.org/show_bug.cgi?id=183811
1210
1211         Reviewed by Philippe Normand.
1212
1213         Add build guards for USE_GSTREAMER.
1214
1215         No new tests, it is a build fix.
1216
1217         * platform/graphics/gstreamer/GStreamerUtilities.h:
1218
1219 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1220
1221         [Cairo] Draw Cairo patterns with cairo_paint_with_alpha()
1222         https://bugs.webkit.org/show_bug.cgi?id=183774
1223
1224         Reviewed by Carlos Garcia Campos.
1225
1226         In the drawPatternToCairoContext() helper in CairoOperations.cpp source
1227         file, always clip the painting region to the specified rectangle and
1228         then use cairo_paint_with_alpha() to paint the passed-in pattern object,
1229         not relaying rasterization to cairo_fill() when using opaque alpha. We
1230         still clamp the alpha value to the 0.0 - 1.0 range.
1231
1232         No new tests -- no change in behavior.
1233
1234         * platform/graphics/cairo/CairoOperations.cpp:
1235         (WebCore::Cairo::drawPatternToCairoContext):
1236
1237 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1238
1239         [TexMap] Have TextureMapperLayer::applyAnimationsRecursively() return running animation status
1240         https://bugs.webkit.org/show_bug.cgi?id=183771
1241
1242         Reviewed by Carlos Garcia Campos.
1243
1244         TextureMapperLayer::applyAnimationsRecursively() should return true when
1245         the TextureMapperLayer tree has currently-running animations that
1246         require continuous scene update.
1247
1248         TextureMapperAnimation::ApplicationResult gains the hasRunningAnimation
1249         member that's set to true if any of the applied animations are still in
1250         playing state. That information is then returned in syncAnimations(),
1251         and the result is accumulated in the top applyAnimationsRecursively()
1252         call and returned there to the caller.
1253
1254         No new tests -- no change in behavior.
1255
1256         * platform/graphics/texmap/TextureMapperAnimation.cpp:
1257         (WebCore::TextureMapperAnimation::apply):
1258         * platform/graphics/texmap/TextureMapperAnimation.h:
1259         * platform/graphics/texmap/TextureMapperLayer.cpp:
1260         (WebCore::TextureMapperLayer::applyAnimationsRecursively):
1261         (WebCore::TextureMapperLayer::syncAnimations):
1262         * platform/graphics/texmap/TextureMapperLayer.h:
1263
1264 2018-03-21  Zan Dobersek  <zdobersek@igalia.com>
1265
1266         Use-after-move in SWContextManager::terminateWorker() with Linux x86_64 calling convention
1267         https://bugs.webkit.org/show_bug.cgi?id=183783
1268
1269         Reviewed by Chris Dumez.
1270
1271         In SWContextManager::terminateWorker(), some calling conventions can
1272         end up moving the ServiceWorkerThreadProxy RefPtr into the lambda struct
1273         before that proxy's thread (on which the lambda is bound to execute) is
1274         retrieved.
1275
1276         Avoid this by taking a reference to the thread in a separate earlier
1277         expression, before the RefPtr is moved into the lambda in the following
1278         one.
1279
1280         * workers/service/context/SWContextManager.cpp:
1281         (WebCore::SWContextManager::terminateWorker):
1282
1283 2018-03-21  Timothy Horton  <timothy_horton@apple.com>
1284
1285         Fix the build
1286
1287         * platform/network/cf/FormDataStreamCFNet.cpp:
1288
1289 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1290
1291         Introduce HAVE_MEDIA_PLAYER and HAVE_CORE_VIDEO
1292         https://bugs.webkit.org/show_bug.cgi?id=183803
1293         <rdar://problem/38690487>
1294
1295         Reviewed by Sam Weinig.
1296
1297         * platform/audio/ios/MediaSessionManagerIOS.mm:
1298         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1299         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
1300         (-[WebMediaSessionHelper initWithCallback:]):
1301         (-[WebMediaSessionHelper dealloc]):
1302         (-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
1303         * platform/cocoa/CoreVideoSoftLink.cpp:
1304         * platform/cocoa/CoreVideoSoftLink.h:
1305         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1306         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1307         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1308         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasAvailableVideoFrame const):
1309         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
1310         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
1311         (WebCore::MediaSampleAVFObjC::getRGBAImageData const):
1312         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1313         * platform/graphics/cv/PixelBufferConformerCV.h:
1314         * platform/graphics/cv/TextureCacheCV.h:
1315         * platform/graphics/cv/TextureCacheCV.mm:
1316         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1317         * platform/graphics/cv/VideoTextureCopierCV.h:
1318         Make it possible to disable our dependency on MediaPlayer and CoreVideo.
1319
1320 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1321
1322         Enable the minimal simulator feature flag when appropriate
1323         https://bugs.webkit.org/show_bug.cgi?id=183807
1324
1325         Reviewed by Dan Bernstein.
1326
1327         * Configurations/FeatureDefines.xcconfig:
1328
1329 2018-03-19  Ryosuke Niwa  <rniwa@webkit.org>
1330
1331         Expose content attributes on _WKLinkIconParameters
1332         https://bugs.webkit.org/show_bug.cgi?id=183768
1333
1334         Reviewed by Alex Christensen.
1335
1336         Collect a vector of content attributes upon finding touch and fav-icons in order to expose it in a WebKit API.
1337
1338         Tests: IconLoading.DefaultFavicon
1339
1340         * html/LinkIconCollector.cpp:
1341         (WebCore::LinkIconCollector::iconsOfTypes): Collect attributes.
1342         * loader/DocumentLoader.cpp:
1343         (WebCore::DocumentLoader::startIconLoading): Use an empty vector for /favicon.ico.
1344         * platform/LinkIcon.h:
1345         (WebCore::LinkIcon::encode const): Encode the vector of content attributes.
1346         (WebCore::LinkIcon::decode): Ditto for decoding.
1347
1348 2018-03-20  Zalan Bujtas  <zalan@apple.com>
1349
1350         RenderTreeNeedsLayoutChecker fails with absolutely positioned svg and <use>
1351         https://bugs.webkit.org/show_bug.cgi?id=183718
1352
1353         Reviewed by Antti Koivisto.
1354
1355         This patch ensures after resolving the style for an SVG element with a corresponding element (<use>),
1356         we adjust this style for the cloned SVG element too.
1357
1358         Test: svg/in-html/path-with-absolute-positioned-svg-and-use-crash.html
1359
1360         * css/StyleResolver.cpp:
1361         (WebCore::StyleResolver::adjustSVGElementStyle):
1362         (WebCore::StyleResolver::adjustRenderStyle):
1363         * css/StyleResolver.h:
1364         * svg/SVGElement.cpp:
1365         (WebCore::SVGElement::resolveCustomStyle):
1366
1367 2018-03-20  Brady Eidson  <beidson@apple.com>
1368
1369         First piece of process swapping on navigation.
1370         https://bugs.webkit.org/show_bug.cgi?id=183665
1371
1372         Reviewed by Andy Estes.
1373
1374         Covered by API test(s)
1375
1376         This patch:
1377         - A new PolicyAction::Suspend for future use in this feature
1378         - Makes sure that loads triggered as part of a process swap do *not* re-consult the policy delegate
1379
1380         * loader/DocumentLoader.cpp:
1381         (WebCore::DocumentLoader::continueAfterContentPolicy):
1382
1383         * loader/FrameLoadRequest.h:
1384         (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy):
1385         (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const):
1386
1387         * loader/FrameLoader.cpp:
1388         (WebCore::FrameLoader::load):
1389         (WebCore::FrameLoader::loadWithDocumentLoader):
1390         * loader/FrameLoader.h:
1391
1392         * loader/FrameLoaderTypes.h: Add a new Policy type "Suspend" to be used in the future
1393           by the process-swap-on-navigation mechanism.
1394
1395         * loader/PolicyChecker.cpp:
1396         (WebCore::PolicyChecker::checkNavigationPolicy):
1397         (WebCore::PolicyChecker::checkNewWindowPolicy):
1398
1399 2018-03-20  Chris Dumez  <cdumez@apple.com>
1400
1401         QuickLook.NavigationDelegate API test is failing on iOS with async policy delegates
1402         https://bugs.webkit.org/show_bug.cgi?id=183791
1403
1404         Reviewed by Alex Christensen.
1405
1406         Update PreviewLoader to not send data (or call finishFinishLoading) until
1407         the resource response has been processed.
1408
1409         * loader/ios/PreviewLoader.mm:
1410         (-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
1411         (-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
1412         (-[WebPreviewLoader connectionDidFinishLoading:]):
1413
1414 2018-03-20  Antoine Quint  <graouts@apple.com>
1415
1416         [Web Animations] Update the timing model when pending tasks schedule changes
1417         https://bugs.webkit.org/show_bug.cgi?id=183785
1418
1419         Reviewed by Dean Jackson.
1420
1421         Changing the time at which a pending play or pause task is scheduled changes the pending
1422         state of the animation and thus should notify that the timing model has changed and invalidate
1423         the effect.
1424
1425         * animation/WebAnimation.cpp:
1426         (WebCore::WebAnimation::setTimeToRunPendingPlayTask):
1427         (WebCore::WebAnimation::setTimeToRunPendingPauseTask):
1428         (WebCore::WebAnimation::updatePendingTasks):
1429
1430 2018-03-20  Tim Horton  <timothy_horton@apple.com>
1431
1432         Add and adopt WK_PLATFORM_NAME and adjust default feature defines
1433         https://bugs.webkit.org/show_bug.cgi?id=183758
1434         <rdar://problem/38017644>
1435
1436         Reviewed by Dan Bernstein.
1437
1438         * Configurations/Base.xcconfig:
1439         * Configurations/FeatureDefines.xcconfig:
1440         * WebCore.xcodeproj/project.pbxproj:
1441
1442 2018-03-19  Tim Horton  <timothy_horton@apple.com>
1443
1444         Apply some SDK checks in LocalDefaultSystemAppearance
1445         https://bugs.webkit.org/show_bug.cgi?id=183767
1446         <rdar://problem/38649611>
1447
1448         Reviewed by Zalan Bujtas.
1449
1450         * platform/mac/LocalDefaultSystemAppearance.h:
1451         * platform/mac/LocalDefaultSystemAppearance.mm:
1452         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1453         (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
1454
1455 2018-03-19  Chris Dumez  <cdumez@apple.com>
1456
1457         Have one service worker process per security origin
1458         https://bugs.webkit.org/show_bug.cgi?id=183600
1459         <rdar://problem/35280128>
1460
1461         Reviewed by Brady Eidson.
1462
1463         Split service workers from different origins into their own processes
1464         for security reasons.
1465
1466         * workers/service/server/SWServer.cpp:
1467         (WebCore::SWServer::addRegistrationFromStore):
1468         (WebCore::SWServer::clear):
1469         (WebCore::SWServer::tryInstallContextData):
1470         (WebCore::SWServer::serverToContextConnectionCreated):
1471         (WebCore::SWServer::installContextData):
1472         (WebCore::SWServer::runServiceWorkerIfNecessary):
1473         (WebCore::SWServer::markAllWorkersAsTerminated):
1474         * workers/service/server/SWServer.h:
1475         * workers/service/server/SWServerToContextConnection.cpp:
1476         (WebCore::SWServerToContextConnection::SWServerToContextConnection):
1477         (WebCore::SWServerToContextConnection::~SWServerToContextConnection):
1478         (WebCore::SWServerToContextConnection::connectionForOrigin):
1479         * workers/service/server/SWServerToContextConnection.h:
1480         (WebCore::SWServerToContextConnection::origin):
1481         * workers/service/server/SWServerWorker.cpp:
1482         (WebCore::SWServerWorker::SWServerWorker):
1483         (WebCore::SWServerWorker::securityOrigin const):
1484         (WebCore::SWServerWorker::contextConnection):
1485         * workers/service/server/SWServerWorker.h:
1486
1487 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
1488
1489         Have select element respect current appearance
1490         https://bugs.webkit.org/show_bug.cgi?id=183753
1491
1492         Reviewed by Tim Horton.
1493
1494         Not currently testable, will add tests in a later patch.
1495
1496         Have the menu lists/select elements follow the system colors.
1497
1498         * rendering/RenderThemeMac.mm:
1499         (WebCore::RenderThemeMac::adjustMenuListStyle const):
1500
1501 2018-03-19  Nan Wang  <n_wang@apple.com>
1502
1503         AX: embedded attachments do not work correctly with text marker APIs on macOS
1504         https://bugs.webkit.org/show_bug.cgi?id=183751
1505
1506         Reviewed by Chris Fleizach.
1507
1508         In WebKit1, embedded attachments are not working well with text marker APIs.
1509         We should use the corresponding attachment view in the following cases:
1510         1. Hit testing on an attachment object.
1511         2. Getting the attachment object at a text marker position.
1512         3. Asking for the associated element with NSAccessibilityAttachmentTextAttribute. 
1513
1514         Not able to construct a layout test because it relies on embedded attachments.
1515
1516         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1517         (AXAttributeStringSetElement):
1518         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
1519         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1520
1521 2018-03-19  Jiewen Tan  <jiewen_tan@apple.com>
1522
1523         Unreviewed, another quick fix for r229699
1524
1525         Restricts ENABLE_WEB_AUTHN to only macOS and iOS.
1526
1527         * Configurations/FeatureDefines.xcconfig:
1528
1529 2018-03-19  Daniel Bates  <dabates@apple.com>
1530
1531         Fix case of Strong Password localized string
1532
1533         * English.lproj/Localizable.strings:
1534         * platform/LocalizedStrings.cpp:
1535         (WebCore::autoFillStrongPasswordLabel):
1536
1537 2018-03-19  Chris Dumez  <cdumez@apple.com>
1538
1539         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
1540         https://bugs.webkit.org/show_bug.cgi?id=183702
1541         <rdar://problem/38566060>
1542
1543         Reviewed by Alex Christensen.
1544
1545         The issue is that the test calls loadHTMLString then loadRequest right after, without
1546         waiting for the first load to complete first. loadHTMLString is special as it relies
1547         on substitute data and which schedules a timer to commit the data. When doing the
1548         navigation policy check for the following loadRequest(), the substitute data timer
1549         would fire and commit its data and load. This would in turn cancel the pending
1550         navigation policy check for the loadRequest().
1551
1552         With sync policy delegates, this is not an issue because we take care of stopping
1553         all loaders when receiving the policy decision, which happens synchronously. However,
1554         when the policy decision happens asynchronously, the pending substitute data load
1555         does not get cancelled in time and it gets committed.
1556
1557         To address the issue, we now cancel any pending provisional load before doing the
1558         navigation policy check.
1559
1560         Test: fast/loader/inner-iframe-loads-data-url-into-parent-on-unload-crash-async-delegate.html
1561
1562         * loader/FrameLoader.cpp:
1563         (WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
1564         * loader/FrameLoader.h:
1565         * loader/PolicyChecker.cpp:
1566         (WebCore::PolicyChecker::checkNavigationPolicy):
1567         Cancel any pending provisional load before starting the navigation policy check. This call
1568         needs to be here rather than in the call site of policyChecker().checkNavigationPolicy()
1569         because there is code in PolicyChecker::checkNavigationPolicy() which relies on
1570         FrameLoader::activeDocumentLoader().
1571         Also, we only cancel the provisional load if there is a policy document loader. In some
1572         rare cases (when we receive a redirect after navigation policy has been decided for the
1573         initial request), the provisional document loader needs to receive navigation policy
1574         decisions so we cannot clear the provisional document loader in such case.
1575
1576 2018-03-19  Eric Carlson  <eric.carlson@apple.com>
1577
1578         [Extra zoom mode] Require fullscreen for video playback
1579         https://bugs.webkit.org/show_bug.cgi?id=183742
1580         <rdar://problem/38235862>
1581
1582         Reviewed by Jer Noble.
1583
1584         * Modules/modern-media-controls/media/playback-support.js:
1585         (PlaybackSupport.prototype.syncControl): Always show the play button.
1586         * html/HTMLMediaElement.cpp:
1587         (WebCore::HTMLMediaElement::updatePlayState): Return immediately if playback requires fullscreen
1588         (WebCore::HTMLMediaElement::didBecomeFullscreenElement): Call updatePlayState in case 
1589         playback is pending.
1590         * html/HTMLMediaElement.h:
1591         * platform/cocoa/VideoFullscreenModel.h:
1592         (WebCore::VideoFullscreenModel::presentingViewController): New.
1593         (WebCore::VideoFullscreenModel::createVideoFullscreenViewController): New.
1594         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1595         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1596         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
1597         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1598         (WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):
1599
1600         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1601         * platform/ios/VideoFullscreenInterfaceAVKit.mm: Wrap AVPlayerLayerView so we can change its
1602         behavior.
1603         (WebAVPlayerLayerView_playerLayer):
1604         (WebAVPlayerLayerView_videoView):
1605         (allocWebAVPlayerLayerViewInstance):
1606         (-[WebAVPlayerViewController initWithFullscreenInterface:]):
1607         (-[WebAVPlayerViewController playerViewControllerShouldHandleDoneButtonTap:]):
1608         (-[WebAVPlayerViewController enterFullScreenAnimated:completionHandler:]):
1609         (-[WebAVPlayerViewController exitFullScreenAnimated:completionHandler:]):
1610         (-[WebAVPlayerViewController NO_RETURN_DUE_TO_ASSERT]):
1611         (-[WebAVPlayerViewController isPictureInPicturePossible]):
1612         (-[WebAVPlayerViewController isPictureInPictureActive]):
1613         (-[WebAVPlayerViewController isPictureInPictureSuspended]):
1614         (-[WebAVPlayerViewController pictureInPictureActive]):
1615         (-[WebAVPlayerViewController pictureInPictureWasStartedWhenEnteringBackground]):
1616         (-[WebAVPlayerViewController view]):
1617         (-[WebAVPlayerViewController showsPlaybackControls]):
1618         (-[WebAVPlayerViewController setShowsPlaybackControls:]):
1619         (-[WebAVPlayerViewController setAllowsPictureInPicturePlayback:]):
1620         (-[WebAVPlayerViewController setDelegate:]):
1621         (-[WebAVPlayerViewController setPlayerController:]):
1622         (-[WebAVPlayerViewController avPlayerViewController]):
1623         (-[WebAVPlayerViewController removeFromParentViewController]):
1624         (VideoFullscreenInterfaceAVKit::setupFullscreen):
1625         (fallbackViewController):
1626         (VideoFullscreenInterfaceAVKit::presentingViewController):
1627         (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
1628         (VideoFullscreenInterfaceAVKit::doSetup):
1629         (WebCore::supportsPictureInPicture):
1630
1631 2018-03-19  Per Arne Vollan  <pvollan@apple.com>
1632
1633         When the WebContent process is blocked from accessing the WindowServer, the call CVDisplayLinkCreateWithCGDisplay will fail.
1634         https://bugs.webkit.org/show_bug.cgi?id=183604
1635         <rdar://problem/38305109>
1636
1637         Reviewed by Brent Fulgham.
1638
1639         The call to CVDisplayLinkCreateWithCGDisplay can instead be made in the UIProcess. Notify the WebContent process
1640         about display updates by sending a message from the UIProcess on each screen update. This patch adds an extra
1641         IPC step when notifying the WebContent process about display updates. However, the MotionMark benchmark shows no
1642         performance regression when running it with this patch. A possible explanation for this is that the high priority
1643         display link thread is now running in the UIProcess instead of the WebContent process, which means there will be
1644         more available CPU resources for the WebContent process. A run loop observer is added to make sure that only one
1645         display callback (for each display observer) is executed in a single iteration of the run loop. This will make
1646         sure we are not filling the IPC message queue with unhandled display link messages.
1647
1648         No new tests, covered by existing tests. 
1649
1650         * platform/graphics/DisplayRefreshMonitor.h:
1651         (WebCore::DisplayRefreshMonitor::displayLinkFired):
1652         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1653         (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
1654         * platform/graphics/DisplayRefreshMonitorManager.h:
1655         * platform/graphics/mac/DisplayRefreshMonitorMac.h:
1656
1657 2018-03-19  Megan Gardner  <megan_gardner@apple.com>
1658
1659         Ensure local appearance actually mirrors the app's appearance
1660         https://bugs.webkit.org/show_bug.cgi?id=183743
1661
1662         Reviewed by Tim Horton.
1663
1664         Not currently testable, will add tests in a later patch.
1665
1666         Current appearance isn't always accurate by default and needs to be set manually.
1667
1668         * platform/mac/LocalDefaultSystemAppearance.mm:
1669         (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
1670
1671 2018-03-19  Zan Dobersek  <zdobersek@igalia.com>
1672
1673         Unreviewed GCC 4.9 build-fix after r229672.
1674
1675         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
1676         (Nicosia::createCommand): Don't depend on implicit conversion of the
1677         returning std::unique_ptr<> object, and instead only wrap the
1678         heap-allocated PaintingOperation-derived in a std::unique_ptr<> at the
1679         point of return.
1680
1681 2018-03-18  Commit Queue  <commit-queue@webkit.org>
1682
1683         Unreviewed, rolling out r229689.
1684         https://bugs.webkit.org/show_bug.cgi?id=183735
1685
1686         Causes fast/loader/inner-iframe-loads-data-url-into-parent-on-
1687         unload-crash.html to fail with async delegates (Requested by
1688         cdumez_ on #webkit).
1689
1690         Reverted changeset:
1691
1692         "WebKit.WebsitePoliciesAutoplayQuirks API test times out with
1693         async policy delegates"
1694         https://bugs.webkit.org/show_bug.cgi?id=183702
1695         https://trac.webkit.org/changeset/229689
1696
1697 2018-03-17  Tim Horton  <timothy_horton@apple.com>
1698
1699         Correct redefined fnfErr type
1700         https://bugs.webkit.org/show_bug.cgi?id=183728
1701         <rdar://problem/38590063>
1702
1703         Reviewed by Dan Bernstein.
1704
1705         * platform/network/cf/FormDataStreamCFNet.cpp:
1706         CFStreamError's error parameter takes a SInt32, not an int.
1707         Make sure our redefinition has a compatible type.
1708
1709 2018-03-17  Jiewen Tan  <jiewen_tan@apple.com>
1710
1711         [WebAuthN] Implement authenticatorMakeCredential
1712         https://bugs.webkit.org/show_bug.cgi?id=183527
1713         <rdar://problem/35275886>
1714
1715         Reviewed by Brent Fulgham.
1716
1717         This patch does the following few things:
1718         1) It implements the authenticatorMakeCredential logic from the spec: https://www.w3.org/TR/webauthn/#op-make-cred.
1719         2) It tweaks enocding and deocding of PublicKeyCredentialCreationOptions between UIProccess and WebProcess.
1720         3) It soft links LocalAuthentication.Framework to WebCore, which was linked to WebKit.
1721         4) It creates SPI header for DeviceIdentity.Framework, and provides stubs to link it to WebCore.
1722
1723         Here is a detailed explanantion of 1):
1724         1. A helper class called LocalAuthenticator is crafted to represent Apple platform attached authenticator, i.e.
1725         the devices themselves. All operations are currently restricted to iOS at this moment as macOS lacks attestation
1726         support.
1727         2. To do testing, this helper class is then moved from WebKit to WebCore even though all operations can only happens
1728         in the UIProcess. We currently lack the ability to pretend a https environment in TestWebKitAPI which is required by
1729         the WebAuthN API, and thus it is moved to WebCore to perform unit tesing flavor API tests. This is not enough as it
1730         can't test message exchange between the UI and Web processes. We will address this in a subsequent patch.
1731         3. More on testing: The attestation process is abstracted into a protected method such that the testing enviroment can
1732         override it with self attestation as network access is restricted in the WebKit testing enviroment. Also, swizzlers of
1733         LocalAuthentication API are provided to override the behavoir of LAContext.
1734         4. More on testing: The actual Apple attestation can only happen in real device and with network access, therefore
1735         it can only be covered by manual tests at this moment.
1736         5. Back to LocalAuthenticator, it currently has two public methods:
1737                 5.1. makeCredential(): This method is the one does all the magic.
1738                 + It first checks some parameters.
1739                 + It then invokes LAContext to get user consent.
1740                 + It then talks to Apple Attestation Privacy CA to do attestations.
1741                 + It then stores necessary information into the Keychain.
1742                 + Finally it generates the attestation object.
1743                 5.2 isAvailable():
1744                 To check if a LocalAuthenticator is available or not.
1745         6. Even though files are of .mm format, they are written in a way that mixes NS, CF and C++ types. Here is the rule:
1746                 6.1 Use CF type only if it is requested by APIs.
1747                 6.2 Use NS type to manipulate all Objc objects.
1748                 6.3 Use C++ otherwise.
1749
1750         Covered by API tests.
1751
1752         * Configurations/WebCore.xcconfig:
1753         * Modules/credentialmanagement/CredentialsMessenger.cpp:
1754         (WebCore::getIdFromAttestationObject): Deleted.
1755         Decoding attestation object is tedious. UIProcess will instead return credential ID and attestation object
1756         at the same time. Therefore, this method is removed.
1757         * Modules/credentialmanagement/CredentialsMessenger.h:
1758         (WebCore::CreationReturnBundle::CreationReturnBundle): Deleted.
1759         (WebCore::AssertionReturnBundle::AssertionReturnBundle): Deleted.
1760         * Modules/webauthn/COSEConstants.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
1761         * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
1762         (WebCore::PublicKeyCredentialCreationOptions::isolatedPartialCopyPtr const):
1763         (WebCore::PublicKeyCredentialCreationOptions::Parameters::encode const):
1764         (WebCore::PublicKeyCredentialCreationOptions::Parameters::decode):
1765         (WebCore::PublicKeyCredentialCreationOptions::encode const):
1766         (WebCore::PublicKeyCredentialCreationOptions::decode):
1767         * Modules/webauthn/PublicKeyCredentialDescriptor.h:
1768         (WebCore::PublicKeyCredentialDescriptor::encode const):
1769         (WebCore::PublicKeyCredentialDescriptor::decode):
1770         * Modules/webauthn/PublicKeyCredentialType.h:
1771         * Modules/webauthn/cocoa/LocalAuthenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
1772         * Modules/webauthn/cocoa/LocalAuthenticator.mm: Added.
1773         (WebCore::LocalAuthenticatorInternal::freePtrs):
1774         (WebCore::LocalAuthenticator::makeCredential const):
1775         (WebCore::LocalAuthenticator::isAvailable const):
1776         (WebCore::LocalAuthenticator::issueClientCertificate const):
1777         * SourcesCocoa.txt:
1778         * WebCore.xcodeproj/project.pbxproj:
1779         * platform/cocoa/LocalAuthenticationSoftLink.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialType.h.
1780         * platform/cocoa/LocalAuthenticationSoftLink.mm: Added.
1781         * testing/MockCredentialsMessenger.cpp:
1782         (WebCore::MockCredentialsMessenger::setCreationReturnBundle):
1783         (WebCore::MockCredentialsMessenger::makeCredential):
1784         (WebCore::MockCredentialsMessenger::makeCredentialReply):
1785         (WebCore::MockCredentialsMessenger::setAttestationObject): Deleted.
1786         * testing/MockCredentialsMessenger.h:
1787         * testing/MockCredentialsMessenger.idl:
1788
1789 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
1790
1791         Correct debug assertion in Range::borderAndTextRects
1792         https://bugs.webkit.org/show_bug.cgi?id=183710
1793         <rdar://problem/38466976>
1794
1795         Reviewed by Ryosuke Niwa.
1796
1797         A debug assertion will fire if Range::borderAndTextRects is asked to evaluate a set of selected elements, where one of the elements does not have a parent.
1798
1799         We should consider a nullptr parent as satisfying the condition of a parent not being present in the selection set.
1800
1801         Tests: fast/dom/range/range-selection-empty-body.html
1802
1803         * dom/Range.cpp:
1804         (WebCore::Range::borderAndTextRects const):
1805
1806 2018-03-15  Filip Pizlo  <fpizlo@apple.com>
1807
1808         Put the DOM in IsoHeaps
1809         https://bugs.webkit.org/show_bug.cgi?id=183546
1810
1811         Reviewed by Daniel Bates.
1812
1813         No new tests because no change in behavior.
1814         
1815         This puts all descendants of WebCore::Node in isoheaps, so that UAFs on the DOM cannot be
1816         used for RCE attacks. This probably also makes it harder to use UAFs for UXSS, since it means
1817         that DOM UAFs cannot be used for universal read gadgets.
1818         
1819         This looks neutral on Speedometer and membuster, though I did have one round of testing
1820         that led me to believe that membuster was regressed - I just wasn't able to reproduce that
1821         result on subsequent testing.
1822
1823         * Sources.txt:
1824         * WebCore.xcodeproj/project.pbxproj:
1825         * dom/Attr.cpp:
1826         * dom/Attr.h:
1827         * dom/CDATASection.cpp:
1828         * dom/CDATASection.h:
1829         * dom/CharacterData.cpp:
1830         * dom/CharacterData.h:
1831         * dom/Comment.cpp:
1832         * dom/Comment.h:
1833         * dom/ContainerNode.cpp:
1834         * dom/ContainerNode.h:
1835         * dom/Document.cpp:
1836         * dom/Document.h:
1837         * dom/DocumentFragment.cpp:
1838         * dom/DocumentFragment.h:
1839         * dom/DocumentType.cpp:
1840         * dom/DocumentType.h:
1841         * dom/Node.cpp:
1842         * dom/Node.h:
1843         * dom/ProcessingInstruction.cpp:
1844         * dom/ProcessingInstruction.h:
1845         * dom/PseudoElement.cpp:
1846         * dom/PseudoElement.h:
1847         * dom/ShadowRoot.cpp:
1848         * dom/ShadowRoot.h:
1849         * dom/StyledElement.cpp:
1850         * dom/StyledElement.h:
1851         * dom/TemplateContentDocumentFragment.cpp: Added.
1852         * dom/TemplateContentDocumentFragment.h:
1853         * dom/Text.cpp:
1854         * dom/Text.h:
1855         * dom/XMLDocument.cpp: Added.
1856         * dom/XMLDocument.h:
1857         * html/FTPDirectoryDocument.cpp:
1858         * html/FTPDirectoryDocument.h:
1859         * html/FileInputType.cpp:
1860         * html/HTMLAnchorElement.cpp:
1861         * html/HTMLAnchorElement.h:
1862         * html/HTMLAppletElement.cpp:
1863         * html/HTMLAppletElement.h:
1864         * html/HTMLAreaElement.cpp:
1865         * html/HTMLAreaElement.h:
1866         * html/HTMLAttachmentElement.cpp:
1867         * html/HTMLAttachmentElement.h:
1868         * html/HTMLBDIElement.cpp: Added.
1869         * html/HTMLBDIElement.h:
1870         * html/HTMLBRElement.cpp:
1871         * html/HTMLBRElement.h:
1872         * html/HTMLBaseElement.cpp:
1873         * html/HTMLBaseElement.h:
1874         * html/HTMLBodyElement.cpp:
1875         * html/HTMLBodyElement.h:
1876         * html/HTMLButtonElement.cpp:
1877         * html/HTMLButtonElement.h:
1878         * html/HTMLCanvasElement.cpp:
1879         * html/HTMLCanvasElement.h:
1880         * html/HTMLDListElement.cpp:
1881         * html/HTMLDListElement.h:
1882         * html/HTMLDataElement.cpp:
1883         * html/HTMLDataElement.h:
1884         * html/HTMLDataListElement.cpp:
1885         * html/HTMLDataListElement.h:
1886         * html/HTMLDetailsElement.cpp:
1887         * html/HTMLDetailsElement.h:
1888         * html/HTMLDirectoryElement.cpp:
1889         * html/HTMLDirectoryElement.h:
1890         * html/HTMLDivElement.cpp:
1891         * html/HTMLDivElement.h:
1892         * html/HTMLDocument.cpp:
1893         * html/HTMLDocument.h:
1894         * html/HTMLElement.cpp:
1895         * html/HTMLElement.h:
1896         * html/HTMLEmbedElement.cpp:
1897         * html/HTMLEmbedElement.h:
1898         * html/HTMLFieldSetElement.cpp:
1899         * html/HTMLFieldSetElement.h:
1900         * html/HTMLFontElement.cpp:
1901         * html/HTMLFontElement.h:
1902         * html/HTMLFormControlElement.cpp:
1903         * html/HTMLFormControlElement.h:
1904         * html/HTMLFormControlElementWithState.cpp:
1905         * html/HTMLFormControlElementWithState.h:
1906         * html/HTMLFormElement.cpp:
1907         * html/HTMLFormElement.h:
1908         * html/HTMLFrameElement.cpp:
1909         * html/HTMLFrameElement.h:
1910         * html/HTMLFrameElementBase.cpp:
1911         * html/HTMLFrameElementBase.h:
1912         * html/HTMLFrameOwnerElement.cpp:
1913         * html/HTMLFrameOwnerElement.h:
1914         * html/HTMLFrameSetElement.cpp:
1915         * html/HTMLFrameSetElement.h:
1916         * html/HTMLHRElement.cpp:
1917         * html/HTMLHRElement.h:
1918         * html/HTMLHeadElement.cpp:
1919         * html/HTMLHeadElement.h:
1920         * html/HTMLHeadingElement.cpp:
1921         * html/HTMLHeadingElement.h:
1922         * html/HTMLHtmlElement.cpp:
1923         * html/HTMLHtmlElement.h:
1924         * html/HTMLIFrameElement.cpp:
1925         * html/HTMLIFrameElement.h:
1926         * html/HTMLImageElement.cpp:
1927         * html/HTMLImageElement.h:
1928         * html/HTMLInputElement.cpp:
1929         * html/HTMLInputElement.h:
1930         * html/HTMLKeygenElement.cpp:
1931         * html/HTMLKeygenElement.h:
1932         * html/HTMLLIElement.cpp:
1933         * html/HTMLLIElement.h:
1934         * html/HTMLLabelElement.cpp:
1935         * html/HTMLLabelElement.h:
1936         * html/HTMLLegendElement.cpp:
1937         * html/HTMLLegendElement.h:
1938         * html/HTMLLinkElement.cpp:
1939         * html/HTMLLinkElement.h:
1940         * html/HTMLMapElement.cpp:
1941         * html/HTMLMapElement.h:
1942         * html/HTMLMarqueeElement.cpp:
1943         * html/HTMLMarqueeElement.h:
1944         * html/HTMLMenuElement.cpp:
1945         * html/HTMLMenuElement.h:
1946         * html/HTMLMenuItemElement.cpp:
1947         * html/HTMLMenuItemElement.h:
1948         * html/HTMLMetaElement.cpp:
1949         * html/HTMLMetaElement.h:
1950         * html/HTMLMeterElement.cpp:
1951         * html/HTMLMeterElement.h:
1952         * html/HTMLModElement.cpp:
1953         * html/HTMLModElement.h:
1954         * html/HTMLOListElement.cpp:
1955         * html/HTMLOListElement.h:
1956         * html/HTMLObjectElement.cpp:
1957         * html/HTMLObjectElement.h:
1958         * html/HTMLOptGroupElement.cpp:
1959         * html/HTMLOptGroupElement.h:
1960         * html/HTMLOptionElement.cpp:
1961         * html/HTMLOptionElement.h:
1962         * html/HTMLOutputElement.cpp:
1963         * html/HTMLOutputElement.h:
1964         * html/HTMLParagraphElement.cpp:
1965         * html/HTMLParagraphElement.h:
1966         * html/HTMLParamElement.cpp:
1967         * html/HTMLParamElement.h:
1968         * html/HTMLPictureElement.cpp:
1969         * html/HTMLPictureElement.h:
1970         * html/HTMLPlugInElement.cpp:
1971         * html/HTMLPlugInElement.h:
1972         * html/HTMLPlugInImageElement.cpp:
1973         * html/HTMLPlugInImageElement.h:
1974         * html/HTMLPreElement.cpp:
1975         * html/HTMLPreElement.h:
1976         * html/HTMLProgressElement.cpp:
1977         * html/HTMLProgressElement.h:
1978         * html/HTMLQuoteElement.cpp:
1979         * html/HTMLQuoteElement.h:
1980         * html/HTMLScriptElement.cpp:
1981         * html/HTMLScriptElement.h:
1982         * html/HTMLSelectElement.cpp:
1983         * html/HTMLSelectElement.h:
1984         * html/HTMLSlotElement.cpp:
1985         * html/HTMLSlotElement.h:
1986         * html/HTMLSourceElement.cpp:
1987         * html/HTMLSourceElement.h:
1988         * html/HTMLSpanElement.cpp:
1989         * html/HTMLSpanElement.h:
1990         * html/HTMLStyleElement.cpp:
1991         * html/HTMLStyleElement.h:
1992         * html/HTMLSummaryElement.cpp:
1993         * html/HTMLSummaryElement.h:
1994         * html/HTMLTableCaptionElement.cpp:
1995         * html/HTMLTableCaptionElement.h:
1996         * html/HTMLTableCellElement.cpp:
1997         * html/HTMLTableCellElement.h:
1998         * html/HTMLTableColElement.cpp:
1999         * html/HTMLTableColElement.h:
2000         * html/HTMLTableElement.cpp:
2001         * html/HTMLTableElement.h:
2002         * html/HTMLTablePartElement.cpp:
2003         * html/HTMLTablePartElement.h:
2004         * html/HTMLTableRowElement.cpp:
2005         * html/HTMLTableRowElement.h:
2006         * html/HTMLTableSectionElement.cpp:
2007         * html/HTMLTableSectionElement.h:
2008         * html/HTMLTemplateElement.cpp:
2009         * html/HTMLTemplateElement.h:
2010         * html/HTMLTextAreaElement.cpp:
2011         * html/HTMLTextAreaElement.h:
2012         * html/HTMLTextFormControlElement.cpp:
2013         * html/HTMLTextFormControlElement.h:
2014         * html/HTMLTimeElement.cpp:
2015         * html/HTMLTimeElement.h:
2016         * html/HTMLTitleElement.cpp:
2017         * html/HTMLTitleElement.h:
2018         * html/HTMLTrackElement.cpp:
2019         * html/HTMLTrackElement.h:
2020         * html/HTMLUListElement.cpp:
2021         * html/HTMLUListElement.h:
2022         * html/HTMLUnknownElement.cpp: Added.
2023         * html/HTMLUnknownElement.h:
2024         * html/HTMLWBRElement.cpp:
2025         * html/HTMLWBRElement.h:
2026         * html/ImageDocument.cpp:
2027         * html/ImageDocument.h:
2028         * html/LabelableElement.cpp:
2029         * html/LabelableElement.h:
2030         * html/MediaController.cpp:
2031         (MediaController::create): Deleted.
2032         (MediaController::MediaController): Deleted.
2033         (MediaController::addMediaElement): Deleted.
2034         (MediaController::removeMediaElement): Deleted.
2035         (MediaController::containsMediaElement const): Deleted.
2036         (MediaController::buffered const): Deleted.
2037         (MediaController::seekable const): Deleted.
2038         (MediaController::played): Deleted.
2039         (MediaController::duration const): Deleted.
2040         (MediaController::currentTime const): Deleted.
2041         (MediaController::setCurrentTime): Deleted.
2042         (MediaController::unpause): Deleted.
2043         (MediaController::play): Deleted.
2044         (MediaController::pause): Deleted.
2045         (MediaController::setDefaultPlaybackRate): Deleted.
2046         (MediaController::playbackRate const): Deleted.
2047         (MediaController::setPlaybackRate): Deleted.
2048         (MediaController::setVolume): Deleted.
2049         (MediaController::setMuted): Deleted.
2050         (playbackStateWaiting): Deleted.
2051         (playbackStatePlaying): Deleted.
2052         (playbackStateEnded): Deleted.
2053         (MediaController::playbackState const): Deleted.
2054         (MediaController::reportControllerState): Deleted.
2055         (eventNameForReadyState): Deleted.
2056         (MediaController::updateReadyState): Deleted.
2057         (MediaController::updatePlaybackState): Deleted.
2058         (MediaController::updateMediaElements): Deleted.
2059         (MediaController::bringElementUpToSpeed): Deleted.
2060         (MediaController::isBlocked const): Deleted.
2061         (MediaController::hasEnded const): Deleted.
2062         (MediaController::scheduleEvent): Deleted.
2063         (MediaController::asyncEventTimerFired): Deleted.
2064         (MediaController::clearPositionTimerFired): Deleted.
2065         (MediaController::hasAudio const): Deleted.
2066         (MediaController::hasVideo const): Deleted.
2067         (MediaController::hasClosedCaptions const): Deleted.
2068         (MediaController::setClosedCaptionsVisible): Deleted.
2069         (MediaController::supportsScanning const): Deleted.
2070         (MediaController::beginScrubbing): Deleted.
2071         (MediaController::endScrubbing): Deleted.
2072         (MediaController::beginScanning): Deleted.
2073         (MediaController::endScanning): Deleted.
2074         (MediaController::canPlay const): Deleted.
2075         (MediaController::isLiveStream const): Deleted.
2076         (MediaController::hasCurrentSrc const): Deleted.
2077         (MediaController::returnToRealtime): Deleted.
2078         (MediaController::startTimeupdateTimer): Deleted.
2079         (MediaController::scheduleTimeupdateEvent): Deleted.
2080         * html/MediaDocument.cpp:
2081         * html/MediaDocument.h:
2082         * html/PluginDocument.cpp:
2083         * html/PluginDocument.h:
2084         * html/RubyElement.cpp:
2085         * html/RubyElement.h:
2086         * html/RubyTextElement.cpp:
2087         * html/RubyTextElement.h:
2088         * html/TextDocument.cpp:
2089         * html/TextDocument.h:
2090         * html/shadow/AutoFillButtonElement.cpp:
2091         * html/shadow/AutoFillButtonElement.h:
2092         * html/shadow/DetailsMarkerControl.cpp:
2093         * html/shadow/DetailsMarkerControl.h:
2094         * html/shadow/ImageControlsRootElement.cpp:
2095         * html/shadow/ImageControlsRootElement.h:
2096         * html/shadow/MediaControlElementTypes.cpp:
2097         * html/shadow/MediaControlElementTypes.h:
2098         * html/shadow/MediaControlElements.cpp:
2099         * html/shadow/MediaControlElements.h:
2100         * html/shadow/MediaControls.cpp:
2101         * html/shadow/MediaControls.h:
2102         * html/shadow/ProgressShadowElement.cpp:
2103         * html/shadow/ProgressShadowElement.h:
2104         * html/shadow/SliderThumbElement.cpp:
2105         * html/shadow/SliderThumbElement.h:
2106         * html/shadow/SpinButtonElement.cpp:
2107         * html/shadow/SpinButtonElement.h:
2108         * html/shadow/TextControlInnerElements.cpp:
2109         * html/shadow/TextControlInnerElements.h:
2110         * html/shadow/YouTubeEmbedShadowElement.cpp:
2111         * html/shadow/YouTubeEmbedShadowElement.h:
2112         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
2113         * html/shadow/mac/ImageControlsButtonElementMac.h:
2114         * html/shadow/mac/ImageControlsRootElementMac.cpp:
2115         * html/shadow/mac/ImageControlsRootElementMac.h:
2116         * html/track/TextTrackCueGeneric.cpp:
2117         * html/track/VTTCue.cpp:
2118         * html/track/VTTCue.h:
2119         * html/track/WebVTTElement.cpp:
2120         * html/track/WebVTTElement.h:
2121         * loader/SinkDocument.cpp:
2122         * loader/SinkDocument.h:
2123         * mathml/MathMLAnnotationElement.cpp:
2124         * mathml/MathMLAnnotationElement.h:
2125         * mathml/MathMLElement.cpp:
2126         * mathml/MathMLElement.h:
2127         * mathml/MathMLFractionElement.cpp:
2128         * mathml/MathMLFractionElement.h:
2129         * mathml/MathMLMathElement.cpp:
2130         * mathml/MathMLMathElement.h:
2131         * mathml/MathMLMencloseElement.cpp:
2132         * mathml/MathMLMencloseElement.h:
2133         * mathml/MathMLOperatorElement.cpp:
2134         * mathml/MathMLOperatorElement.h:
2135         * mathml/MathMLPaddedElement.cpp:
2136         * mathml/MathMLPaddedElement.h:
2137         * mathml/MathMLPresentationElement.cpp:
2138         * mathml/MathMLPresentationElement.h:
2139         * mathml/MathMLRootElement.cpp:
2140         * mathml/MathMLRootElement.h:
2141         * mathml/MathMLRowElement.cpp:
2142         * mathml/MathMLRowElement.h:
2143         * mathml/MathMLScriptsElement.cpp:
2144         * mathml/MathMLScriptsElement.h:
2145         * mathml/MathMLSelectElement.cpp:
2146         * mathml/MathMLSelectElement.h:
2147         * mathml/MathMLSpaceElement.cpp:
2148         * mathml/MathMLSpaceElement.h:
2149         * mathml/MathMLTokenElement.cpp:
2150         * mathml/MathMLTokenElement.h:
2151         * mathml/MathMLUnderOverElement.cpp:
2152         * mathml/MathMLUnderOverElement.h:
2153         * mathml/MathMLUnknownElement.cpp: Added.
2154         * mathml/MathMLUnknownElement.h:
2155         * svg/SVGAElement.cpp:
2156         * svg/SVGAElement.h:
2157         * svg/SVGAltGlyphDefElement.cpp:
2158         * svg/SVGAltGlyphDefElement.h:
2159         * svg/SVGAltGlyphElement.cpp:
2160         * svg/SVGAltGlyphElement.h:
2161         * svg/SVGAltGlyphItemElement.cpp:
2162         * svg/SVGAltGlyphItemElement.h:
2163         * svg/SVGAnimateColorElement.cpp:
2164         * svg/SVGAnimateColorElement.h:
2165         * svg/SVGAnimateElement.cpp:
2166         * svg/SVGAnimateElement.h:
2167         * svg/SVGAnimateElementBase.cpp:
2168         * svg/SVGAnimateElementBase.h:
2169         * svg/SVGAnimateMotionElement.cpp:
2170         * svg/SVGAnimateMotionElement.h:
2171         * svg/SVGAnimateTransformElement.cpp:
2172         * svg/SVGAnimateTransformElement.h:
2173         * svg/SVGAnimationElement.cpp:
2174         * svg/SVGAnimationElement.h:
2175         * svg/SVGCircleElement.cpp:
2176         * svg/SVGCircleElement.h:
2177         * svg/SVGClipPathElement.cpp:
2178         * svg/SVGClipPathElement.h:
2179         * svg/SVGComponentTransferFunctionElement.cpp:
2180         * svg/SVGComponentTransferFunctionElement.h:
2181         * svg/SVGCursorElement.cpp:
2182         * svg/SVGCursorElement.h:
2183         * svg/SVGDefsElement.cpp:
2184         * svg/SVGDefsElement.h:
2185         * svg/SVGDescElement.cpp:
2186         * svg/SVGDescElement.h:
2187         * svg/SVGDocument.cpp:
2188         * svg/SVGDocument.h:
2189         * svg/SVGElement.cpp:
2190         * svg/SVGElement.h:
2191         * svg/SVGEllipseElement.cpp:
2192         * svg/SVGEllipseElement.h:
2193         * svg/SVGFEBlendElement.cpp:
2194         * svg/SVGFEBlendElement.h:
2195         * svg/SVGFEColorMatrixElement.cpp:
2196         * svg/SVGFEColorMatrixElement.h:
2197         * svg/SVGFEComponentTransferElement.cpp:
2198         * svg/SVGFEComponentTransferElement.h:
2199         * svg/SVGFECompositeElement.cpp:
2200         * svg/SVGFECompositeElement.h:
2201         * svg/SVGFEConvolveMatrixElement.cpp:
2202         * svg/SVGFEConvolveMatrixElement.h:
2203         * svg/SVGFEDiffuseLightingElement.cpp:
2204         * svg/SVGFEDiffuseLightingElement.h:
2205         * svg/SVGFEDisplacementMapElement.cpp:
2206         * svg/SVGFEDisplacementMapElement.h:
2207         * svg/SVGFEDropShadowElement.cpp:
2208         * svg/SVGFEDropShadowElement.h:
2209         * svg/SVGFEFloodElement.cpp:
2210         * svg/SVGFEFloodElement.h:
2211         * svg/SVGFEGaussianBlurElement.cpp:
2212         * svg/SVGFEGaussianBlurElement.h:
2213         * svg/SVGFEImageElement.cpp:
2214         * svg/SVGFEImageElement.h:
2215         * svg/SVGFELightElement.cpp:
2216         * svg/SVGFELightElement.h:
2217         * svg/SVGFEMergeElement.cpp:
2218         * svg/SVGFEMergeElement.h:
2219         * svg/SVGFEMergeNodeElement.cpp:
2220         * svg/SVGFEMergeNodeElement.h:
2221         * svg/SVGFEMorphologyElement.cpp:
2222         * svg/SVGFEMorphologyElement.h:
2223         * svg/SVGFEOffsetElement.cpp:
2224         * svg/SVGFEOffsetElement.h:
2225         * svg/SVGFESpecularLightingElement.cpp:
2226         * svg/SVGFESpecularLightingElement.h:
2227         * svg/SVGFETileElement.cpp:
2228         * svg/SVGFETileElement.h:
2229         * svg/SVGFETurbulenceElement.cpp:
2230         * svg/SVGFETurbulenceElement.h:
2231         * svg/SVGFilterElement.cpp:
2232         * svg/SVGFilterElement.h:
2233         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2234         * svg/SVGFilterPrimitiveStandardAttributes.h:
2235         * svg/SVGFontFaceElement.cpp:
2236         * svg/SVGFontFaceElement.h:
2237         * svg/SVGFontFaceFormatElement.cpp:
2238         * svg/SVGFontFaceFormatElement.h:
2239         * svg/SVGFontFaceNameElement.cpp:
2240         * svg/SVGFontFaceNameElement.h:
2241         * svg/SVGFontFaceSrcElement.cpp:
2242         * svg/SVGFontFaceSrcElement.h:
2243         * svg/SVGFontFaceUriElement.cpp:
2244         * svg/SVGFontFaceUriElement.h:
2245         * svg/SVGForeignObjectElement.cpp:
2246         * svg/SVGForeignObjectElement.h:
2247         * svg/SVGGElement.cpp:
2248         * svg/SVGGElement.h:
2249         * svg/SVGGlyphElement.cpp:
2250         * svg/SVGGlyphElement.h:
2251         * svg/SVGGlyphRefElement.cpp:
2252         * svg/SVGGlyphRefElement.h:
2253         * svg/SVGGradientElement.cpp:
2254         * svg/SVGGradientElement.h:
2255         * svg/SVGGraphicsElement.cpp:
2256         * svg/SVGGraphicsElement.h:
2257         * svg/SVGHKernElement.cpp:
2258         * svg/SVGHKernElement.h:
2259         * svg/SVGImageElement.cpp:
2260         * svg/SVGImageElement.h:
2261         * svg/SVGLineElement.cpp:
2262         * svg/SVGLineElement.h:
2263         * svg/SVGLinearGradientElement.cpp:
2264         * svg/SVGLinearGradientElement.h:
2265         * svg/SVGMPathElement.cpp:
2266         * svg/SVGMPathElement.h:
2267         * svg/SVGMarkerElement.cpp:
2268         * svg/SVGMarkerElement.h:
2269         * svg/SVGMaskElement.cpp:
2270         * svg/SVGMaskElement.h:
2271         * svg/SVGMetadataElement.cpp:
2272         * svg/SVGMetadataElement.h:
2273         * svg/SVGMissingGlyphElement.cpp:
2274         * svg/SVGMissingGlyphElement.h:
2275         * svg/SVGPathElement.cpp:
2276         * svg/SVGPathElement.h:
2277         * svg/SVGPatternElement.cpp:
2278         * svg/SVGPatternElement.h:
2279         * svg/SVGPolyElement.cpp:
2280         * svg/SVGPolyElement.h:
2281         * svg/SVGPolygonElement.cpp:
2282         * svg/SVGPolygonElement.h:
2283         * svg/SVGPolylineElement.cpp:
2284         * svg/SVGPolylineElement.h:
2285         * svg/SVGRadialGradientElement.cpp:
2286         * svg/SVGRadialGradientElement.h:
2287         * svg/SVGRectElement.cpp:
2288         * svg/SVGRectElement.h:
2289         * svg/SVGSVGElement.cpp:
2290         * svg/SVGSVGElement.h:
2291         * svg/SVGScriptElement.cpp:
2292         * svg/SVGScriptElement.h:
2293         * svg/SVGSetElement.cpp:
2294         * svg/SVGSetElement.h:
2295         * svg/SVGStopElement.cpp:
2296         * svg/SVGStopElement.h:
2297         * svg/SVGStyleElement.cpp:
2298         * svg/SVGStyleElement.h:
2299         * svg/SVGSwitchElement.cpp:
2300         * svg/SVGSwitchElement.h:
2301         * svg/SVGSymbolElement.cpp:
2302         * svg/SVGSymbolElement.h:
2303         * svg/SVGTRefElement.cpp:
2304         * svg/SVGTRefElement.h:
2305         * svg/SVGTSpanElement.cpp:
2306         * svg/SVGTSpanElement.h:
2307         * svg/SVGTextContentElement.cpp:
2308         * svg/SVGTextContentElement.h:
2309         * svg/SVGTextElement.cpp:
2310         * svg/SVGTextElement.h:
2311         * svg/SVGTextPathElement.cpp:
2312         * svg/SVGTextPathElement.h:
2313         * svg/SVGTextPositioningElement.cpp:
2314         * svg/SVGTextPositioningElement.h:
2315         * svg/SVGTitleElement.cpp:
2316         * svg/SVGTitleElement.h:
2317         * svg/SVGUnknownElement.cpp: Added.
2318         * svg/SVGUnknownElement.h:
2319         * svg/SVGUseElement.cpp:
2320         * svg/SVGUseElement.h:
2321         * svg/SVGVKernElement.cpp:
2322         * svg/SVGVKernElement.h:
2323         * svg/SVGViewElement.cpp:
2324         * svg/SVGViewElement.h:
2325         * svg/animation/SVGSMILElement.cpp:
2326         * svg/animation/SVGSMILElement.h:
2327
2328 2018-03-16  Youenn Fablet  <youenn@apple.com>
2329
2330         Ensure Document::responseReceived and clearResource are called on the main thread
2331         https://bugs.webkit.org/show_bug.cgi?id=183709
2332
2333         Reviewed by Chris Dumez.
2334
2335         No change of behavior.
2336
2337         * loader/DocumentLoader.cpp:
2338         (WebCore::DocumentLoader::responseReceived):
2339         (WebCore::DocumentLoader::clearMainResource):
2340
2341 2018-03-16  Chris Dumez  <cdumez@apple.com>
2342
2343         WebKit.WebsitePoliciesAutoplayQuirks API test times out with async policy delegates
2344         https://bugs.webkit.org/show_bug.cgi?id=183702
2345
2346         Reviewed by Alex Christensen.
2347
2348         The issue is that the test calls loadHTMLString then loadRequest right after, without
2349         waiting for the first load to complete first. loadHTMLString is special as it relies
2350         on substitute data and which schedules a timer to commit the data. When doing the
2351         navigation policy check for the following loadRequest(), the substitute data timer
2352         would fire and commit its data and load. This would in turn cancel the pending
2353         navigation policy check for the loadRequest().
2354
2355         With sync policy delegates, this is not an issue because we take care of stopping
2356         all loaders when receiving the policy decision, which happens synchronously. However,
2357         when the policy decision happens asynchronously, the pending substitute data load
2358         does not get cancelled in time and it gets committed.
2359
2360         To address the issue, this patch updates loadWithDocumentLoader() to cancel any
2361         provisional load when there is an asynchronous navigation policy decision pending.
2362
2363         Change covered by new API test.
2364
2365         * loader/FrameLoader.cpp:
2366         (WebCore::FrameLoader::loadWithDocumentLoader):
2367
2368 2018-03-16  Brent Fulgham  <bfulgham@apple.com>
2369
2370         Set a trap to catch an infrequent form-related nullptr crash
2371         https://bugs.webkit.org/show_bug.cgi?id=183704
2372         <rdar://problem/37579354>
2373
2374         Reviewed by Ryosuke Niwa.
2375
2376         Make FormState a FrameDestructionObserver. We expect all relevant FormState objects to have been
2377         cleaned up prior to the frame being destroyed. If we find such a case, we'd like to see the
2378         stack trace to see what's going on.
2379
2380         * loader/FormState.cpp:
2381         (WebCore::FormState::FormState):
2382         (WebCore::FormState::willDetachPage): RELEASE_ASSERT_NOT_REACHED if we ever get here.
2383         * loader/FormState.h:
2384
2385 2018-03-16  Joanmarie Diggs  <jdiggs@igalia.com>
2386
2387         AX: AccessibilityNodeObject::textForLabelElement() doesn't follow AccName calculation rules
2388         https://bugs.webkit.org/show_bug.cgi?id=183661
2389
2390         Reviewed by Chris Fleizach.
2391
2392         Have AccessibilityNodeObject::textForLabelElement() return the value from
2393         accessibleNameForNode() instead of innerText(). The former falls back on
2394         the latter if there is no author-provided accessible name.
2395
2396         Tests: accessibility/aria-label-on-label-element.html
2397                accessibility/label-with-pseudo-elements.html
2398
2399         * accessibility/AccessibilityNodeObject.cpp:
2400         (WebCore::AccessibilityNodeObject::textForLabelElement const):
2401         (WebCore::AccessibilityNodeObject::titleElementText const):
2402
2403 2018-03-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2404
2405         [Curl] Fix crash on websocket with bad handshake message.
2406         https://bugs.webkit.org/show_bug.cgi?id=183686
2407
2408         Reviewed by Youenn Fablet.
2409
2410         The closing cleanup was called multiple times. Add flag to detect
2411         it is already closed or not.
2412
2413         No new tests because it is covered by existing test:
2414         - LayoutTests/http/tests/websocket/tests/hybi/bad-handshake-crash.html
2415
2416         * platform/network/curl/SocketStreamHandleImpl.h:
2417         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
2418         (WebCore::SocketStreamHandleImpl::platformClose):
2419         (WebCore::SocketStreamHandleImpl::didReceiveData):
2420
2421 2018-03-16  Jer Noble  <jer.noble@apple.com>
2422
2423         Make Fullscreen API an Experimental Feature
2424         https://bugs.webkit.org/show_bug.cgi?id=183662
2425
2426         Reviewed by Jon Lee.
2427
2428         The Fullscreen APIs should be guarded by a Setting, so they are not present in the DOM when the
2429         Experimental Feature is disabled.
2430
2431         * dom/Document.idl:
2432         * dom/Element.idl:
2433
2434 2018-03-16  Megan Gardner  <megan_gardner@apple.com>
2435
2436         Ensure that style is updated when the effective appearance changes
2437         https://bugs.webkit.org/show_bug.cgi?id=183690
2438         <rdar://problem/38385900>
2439
2440         Reviewed by Tim Horton and Wenson Hsieh.
2441
2442         Only exposing a function to outside WebCore, no tests needed.
2443
2444         * page/Page.h:
2445
2446 2018-03-16  Chris Dumez  <cdumez@apple.com>
2447
2448         WebKit.RestoreSessionStateContainingScrollRestorationDefault API test is failing with async policy delegates
2449         https://bugs.webkit.org/show_bug.cgi?id=183679
2450
2451         Reviewed by Alex Christensen.
2452
2453         Update CachedRawResource::didAddClient() to not send data until we've received
2454         the policy decision for the response.
2455
2456         No new tests, covered by new API test.
2457
2458         * loader/DocumentLoader.cpp:
2459         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
2460         (WebCore::DocumentLoader::responseReceived):
2461         * loader/DocumentLoader.h:
2462         * loader/DocumentThreadableLoader.cpp:
2463         (WebCore::DocumentThreadableLoader::responseReceived):
2464         * loader/DocumentThreadableLoader.h:
2465         * loader/MediaResourceLoader.cpp:
2466         (WebCore::MediaResource::responseReceived):
2467         * loader/MediaResourceLoader.h:
2468         * loader/appcache/ApplicationCacheResourceLoader.cpp:
2469         (WebCore::ApplicationCacheResourceLoader::responseReceived):
2470         * loader/appcache/ApplicationCacheResourceLoader.h:
2471         * loader/cache/CachedRawResource.cpp:
2472         (WebCore::CachedRawResource::didAddClient):
2473         (WebCore::CachedRawResource::responseReceived):
2474         * loader/cache/CachedRawResourceClient.h:
2475         (WebCore::CachedRawResourceClient::responseReceived):
2476         * loader/cache/KeepaliveRequestTracker.cpp:
2477         (WebCore::KeepaliveRequestTracker::responseReceived):
2478         * loader/cache/KeepaliveRequestTracker.h:
2479         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2480         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2481         (WebCore::WebCoreAVFResourceLoader::responseReceived):
2482
2483 2018-03-16  Youenn Fablet  <youenn@apple.com>
2484
2485         Name Service Worker threads differently from regular Worker threads
2486         https://bugs.webkit.org/show_bug.cgi?id=183698
2487
2488         Reviewed by Chris Dumez.
2489
2490         No observable change of behavior.
2491         For debugging purposes, knowing that a thread is a service worker thread might help give context.
2492         It might also identify on a crash log whether the process is a service worker process or a regular web process.
2493
2494         * workers/WorkerThread.cpp:
2495         (WebCore::WorkerThread::start):
2496         * workers/WorkerThread.h:
2497         (WebCore::WorkerThread::isServiceWorkerThread const):
2498         * workers/service/context/ServiceWorkerThread.h:
2499
2500 2018-03-16  Youenn Fablet  <youenn@apple.com>
2501
2502         IceCandidates leak on webrtc/datachannel/basic.html and other tests
2503         https://bugs.webkit.org/show_bug.cgi?id=183676
2504         <rdar://problem/36116228>
2505
2506         Reviewed by Eric Carlson.
2507
2508         Covered by manual testing using --leaks option on WK1.
2509         WebKit should not release the candidates since libwebrtc is not taking ownership.
2510
2511         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2512         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
2513         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
2514
2515 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
2516
2517         [Nicosia] Add Cairo-specific GraphicsContext operation recorder
2518         https://bugs.webkit.org/show_bug.cgi?id=183593
2519
2520         Reviewed by Carlos Garcia Campos.
2521
2522         Add Nicosia::CairoOperationRecorder, GraphicsContextImpl implementation
2523         that records all GraphicsContext operations for deferred replay on a
2524         different thread. Recording here mostly consists of storing all the
2525         Cairo resources in a thread-safe manner, which is eased by the atomic
2526         reference counting used in Cairo.
2527
2528         Nicosia::PaintingOperation derivatives are used for operations or state
2529         updates that require recording. Instances of these classes are appended
2530         to a Vector<> object that is then pushed into a thread pool in
2531         Nicosia::PaintingEngineThreaded , replaying all the operations against
2532         the Cairo context established from an associated target Nicosia::Buffer.
2533
2534         This GraphicsContextImpl implementation is now used in the
2535         PaintingContextCairo::ForRecording constructor to construct the
2536         GraphicsContext implementation that will be used for recording.
2537
2538         * platform/TextureMapper.cmake:
2539         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: Added.
2540         (Nicosia::getContext):
2541         (Nicosia::OperationData::arg const const):
2542         (Nicosia::createCommand):
2543         (Nicosia::CairoOperationRecorder::CairoOperationRecorder):
2544         (Nicosia::m_commandList):
2545         (Nicosia::CairoOperationRecorder::updateState):
2546         (Nicosia::CairoOperationRecorder::clearShadow):
2547         (Nicosia::CairoOperationRecorder::setLineCap):
2548         (Nicosia::CairoOperationRecorder::setLineDash):
2549         (Nicosia::CairoOperationRecorder::setLineJoin):
2550         (Nicosia::CairoOperationRecorder::setMiterLimit):
2551         (Nicosia::CairoOperationRecorder::fillRect):
2552         (Nicosia::CairoOperationRecorder::fillRoundedRect):
2553         (Nicosia::CairoOperationRecorder::fillRectWithRoundedHole):
2554         (Nicosia::CairoOperationRecorder::fillPath):
2555         (Nicosia::CairoOperationRecorder::fillEllipse):
2556         (Nicosia::CairoOperationRecorder::strokeRect):
2557         (Nicosia::CairoOperationRecorder::strokePath):
2558         (Nicosia::CairoOperationRecorder::strokeEllipse):
2559         (Nicosia::CairoOperationRecorder::clearRect):
2560         (Nicosia::CairoOperationRecorder::drawGlyphs):
2561         (Nicosia::CairoOperationRecorder::drawImage):
2562         (Nicosia::CairoOperationRecorder::drawTiledImage):
2563         (Nicosia::CairoOperationRecorder::drawNativeImage):
2564         (Nicosia::CairoOperationRecorder::drawPattern):
2565         (Nicosia::CairoOperationRecorder::drawRect):
2566         (Nicosia::CairoOperationRecorder::drawLine):
2567         (Nicosia::CairoOperationRecorder::drawLinesForText):
2568         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
2569         (Nicosia::CairoOperationRecorder::drawEllipse):
2570         (Nicosia::CairoOperationRecorder::drawPath):
2571         (Nicosia::CairoOperationRecorder::drawFocusRing):
2572         (Nicosia::CairoOperationRecorder::save):
2573         (Nicosia::CairoOperationRecorder::restore):
2574         (Nicosia::CairoOperationRecorder::translate):
2575         (Nicosia::CairoOperationRecorder::rotate):
2576         (Nicosia::CairoOperationRecorder::scale):
2577         (Nicosia::CairoOperationRecorder::concatCTM):
2578         (Nicosia::CairoOperationRecorder::setCTM):
2579         (Nicosia::CairoOperationRecorder::getCTM):
2580         (Nicosia::CairoOperationRecorder::beginTransparencyLayer):
2581         (Nicosia::CairoOperationRecorder::endTransparencyLayer):
2582         (Nicosia::CairoOperationRecorder::clip):
2583         (Nicosia::CairoOperationRecorder::clipOut):
2584         (Nicosia::CairoOperationRecorder::clipPath):
2585         (Nicosia::CairoOperationRecorder::clipBounds):
2586         (Nicosia::CairoOperationRecorder::applyDeviceScaleFactor):
2587         (Nicosia::CairoOperationRecorder::roundToDevicePixels):
2588         (Nicosia::CairoOperationRecorder::append):
2589         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: Added.
2590         * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
2591         (Nicosia::PaintingContextCairo::ForRecording::ForRecording):
2592
2593 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
2594
2595         [TexMap] Clean up TextureMapperLayer constructor
2596         https://bugs.webkit.org/show_bug.cgi?id=183634
2597
2598         Reviewed by Michael Catanzaro.
2599
2600         In the TextureMapperLayer header, only declare the constructor, and move
2601         all the previous member initialization to the point of declaration of
2602         these member variables.
2603
2604         In the TextureMapperLayer implementation file, the constructor and
2605         destructor are moved into proper order at the top of the file. The
2606         former is defaulted, and the latter remains unchanged.
2607
2608         No change in behavior.
2609
2610         * platform/graphics/texmap/TextureMapperLayer.cpp:
2611         (WebCore::TextureMapperLayer::~TextureMapperLayer):
2612         * platform/graphics/texmap/TextureMapperLayer.h:
2613
2614 2018-03-16  Miguel Gomez  <magomez@igalia.com>
2615
2616         [GTK] When using EGL, request an OpenGL core profile when possible
2617         https://bugs.webkit.org/show_bug.cgi?id=178719
2618
2619         Reviewed by Carlos Garcia Campos.
2620
2621         When using EGL and OpenGL, try to request a context with version >= 3.2 with a core profile
2622         whenever possible. In order to to this, we require EGL version 1.5 or version 1.4 with the
2623         extension EGL_KHR_create_context. If EGL requirements are not met, or we cannot get a
2624         context with version >= 3.2 then use whatever EGL gives us.
2625
2626         Covered by existent tests.
2627
2628         * platform/graphics/egl/GLContextEGL.cpp:
2629         (WebCore::GLContextEGL::createWindowContext):
2630         (WebCore::GLContextEGL::createPbufferContext):
2631         (WebCore::GLContextEGL::createSurfacelessContext):
2632         (WebCore::GLContextEGL::createContextForEGLVersion):
2633         * platform/graphics/egl/GLContextEGL.h:
2634         * platform/graphics/egl/GLContextEGLWPE.cpp:
2635         (WebCore::GLContextEGL::createWPEContext):
2636         * platform/graphics/egl/GLContextEGLWayland.cpp:
2637         (WebCore::GLContextEGL::createWaylandContext):
2638         * platform/graphics/egl/GLContextEGLX11.cpp:
2639         (WebCore::GLContextEGL::createPixmapContext):
2640
2641 2018-03-16  Zan Dobersek  <zdobersek@igalia.com>
2642
2643         [TexMap] Don't use the TextureMapperAnimation::Client interface to apply animation
2644         https://bugs.webkit.org/show_bug.cgi?id=183656
2645
2646         Reviewed by Carlos Garcia Campos.
2647
2648         Don't have the TextureMapperLayer class inherit from the
2649         TextureMapperAnimation::Client interface just for the purposes of
2650         synchronization of animation-affected attributes in syncAnimations().
2651         For that purpose it's enough to provide a struct that is passed to that
2652         method, and with the TextureMapperAnimation class filling out any of the
2653         animated attributes that need to be updated.
2654
2655         TextureMapperAnimation::ApplicationResult struct is introducted for that
2656         purpose. std::optional<> members in it are assigned values during the
2657         application process, if an appropriate animation affects them. The
2658         relevant member values in TextureMapperLayer are then updated, or value
2659         from the default state is used.
2660
2661         TextureMapperAnimation::Client is removed.
2662
2663         No new tests -- no change in behavior.
2664
2665         * platform/graphics/texmap/TextureMapperAnimation.cpp:
2666         (WebCore::TextureMapperAnimation::apply):
2667         (WebCore::TextureMapperAnimation::applyInternal):
2668         (WebCore::TextureMapperAnimations::apply):
2669         * platform/graphics/texmap/TextureMapperAnimation.h:
2670         * platform/graphics/texmap/TextureMapperLayer.cpp:
2671         (WebCore::TextureMapperLayer::syncAnimations):
2672         (WebCore::TextureMapperLayer::setAnimatedTransform): Deleted.
2673         (WebCore::TextureMapperLayer::setAnimatedOpacity): Deleted.
2674         (WebCore::TextureMapperLayer::setAnimatedFilters): Deleted.
2675         * platform/graphics/texmap/TextureMapperLayer.h:
2676
2677 2018-03-16  Devin Rousso  <webkit@devinrousso.com>
2678
2679         Web Inspector: Canvas Tab: main WebGL canvas on acko.net has no reported size
2680         https://bugs.webkit.org/show_bug.cgi?id=178798
2681         <rdar://problem/35175740>
2682
2683         Reviewed by Brian Burg.
2684
2685         When the main frame navigates, the DOMAgent would recieve two InspectorInstrumentation calls,
2686         one when the frame begins its navigation and the other when the document for that frame has
2687         loaded. Both of these would discard the DOMAgent's bindings, which included the map of
2688         `nodeId`s. This was an issue for canvases, as the frontend would be notified whenever any
2689         canvas is created, which would usually occur before the `DOMContentLoaded` event is fired.
2690         As a result, the canvases would attempt to retrieve their associated node, only to have the
2691         DOMAgent discard those bindings quickly thereafter.
2692
2693         This patch removes DOMAgent's and DOMDebuggerAgent's (parity) instrumentation hooks for the
2694         latter event, ensuring that the bindings are only discarded once.
2695
2696         * inspector/agents/InspectorDOMAgent.h:
2697         * inspector/agents/InspectorDOMAgent.cpp:
2698         (WebCore::InspectorDOMAgent::mainFrameDOMContentLoaded): Deleted.
2699
2700         * inspector/agents/InspectorDOMDebuggerAgent.h:
2701         * inspector/agents/InspectorDOMDebuggerAgent.cpp:
2702         (WebCore::InspectorDOMDebuggerAgent::frameDocumentUpdated): Added.
2703         (WebCore::InspectorDOMDebuggerAgent::mainFrameDOMContentLoaded): Deleted.
2704
2705         * inspector/InspectorInstrumentation.cpp:
2706         (WebCore::InspectorInstrumentation::domContentLoadedEventFiredImpl):
2707         (WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
2708
2709 2018-03-15  Tim Horton  <timothy_horton@apple.com>
2710
2711         Include CADisplayLink explicitly where needed, instead of all of CA
2712         https://bugs.webkit.org/show_bug.cgi?id=183689
2713         <rdar://problem/38528719>
2714
2715         Reviewed by Wenson Hsieh.
2716
2717         * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
2718
2719 2018-03-15  Tim Horton  <timothy_horton@apple.com>
2720
2721         Include MobileCoreServices in the WebCore prefix header
2722         https://bugs.webkit.org/show_bug.cgi?id=183688
2723         <rdar://problem/38527621>
2724
2725         Reviewed by Dan Bernstein.
2726
2727         * WebCorePrefix.h:
2728
2729 2018-03-15  Megan Gardner  <megan_gardner@apple.com>
2730
2731         Create MediaQueryParserContext to provide additional context for the evaluation of media queries
2732         https://bugs.webkit.org/show_bug.cgi?id=183677
2733
2734         Reviewed by Tim Horton.
2735
2736         We need additional context for parsing media queries to make sure they are parsed correctly and valid.
2737
2738         Not currently testable, will add tests in a later patch.
2739
2740         * WebCore.xcodeproj/project.pbxproj:
2741         * css/MediaList.cpp:
2742         (WebCore::MediaQuerySet::create):
2743         (WebCore::MediaQuerySet::set):
2744         (WebCore::MediaQuerySet::add):
2745         (WebCore::MediaQuerySet::remove):
2746         * css/MediaList.h:
2747         * css/MediaQueryEvaluator.cpp:
2748         (WebCore::MediaQueryEvaluator::mediaAttributeMatches):
2749         * css/MediaQueryExpression.cpp:
2750         (WebCore::featureWithValidIdent):
2751         (WebCore::featureWithValidDensity):
2752         (WebCore::featureWithValidPositiveLength):
2753         (WebCore::featureWithPositiveInteger):
2754         (WebCore::featureWithPositiveNumber):
2755         (WebCore::featureWithZeroOrOne):
2756         (WebCore::isFeatureValidWithoutValue):
2757         (WebCore::MediaQueryExpression::MediaQueryExpression):
2758         * css/MediaQueryExpression.h:
2759         * css/MediaQueryMatcher.cpp:
2760         (WebCore::MediaQueryMatcher::matchMedia):
2761         * css/MediaQueryParserContext.cpp: Added.
2762         (WebCore::MediaQueryParserContext::MediaQueryParserContext):
2763         * css/MediaQueryParserContext.h: Added.
2764         (WebCore::MediaQueryParserContext::MediaQueryParserContext):
2765         * css/StyleMedia.cpp:
2766         (WebCore::StyleMedia::matchMedium const):
2767         * css/StyleRuleImport.cpp:
2768         (WebCore::StyleRuleImport::StyleRuleImport):
2769         (WebCore::StyleRuleImport::setCSSStyleSheet):
2770         * css/parser/CSSParser.cpp:
2771         (WebCore::CSSParserContext::CSSParserContext):
2772         (WebCore::operator==):
2773         * css/parser/CSSParserImpl.cpp:
2774         (WebCore::CSSParserImpl::consumeImportRule):
2775         (WebCore::CSSParserImpl::consumeMediaRule):
2776         * css/parser/MediaQueryParser.cpp:
2777         (WebCore::MediaQueryParser::parseMediaQuerySet):
2778         (WebCore::MediaQueryParser::parseMediaCondition):
2779         (WebCore::MediaQueryParser::MediaQueryParser):
2780         (WebCore::MediaQueryData::addExpression):
2781         * css/parser/MediaQueryParser.h:
2782         (WebCore::MediaQueryData::setMediaQueryParserContext):
2783         * css/parser/SizesAttributeParser.cpp:
2784         (WebCore::SizesAttributeParser::parse):
2785         * dom/DOMImplementation.cpp:
2786         (WebCore::DOMImplementation::createCSSStyleSheet):
2787         * dom/InlineStyleSheetOwner.cpp:
2788         (WebCore::InlineStyleSheetOwner::createSheet):
2789         * dom/ProcessingInstruction.cpp:
2790         (WebCore::ProcessingInstruction::setCSSStyleSheet):
2791         * html/HTMLImageElement.cpp:
2792         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2793         * html/HTMLLinkElement.cpp:
2794         (WebCore::HTMLLinkElement::process):
2795         (WebCore::HTMLLinkElement::initializeStyleSheet):
2796         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2797         * html/HTMLLinkElement.h:
2798         * html/HTMLMediaElement.cpp:
2799         (WebCore::HTMLMediaElement::selectNextSourceChild):
2800         * html/HTMLSourceElement.cpp:
2801         (WebCore::HTMLSourceElement::parsedMediaAttribute const):
2802         * html/HTMLSourceElement.h:
2803         * html/HTMLStyleElement.cpp:
2804         (WebCore::HTMLStyleElement::parseAttribute):
2805         * html/parser/HTMLPreloadScanner.cpp:
2806         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2807
2808 2018-03-15  Commit Queue  <commit-queue@webkit.org>
2809
2810         Unreviewed, rolling out r229639.
2811         https://bugs.webkit.org/show_bug.cgi?id=183683
2812
2813         it is causing a crash in API tests (Requested by youenn on
2814         #webkit).
2815
2816         Reverted changeset:
2817
2818         "ActiveDOMObject should assert that they are destroyed in the
2819         thread they are created"
2820         https://bugs.webkit.org/show_bug.cgi?id=183671
2821         https://trac.webkit.org/changeset/229639
2822
2823 2018-03-15  Youenn Fablet  <youenn@apple.com>
2824
2825         Bad configuration parameters should make RTCPeerConnection constructor throw
2826         https://bugs.webkit.org/show_bug.cgi?id=183615
2827
2828         Reviewed by Eric Carlson.
2829
2830         Implement more of https://w3c.github.io/webrtc-pc/#set-pc-configuration.
2831         Throw an error whenever underlying libwebrtc set configuration fails.
2832
2833         Covered by rebased test.
2834
2835         * Modules/mediastream/PeerConnectionBackend.h:
2836         * Modules/mediastream/RTCPeerConnection.cpp:
2837         (WebCore::iceServersFromConfiguration):
2838         (WebCore::RTCPeerConnection::initializeConfiguration):
2839         (WebCore::RTCPeerConnection::setConfiguration):
2840         * Modules/mediastream/RTCPeerConnection.js:
2841         (initializeRTCPeerConnection):
2842         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2843
2844 2018-03-15  Youenn Fablet  <youenn@apple.com>
2845
2846         replaceTrack triggers negotiationneeded
2847         https://bugs.webkit.org/show_bug.cgi?id=180342
2848         <rdar://problem/35822426>
2849
2850         Reviewed by Eric Carlson.
2851
2852         Covered by updated test.
2853         Fix the case of replacing a track for which data is already flowing.
2854         We should probably do the same for null tracks when fully implementing transceivers.
2855
2856         * Modules/mediastream/RTCPeerConnection.cpp:
2857         (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
2858
2859 2018-03-15  Keith Rollin  <krollin@apple.com>
2860
2861         Telemetry for stalled webpage loads
2862         https://bugs.webkit.org/show_bug.cgi?id=183221
2863         <rdar://problem/36549013>
2864
2865         Reviewed by Chris Dumez.
2866
2867         Add telemetry for page loads, tracking the pages that succeed, fail,
2868         or are canceled. This information will be used to track the overall
2869         health of our page loading as time goes on.
2870
2871         No new tests -- no new/changed user-level functionality.
2872
2873         * page/DiagnosticLoggingKeys.cpp:
2874         (WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
2875         (WebCore::DiagnosticLoggingKeys::timedOutKey):
2876         (WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
2877         (WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
2878         (WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
2879         (WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
2880         (WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
2881         (WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
2882         (WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
2883         (WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
2884         (WebCore::DiagnosticLoggingKeys::occurredKey):
2885         (WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
2886         (WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
2887         (WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
2888         (WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
2889         * page/DiagnosticLoggingKeys.h:
2890         * platform/network/cf/ResourceError.h:
2891         (WebCore::ResourceError::ResourceError):
2892         * platform/network/mac/ResourceErrorMac.mm:
2893         (WebCore::ResourceError::ResourceError):
2894         (WebCore::ResourceError::getNSURLErrorDomain const):
2895         (WebCore::ResourceError::getCFErrorDomainCFNetwork const):
2896         (WebCore::ResourceError::mapPlatformError):
2897
2898 2018-03-15  Youenn Fablet  <youenn@apple.com>
2899
2900         ActiveDOMObject should assert that they are destroyed in the thread they are created
2901         https://bugs.webkit.org/show_bug.cgi?id=183671
2902
2903         Reviewed by Chris Dumez.
2904
2905         No change of behavior.
2906         Moved MessagePort assertion to ActiveDOMObject.
2907
2908         * dom/ActiveDOMObject.cpp:
2909         (WebCore::ActiveDOMObject::~ActiveDOMObject):
2910         * dom/ActiveDOMObject.h:
2911         * dom/MessagePort.cpp:
2912         (WebCore::MessagePort::~MessagePort):
2913         * dom/MessagePort.h:
2914
2915 2018-03-15  Youenn Fablet  <youenn@apple.com>
2916
2917         MessagePort is not always destroyed on the right thread
2918         https://bugs.webkit.org/show_bug.cgi?id=183619
2919         <rdar://problem/38204711>
2920
2921         Reviewed by Chris Dumez.
2922
2923         Add assertion to ensure MessagePort is destroyed in the right thread.
2924         Modify methods taking a ref in a lambda to rely on weak pointers and refing the WorkerThread if in a worker context.
2925         It is safe to ref the WorkerThread since it is thread safe ref counted and we are passing the ref to the main thread
2926         where the WorkerThread is expected to be destroyed.
2927
2928         Test: http/tests/workers/worker-messageport-2.html
2929
2930         * dom/MessagePort.cpp:
2931         (WebCore::MessagePort::~MessagePort):
2932         (WebCore::MessagePort::dispatchMessages):
2933         (WebCore::MessagePort::updateActivity):
2934         (WebCore::MessagePort::hasPendingActivity const):
2935         * dom/MessagePort.h:
2936
2937 2018-03-15  Jer Noble  <jer.noble@apple.com>
2938
2939         Adopt new AVURLAssetUseClientURLLoadingExclusively AVURLAsset creation option.
2940         https://bugs.webkit.org/show_bug.cgi?id=183660
2941
2942         Reviewed by Jon Lee.
2943
2944         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2945         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2946
2947 2018-03-15  Chris Dumez  <cdumez@apple.com>
2948
2949         Unreviewed, fix tiny mistake in r229615 that caused API tests failures.
2950
2951         * workers/service/server/SWServer.cpp:
2952         (WebCore::SWServer::addRegistrationFromStore):
2953
2954 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
2955
2956         [TexMap] Remove TextureMapperLayer::texture()
2957         https://bugs.webkit.org/show_bug.cgi?id=183635
2958
2959         Reviewed by Michael Catanzaro.
2960
2961         Remove the unused TextureMapperLayer::texture() method. This enables
2962         removing the virtual TextureMapperBackingStore::texture() method, as
2963         well as the implementations of it in TextureMapperTiledBackingStore and
2964         CoordinatedBackingStore classes.
2965
2966         No change in behavior.
2967
2968         * platform/graphics/texmap/TextureMapperBackingStore.h:
2969         * platform/graphics/texmap/TextureMapperLayer.h:
2970         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
2971         (WebCore::TextureMapperTiledBackingStore::texture const): Deleted.
2972         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2973
2974 2018-03-15  Zan Dobersek  <zdobersek@igalia.com>
2975
2976         [TexMap] Don't bother caching pattern transform matrix
2977         https://bugs.webkit.org/show_bug.cgi?id=183633
2978
2979         Reviewed by Michael Catanzaro.
2980
2981         Remove the m_patternTransform and m_patternTransformDirty member
2982         variables from the TextureMapperLayer class. These unnecessarily
2983         complicate the state update methods that need to compare the given
2984         attribute against the current state, and only update it if it has
2985         changed.
2986
2987         Instead, compute the pattern TransformationMatrix value on-the-fly in
2988         the paintSelf() method, if at all necessary.
2989
2990         No change in functionality.
2991
2992         * platform/graphics/texmap/TextureMapperLayer.cpp:
2993         (WebCore::TextureMapperLayer::paintSelf):
2994         (WebCore::TextureMapperLayer::setContentsRect):
2995         (WebCore::TextureMapperLayer::setContentsTileSize):
2996         (WebCore::TextureMapperLayer::setContentsTilePhase):
2997         (WebCore::TextureMapperLayer::computePatternTransformIfNeeded): Deleted.
2998         * platform/graphics/texmap/TextureMapperLayer.h:
2999
3000 2018-03-14  John Wilander  <wilander@apple.com>
3001
3002         Resource Load Statistics: Add clearing of storage access to WebResourceLoadStatisticsStore::clearInMemory()
3003         https://bugs.webkit.org/show_bug.cgi?id=183641
3004         <rdar://problem/38469497>
3005
3006         Reviewed by Brent Fulgham and Chris Dumez.
3007
3008         No new tests. This change is to stabilize existing layout tests.
3009         See Ryan Haddad's comment in https://bugs.webkit.org/show_bug.cgi?id=183620.
3010
3011         * platform/network/NetworkStorageSession.h:
3012         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3013         (WebCore::NetworkStorageSession::removeAllStorageAccess):
3014             New function to clear out all storage access entries.
3015
3016 2018-03-14  Youenn Fablet  <youenn@apple.com>
3017
3018         imported/w3c/web-platform-tests/WebCryptoAPI/wrapKey_unwrapKey/wrapKey_unwrapKey.worker.html is crashing
3019         https://bugs.webkit.org/show_bug.cgi?id=183602
3020
3021         Reviewed by Chris Dumez.
3022
3023         Introduce a map of ScriptExecutionContext that is read/write protected using a Lock.
3024         This allows introducing postTaskTo taking a ScriptExecutionContext identifier and callable from any thread.
3025         Use that method in Crypto instead of refing/unrefing  the context.
3026         Lock only happens if context does some postTask activity. This is governed by calling or not the new contextIdentifier() getter.
3027
3028         Covered by crypto tests no longer failing m_workerGlobalScope->hasOneRef() assertion.
3029
3030         * crypto/CryptoAlgorithm.cpp:
3031         (WebCore::dispatchAlgorithmOperation):
3032         * crypto/algorithms/CryptoAlgorithmECDH.cpp:
3033         (WebCore::CryptoAlgorithmECDH::deriveBits):
3034         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
3035         (WebCore::CryptoAlgorithmSHA1::digest):
3036         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
3037         (WebCore::CryptoAlgorithmSHA224::digest):
3038         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
3039         (WebCore::CryptoAlgorithmSHA256::digest):
3040         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
3041         (WebCore::CryptoAlgorithmSHA384::digest):
3042         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
3043         (WebCore::CryptoAlgorithmSHA512::digest):
3044         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
3045         (WebCore::CryptoKeyRSA::generatePair):
3046         * crypto/mac/CryptoKeyRSAMac.cpp:
3047         (WebCore::CryptoKeyRSA::generatePair):
3048         * dom/Document.cpp:
3049         (WebCore::Document::~Document):
3050         * dom/ScriptExecutionContext.cpp:
3051         (WebCore::allScriptExecutionContextsMapLock):
3052         (WebCore::ScriptExecutionContext::ScriptExecutionContext):
3053         (WebCore::ScriptExecutionContext::removeFromContextsMap):
3054         (WebCore::ScriptExecutionContext::checkConsistency const):
3055         (WebCore::ScriptExecutionContext::postTaskTo):
3056         * dom/ScriptExecutionContext.h:
3057         (WebCore::ScriptExecutionContext::contextIdentifier const):
3058         * workers/WorkerGlobalScope.cpp:
3059         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
3060
3061 2018-03-14  Chris Dumez  <cdumez@apple.com>
3062
3063         Reduce use of SWServerToContextConnection::globalServerToContextConnection()
3064         https://bugs.webkit.org/show_bug.cgi?id=183626
3065
3066         Reviewed by Youenn Fablet.
3067
3068         Reduce use of SWServerToContextConnection::globalServerToContextConnection() as we are moving towards
3069         having multiple context connections.
3070
3071         No new tests, no expected behavior change.
3072
3073         * workers/service/server/SWServer.cpp:
3074         (WebCore::SWServer::matchAll):
3075         (WebCore::SWServer::serverToContextConnectionCreated):
3076         (WebCore::SWServer::runServiceWorkerIfNecessary):
3077         (WebCore::SWServer::runServiceWorker):
3078         (WebCore::SWServer::terminateWorkerInternal):
3079         (WebCore::SWServer::markAllWorkersAsTerminated):
3080         (WebCore::SWServer::workerContextTerminated):
3081         (WebCore::SWServer::fireInstallEvent):
3082         (WebCore::SWServer::fireActivateEvent):
3083         * workers/service/server/SWServer.h:
3084         * workers/service/server/SWServerToContextConnection.cpp:
3085         (WebCore::SWServerToContextConnection::findClientByIdentifier):
3086         (WebCore::SWServerToContextConnection::matchAll):
3087         (WebCore::SWServerToContextConnection::claim):
3088         * workers/service/server/SWServerWorker.cpp:
3089         (WebCore::SWServerWorker::contextConnection):
3090         (WebCore::SWServerWorker::matchAll):
3091         * workers/service/server/SWServerWorker.h:
3092
3093 2018-03-14  Youenn Fablet  <youenn@apple.com>
3094
3095         MessagePort should remove its listeners when being closed
3096         https://bugs.webkit.org/show_bug.cgi?id=183644
3097
3098         Reviewed by Chris Dumez.
3099
3100         Test: http/tests/workers/worker-messageport.html
3101
3102         * dom/MessagePort.cpp:
3103         (WebCore::MessagePort::close):
3104         (WebCore::MessagePort::contextDestroyed):
3105
3106 2018-03-14  Chris Dumez  <cdumez@apple.com>
3107
3108         Drop unnecessary StorageToWebProcessConnection::workerContextProcessConnectionCreated()
3109         https://bugs.webkit.org/show_bug.cgi?id=183624
3110
3111         Reviewed by Youenn Fablet.
3112
3113         Pass in context connection to SWServer::serverToContextConnectionCreated() to avoid
3114         relying on the deprecated globalServerToContextConnection().
3115
3116         No new tests, no expected behavior change.
3117
3118         * workers/service/server/SWServer.cpp:
3119         (WebCore::SWServer::serverToContextConnectionCreated):
3120         * workers/service/server/SWServer.h:
3121
3122 2018-03-14  Mark Lam  <mark.lam@apple.com>
3123
3124         Enhance the MacroAssembler and LinkBuffer to support pointer profiling.
3125         https://bugs.webkit.org/show_bug.cgi?id=183623
3126         <rdar://problem/38443314>
3127
3128         Reviewed by Michael Saboff.
3129
3130         No new tests.  Just adding PtrTags required by new MacroAssembler API.
3131
3132         * cssjit/FunctionCall.h:
3133         (WebCore::FunctionCall::prepareAndCall):
3134         * cssjit/SelectorCompiler.cpp:
3135         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
3136
3137 2018-03-14  Chris Fleizach  <cfleizach@apple.com>
3138
3139         AX: Implement accessible dismiss action on iOS
3140         https://bugs.webkit.org/show_bug.cgi?id=183352
3141         <rdar://problem/38161500>
3142
3143         Reviewed by Zalan Bujtas.
3144
3145         Test: accessibility/ios-simulator/AOM-dismiss-event.html
3146
3147         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3148         (-[WebAccessibilityObjectWrapper accessibilityPerformEscape]):
3149
3150 2018-03-14  Youenn Fablet  <youenn@apple.com>
3151
3152         Update libwebrtc up to 36af4e9614f707f733eb2340fae66d6325aaac5b
3153         https://bugs.webkit.org/show_bug.cgi?id=183481
3154
3155         Reviewed by Eric Carlson.
3156
3157         Covered by existing tests.
3158         Updated libwebrtc binding code.
3159
3160         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3161         (WebCore::fillEncodingParameters):
3162         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
3163
3164 2018-03-14  Tim Horton  <timothy_horton@apple.com>
3165
3166         Fix the build after r229567
3167
3168         * Configurations/FeatureDefines.xcconfig:
3169
3170 2018-03-13  John Wilander  <wilander@apple.com>
3171
3172         Resource Load Statistics: Immediately forward cookie access for domains with previous user interaction when there's an opener document
3173         https://bugs.webkit.org/show_bug.cgi?id=183620
3174         <rdar://problem/38431469>
3175
3176         Reviewed by Brent Fulgham.
3177
3178         Tests: http/tests/storageAccess/deny-storage-access-under-opener.html
3179                http/tests/storageAccess/grant-storage-access-under-opener.html
3180
3181         It turns out the fix in https://bugs.webkit.org/show_bug.cgi?id=183577
3182         wasn't enough to address the compatibility issues with popups. Some of
3183         them just detect their unpartitioned cookies, auto-dismiss themselves,
3184         and expect their unpartitioned cookies to be available under the opener
3185         afterwards. We should grant them access if the popup's domain has had
3186         user interaction _previously_.
3187
3188         Note that we still need https://bugs.webkit.org/show_bug.cgi?id=183577
3189         because if the popup's domain has not received user interaction
3190         previously, we will not grant it storage access on just the window open.
3191
3192         * dom/Document.cpp:
3193         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
3194         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
3195         (WebCore::Document::hasGrantedPageSpecificStorageAccess): Deleted.
3196         (WebCore::Document::setHasGrantedPageSpecificStorageAccess): Deleted.
3197             Renamed from *Granted* to *Requested* since there is now a case
3198             where access will not be granted, i.e. when the popup domain has
3199             not had user interaction previously.
3200         * dom/Document.h:
3201         * loader/ResourceLoadObserver.cpp:
3202         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
3203             Renamed *Grant* to *Request*.
3204         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3205         (WebCore::ResourceLoadObserver::logWindowCreation):
3206             New function called from DOMWindow::createWindow().
3207         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
3208             New convenience function.
3209         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback): Deleted.
3210             Renamed *Grant* to *Request*.
3211         * loader/ResourceLoadObserver.h:
3212         * page/DOMWindow.cpp:
3213         (WebCore::DOMWindow::createWindow):
3214             Now calls ResourceLoadObserver::logWindowCreation() if a window
3215             was created and the opener has a document and a page ID.
3216
3217 2018-03-13  Chris Dumez  <cdumez@apple.com>
3218
3219         fast/loader/javascript-url-iframe-remove-on-navigate.html is a flaky crash on iOS with async delegates
3220         https://bugs.webkit.org/show_bug.cgi?id=183610
3221
3222         Reviewed by Youenn Fablet.
3223
3224         The issue was that in DocumentLoader::loadMainResource(), the call to requestMainResource() which
3225         return null due to the load getting cancelled synchronously. If this load is the parent frame's last
3226         pending load, then the 'load' event gets fired in the parent frame. In the test, the parent frame's
3227         load event handler does a document.write() call which blows away the iframe. As a result, when
3228         we return from the requestMainResource(), m_frame is null and we crash later on dereferencing it.
3229
3230         No new tests, covered by fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html
3231         which was crashing flakily.
3232
3233         * loader/DocumentLoader.cpp:
3234         (WebCore::DocumentLoader::loadMainResource):
3235
3236 2018-03-13  Jer Noble  <jer.noble@apple.com>
3237
3238         [iOS] Muted media playback can interrupt out-of-process audio
3239         https://bugs.webkit.org/show_bug.cgi?id=183606
3240         <rdar://problem/37466253>
3241
3242         Reviewed by Eric Carlson.
3243
3244         Test: Updated TestWebKitAPI test to verify the correct AVAudioSession category is set.
3245
3246         A non-playing, non-muted media element will cause the AVAudioSession category to be set to
3247         "playing" when a muted media element begins playback. Ignore these non-playing elements for
3248         the purposes of determining the AVAudioSession category.
3249
3250         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
3251         (PlatformMediaSessionManager::updateSessionState):
3252
3253 2018-03-13  Youenn Fablet  <youenn@apple.com>
3254
3255         Calling removeTrack with RTCRtpSender does not set SenderTrack to null
3256         https://bugs.webkit.org/show_bug.cgi?id=183308
3257
3258         Reviewed by Eric Carlson.
3259
3260         Covered by updated test.
3261
3262         * Modules/mediastream/RTCRtpSender.cpp:
3263         (WebCore::RTCRtpSender::stop): Set track to null when being stopped i.e. removed.
3264         * Modules/mediastream/RTCRtpSender.h:
3265
3266 2018-03-13  Youenn Fablet  <youenn@apple.com>
3267
3268         Changing link element rel attribute from preload to stylesheet should succeed loading the stylesheet
3269         https://bugs.webkit.org/show_bug.cgi?id=183601
3270         <rdar://problem/38309441>
3271
3272         Reviewed by Antti Koivisto.
3273
3274         Test: http/wpt/preload/change-link-rel-attribute.html
3275
3276         * loader/LinkPreloadResourceClients.h:
3277         (WebCore::LinkPreloadResourceClient::clearResource): Remove the call to CachedResource::cancelLoad.
3278         This call is expected to be called by ResourceLoader when cancelling the load from below CachedResource.
3279         * loader/cache/CachedResource.cpp:
3280         (WebCore::CachedResource::allClientsRemoved): In case of preload,
3281         cancel the load if not finished when there is no more client attached to it.
3282         * loader/cache/CachedResource.h:
3283
3284 2018-03-12  John Wilander  <wilander@apple.com>
3285
3286         Resource Load Statistics: Immediately forward cookie access at user interaction when there's an opener document
3287         https://bugs.webkit.org/show_bug.cgi?id=183577
3288         <rdar://problem/38266987>
3289
3290         Reviewed by Brent Fulgham.
3291
3292         Tested manually on live websites.
3293         No new automated tests because of a bug in WebKitTestRunner:
3294         https://bugs.webkit.org/show_bug.cgi?id=183578
3295         The event sender triggers gestures in the opener rather than
3296         in the popup.
3297
3298         * dom/Document.cpp:
3299         (WebCore::Document::removedLastRef):
3300             Clears the new m_primaryDomainsGrantedPageSpecificStorageAccess.
3301         (WebCore::Document::hasGrantedPageSpecificStorageAccess):
3302         (WebCore::Document::setHasGrantedPageSpecificStorageAccess):
3303         * dom/Document.h:
3304             Added member m_primaryDomainsGrantedPageSpecificStorageAccess
3305             where we store domains that have been granted access.
3306         * loader/ResourceLoadObserver.cpp:
3307         (WebCore::ResourceLoadObserver::setGrantStorageAccessUnderOpenerCallback):
3308         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
3309             Now checks if there is a cross-origin opener and if so, immediately
3310             grants cookie access to the popup's domain if it is partitioned or
3311             blocked. 
3312         * loader/ResourceLoadObserver.h:
3313         * platform/network/NetworkStorageSession.h:
3314             Added member m_pagesGrantedStorageAccess.
3315         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
3316         (WebCore::NetworkStorageSession::cookieStoragePartition const):
3317         (WebCore::NetworkStorageSession::hasStorageAccess const):
3318             Renamed from hasStorageAccessForFrame since the frameID now is optional.
3319         (WebCore::NetworkStorageSession::grantStorageAccess):
3320             Renamed from grantStorageAccessForFrame since the frameID now is optional.
3321         (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
3322             Now removes the pageID entry in m_pagesGrantedStorageAccess.
3323         (WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Deleted.
3324             Renamed since the frameID now is optional.
3325         (WebCore::NetworkStorageSession::grantStorageAccessForFrame): Deleted.
3326             Renamed since the frameID now is optional.
3327
3328 2018-03-12  Tim Horton  <timothy_horton@apple.com>
3329
3330         Stop using SDK conditionals to control feature definitions
3331         https://bugs.webkit.org/show_bug.cgi?id=183430
3332         <rdar://problem/38251619>
3333
3334         Reviewed by Dan Bernstein.
3335
3336         * Configurations/FeatureDefines.xcconfig:
3337         * Configurations/WebKitTargetConditionals.xcconfig: Renamed.
3338
3339 2018-03-12  Chris Dumez  <cdumez@apple.com>
3340
3341         Return boolean from DOMTokenList's replace() method
3342         https://bugs.webkit.org/show_bug.cgi?id=183567
3343
3344         Reviewed by Youenn Fablet.
3345
3346         Have DOMTokenList's replace() method return a boolean indicating if the
3347         token was replaced, as per:
3348         - https://dom.spec.whatwg.org/#dom-domtokenlist-replace
3349
3350         This is a recent addition to the DOM specification:
3351         - https://github.com/whatwg/dom/pull/582
3352
3353         No new tests, rebaselined existing test.
3354
3355         * html/DOMTokenList.cpp:
3356         (WebCore::replaceInOrderedSet):
3357         (WebCore::DOMTokenList::replace):
3358         * html/DOMTokenList.h:
3359         * html/DOMTokenList.idl:
3360
3361 2018-03-12  Brian Burg  <bburg@apple.com>
3362
3363         Ignore some deprecation warnings encountered when compiling with newer versions of ICU
3364         https://bugs.webkit.org/show_bug.cgi?id=183584
3365         <rdar://problem/38395317>
3366
3367         Reviewed by Daniel Bates.
3368
3369         Ignore new deprecation warnings. Where a function has more than one
3370         deprecation warning, mark out the entire function so it remains readable.
3371
3372         * editing/TextIterator.cpp:
3373         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
3374         (WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
3375         * platform/text/TextEncoding.cpp:
3376
3377 2018-03-12  Yoav Weiss  <yoav@yoav.ws>
3378
3379         Runtime flag for link prefetch and remove link subresource.
3380         https://bugs.webkit.org/show_bug.cgi?id=183540
3381
3382         Reviewed by Chris Dumez.
3383
3384         This patch removes the LINK_PREFETCH build time flag, removes
3385         link subresource, adds an off-by-default runtime flag for link
3386         prefetch and makes sure link prefetch only works when this flag is on.
3387
3388         Subresource is removed as it's not a part of any spec, nor supported by any
3389         other browser. It was replaced by link preload.
3390
3391         No new tests as this is not adding any new functionality.
3392
3393         * Configurations/FeatureDefines.xcconfig: Remove the LINK_PREFETCH flag.
3394         * html/LinkRelAttribute.cpp:
3395         (WebCore::LinkRelAttribute::LinkRelAttribute): Put prefetch support behind the runtime flag.
3396         (WebCore::LinkRelAttribute::isSupported): Add prefetch.
3397         * html/LinkRelAttribute.h: Remove the LINK_PREFETCH flag.
3398         * loader/LinkLoader.cpp:
3399         (WebCore::createLinkPreloadResourceClient): Remove the LINK_PREFETCH flag.
3400         (WebCore::LinkLoader::prefetchIfNeeded): Move the prefetch code to `prefetchIfNeeded()`. Remove subresource bits.
3401         (WebCore::LinkLoader::loadLink): Call `prefetchIfNeeded()`.
3402         * loader/LinkLoader.h:
3403         * loader/ResourceLoadInfo.cpp:
3404         (WebCore::toResourceType): Remove the LINK_PREFETCH flag as well as subresource.
3405         *