Allow clients to override their own hardware media requirements where no fallback...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-14  Jer Noble  <jer.noble@apple.com>
2
3         Allow clients to override their own hardware media requirements where no fallback media exists.
4         https://bugs.webkit.org/show_bug.cgi?id=174426
5         <rdar://problem/32537704>
6
7         Reviewed by Eric Carlson.
8
9         Add a new setting which allows clients to specify their own mediaContentTypesRequiringHardwareSupport should be
10         ignared in the case where no fallback exists, such as the case of a single <source> element, or setting the src
11         attribute directly.
12
13         * html/HTMLMediaElement.cpp:
14         (WebCore::HTMLMediaElement::havePotentialSourceChild):
15         (WebCore::HTMLMediaElement::selectNextSourceChild):
16         (WebCore::HTMLMediaElement::sourceWasAdded):
17         (WebCore::HTMLMediaElement::sourceWasRemoved):
18         (WebCore::HTMLMediaElement::mediaPlayerShouldCheckHardwareSupport):
19         * html/HTMLMediaElement.h:
20         * page/Settings.h:
21         * platform/graphics/MediaPlayer.cpp:
22         (WebCore::MediaPlayer::shouldCheckHardwareSupport):
23         * platform/graphics/MediaPlayer.h:
24         (WebCore::MediaPlayerClient::mediaPlayerShouldCheckHardwareSupport):
25         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
26         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
27         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
28         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
29
30 2017-07-14  Chris Dumez  <cdumez@apple.com>
31
32         Possible crash under NetworkSocketStream::didFailSocketStream()
33         https://bugs.webkit.org/show_bug.cgi?id=174526
34         <rdar://problem/32831441>
35
36         Reviewed by Brent Fulgham.
37
38         Call m_client.didFailSocketStream() asynchronously in the constructor as our
39         caller (the client) is also being initialized at this point.
40
41         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
42         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
43
44 2017-07-14  Youenn Fablet  <youenn@apple.com>
45
46         WebRTC: silence data not sent for disabled audio track
47         https://bugs.webkit.org/show_bug.cgi?id=174456
48         <rdar://problem/33284623>
49
50         Reviewed by Eric Carlson.
51
52         Test: webrtc/audio-muted-stats.html
53               webrtc/audio-muted-stats2.html
54
55         Adding a timer-based approach to send 10ms of silence every second.
56         This is consistent with how muted video tracks are implemented.
57         In case the audio track is muted at the time it is added, no silence data is sent.
58
59         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
60         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
61         (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
62         (WebCore::RealtimeOutgoingAudioSource::stop):
63         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
64         (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
65         (WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded):
66         (WebCore::RealtimeOutgoingAudioSource::sendSilence):
67         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
68
69 2017-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
70
71         [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
72         https://bugs.webkit.org/show_bug.cgi?id=153189
73
74         Reviewed by Antonio Gomes.
75
76         * CMakeLists.txt: Include WebCoreMacros.cmake.
77         * WebCoreMacros.cmake: Added.
78
79 2017-07-14  Jeremy Jones  <jeremyj@apple.com>
80
81         Fix style for name of class alloc function in WebVideoFullscreenInterfaceAVKit.
82         https://bugs.webkit.org/show_bug.cgi?id=174476
83
84         Reviewed by Alex Christensen.
85
86         No new tests because no behavior change.
87
88         This is a rename for per style requirements.
89
90         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
91         (allocWebAVPictureInPicturePlayerLayerViewInstance):
92         (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
93         (allocWebAVPlayerLayerViewInstance):
94         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
95         (getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
96         (getWebAVPlayerLayerViewClass): Deleted.
97
98 2017-07-14  Jer Noble  <jer.noble@apple.com>
99
100         [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
101         https://bugs.webkit.org/show_bug.cgi?id=174514
102
103         Reviewed by Sam Weinig.
104
105         Test: media/media-source/media-source-remove-decodeorder-crash.html
106
107         Fix the algorithm in removeCodedFrames() so that it's not possible to have a removePresentationStart >
108         removePresentationEnd (and also removeDecodeStart > removeDecodeEnd).
109
110         * Modules/mediasource/SampleMap.cpp:
111         (WebCore::PresentationOrderSampleMap::findSampleContainingOrAfterPresentationTime):
112         (WebCore::PresentationOrderSampleMap::findSampleStartingAfterPresentationTime):
113         * Modules/mediasource/SampleMap.h:
114         * Modules/mediasource/SourceBuffer.cpp:
115         (WebCore::SourceBuffer::removeCodedFrames):
116
117 2017-07-14  Youenn Fablet  <youenn@apple.com>
118
119         Increase CoreAudio render audio buffer sizes for WebRTC
120         https://bugs.webkit.org/show_bug.cgi?id=174508
121
122         Reviewed by Eric Carlson.
123
124         Covered by manually testing audio rendering through WebRTC sites.
125
126         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
127         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): Setting audio buffer size equivalent to 20 ms.
128
129 2017-07-14  Brady Eidson  <beidson@apple.com>
130
131         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
132         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
133
134         Reviewed by Tim Horton.
135
136         * platform/spi/cf/CFNetworkSPI.h:
137
138 2017-07-14  Youenn Fablet  <youenn@apple.com>
139
140         Remove CoreAudioCaptureSource speaker configuration
141         https://bugs.webkit.org/show_bug.cgi?id=174512
142
143         Reviewed by Eric Carlson.
144
145         Covered by manually testing audio rendering through WebRTC sites.
146
147         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
148         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
149
150 2017-07-14  Eric Carlson  <eric.carlson@apple.com>
151
152         [MediaStream] Limit the number of remote video samples queued
153         https://bugs.webkit.org/show_bug.cgi?id=174505
154         <rdar://problem/33223015>
155
156         Reviewed by Youenn Fablet.
157
158         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
159         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeOldSamplesFromPendingQueue): Only
160         enqueue a fixed number of frames with invalid or negative decode times.
161
162 2017-07-14  Youenn Fablet  <youenn@apple.com>
163
164         Report CoreAudioCaptureSource failure in case shared unit stops working properly
165         https://bugs.webkit.org/show_bug.cgi?id=174494
166
167         Reviewed by Eric Carlson.
168
169         Manual test by interrupting an audio capture on Mac.
170
171         This patch adds a timer to CoreAudioSharedUnit.
172         In case the capture callback is not called after one second, the shared unit is said to fail.
173         Each source is notified that capture is failing.
174         This will in turn trigger onend track event so that web pages can remedy capture failure.
175
176         Timer starts with 10 seconds for audio data to start being captured.
177         It is then decreased to 2 seconds.
178
179         * platform/mediastream/RealtimeMediaSource.cpp:
180         (WebCore::RealtimeMediaSource::captureFailed):
181         * platform/mediastream/RealtimeMediaSource.h:
182         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
183         (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
184         (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
185         (WebCore::CoreAudioSharedUnit::startInternal):
186         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
187         (WebCore::CoreAudioSharedUnit::stopInternal):
188
189 2017-07-14  Jer Noble  <jer.noble@apple.com>
190
191         Adding the 'autoplay' attribute to a media element during a user gesture should remove user gesture restrictions.
192         https://bugs.webkit.org/show_bug.cgi?id=174373
193
194         Reviewed by Eric Carlson.
195
196         Test: media/video-add-autoplay-user-gesture.html
197
198         * html/HTMLMediaElement.cpp:
199         (WebCore::HTMLMediaElement::parseAttribute):
200
201 2017-07-14  Matt Lewis  <jlewis3@apple.com>
202
203         Unreviewed, rolling out r219500.
204
205         The test is consistently failing on iOS simulator.
206
207         Reverted changeset:
208
209         "AX: VoiceOver silent or skipping over time values on media
210         player."
211         https://bugs.webkit.org/show_bug.cgi?id=174324
212         http://trac.webkit.org/changeset/219500
213
214 2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>
215
216         [WinCairo] error 'm_compositorTexture': undeclared identifier since Bug 174345
217         https://bugs.webkit.org/show_bug.cgi?id=174493
218
219         Reviewed by Alex Christensen.
220
221         Compilation errors are reported by the code using a member
222         m_compositorTexture of GraphicsContext3D which exists only if
223         USE(COORDINATED_GRAPHICS_THREADED). WinCairo port doesn't use it.
224
225         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
226         (WebCore::GraphicsContext3D::GraphicsContext3D):
227         Use m_compositorTexture only if USE(COORDINATED_GRAPHICS_THREADED).
228         (WebCore::GraphicsContext3D::~GraphicsContext3D): Ditto.
229         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
230         (WebCore::GraphicsContext3D::reshapeFBOs):
231         Ditto. Fix the wrong indentation level.
232
233 2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>
234
235         [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
236         https://bugs.webkit.org/show_bug.cgi?id=174418
237
238         Reviewed by Michael Catanzaro.
239
240         HarfBuzzShaper should normalize the input text before collecting
241         HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
242         the task. But, this function hasn't been called from anywhere
243         since Bug 108077.
244
245         Test: fast/text/international/vietnamese-nfd.html
246
247         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
248         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
249         Call setNormalizedBuffer instead of normalizeCharacters.
250         (WebCore::normalizeCharacters): Deleted.
251
252 2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>
253
254         [WinCairo] Build broken "Cannot open include file: 'GL/glext.h'" since Bug 172104
255         https://bugs.webkit.org/show_bug.cgi?id=174492
256
257         Reviewed by Žan Doberšek.
258
259         WinCairo port uses GLES. OpenGLShims.h shouldn't be included.
260
261         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
262         Include "OpenGLShims.h" only if !USE(OPENGL_ES_2) instead of USE(OPENGL).
263
264 2017-07-14  Chris Dumez  <cdumez@apple.com>
265
266         PageCache::removeAllItemsForPage(Page&) may reenter itself and cause crashes
267         https://bugs.webkit.org/show_bug.cgi?id=174473
268         <rdar://problem/32177485>
269
270         Reviewed by Antti Koivisto.
271
272         This could happen when a Page containing an SVGImage is removed from PageCache and
273         this resulted in the destruction of the SVGImage. Because the SVGImage has an internal
274         utility Page, it will also call PageCache::removeAllItemsForPage(WebCore::Page&) upon
275         destruction, causing us to reenter.
276
277         Address the issue by not calling PageCache::removeAllItemsForPage() for utility pages
278         since those cannot be in PageCache in the first place.
279
280         Also add assertions to make sure:
281         1. We never insert a utility page into PageCache
282         2. PageCache::removeAllItemsForPage() does not reenter
283
284         No new tests, because I was unable to write a test which reproduced the crash. This
285         is in theory testable using an API test which enables PageCache, loads a page
286         containing an SVGImage, navigates away from this page so that it goes into PageCache,
287         and then calls [WebView _close]. However, when I tried writing such test, I could
288         not get the SVGImage to get destroyed while PageCache::removeAllItemsForPage() is
289         called for the top-level page for some reason. Something seems to be keeping the
290         SVGImage alive longer. I tried disabling the MemoryCache but it did not help.
291
292         * history/PageCache.cpp:
293         (WebCore::PageCache::addIfCacheable):
294         (WebCore::PageCache::removeAllItemsForPage):
295         * history/PageCache.h:
296         * page/Page.cpp:
297         (WebCore::Page::~Page):
298
299 2017-07-14  Aaron Chu  <aaron_chu@apple.com>
300
301         AX: VoiceOver silent or skipping over time values on media player.
302         https://bugs.webkit.org/show_bug.cgi?id=174324
303         <rdar://problem/32021784>
304
305         Reviewed by Antoine Quint.
306
307         Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.
308
309         Updated: media/modern-media-controls/time-label/time-label.html
310
311         * Modules/modern-media-controls/controls/time-label.js:
312
313 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
314
315         Fix compiler warnings when building with GCC 7
316         https://bugs.webkit.org/show_bug.cgi?id=174463
317
318         Reviewed by Darin Adler.
319
320         * testing/InternalSettings.cpp:
321         (WebCore::InternalSettings::setShouldManageAudioSessionCategory):
322
323 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
324
325         Incorrect call to StyledElement::setInlineStyleProperty in ImageDocument::createDocumentStructure
326         https://bugs.webkit.org/show_bug.cgi?id=174470
327
328         Reviewed by Darin Adler.
329
330         * html/ImageDocument.cpp:
331         (WebCore::ImageDocument::createDocumentStructure):
332
333 2017-07-13  Dean Jackson  <dino@apple.com>
334
335         Fix iOS build.
336
337         * platform/graphics/GraphicsContext3D.h:
338
339 2017-07-12  Dean Jackson  <dino@apple.com>
340
341         Rename GraphicsContext[3D]Mac to Cocoa and move things into graphics/cocoa
342         https://bugs.webkit.org/show_bug.cgi?id=174453
343         <rdar://problem/33281481>
344
345         Reviewed by Simon Fraser.
346
347         Two renames, two moves:
348         graphics/mac/GraphicsContext3DMac.mm -> graphics/cocoa/GraphicsContext3DCocoa.mm
349         graphics/mac/GraphicsContext.mm -> graphics/cocoa/GraphicsContextCocoa.mm
350         graphics/mac/WebGLLayer.h -> graphics/cocoa/WebGLLayer.h
351         graphics/mac/WebGLLayer.mm -> graphics/cocoa/WebGLLayer.mm
352
353         * PlatformMac.cmake:
354         * WebCore.xcodeproj/project.pbxproj:
355         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm.
356         * platform/graphics/cocoa/GraphicsContextCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm.
357         * platform/graphics/cocoa/WebGLLayer.h: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.h.
358         * platform/graphics/cocoa/WebGLLayer.mm: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.mm.
359
360 2017-07-12  Dean Jackson  <dino@apple.com>
361
362         Clean-up some things in GraphicsContext3D
363         https://bugs.webkit.org/show_bug.cgi?id=174452
364         <rdar://problem/33281257>
365
366         Reviewed by Simon Fraser.
367
368         General clean-up in GC3D.
369
370         Covered by existing tests.
371
372         * platform/graphics/GraphicsContext3D.h: Use initial values where possible.
373         (WebCore::GraphicsContext3D::GraphicsContext3DState::GraphicsContext3DState): Deleted.
374         * platform/graphics/mac/GraphicsContext3DMac.mm:
375         (WebCore::GraphicsContext3D::GraphicsContext3D): Nearly everything can come from the
376         initial values now.
377         (WebCore::GraphicsContext3D::~GraphicsContext3D): Remove code that won't be enabled
378         on this platform.
379         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
380         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): While unlikely to happen,
381         and possibly harmless in this case, add some checked arithmetic to make sure we don't overflow
382         when working out how big a buffer to create.
383         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData): Ditto.
384         (WebCore::GraphicsContext3D::reshape): Do nothing if we are ever given negative
385         width or height. Again unlikely.
386
387 2017-07-13  Dean Jackson  <dino@apple.com>
388
389         Avoid unnecessary copy of framebuffer into WebGL Layer
390         https://bugs.webkit.org/show_bug.cgi?id=174345
391         <rdar://problem/33228950>
392
393         Reviewed by Sam Weinig.
394
395         On macOS, we're unnecessarily copying the framebuffer into another
396         texture before pushing it into the compositing layer. Instead we
397         should simply render the FBO into the CALayer we use to draw on
398         the screen.
399
400         Covered by the existing WebGL tests.
401
402         * platform/graphics/GraphicsContext3D.h:
403         (WebCore::GraphicsContext3D::platformTexture): Return the FBO texture instead.
404         * platform/graphics/mac/GraphicsContext3DMac.mm:
405         (WebCore::GraphicsContext3D::GraphicsContext3D): No need to have a compositing
406         texture.
407         (WebCore::GraphicsContext3D::~GraphicsContext3D):
408         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
409         (WebCore::GraphicsContext3D::reshapeFBOs):
410         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
411         (WebCore::GraphicsContext3D::prepareTexture): Don't copy the pixels from
412         the FBO into the compositing texture
413
414 2017-07-13  Mark Lam  <mark.lam@apple.com>
415
416         Implementors of memoryCost() need to be thread-safe.
417         https://bugs.webkit.org/show_bug.cgi?id=172738
418         <rdar://problem/32474881>
419
420         Reviewed by Keith Miller.
421
422         No new tests. This patch fixes a race condition bug that can result in random
423         crashes (and other unpredictable behavior), and is very difficult to test for.
424
425         * Modules/webaudio/AudioBuffer.cpp:
426         (WebCore::AudioBuffer::releaseMemory):
427         (WebCore::AudioBuffer::memoryCost):
428         * Modules/webaudio/AudioBuffer.h:
429         * dom/ChildNodeList.h:
430         * dom/CollectionIndexCache.h:
431         (WebCore::CollectionIndexCache::memoryCost):
432         * dom/LiveNodeList.h:
433         * html/CachedHTMLCollection.h:
434         * html/HTMLCanvasElement.cpp:
435         (WebCore::HTMLCanvasElement::memoryCost):
436         (WebCore::HTMLCanvasElement::externalMemoryCost):
437         (WebCore::HTMLCanvasElement::setImageBuffer):
438         * html/HTMLCanvasElement.h:
439         * html/HTMLCollection.cpp:
440         (WebCore::HTMLCollection::invalidateNamedElementCache):
441         * html/HTMLCollection.h:
442         (WebCore::CollectionNamedElementCache::memoryCost):
443         (WebCore::HTMLCollection::memoryCost):
444         (WebCore::HTMLCollection::setNamedItemCache):
445         * platform/graphics/ImageBuffer.cpp:
446         (WebCore::ImageBuffer::memoryCost):
447         * platform/graphics/cg/ImageBufferCG.cpp:
448         (WebCore::ImageBuffer::memoryCost):
449         (WebCore::ImageBuffer::externalMemoryCost):
450
451 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
452
453         Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
454         https://bugs.webkit.org/show_bug.cgi?id=174448
455
456         Reviewed by Eric Carlson.
457
458         No behavior change.
459
460         * platform/cocoa/WebPlaybackSessionInterface.h:
461         * platform/cocoa/WebVideoFullscreenChangeObserver.h:
462         * platform/cocoa/WebVideoFullscreenModel.h:
463         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
464         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
465         * platform/ios/WebVideoFullscreenControllerAVKit.h:
466         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
467         * platform/mac/WebVideoFullscreenInterfaceMac.h:
468
469 2017-07-13  Alex Christensen  <achristensen@webkit.org>
470
471         Deleting last URLSearchParams key should remove trailing ? in associated URL
472         https://bugs.webkit.org/show_bug.cgi?id=174465
473
474         Reviewed by Chris Dumez.
475
476         This makes us match the behavior of Chrome and Firefox, and the spec after https://github.com/whatwg/url/issues/332 is approved.
477         This will be covered by an upcoming web platform test, and I updated fast/dom/DOMURL/searchparams.html to cover it now.
478
479         * platform/URLParser.cpp:
480         (WebCore::URLParser::serialize):
481         If there are no tuples, serialize to the null string instead of a non-null empty string.
482         This makes it so URL::setQuery removes the ?
483
484 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
485
486         Style fix. Replace strongThis with protectedThis.
487         https://bugs.webkit.org/show_bug.cgi?id=174444
488
489         Reviewed by Eric Carlson.
490
491         Rename, no behavior change.
492
493         * Modules/webaudio/AudioScheduledSourceNode.cpp:
494         (WebCore::AudioScheduledSourceNode::finish):
495         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
496         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
497         (WebCore::WebCoreDecompressionSession::enqueueSample):
498         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
499         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
500         (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
501         (WebCore::WebCoreDecompressionSession::flush):
502
503 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
504
505         Fix block style in WebVideoFullscreen classes.
506         https://bugs.webkit.org/show_bug.cgi?id=174446
507
508         Reviewed by Eric Carlson.
509
510         No behavior change.
511
512         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
513         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
514         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
515         (-[WebAVPlayerLayer layoutSublayers]):
516         (getWebAVPictureInPicturePlayerLayerViewClass):
517         (getWebAVPlayerLayerViewClass):
518
519 2017-07-13  Joseph Pecoraro  <pecoraro@apple.com>
520
521         Web Inspector: Remove unused and untested Page domain commands
522         https://bugs.webkit.org/show_bug.cgi?id=174429
523
524         Reviewed by Timothy Hatcher.
525
526         * inspector/InspectorPageAgent.cpp:
527         (WebCore::InspectorPageAgent::disable):
528         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
529         (WebCore::InspectorPageAgent::addScriptToEvaluateOnLoad): Deleted.
530         (WebCore::InspectorPageAgent::removeScriptToEvaluateOnLoad): Deleted.
531         * inspector/InspectorPageAgent.h:
532
533 2017-07-13  Zan Dobersek  <zdobersek@igalia.com>
534
535         [GCrypt] Implement CryptoKeyRSA SPKI exports
536         https://bugs.webkit.org/show_bug.cgi?id=173695
537
538         Reviewed by Jiewen Tan.
539
540         Implement the SPKI export operation for RSA keys for platforms that use
541         libgcrypt.
542
543         In CryptoKeyRSA::exportSpki(), we bail early with an invalid access exception if
544         this export is not being done for a public key. Otherwise, we start with creating
545         the `RSAPublicKey` ASN.1 structure, filling in the modulus and public exponent
546         data that's retrieved from the `public-key` s-expression in the signed MPI format.
547
548         We then create the `SubjectPublicKeyInfo` ASN.1 structure and fill it out with
549         the necessary data. The id-rsaEncryption object identifier is written out under
550         the `algorithm.algorithm` element, and a null value is written out under the
551         `algorithm.parameters` element. This doesn't follow the specification at the
552         moment, since id-RSASSA-PSS would have to be written for the RSA-PSS algorithm,
553         and id-RSAES-OAEP for the RSA-OAEP algorithm, along with specific parameter
554         structures. But no test in WebKit or the web-platform-tests suite covers this,
555         so this deviation should be addressed later.
556
557         Data of the previously-constructed `RSAPublicKey` structure is retrieved and
558         written out under the `subjectPublicKey` element, before finally retrieving
559         data of the `SubjectPublicKeyInfo` structure and returning that to the caller.
560
561         A helper mpiSignedData() function is added, providing overloads for gcry_mpi_t
562         and gcry_sexp_t parameters. MPI data for that parameter is retrieved and the
563         first byte of that data is tested, inserting an additional 0x00 byte at the
564         beginning of the Vector if that first byte has the first bit set, avoiding this
565         data accidentally being interpreted as a signed integer.
566
567         No new tests -- related tests are now passing and are unskipped.
568
569         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
570         (WebCore::CryptoKeyRSA::exportSpki):
571         * crypto/gcrypt/GCryptUtilities.h:
572         (WebCore::mpiSignedData):
573
574 2017-07-13  Zan Dobersek  <zdobersek@igalia.com>
575
576         [GCrypt] Implement CryptoKeyRSA SPKI imports
577         https://bugs.webkit.org/show_bug.cgi?id=173694
578
579         Reviewed by Jiewen Tan.
580
581         Implement the SPKI import operation for RSA keys for platforms that use
582         libgcrypt.
583
584         The passed-in key data is decoded against the `SubjectPublicKeyInfo` ASN.1
585         structure. We then validate the `algorithm.algorithm` element, ensuring that
586         the value under that represents a supported object identifier. This check is
587         for now mostly superficial, only ensuring that the object identifier is either
588         id-rsaEncryption, id-RSAES-OAEP or id-RSASSA-PSS. This has to be further extended
589         to also check the id-sha{1,256,384,512}WithRSAEncryption identifiers as well as
590         decoding the `algorithm.parameters` element against a specific ASN.1 structure,
591         if necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
592         specified digest algorithm with the algorithm that's specified through the main
593         object identifier or the structure contained in `algorithm.parameters`. This is
594         avoided for now because no test in WebKit or the web-platform-tests suite covers
595         this detail of the specification.
596
597         After the algorithm is identified as supported, we proceed with decoding the
598         `subjectPublicKey` data against the `RSAPublicKey` ASN.1 structure. From there,
599         we retrieve the `modulus` and `publicExponent` data from which we can construct
600         an RSA `public-key` s-expression that can be used through libgcrypt. A new
601         CryptoKeyRSA object is then created, taking over ownership of the `public-key`
602         s-expression, and returned.
603
604         No new tests -- related tests are now passing and are unskipped.
605
606         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
607         (WebCore::supportedAlgorithmIdentifier):
608         (WebCore::CryptoKeyRSA::importSpki):
609
610 2017-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
611
612         REGRESSION(r219332): [GTK] 9 new failures on fast/forms spinbutton related tests
613         https://bugs.webkit.org/show_bug.cgi?id=174395
614
615         Reviewed by Carlos Garcia Campos.
616
617         Covered by existing tests.
618
619         Before r219332 the height of the spin button widget was
620         calculated as the maximum value between the individual button
621         ( the [+] or [-] ) width (33 pixels) and height (16 pixels).
622         And r219332 caused the height of the widget to be calculated as
623         the height of the button (16 pixels), which was incorrect as
624         each button should be first expanded vertically to fit the
625         preferred size of the widget.
626
627         Fix this by making the calculations about the spin button widget
628         on a new function spinButtonSize() that takes this into account,
629         and use this values both for adjusting the style of the input
630         field and the spin button widget itself.
631
632         * rendering/RenderThemeGtk.cpp:
633         (WebCore::spinButtonSize):
634         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
635         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
636
637 2017-07-13  Miguel Gomez  <magomez@igalia.com>
638
639         [GTK][WPE] border-radius with non visible border doesn't work on images that have their own RenderLayer
640         https://bugs.webkit.org/show_bug.cgi?id=174157
641
642         Reviewed by Carlos Garcia Campos.
643
644         Do not allow direct compositing of images when they have a border-radius property on WebKitGTK+ and WPE.
645         These platforms don't support clipping using rounded rectangles during composition, which is required
646         when using border-radius and the border is not visible. Due to this, they need to perform the clippping
647         with cairo.
648
649         This is a temporal fix, until appropriate clipping is implemented in the TextureMapper.
650
651         No new tests.
652
653         * rendering/RenderLayerBacking.cpp:
654         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
655
656 2017-07-13  Chris Fleizach  <cfleizach@apple.com>
657
658         AX: WebView crashes app after opening VoiceOver context box menu from modal dialog
659         https://bugs.webkit.org/show_bug.cgi?id=163999
660         <rdar://problem/28949013>
661
662         Reviewed by Joanmarie Diggs.
663
664         Protect when m_object goes away.
665
666         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
667         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
668
669 2017-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
670
671         Async image decoding for large images should be disabled by default
672         https://bugs.webkit.org/show_bug.cgi?id=174432
673
674         Reviewed by Simon Fraser.
675
676         -- Rename GraphicsLayerPaintFlags::Snapshotting to AllowAsyncImageDecoding.
677         -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
678            GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
679            by AllowAsyncImageDecoding.
680         -- Rename PaintBehaviorSnapshotting to PaintBehaviorAllowAsyncImageDecoding.
681         -- Propagate PaintBehaviorAllowAsyncImageDecoding from a parent view to 
682            a child view instead of propagating PaintBehaviorSnapshotting.
683         -- Remove setting the bit PaintBehaviorSnapshotting in any new PaintBehavoir.
684         -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir
685            by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
686
687         * html/shadow/MediaControlElements.cpp:
688         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
689         * page/FrameView.cpp:
690         (WebCore::FrameView::willPaintContents):
691         (WebCore::FrameView::paintContentsForSnapshot):
692         * platform/graphics/GraphicsLayer.h:
693         * platform/graphics/GraphicsLayerClient.h:
694         * platform/graphics/mac/WebLayer.mm:
695         (-[WebLayer drawInContext:]):
696         (-[WebSimpleLayer drawInContext:]):
697         * rendering/PaintPhase.h:
698         * rendering/RenderBoxModelObject.cpp:
699         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
700         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
701         * rendering/RenderBoxModelObject.h:
702         * rendering/RenderImage.cpp:
703         (WebCore::RenderImage::paintIntoRect):
704         * rendering/RenderLayer.cpp:
705         (WebCore::RenderLayer::paintLayerContents):
706         (WebCore::RenderLayer::paintForegroundForFragments):
707         * rendering/RenderLayerBacking.cpp:
708         (WebCore::RenderLayerBacking::paintContents):
709         * rendering/RenderWidget.cpp:
710         (WebCore::RenderWidget::paintContents): We need to propagate the 
711         PaintBehaviorAllowAsyncImageDecoding from RenderWidget to the FrameView.
712         We did not need to do that for PaintBehaviorSnapshotting because 
713         FrameView was setting it in its m_paintBehavior if (document->printing())
714         in FrameView::willPaintContents().
715
716 2017-07-12  Timothy Hatcher  <timothy@hatcher.name>
717
718         REGRESSION(r219391): Broke the USE(OPENGL_ES_2) build
719         https://bugs.webkit.org/show_bug.cgi?id=174442
720
721         Unreviewed build fix.
722
723         * platform/graphics/egl/GLContextEGL.cpp: Fix typo of OPENGL_ES2.
724
725 2017-07-12  Youenn Fablet  <youenn@apple.com>
726
727         Recreate the AudioUnit when restarting capture
728         https://bugs.webkit.org/show_bug.cgi?id=174439
729
730         Reviewed by Jer Noble.
731
732         Sometimes other applications in the system like FaceTime may make the audio unit not functional.
733         Reloading the tab capturing audio will trigger a call to stop the audio shared unit.
734         When the tab requests again audio, the shared unit will restart.
735         At that time, the AudioUnit shared unit will be fully recreated.
736
737         Manually tested by doing a webrtc call and then doing a FaceTime call.
738         Remote WebRTC endpoints may not receive any audio.
739         With the patch, reloading the web page will get back the audio.
740         Previously, restarting the UIProcess was the only way.
741
742         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
743         (WebCore::CoreAudioSharedUnit::startProducingData): Cleaning the audio unit when starting to produce data if there is a preexisting audio unit.
744
745 2017-07-12  Youenn Fablet  <youenn@apple.com>
746
747         Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_ACCESS
748         https://bugs.webkit.org/show_bug.cgi?id=174323
749         <rdar://problem/33267876>
750
751         Reviewed by Eric Carlson.
752
753         Test: webrtc/calling-peerconnection-once-closed.html
754
755         In case the libwebrtc backend is null, we should not use it to get description from it.
756         Return null in that case.
757
758         Adding ASSERT to other calls where the layer above LibWebRTCMediaEndpoint should protect
759         from calling a function on a null libwebrtc backend.
760
761         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
762         (WebCore::LibWebRTCMediaEndpoint::currentLocalDescription):
763         (WebCore::LibWebRTCMediaEndpoint::currentRemoteDescription):
764         (WebCore::LibWebRTCMediaEndpoint::pendingLocalDescription):
765         (WebCore::LibWebRTCMediaEndpoint::pendingRemoteDescription):
766         (WebCore::LibWebRTCMediaEndpoint::localDescription):
767         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
768         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
769         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
770         (WebCore::LibWebRTCMediaEndpoint::addTrack):
771         (WebCore::LibWebRTCMediaEndpoint::removeTrack):
772         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
773         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
774         (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
775
776 2017-07-12  Commit Queue  <commit-queue@webkit.org>
777
778         Unreviewed, rolling out r219176.
779         https://bugs.webkit.org/show_bug.cgi?id=174436
780
781         "Can cause infinite recursion on iOS" (Requested by mlam on
782         #webkit).
783
784         Reverted changeset:
785
786         "WTF::Thread should have the threads stack bounds."
787         https://bugs.webkit.org/show_bug.cgi?id=173975
788         http://trac.webkit.org/changeset/219176
789
790 2017-07-12  Nan Wang  <n_wang@apple.com>
791
792         AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
793         https://bugs.webkit.org/show_bug.cgi?id=174393
794         <rdar://problem/33248006>
795
796         Reviewed by Chris Fleizach.
797
798         Used the existing findClosestPlainText function to search the range on iOS.
799         Also exposed a function on the iOS wrapper to return the selection rects of
800         the result range from the searching. 
801
802         Test: accessibility/ios-simulator/text-marker-range-matches-text.html
803
804         * accessibility/AXObjectCache.cpp:
805         (WebCore::visiblePositionForPositionWithOffset):
806         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
807         * accessibility/AXObjectCache.h:
808         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
809         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
810         (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
811         (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
812         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
813
814 2017-07-12  Matt Lewis  <jlewis3@apple.com>
815
816         Unreviewed, rolling out r219409.
817
818         The revision caused the Windows builds to fail.
819
820         Reverted changeset:
821
822         "AX: [iOS] Implement a way to retrieve a text marker range
823         with desired text that is closest to a position"
824         https://bugs.webkit.org/show_bug.cgi?id=174393
825         http://trac.webkit.org/changeset/219409
826
827 2017-07-12  Alicia Boya García  <aboya@igalia.com>
828
829         [FreeType] Enable BCI on webfonts
830         https://bugs.webkit.org/show_bug.cgi?id=174403
831
832         Reviewed by Michael Catanzaro.
833
834         The FreeType BCI hinter used to be disabled on webfonts in favor of
835         the autohinter.
836
837         FreeType BCI hinter has improved considerably in the past and now most
838         other browsers enable it too. Given the old reasons no longer apply,
839         the BCI has now been enabled in order to get better text rendering when
840         embedded hints are available.
841
842         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
843         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
844
845 2017-07-12  Commit Queue  <commit-queue@webkit.org>
846
847         Unreviewed, rolling out r219361.
848         https://bugs.webkit.org/show_bug.cgi?id=174434
849
850         Huge PLUM memory regression on iOS (Requested by kling on
851         #webkit).
852
853         Reverted changeset:
854
855         "[WebIDL] Convert MutationCallback to be a normal generate
856         callback"
857         https://bugs.webkit.org/show_bug.cgi?id=174140
858         http://trac.webkit.org/changeset/219361
859
860 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
861
862         [MediaStream] a capture source failure should end the MediaStreamTrack
863         https://bugs.webkit.org/show_bug.cgi?id=174375
864
865         Reviewed by Youenn Fablet.
866
867         Test: fast/mediastream/media-stream-track-source-failure.html
868
869         * platform/mediastream/RealtimeMediaSource.cpp:
870         (WebCore::RealtimeMediaSource::captureFailed): New, signal observers that the source has ended.
871         * platform/mediastream/RealtimeMediaSource.h:
872
873         * platform/mediastream/mac/AVMediaCaptureSource.h:
874         * platform/mediastream/mac/AVMediaCaptureSource.mm:
875         (WebCore::AVMediaCaptureSource::setupSession): Call captureFailed if setupCaptureSession fails.
876
877         * platform/mediastream/mac/AVVideoCaptureSource.h:
878         * platform/mediastream/mac/AVVideoCaptureSource.mm:
879         (WebCore::AVVideoCaptureSource::setupCaptureSession): Return false on failure.
880         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete unused instance variable.
881         (WebCore::AVVideoCaptureSource::processNewFrame): Ditto.
882
883         * testing/Internals.cpp:
884         (WebCore::Internals::endMediaStreamTrackCaptureSource): Call track.source.captureFailed().
885         * testing/Internals.h:
886         * testing/Internals.idl:
887
888 2017-07-12  Timothy Hatcher  <timothy@hatcher.name>
889
890         Improve font matching with FontConfig and FreeType
891         https://bugs.webkit.org/show_bug.cgi?id=174374
892
893         Reviewed by Michael Catanzaro.
894
895         * platform/graphics/freetype/FontCacheFreeType.cpp:
896         (WebCore::FontCache::createFontPlatformData): Loop through all family name matches from FcFontMatch.
897
898 2017-07-12  Youenn Fablet  <youenn@apple.com>
899
900         Reactivate audio ducking when restarting the shared unit
901         https://bugs.webkit.org/show_bug.cgi?id=174428
902
903         Reviewed by Eric Carlson.
904
905         Currently, when another application ducks WebKit, there is no other way than to quit the UIProcess and restart it.
906         By again audio ducking when starting the audio unit, reloading the page will be enough.
907         Testing by launching a tab with audio capture and audio playing.
908         Then make a FaceTime call and hear the tab volume go down.
909         End the call to FaceTime and the tab volume remains low.
910         Reload the tab and the volume has a normal level.
911
912         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
913         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
914         (WebCore::CoreAudioSharedUnit::startInternal):
915
916 2017-07-12  Antoine Quint  <graouts@apple.com>
917
918         Playback controls should not hide while AirPlay is active
919         https://bugs.webkit.org/show_bug.cgi?id=174422
920         <rdar://problem/33011477>
921
922         Reviewed by Eric Carlson.
923
924         We now also track changes in AirPlay playback status and account for it when identifying whether we
925         ought to let media controls automatically hide, which should only happen if the media is playing and
926         not playing back through AirPlay.
927
928         * Modules/modern-media-controls/media/controls-visibility-support.js:
929         (ControlsVisibilitySupport.prototype.get mediaEvents):
930         (ControlsVisibilitySupport.prototype._updateControls):
931         (ControlsVisibilitySupport):
932
933 2017-07-12  Daniel Bates  <dabates@apple.com>
934
935         Attempt to fix the build following <https://trac.webkit.org/changeset/219407>
936         (https://bugs.webkit.org/show_bug.cgi?id=174386)
937
938         Fix bad merge after <https://trac.webkit.org/changeset/219404>.
939
940         * loader/FrameLoader.cpp:
941         (WebCore::FrameLoader::loadURL):
942         (WebCore::FrameLoader::loadWithNavigationAction):
943         (WebCore::FrameLoader::loadPostRequest):
944         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
945         (WebCore::FrameLoader::loadDifferentDocumentItem):
946         * loader/FrameLoader.h:
947
948 2017-07-12  Nan Wang  <n_wang@apple.com>
949
950         AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
951         https://bugs.webkit.org/show_bug.cgi?id=174393
952         <rdar://problem/33248006>
953
954         Reviewed by Chris Fleizach.
955
956         Used the existing findClosestPlainText function to search the range on iOS.
957         Also exposed a function on the iOS wrapper to return the selection rects of
958         the result range from the searching. 
959
960         Test: accessibility/ios-simulator/text-marker-range-matches-text.html
961
962         * accessibility/AXObjectCache.cpp:
963         (WebCore::visiblePositionForPositionWithOffset):
964         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
965         * accessibility/AXObjectCache.h:
966         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
967         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
968         (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
969         (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
970         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
971
972 2017-07-12  Daniel Bates  <dabates@apple.com>
973
974         NavigationAction should track whether the navigation was initiated by the main frame
975         https://bugs.webkit.org/show_bug.cgi?id=174386
976         <rdar://problem/33245267>
977
978         Reviewed by Brady Eidson.
979
980         Although we added state to NavigationAction to track whether the navigation was
981         initiated by the main frame in r219170 it is not possible to initialize this state
982         when instantiating a NavigationAction. Having NavigationAction track this state
983         will be useful to ensure that we can always compute the source frame information
984         when asking the embedding client whether to allow a navigation. We will make use
985         of it in the fix for <https://bugs.webkit.org/show_bug.cgi?id=174385>.
986
987         No behavior changed. So, no new tests.
988
989         * loader/FrameLoader.cpp:
990         (WebCore::FrameLoader::loadURL): Pass whether the load was initiated by the main frame
991         when instantiating the NavigationAction.
992         (WebCore::FrameLoader::load): For now, pass InitiatedByMainFrame::Unknown when instantiating
993         the NavigationAction as we do not know if the load was initiated by the main frame.
994         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
995         (WebCore::FrameLoader::reload): Ditto
996         (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
997         (WebCore::createWindow): Pass whether the load was initiated by the main frame when
998         instantiating the NavigationAction.
999         * loader/NavigationAction.cpp:
1000         (WebCore::NavigationAction::NavigationAction): Modified to take argument of type InitiatedByMainFrame
1001         that indicates whether the navigation was initiated by the main frame.
1002         * loader/NavigationAction.h:
1003         * loader/PolicyChecker.cpp:
1004         (WebCore::PolicyChecker::checkNavigationPolicy): For now, pass InitiatedByMainFrame::Unknown
1005         when instantiating the NavigationAction as we do not know if the load was initiated by the
1006         main frame.
1007         * page/ContextMenuController.cpp:
1008         (WebCore::openNewWindow): Pass whether the load was initiated by the main frame when
1009         instantiating the NavigationAction.
1010
1011 2017-07-12  Daniel Bates  <dabates@apple.com>
1012
1013         Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
1014         https://bugs.webkit.org/show_bug.cgi?id=174427
1015
1016         Rubber-stamped by Brady Eidson.
1017
1018         * inspector/InspectorFrontendClientLocal.cpp:
1019         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1020         * inspector/InspectorPageAgent.cpp:
1021         (WebCore::InspectorPageAgent::navigate):
1022         * loader/FrameLoadRequest.cpp:
1023         (WebCore::FrameLoadRequest::FrameLoadRequest):
1024         * loader/FrameLoadRequest.h:
1025         (WebCore::FrameLoadRequest::FrameLoadRequest):
1026         (WebCore::FrameLoadRequest::initiatedByMainFrame):
1027         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame): Deleted.
1028         * loader/FrameLoader.cpp:
1029         (WebCore::FrameLoader::urlSelected):
1030         (WebCore::FrameLoader::loadURLIntoChildFrame):
1031         (WebCore::shouldOpenExternalURLsPolicyToApply):
1032         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
1033         (WebCore::FrameLoader::loadURL):
1034         (WebCore::FrameLoader::loadWithNavigationAction):
1035         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1036         (WebCore::FrameLoader::reload):
1037         (WebCore::FrameLoader::loadPostRequest):
1038         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1039         (WebCore::FrameLoader::loadDifferentDocumentItem):
1040         * loader/FrameLoader.h:
1041         * loader/FrameLoaderTypes.h:
1042         * loader/NavigationAction.h:
1043         (WebCore::NavigationAction::initiatedByMainFrame):
1044         (WebCore::NavigationAction::navigationInitiatedByMainFrame): Deleted.
1045         * loader/NavigationScheduler.cpp:
1046         (WebCore::ScheduledNavigation::ScheduledNavigation):
1047         (WebCore::ScheduledNavigation::initiatedByMainFrame):
1048         (WebCore::NavigationScheduler::scheduleLocationChange):
1049         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame): Deleted.
1050         * page/ContextMenuController.cpp:
1051         (WebCore::openNewWindow):
1052         (WebCore::ContextMenuController::contextMenuItemSelected):
1053         * page/DOMWindow.cpp:
1054         (WebCore::DOMWindow::createWindow):
1055
1056 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1057
1058         Unreviewed, rolling out r219401.
1059
1060         This revision rolled out the previous patch, but after talking
1061         with reviewer, a rebaseline is what was needed.Rolling back in
1062         before rebaseline.
1063
1064         Reverted changeset:
1065
1066         "Unreviewed, rolling out r219379."
1067         https://bugs.webkit.org/show_bug.cgi?id=174400
1068         http://trac.webkit.org/changeset/219401
1069
1070 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1071
1072         Unreviewed, rolling out r219379.
1073
1074         This revision caused a consistent failure in the test
1075         fast/dom/Window/property-access-on-cached-window-after-frame-
1076         removed.html.
1077
1078         Reverted changeset:
1079
1080         "Remove NAVIGATOR_HWCONCURRENCY"
1081         https://bugs.webkit.org/show_bug.cgi?id=174400
1082         http://trac.webkit.org/changeset/219379
1083
1084 2017-07-12  Zalan Bujtas  <zalan@apple.com>
1085
1086         Paginated mode: Infinite recursion in RenderTable::layout
1087         https://bugs.webkit.org/show_bug.cgi?id=174413
1088
1089         Reviewed by Simon Fraser.
1090
1091         This patch is a workaround for avoiding infinite recursion when the table layout does not stabilize.
1092         Apparently we leak some context (computed padding in this case) from the current to the subsequent layout.
1093         The subsequent layouts always end up producing different line heights for some of the cells in the <thead>.
1094         In paginated mode, when the section moves (<thead>, <tbody> etc) we call layout again recursively.
1095         This could lead to infinite recursion for unstable table layout.
1096
1097         Unable to come up with a reduction yet.
1098
1099         * rendering/RenderTable.cpp:
1100         (WebCore::RenderTable::layout):
1101         * rendering/RenderTable.h:
1102
1103 2017-07-12  Youenn Fablet  <youenn@apple.com>
1104
1105         WebRTC: Incorrect sdpMLineIndex for video breaks Firefox interop
1106         https://bugs.webkit.org/show_bug.cgi?id=173530
1107
1108         Reviewed by Alex Christensen.
1109
1110         Test: webrtc/ice-candidate-sdpMLineIndex.html
1111
1112         Reading missing parameter from libwebrtc backend and setting it when firing the RTCIceCandidate event.
1113
1114         * Modules/mediastream/PeerConnectionBackend.cpp:
1115         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
1116         (WebCore::PeerConnectionBackend::newICECandidate):
1117         * Modules/mediastream/PeerConnectionBackend.h:
1118         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1119         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
1120
1121 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
1122
1123         [GCrypt] Implement CryptoKeyEC PKCS#8 exports
1124         https://bugs.webkit.org/show_bug.cgi?id=173648
1125
1126         Reviewed by Jiewen Tan.
1127
1128         Implement the PKCS#8 export operation for EC keys for platforms that use
1129         libgcrypt.
1130
1131         First, the `ECParameters` and the `ECPrivateKey` ASN.1 structures are created
1132         and filled out accordingly. For the former, the appropriate object identifier
1133         is written under the `namedCurve` element of the structure. For the latter, we
1134         write out '1' under `version`, and eliminate the optional `parameters` element.
1135         An libgcrypt EC context is then used to retrieve the private and public key
1136         MPIs that are then written out under the `privateKey` and `publicKey` elements,
1137         respectively.
1138
1139         After that, we can proceed to create and fill out the `PrivateKeyInfo` structure.
1140         0 is written out under the `version` element, and the id-ecPublicKey object
1141         identifier is written out under the `privateKeyAlgorithm.algorithm` element. This
1142         doesn't strictly follow the specification, since the id-ecDH identifier should be
1143         used for ECDH keys, but no test in WebKit or the web-platform-tests suite covers
1144         this, so this specific detail should be revisited later.
1145
1146         Data of the previously-constructed `ECParameters` structure is retrieved and
1147         written out under the `privateKeyAlgorithm.parameters` element. Similarly is done
1148         for the `ECPrivateKey` structure, writing out its data under the `privateKey`
1149         element. Finally, the optional `attributes` element of the `PrivateKeyInfo`
1150         structure is eliminated, and the encoded data of this structure is retrieved and
1151         returned.
1152
1153         No new tests -- relevant tests are now passing and are unskipped.
1154
1155         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1156         (WebCore::CryptoKeyEC::platformExportPkcs8):
1157
1158 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
1159
1160         [WPE] Use libepoxy
1161         https://bugs.webkit.org/show_bug.cgi?id=172104
1162
1163         Reviewed by Michael Catanzaro.
1164
1165         No new tests -- no changes in behavior.
1166
1167         Implement the proper libepoxy header inclusion for ports that enable it.
1168
1169         The library acts as a loading facility working on top of the system-provided
1170         OpenGL and EGL libraries, with the headers providing a complete collection of
1171         specification-defined OpenGL and EGL types, constants and entrypoints.
1172
1173         Support is added through the USE(LIBEPOXY) build guard. Note that this guard
1174         isn't exclusive with USE(OPENGL), USE(OPENGL_ES_2) or USE(EGL), so the
1175         USE(LIBEPOXY) condition is tested before those.
1176
1177         In case of OpenGL headers, the <epoxy/gl.h> header is included, and in
1178         case of EGL headers, the <epoxy/egl.h> header. <epoxy/egl.h> includes
1179         <epoxy/gl.h> on its own, so in some cases the inclusion of the latter is
1180         omitted.
1181
1182         EpoxyShims.h header is added, doing a job similar to OpenGLESShims.h. The
1183         EXT-suffixed GL entrypoints are redefined to the non-suffixed versions.
1184         No suffixed constants are defined because those are defined by the libepoxy
1185         headers to the well-known values.
1186
1187         * CMakeLists.txt:
1188         * PlatformWPE.cmake:
1189         * platform/graphics/ANGLEWebKitBridge.h:
1190         * platform/graphics/EpoxyShims.h: Added.
1191         * platform/graphics/GLContext.cpp:
1192         (WebCore::initializeOpenGLShimsIfNeeded):
1193         * platform/graphics/GraphicsContext3DPrivate.cpp:
1194         * platform/graphics/PlatformDisplay.cpp:
1195         * platform/graphics/cairo/CairoUtilities.cpp:
1196         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1197         (WebCore::GraphicsContext3D::create):
1198         * platform/graphics/cairo/ImageBufferCairo.cpp:
1199         * platform/graphics/egl/GLContextEGL.cpp:
1200         * platform/graphics/egl/GLContextEGLWPE.cpp:
1201         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1202         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1203         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1204         * platform/graphics/opengl/Extensions3DOpenGLES.h:
1205         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1206         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1207         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1208         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
1209
1210 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1211
1212         ImageDecoder: Gifs with infinite animation only play once very often
1213         https://bugs.webkit.org/show_bug.cgi?id=173403
1214
1215         Reviewed by Michael Catanzaro.
1216
1217         It doesn't always happen, it's easier to reproduce when loading big files from the network, but it also depends
1218         on every file. The problem is that ImageFrameCache is caching the repetition count value always when the size is
1219         already available. In the case of gif files, the loop count value can be at any point of the image stream, so
1220         having the size available doesn't mean we also have the loop count. So, if the value is queried before it's
1221         available, the default value is cached (repeat once) and then always used. We should clear the cached value when
1222         new data is added to the decoder, like we do with other cached values that can change when more data is decoded.
1223
1224         * platform/graphics/ImageFrameCache.cpp:
1225         (WebCore::ImageFrameCache::clearMetadata): Clear m_repetitionCount.
1226
1227 2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>
1228
1229         [SOUP] Do not use C linkage for functions using C++ features
1230         https://bugs.webkit.org/show_bug.cgi?id=174392
1231
1232         Reviewed by Michael Catanzaro.
1233
1234         No new tests because there is no behavior change.
1235
1236         * platform/network/soup/WebKitSoupRequestGeneric.h: Move G_END_DECLS
1237         to leave functions which use C++ features outside of the block it
1238         delimits.
1239
1240 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1241
1242         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
1243         https://bugs.webkit.org/show_bug.cgi?id=174161
1244
1245         Reviewed by Michael Catanzaro.
1246
1247         It seems selection data could contain an empty string, in which case gtk_selection_data_get_data() returns a
1248         valid pointer, but gtk_selection_data_get_length() returns 0. When this happens we end up trying to split an
1249         empty string resulting in an empty vector, but we unconditionally access the first element of the vector.
1250
1251         * platform/gtk/PasteboardHelper.cpp:
1252         (WebCore::selectionDataToUTF8String): Return a null string in case selection data length is 0.
1253         (WebCore::PasteboardHelper::fillSelectionData): Return early if selection data length is 0, instead of checking
1254         the selection data pointer.
1255
1256 2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1257
1258         [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
1259         https://bugs.webkit.org/show_bug.cgi?id=174357
1260
1261         Reviewed by Michael Catanzaro.
1262
1263         Implement lockFile and unlockFile using flock().
1264
1265         * PlatformWPE.cmake:
1266         * platform/glib/FileSystemGlib.cpp:
1267         (WebCore::lockFile):
1268         (WebCore::unlockFile):
1269
1270 2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1271
1272         Use FastAllocator in STL containers
1273         https://bugs.webkit.org/show_bug.cgi?id=174366
1274
1275         Rubber stamped by Sam Weinig.
1276
1277         This patch uses FastAllocator for STL containers including std::set and std::map.
1278         STL can take a template parameter to be used as allocator for containers.
1279         We prepare FastAllocator, which uses fastMalloc for allocation.
1280         This allows us to use bmalloc (if supported) for STL containers which offers
1281         functionalities that is not supported in WTF containers.
1282
1283         * Modules/indexeddb/IDBKeyData.h:
1284         * Modules/indexeddb/server/IndexValueEntry.cpp:
1285         (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
1286         (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
1287         (WebCore::IDBServer::IndexValueEntry::reverseFind):
1288         * Modules/indexeddb/server/IndexValueEntry.h:
1289         * Modules/indexeddb/server/IndexValueStore.cpp:
1290         (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
1291         (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
1292         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
1293         * Modules/indexeddb/server/IndexValueStore.h:
1294         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1295         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
1296         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1297         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1298         (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
1299         (WebCore::IDBServer::MemoryObjectStore::addRecord):
1300         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
1301         * Modules/indexeddb/server/MemoryObjectStore.h:
1302         (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
1303         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1304         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
1305         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
1306         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
1307         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
1308         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1309         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1310         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
1311         * Modules/mediasource/SampleMap.h:
1312         * page/WheelEventTestTrigger.cpp:
1313         (WebCore::WheelEventTestTrigger::deferTestsForReason):
1314         (WebCore::dumpState):
1315         * page/WheelEventTestTrigger.h:
1316         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1317         (WebCore::enumToStringMap):
1318         * rendering/OrderIterator.h:
1319
1320 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
1321
1322         [Win] Build error when building WebKit.dll from WebKit.proj project file.
1323         https://bugs.webkit.org/show_bug.cgi?id=174410
1324
1325         Reviewed by Brent Fulgham.
1326
1327         Copy required header files to forwarding headers folder.
1328
1329         * PlatformWin.cmake:
1330
1331 2017-07-11  Dean Jackson  <dino@apple.com>
1332
1333         Remove NAVIGATOR_HWCONCURRENCY
1334         https://bugs.webkit.org/show_bug.cgi?id=174400
1335
1336         Reviewed by Sam Weinig.
1337
1338         * Configurations/FeatureDefines.xcconfig:
1339         * WebCore.xcodeproj/project.pbxproj:
1340         * page/NavigatorBase.cpp:
1341         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
1342         * page/NavigatorBase.h:
1343         * page/NavigatorConcurrentHardware.idl: Removed.
1344
1345 2017-07-11  Youenn Fablet  <youenn@apple.com>
1346
1347         RealtimeOutgoingAudioSource should not push more audio data if the WebRTC thread is not able to process it
1348         https://bugs.webkit.org/show_bug.cgi?id=174383
1349
1350         Reviewed by Eric Carlson.
1351
1352         This patch adds support to check for pending-processing audio data.
1353         If the amount of audio data is bigger than a high water mark of 0.5 seconds,
1354         we stop pushing new audio data until buffered audio data is lower than a low water mark of 0.1 seconds.
1355         Patch is tested by adding breakpoints to trigger the high water mark, verifying that low water mark is triggered
1356         and receiving audio is fine on the other connection endpoint.
1357
1358         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1359         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit):
1360         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataLowLimit):
1361         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1362         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1363
1364 2017-07-11  Dean Jackson  <dino@apple.com>
1365
1366         Rolling out r219372.
1367
1368         * Configurations/FeatureDefines.xcconfig:
1369         * WebCore.xcodeproj/project.pbxproj:
1370         * page/NavigatorBase.cpp:
1371         (WebCore::NavigatorBase::hardwareConcurrency):
1372         * page/NavigatorBase.h:
1373         * page/NavigatorConcurrentHardware.idl: Added.
1374
1375 2017-07-11  Dean Jackson  <dino@apple.com>
1376
1377         Remove NAVIGATOR_HWCONCURRENCY
1378         https://bugs.webkit.org/show_bug.cgi?id=174400
1379
1380         Reviewed by Sam Weinig.
1381
1382         * Configurations/FeatureDefines.xcconfig:
1383         * WebCore.xcodeproj/project.pbxproj:
1384         * page/NavigatorBase.cpp:
1385         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
1386         * page/NavigatorBase.h:
1387         * page/NavigatorConcurrentHardware.idl: Removed.
1388
1389 2017-07-11  Jiewen Tan  <jiewen_tan@apple.com>
1390
1391         [WebCrypto] CryptoKeyECMac::Custom OpenSSL tag is actually tagged type [1]
1392         https://bugs.webkit.org/show_bug.cgi?id=174382
1393         <rdar://problem/33244871>
1394
1395         Reviewed by Brent Fulgham.
1396
1397         No change of behaviour.
1398
1399         * crypto/mac/CryptoKeyECMac.cpp:
1400         (WebCore::CryptoKeyEC::platformImportPkcs8):
1401         (WebCore::CryptoKeyEC::platformExportPkcs8):
1402         Replace CustomECParameters with TaggedType1 according to X.690(08/2015) section 8.14:
1403         https://www.itu.int/rec/T-REC-X.690-201508-I/en
1404         and RFC 5915 Appendix A:
1405         http://www.ietf.org/rfc/rfc5915.txt.
1406
1407 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1408
1409         REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
1410         https://bugs.webkit.org/show_bug.cgi?id=174376
1411
1412         Reviewed by Simon Fraser.
1413
1414         When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
1415         and the CachedImageClient is not one of the CachedImage::m_clients, we
1416         should cancel the repaint optimization in CachedImage::imageFrameAvailable().
1417         This can be done by adding all the CachedImage::m_clients to CachedImage::
1418         m_pendingImageDrawingClients.
1419
1420         Test: fast/images/async-image-body-background-image.html
1421
1422         * loader/cache/CachedImage.cpp:
1423         (WebCore::CachedImage::addPendingImageDrawingClient):
1424
1425 2017-07-11  Chris Dumez  <cdumez@apple.com>
1426
1427         Unreviewed, fix Windows build after r219355.
1428
1429         * bindings/js/JSDOMWindowCustom.cpp:
1430         (WebCore::addCrossOriginWindowPropertyNames):
1431         (WebCore::addCrossOriginWindowOwnPropertyNames):
1432         (WebCore::JSDOMWindow::getOwnPropertyNames):
1433         (WebCore::addCrossOriginPropertyNames): Deleted.
1434         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
1435         * bindings/js/JSLocationCustom.cpp:
1436         (WebCore::addCrossOriginLocationPropertyNames):
1437         (WebCore::addCrossOriginLocationOwnPropertyNames):
1438         (WebCore::JSLocation::getOwnPropertyNames):
1439         (WebCore::addCrossOriginPropertyNames): Deleted.
1440         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
1441
1442 2017-07-10  Sam Weinig  <sam@webkit.org>
1443
1444         [WebIDL] Convert MutationCallback to be a normal generate callback
1445         https://bugs.webkit.org/show_bug.cgi?id=174140
1446
1447         Reviewed by Chris Dumez.
1448
1449         To make this work more nicely, I:
1450         - Added the ability to for non-nullable interfaces in sequences to be passed
1451           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
1452           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
1453           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
1454           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
1455         - Added a new extended attribute for callback functions called [CallbackNeedsCanInvoke]
1456           that adds a virtual function called canInvoke() to the generated callback.
1457           All it does is forward to ActiveDOMCallback's canInvokeCallback, but it
1458           allows the implementation to get to it. We may one day want to move the 
1459           inheritance of ActiveDOMCallback from the generated source to the base class.
1460         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
1461           which allows you to specify that the callback needs a this object in addition
1462           to its arguments. When specified, the first argument of the C++ implementation
1463           function will now correspond to the this object, with the remaining arguments
1464           shifted over one.
1465
1466         * DerivedSources.make:
1467         Add MutationCallback.
1468
1469         * WebCore.xcodeproj/project.pbxproj:
1470         Remove non-generated JSMutationCallback.cpp, and add generated JSMutationCallback.cpp.
1471
1472         * Modules/mediastream/MediaDevicesRequest.cpp:
1473         (WebCore::MediaDevicesRequest::filterDeviceList):
1474         (WebCore::MediaDevicesRequest::start):
1475         * Modules/mediastream/MediaDevicesRequest.h:
1476         Switch to using Ref.
1477
1478         * bindings/IDLTypes.h:
1479         Add InnerParameterType and NullableInnerParameterType type hooks
1480         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
1481         for NullableInnerParameterType.
1482
1483         * bindings/js/JSCallbackData.cpp:
1484         * bindings/js/JSCallbackData.h:
1485         Add support for passing a this object.
1486
1487         * bindings/js/JSMutationCallback.cpp: Removed.
1488         * bindings/js/JSMutationCallback.h: Removed.
1489         Remove custom callback code.
1490
1491         * bindings/js/JSMutationObserverCustom.cpp:
1492         (WebCore::constructJSMutationObserver): Deleted.
1493         Remove no longer needed custom constructor.
1494
1495         * bindings/scripts/CodeGenerator.pm:
1496         (ParseType):
1497         Add helper to parse a type and cache the result.
1498
1499         * bindings/scripts/CodeGeneratorJS.pm:
1500         (GenerateCallbackHeaderContent):
1501         (GenerateCallbackImplementationContent):
1502         Add support for [CallbackNeedsCanInvoke] and [CallbackThisObject]. When [CallbackThisObject]
1503         is not specified, use jsUndefined() as the this object as specified by WebIDL.
1504
1505         * bindings/scripts/IDLAttributes.json:
1506         Add [CallbackNeedsCanInvoke] and [CallbackThisObject].
1507
1508         * bindings/scripts/IDLParser.pm:
1509         (ParseType):
1510         Add entry point to parse a single type.
1511
1512         * css/FontFaceSet.h:
1513         Switch to using Ref.
1514
1515         * dom/MutationCallback.h:
1516         Update signatures.
1517
1518         * dom/MutationCallback.idl: Added.
1519     
1520         * dom/MutationObserver.cpp:
1521         (WebCore::MutationObserver::canDeliver):
1522         (WebCore::MutationObserver::deliver):
1523         Switch to new signatures.
1524
1525         * dom/MutationObserver.idl:
1526         Remove CustomConstructor.
1527
1528         * page/IntersectionObserverCallback.h:
1529         Switch to using Ref.
1530
1531         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1532         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
1533         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
1534         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
1535         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
1536         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
1537         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
1538         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
1539         Add / update bindings tests.
1540
1541 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1542
1543         RenderImage should not add itself as a RelevantRepaintedObject if its image frame is being decoded
1544         https://bugs.webkit.org/show_bug.cgi?id=174336
1545
1546         Reviewed by Simon Fraser.
1547
1548         Since nothing will be drawn till the image frame finishes decoding we should
1549         treat returning ImageDrawResult::DidRequestDecoding from BitmapImage::draw
1550         the same as we do when the image is still loading.
1551
1552         * rendering/RenderImage.cpp:
1553         (WebCore::RenderImage::paintReplaced):
1554         (WebCore::RenderImage::paintIntoRect):
1555         * rendering/RenderImage.h:
1556
1557 2017-07-11  Youenn Fablet  <youenn@apple.com>
1558
1559         [WebRTC] Hanging under LibWebRTCMediaEndpoint::getStats
1560         https://bugs.webkit.org/show_bug.cgi?id=174377
1561
1562         Reviewed by Eric Carlson.
1563
1564         No change of behavior.
1565         Moving calls to libwebrtc getStats in the signalling thread since doing it in the main thread
1566         would block the main thread until the signalling thread is ready to handle getStats.
1567         Reducing stat logging since this may be too much for some devices.
1568
1569         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1570         (WebCore::LibWebRTCMediaEndpoint::getStats):
1571         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
1572         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
1573         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
1574
1575 2017-07-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1576
1577         Remove unused OpenGL files
1578         https://bugs.webkit.org/show_bug.cgi?id=174371
1579
1580         Reviewed by Timothy Hatcher.
1581
1582         * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
1583         * platform/graphics/opengl/GLPlatformContext.h: Removed.
1584         * platform/graphics/opengl/GLPlatformSurface.h: Removed.
1585
1586 2017-07-11  Chris Dumez  <cdumez@apple.com>
1587
1588         Window's [[OwnPropertyKeys]] is wrong for cross origin windows
1589         https://bugs.webkit.org/show_bug.cgi?id=174364
1590         <rdar://problem/33238056>
1591
1592         Reviewed by Brent Fulgham.
1593
1594         Window's [[OwnPropertyKeys]] should not list descendant frame names
1595         when the window is cross-origin:
1596         - https://github.com/whatwg/html/pull/2777
1597
1598         This aligns our behavior with Firefox and Chrome.
1599
1600         No new tests, updated existing test.
1601
1602         * bindings/js/JSDOMWindowCustom.cpp:
1603         (WebCore::addCrossOriginPropertyNames):
1604         (WebCore::addCrossOriginOwnPropertyNames):
1605         (WebCore::JSDOMWindow::getOwnPropertyNames):
1606
1607 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
1608
1609         Fix broken build when ENABLE_VIDEO is disabled.
1610         https://bugs.webkit.org/show_bug.cgi?id=174368
1611
1612         Reviewed by Alex Christensen.
1613
1614         * dom/Document.cpp:
1615         * html/canvas/WebGLRenderingContextBase.cpp:
1616         (WebCore::WebGLRenderingContextBase::texSubImage2D):
1617         (WebCore::WebGLRenderingContextBase::texImage2D):
1618         * html/canvas/WebGLRenderingContextBase.h:
1619         * html/canvas/WebGLRenderingContextBase.idl:
1620         * testing/Internals.cpp:
1621         (WebCore::Internals::mediaResponseSources):
1622         (WebCore::Internals::mediaResponseContentRanges):
1623         * testing/Internals.h:
1624         * testing/Internals.idl:
1625
1626 2017-07-11  Ali Juma  <ajuma@chromium.org>
1627
1628         elementFromPoint() should consider x and y to be in client (layout viewport) coordinates
1629         https://bugs.webkit.org/show_bug.cgi?id=172019
1630
1631         Reviewed by Simon Fraser.
1632
1633         When visual viewports are enabled, this makes TreeScope::nodeFromPoint consider its
1634         input to be in client coordinates, and clips this input to the layout viewport. This change
1635         affects the behavior of document.elementFromPoint() and document.caretRangeFromPoint.
1636
1637         No new tests. Modified an existing test, and made a previously-failing test pass on ios.
1638
1639         * dom/TreeScope.cpp:
1640         (WebCore::TreeScope::nodeFromPoint):
1641         * page/FrameView.cpp:
1642         (WebCore::FrameView::layoutViewportToAbsoluteRect):
1643         (WebCore::FrameView::layoutViewportToAbsolutePoint):
1644         (WebCore::FrameView::clientToLayoutViewportPoint):
1645         * page/FrameView.h:
1646         * rendering/RenderLayer.cpp:
1647         (WebCore::RenderLayer::hitTest):
1648
1649 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
1650
1651         Broken build when !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
1652         https://bugs.webkit.org/show_bug.cgi?id=174369
1653
1654         Reviewed by Alex Christensen.
1655
1656         * dom/ScriptedAnimationController.h: Include PlatformScreen.h.
1657
1658 2017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
1659
1660         Address post-review feedback after http://trac.webkit.org/r219310
1661         https://bugs.webkit.org/show_bug.cgi?id=174300
1662         <rdar://problem/33030639>
1663
1664         Reviewed by Simon Fraser.
1665
1666         Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.
1667
1668         * page/scrolling/ScrollingTree.h:
1669         (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
1670         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
1671
1672 2017-07-11  Alex Christensen  <achristensen@webkit.org>
1673
1674         Reduce URL size
1675         https://bugs.webkit.org/show_bug.cgi?id=174319
1676
1677         Reviewed by Andreas Kling.
1678
1679         m_fragmentEnd is redundant information. If a URL is valid, then it is always m_string.length().
1680         If a URL is not valid, then it is always 0. Rather than storing additional information,
1681         deduce the fragment end from the validity of the URL and the String's length.
1682
1683         No change in behavior.  This reduces sizeof(URL) from 56 to 48 and reduces operations when parsing.
1684
1685         * platform/URL.cpp:
1686         (WebCore::URL::invalidate):
1687         (WebCore::URL::fragmentIdentifier):
1688         (WebCore::URL::hasFragmentIdentifier):
1689         (WebCore::URL::removeFragmentIdentifier):
1690         * platform/URL.h:
1691         (WebCore::URL::encode):
1692         (WebCore::URL::decode):
1693         (WebCore::URL::hasFragment):
1694         * platform/URLParser.cpp:
1695         (WebCore::URLParser::urlLengthUntilPart):
1696         (WebCore::URLParser::copyURLPartsUntil):
1697         (WebCore::URLParser::parse):
1698         (WebCore::URLParser::allValuesEqual):
1699         (WebCore::URLParser::internalValuesConsistent):
1700
1701 2017-07-11  Alex Christensen  <achristensen@webkit.org>
1702
1703         SharedBuffer::size should return a size_t
1704         https://bugs.webkit.org/show_bug.cgi?id=174328
1705
1706         Reviewed by Andreas Kling.
1707
1708         No change in behaviour.
1709
1710         * html/FTPDirectoryDocument.cpp:
1711         (WebCore::createTemplateDocumentData):
1712         * loader/ContentFilter.cpp:
1713         (WebCore::ContentFilter::handleProvisionalLoadFailure):
1714         * loader/ResourceLoader.cpp:
1715         (WebCore::ResourceLoader::loadDataURL):
1716         * loader/ResourceLoader.h:
1717         * loader/appcache/ApplicationCacheStorage.cpp:
1718         (WebCore::ApplicationCacheStorage::store):
1719         * loader/cache/CachedScript.cpp:
1720         (WebCore::CachedScript::script):
1721         * platform/SharedBuffer.cpp:
1722         (WebCore::SharedBuffer::tryCreateArrayBuffer):
1723         * platform/SharedBuffer.h:
1724
1725 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
1726
1727         [Win] Build error when building WebCore from WebCore.proj project file.
1728         https://bugs.webkit.org/show_bug.cgi?id=174330
1729
1730         Reviewed by Brent Fulgham.
1731
1732         The CMake variable PAL_DIR should be set in the project file.
1733
1734         * WebCore.vcxproj/WebCore.proj:
1735
1736 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1737
1738         [SVG] Leak in SVGAnimatedListPropertyTearOff
1739         https://bugs.webkit.org/show_bug.cgi?id=172545
1740
1741         Reviewed by Said Abou-Hallawa.
1742
1743         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1744         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1745         reference to SVGAnimatedProperty.
1746
1747         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1748         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1749         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1750         is going to be added to. This effectively creates a reference cycle between the
1751         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1752
1753         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1754
1755         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1756
1757 2017-07-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1758
1759         [GTK] Spin buttons on input type number appear over the value itself for small widths
1760         https://bugs.webkit.org/show_bug.cgi?id=173572
1761
1762         Reviewed by Carlos Garcia Campos.
1763
1764         When drawing the spin buttons, override the width of the input
1765         element to increment it with the width of the spin button.
1766         This ensures that we don't end up covering the input values with
1767         the spin buttons.
1768
1769         Do this also for user controlled styles, because most web authors
1770         won't test how their site renders on WebKitGTK+, and they will
1771         assume spin buttons in the order of 13 pixels wide (that is what
1772         most browsers use), but the GTK+ spin button is much wider (66 pixels).
1773
1774         Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html
1775
1776         * rendering/RenderTheme.cpp:
1777         (WebCore::RenderTheme::adjustStyle):
1778         * rendering/RenderThemeGtk.cpp:
1779         (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles.
1780         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1781
1782 2017-07-11  Youenn Fablet  <youenn@apple.com>
1783
1784         We should do ICE candidate filtering at the Document level
1785         https://bugs.webkit.org/show_bug.cgi?id=173861
1786         <rdar://problem/33122058>
1787
1788         Reviewed by Eric Carlson.
1789
1790         Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
1791                http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
1792                http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
1793                webrtc/filtering-ice-candidate-after-reload.html
1794
1795         Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
1796         All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
1797         are now registered to the RTCController.
1798         This allows disabling filtering to only these RTCPeerConnection.
1799
1800         The page keeps the default ICE candidate filtering policy.
1801         This policy allows disabling ICE candidate filtering for all RTCPeerConnection.
1802
1803         When the top document is changing, the RTCController filtering policy is reset
1804         and its list of RTCPeerConnection is emptied.
1805
1806         Internals no longer disables ICE candidate filtering by default.
1807         This allows finer grained testing.
1808         ICE candidate filtering is disabled for tests including testharnessreport.js
1809         to enable web-platform-tests to run without modifications.
1810
1811         * Modules/mediastream/RTCController.cpp:
1812         (WebCore::RTCController::reset):
1813         * Modules/mediastream/RTCController.h:
1814         * Modules/mediastream/UserMediaRequest.cpp:
1815         (WebCore::UserMediaRequest::allow):
1816         * page/Frame.cpp:
1817         (WebCore::Frame::setDocument):
1818         * page/Page.cpp:
1819         (WebCore::Page::disableICECandidateFiltering):
1820         * page/Page.h:
1821         (WebCore::Page::shouldEnableICECandidateFilteringByDefault):
1822         (WebCore::Page::disableICECandidateFiltering): Deleted.
1823         (WebCore::Page::enableICECandidateFiltering): Deleted.
1824         (WebCore::Page::isICECandidateFilteringEnabled): Deleted.
1825         * testing/Internals.cpp:
1826         (WebCore::Internals::Internals):
1827         (WebCore::Internals::setICECandidateFiltering):
1828         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
1829         (WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
1830         * testing/Internals.h:
1831         * testing/Internals.idl:
1832
1833 2017-07-11  Sergio Villar Senin  <svillar@igalia.com>
1834
1835         Unreviewed, rolling out r219325.
1836
1837         The test is still flaky
1838
1839         Reverted changeset:
1840
1841         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1842         https://bugs.webkit.org/show_bug.cgi?id=172545
1843         http://trac.webkit.org/changeset/219325
1844
1845 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1846
1847         [SVG] Leak in SVGAnimatedListPropertyTearOff
1848         https://bugs.webkit.org/show_bug.cgi?id=172545
1849
1850         Reviewed by Said Abou-Hallawa.
1851
1852         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1853         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1854         reference to SVGAnimatedProperty.
1855
1856         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1857         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1858         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1859         is going to be added to. This effectively creates a reference cycle between the
1860         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1861
1862         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1863
1864         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1865
1866 2017-07-10  Simon Fraser  <simon.fraser@apple.com>
1867
1868         [WK2 iOS] REGRESSION (r216803) During momentum scroll, getBoundingClientRect returns wrong coordinates (missing images on pinterest, elle.com and many other sites)
1869         https://bugs.webkit.org/show_bug.cgi?id=174286
1870         rdar://problem/32864180
1871
1872         Reviewed by Dean Jackson.
1873
1874         r216803 made getBoundingClientRects relative to the layout viewport, but when scrolling we
1875         only update that on stable viewport updates (at the end of the scroll). This meant that during
1876         unstable updates, getBoundingClientRects() used a "frozen" viewport origin so things on-screen
1877         would appear to be off-screen, causing sites to fail to dynamically load images etc. when
1878         scrolling.
1879
1880         Fix by pushing an optional "unstable" layout viewport rect onto FrameView, which gets used by
1881         FrameView::documentToClientOffset(). This is cleared when we do a stable update.
1882
1883         This is a short-term solution. Longer term, I would prefer to always call setLayoutViewportOverrideRect(),
1884         but fix the scrolling tree logic to work correctly in this case.
1885
1886         Add a bit more scrolling logging.
1887
1888         Test: fast/visual-viewport/ios/get-bounding-client-rect-unstable.html
1889
1890         * page/FrameView.cpp:
1891         (WebCore::FrameView::setUnstableLayoutViewportRect):
1892         (WebCore::FrameView::documentToClientOffset):
1893         * page/FrameView.h:
1894         * page/scrolling/AsyncScrollingCoordinator.cpp:
1895         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1896         * page/scrolling/ScrollingStateFixedNode.cpp:
1897         (WebCore::ScrollingStateFixedNode::updateConstraints):
1898         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
1899
1900 2017-07-10  John Wilander  <wilander@apple.com>
1901
1902         Resource Load Statistics: Prune statistics in orders of importance
1903         https://bugs.webkit.org/show_bug.cgi?id=174215
1904         <rdar://problem/33164403>
1905
1906         Reviewed by Chris Dumez.
1907
1908         Test: http/tests/loading/resourceLoadStatistics/prune-statistics.html
1909
1910         * loader/ResourceLoadObserver.cpp:
1911         (WebCore::reduceTimeResolution):
1912         (WebCore::ResourceLoadObserver::logFrameNavigation):
1913         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1914         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1915         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1916             Now all set the new statistics field lastSeen.
1917         * loader/ResourceLoadStatistics.cpp:
1918         (WebCore::ResourceLoadStatistics::encode):
1919         (WebCore::ResourceLoadStatistics::decode):
1920         (WebCore::ResourceLoadStatistics::toString):
1921         (WebCore::ResourceLoadStatistics::merge):
1922             Handling of the new statistics field lastSeen.
1923         * loader/ResourceLoadStatistics.h:
1924
1925 2017-07-10  Devin Rousso  <drousso@apple.com>
1926
1927         Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab
1928         https://bugs.webkit.org/show_bug.cgi?id=174279
1929
1930         Reviewed by Matt Baker.
1931
1932         Test: inspector/dom/highlightNodeList.html
1933
1934         * inspector/InspectorDOMAgent.h:
1935         * inspector/InspectorDOMAgent.cpp:
1936         (WebCore::InspectorDOMAgent::highlightNodeList):
1937
1938 2017-07-10  Javier Fernandez  <jfernandez@igalia.com>
1939
1940         [css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
1941         https://bugs.webkit.org/show_bug.cgi?id=172707
1942
1943         Reviewed by Antti Koivisto.
1944
1945         The CSS Box Alignment specification has been changed recently so that
1946         now all the propeties have the specificed value as computed value. The
1947         rationale of this change are at the associated W3C github issue [1].
1948
1949         This change implies that we don't need to execute the StyleAdjuter
1950         logic we implemented specifically for supporting 'auto' values
1951         resolution for computed style. We can live now with resolution at
1952         layout time only.
1953
1954         [1] https://github.com/w3c/csswg-drafts/issues/440
1955
1956         No new tests, just updating the already defined tests.
1957
1958         * css/CSSComputedStyleDeclaration.cpp:
1959         (WebCore::ComputedStyleExtractor::propertyValue):
1960         * css/StyleResolver.cpp:
1961         (WebCore::StyleResolver::adjustRenderStyle): Removed
1962         * css/StyleResolver.h:
1963         * html/shadow/TextControlInnerElements.cpp:
1964         (WebCore::TextControlInnerElement::resolveCustomStyle):
1965         * rendering/RenderBox.cpp:
1966         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
1967         (WebCore::RenderBox::hasStretchedLogicalWidth):
1968         * rendering/RenderFlexibleBox.cpp:
1969         (WebCore::RenderFlexibleBox::styleDidChange): Added
1970         (WebCore::RenderFlexibleBox::alignmentForChild):
1971         * rendering/RenderFlexibleBox.h:
1972
1973 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
1974
1975         [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
1976         https://bugs.webkit.org/show_bug.cgi?id=174300
1977         <rdar://problem/33030639>
1978
1979         Reviewed by Simon Fraser.
1980
1981         See Source/WebKit2/ChangeLog for more detail.
1982
1983         Tests: fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
1984                fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-overflow.html
1985                fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html
1986
1987         * page/scrolling/ScrollingTree.h:
1988         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture):
1989
1990 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
1991
1992         Captions and subtitles not showing up in picture-in-picture for MSE content
1993         https://bugs.webkit.org/show_bug.cgi?id=174317
1994         rdar://problem/33188591
1995
1996         Reviewed by Eric Carlson.
1997
1998         Reverts a regression created by r218403.
1999
2000         * html/shadow/MediaControlElements.cpp:
2001         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
2002
2003 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
2004
2005         [Win] Link error when building WTF from WTF.proj project file.
2006         https://bugs.webkit.org/show_bug.cgi?id=174316
2007         <rdar://problem/33178200>
2008
2009         Reviewed by Brent Fulgham.
2010
2011         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
2012
2013         * WebCore.vcxproj/WebCore.proj:
2014
2015 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
2016
2017         media element handle adding source immediately before src.
2018         https://bugs.webkit.org/show_bug.cgi?id=174284
2019         rdar://problem/33115439
2020
2021         Reviewed by David Kilzer.
2022
2023         Test: media/video-source-before-src.html
2024
2025         Adding a source causes a selectMediaResource block to be enqueued.
2026         If dataLoadingPermitted prevents creating the m_player but sets the srcAttr, then
2027         the enqueued selectMediaResource will be in a bad state, with a srcAttr but no m_player.
2028
2029         This fix prevents selectMediaResource from being called, if data loading is not permitted
2030         when adding a source element, to match how it prevents player creation when setting srcAttr.
2031
2032         This fix also adds a debug assert to catch the problem earlier and adds an early return to
2033         prevent the crash in release builds.
2034
2035         * html/HTMLMediaElement.cpp:
2036         (WebCore::HTMLMediaElement::selectMediaResource):
2037         (WebCore::HTMLMediaElement::sourceWasAdded):
2038
2039 2017-07-10  Megan Gardner  <megan_gardner@apple.com>
2040
2041         Add location to NavigationActionData
2042         https://bugs.webkit.org/show_bug.cgi?id=174233
2043         <rdar://problem/29165518>
2044
2045         Reviewed by Simon Fraser.
2046         
2047         Add the root view location of a tap to a NavigationAction to vend to Safari.
2048
2049         Test: small enough change to not be tested alone.
2050
2051         * dom/MouseRelatedEvent.cpp:
2052         (WebCore::MouseRelatedEvent::absoluteLocationConvertedToRootView):
2053         * dom/MouseRelatedEvent.h:
2054
2055 2017-07-10  Sam Weinig  <sam@webkit.org>
2056
2057         [WebIDL] Move plugin object customization into the generator
2058         https://bugs.webkit.org/show_bug.cgi?id=174238
2059
2060         Reviewed by Chris Dumez.
2061
2062         - Added [Plugin] extended attribute to forward the necessary hooks
2063           for get/set/delete to the plugin code.
2064         - Removed [CustomNamedSetter] and replaced it's remaining uses
2065           [CustomPut] (formally called [CustomPutFunction]).
2066         - Renamed [CustomNamedGetterOnPrototype] to [CustomPutOnPrototype]
2067           because that is actually what it does.
2068         - Removed [CustomGetOwnPropertySlotByIndex] and made 
2069           [CustomGetOwnPropertySlot] imply it, as the other custom hooks
2070           do.
2071         - Renamed [CustomEnumerateProperty] to [CustomGetOwnPropertyNames]
2072           to conform with other attribute names.
2073         - Renamed [CustomCall] to [CustomGetCallData] to conform with other 
2074           attribute names.
2075
2076         * CMakeLists.txt:
2077         * WebCore.xcodeproj/project.pbxproj:
2078         * bindings/js/JSBindingsAllInOne.cpp:
2079         * bindings/js/JSHTMLAppletElementCustom.cpp: Removed.
2080         * bindings/js/JSHTMLEmbedElementCustom.cpp: Removed.
2081         * bindings/js/JSHTMLObjectElementCustom.cpp: Removed.
2082         Remove custom bindings.
2083
2084         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2085         (WebCore::putCommon):
2086         (WebCore::JSCSSStyleDeclaration::put):
2087         (WebCore::JSCSSStyleDeclaration::putByIndex):
2088         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
2089         Use [CustomPut] rather than [CustomNamedSetter] to allow us
2090         to get rid of [CustomNamedSetter]. Reuse put delegate as
2091         common code to share between put and putByIndex.
2092
2093         * bindings/js/JSLocationCustom.cpp:
2094         (WebCore::getOwnPropertySlotCommon):
2095         (WebCore::JSLocation::getOwnPropertySlot):
2096         (WebCore::JSLocation::getOwnPropertySlotByIndex):
2097         Replace [CustomGetOwnPropertySlotAndDescriptor] with [CustomGetOwnPropertySlot]
2098         which is more clear and reduces the number of variants of this hook override
2099         we need.
2100
2101         (WebCore::putCommon):
2102         (WebCore::JSLocation::put):
2103         (WebCore::JSLocation::putByIndex):
2104         Use [CustomPut] rather than [CustomNamedSetter] to allow us
2105         to get rid of [CustomNamedSetter]. Reuse put delegate as
2106         common code to share between put and putByIndex.
2107
2108         (WebCore::JSLocationPrototype::put):
2109         [CustomPutOnPrototype] (which weirdly used incorrectly be called 
2110         [CustomNamedGetterOnPrototype]) now works like [CustomPut] meaning
2111         you need to call Base.
2112
2113         * bindings/js/JSPluginElementFunctions.cpp:
2114         (WebCore::pluginElementPropertyGetter):
2115         (WebCore::pluginElementCustomGetOwnPropertySlot):
2116         (WebCore::pluginElementCustomPut):
2117         * bindings/js/JSPluginElementFunctions.h:
2118         (WebCore::pluginElementCustomGetOwnPropertySlot): Deleted.
2119         Remove templatized pluginElementCustomGetOwnPropertySlot, which was 
2120         completely unnecessary and merge its functionality into the out of
2121         line overload. Remove pluginElementPropertyGetter from the header,
2122         since it is only used in implementation, and unify the naming and
2123         argument position (JSHTMLElement* comes first) of the hooks.
2124
2125         * bindings/scripts/CodeGeneratorJS.pm:
2126         (GenerateIndexedGetter):
2127         (GenerateNamedGetter):
2128         (GenerateGetOwnPropertySlot):
2129         (GenerateGetOwnPropertySlotByIndex):
2130         (GenerateGetOwnPropertyNames):
2131         (GeneratePut):
2132         (GeneratePutByIndex):
2133         (GenerateDeleteProperty):
2134         (GenerateDeletePropertyByIndex):
2135         (GenerateNamedDeleterDefinition):
2136         (InstanceOverridesGetOwnPropertySlot):
2137         (InstanceOverridesGetOwnPropertyNames):
2138         (InstanceOverridesPut):
2139         (InstanceOverridesDeleteProperty):
2140         (GenerateHeader):
2141         (GenerateImplementation):
2142         (GenerateGetCallData):
2143         (GeneratePluginCall):
2144         (GenerateLegacyCallerDefinitions):
2145         (GenerateLegacyCallerDefinition):
2146         (GeneratePrototypeDeclaration):
2147         (InstanceOverridesGetCallData):
2148         (HeaderNeedsPrototypeDeclaration):
2149         - Add support for [Plugin]
2150         - Remove support for [CustomNamedSetter]
2151         - Replace [CustomGetOwnPropertySlotByIndex] with [CustomGetOwnPropertySlot]
2152         - Replace [CustomEnumerateProperty] with [CustomGetOwnPropertyNames]
2153         - Replace [CustomPutFunction] with [CustomPut].
2154         - Make subroutine names more consistent (remove a few Definition suffixes)
2155
2156         * bindings/scripts/IDLAttributes.json:
2157         Update for new / removed attributes.
2158
2159         * bindings/scripts/test/JS/JSTestInterface.cpp:
2160         * bindings/scripts/test/JS/JSTestInterface.h:
2161         * bindings/scripts/test/JS/JSTestPluginInterface.cpp: Added.
2162         * bindings/scripts/test/JS/JSTestPluginInterface.h: Added.
2163         * bindings/scripts/test/TestInterface.idl:
2164         * bindings/scripts/test/TestPluginInterface.idl: Added.
2165         Update / add tests.
2166
2167         * css/CSSStyleDeclaration.idl:
2168         * html/HTMLAppletElement.idl:
2169         * html/HTMLEmbedElement.idl:
2170         * html/HTMLObjectElement.idl:
2171         * page/DOMWindow.idl:
2172         * page/Location.idl:
2173         * storage/Storage.idl:
2174         Update for new / renamed attributes.
2175
2176 2017-07-03  Brian Burg  <bburg@apple.com>
2177
2178         Web Replay: remove some unused code
2179         https://bugs.webkit.org/show_bug.cgi?id=173903
2180
2181         Rubber-stamped by Joseph Pecoraro.
2182
2183         * CMakeLists.txt:
2184         * Configurations/FeatureDefines.xcconfig:
2185         * DerivedSources.make:
2186         * PlatformMac.cmake:
2187         * WebCore.xcodeproj/project.pbxproj:
2188         * dom/Document.cpp:
2189         (WebCore::Document::Document):
2190         (WebCore::Document::lastModified):
2191         (WebCore::Document::inputCursor): Deleted.
2192         (WebCore::Document::setInputCursor): Deleted.
2193         * dom/Document.h:
2194         * inspector/InspectorController.cpp:
2195         (WebCore::InspectorController::InspectorController):
2196         * inspector/InspectorInstrumentation.cpp:
2197         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
2198         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
2199         (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
2200         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2201         (WebCore::InspectorInstrumentation::sessionCreatedImpl): Deleted.
2202         (WebCore::InspectorInstrumentation::sessionLoadedImpl): Deleted.
2203         (WebCore::InspectorInstrumentation::sessionModifiedImpl): Deleted.
2204         (WebCore::InspectorInstrumentation::segmentCreatedImpl): Deleted.
2205         (WebCore::InspectorInstrumentation::segmentCompletedImpl): Deleted.
2206         (WebCore::InspectorInstrumentation::segmentLoadedImpl): Deleted.
2207         (WebCore::InspectorInstrumentation::segmentUnloadedImpl): Deleted.
2208         (WebCore::InspectorInstrumentation::captureStartedImpl): Deleted.
2209         (WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
2210         (WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
2211         (WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
2212         (WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
2213         (WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
2214         (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
2215         * inspector/InspectorInstrumentation.h:
2216         (WebCore::InspectorInstrumentation::sessionCreated): Deleted.
2217         (WebCore::InspectorInstrumentation::sessionLoaded): Deleted.
2218         (WebCore::InspectorInstrumentation::sessionModified): Deleted.
2219         (WebCore::InspectorInstrumentation::segmentCreated): Deleted.
2220         (WebCore::InspectorInstrumentation::segmentCompleted): Deleted.
2221         (WebCore::InspectorInstrumentation::segmentLoaded): Deleted.
2222         (WebCore::InspectorInstrumentation::segmentUnloaded): Deleted.
2223         (WebCore::InspectorInstrumentation::captureStarted): Deleted.
2224         (WebCore::InspectorInstrumentation::captureStopped): Deleted.
2225         (WebCore::InspectorInstrumentation::playbackStarted): Deleted.
2226         (WebCore::InspectorInstrumentation::playbackPaused): Deleted.
2227         (WebCore::InspectorInstrumentation::playbackFinished): Deleted.
2228         (WebCore::InspectorInstrumentation::playbackHitPosition): Deleted.
2229         * inspector/InspectorReplayAgent.cpp: Removed.
2230         * inspector/InspectorReplayAgent.h: Removed.
2231         * inspector/InstrumentingAgents.cpp:
2232         (WebCore::InstrumentingAgents::reset):
2233         * inspector/InstrumentingAgents.h:
2234         (WebCore::InstrumentingAgents::inspectorReplayAgent): Deleted.
2235         (WebCore::InstrumentingAgents::setInspectorReplayAgent): Deleted.
2236         * page/EventHandler.h:
2237         * page/Page.cpp:
2238         (WebCore::Page::Page):
2239         * page/Page.h:
2240         (WebCore::Page::replayController): Deleted.
2241         * page/scrolling/ScrollingCoordinator.cpp:
2242         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
2243         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Deleted.
2244         * page/scrolling/ScrollingCoordinator.h:
2245         * platform/Logging.h:
2246         * plugins/DOMMimeTypeArray.cpp:
2247         (WebCore::DOMMimeTypeArray::getPluginData):
2248         * plugins/DOMPluginArray.cpp:
2249         (WebCore::DOMPluginArray::pluginData):
2250         * replay/AllReplayInputs.h: Removed.
2251         * replay/CapturingInputCursor.cpp: Removed.
2252         * replay/CapturingInputCursor.h: Removed.
2253         * replay/EventLoopInput.cpp: Removed.
2254         * replay/EventLoopInput.h: Removed.
2255         * replay/EventLoopInputDispatcher.cpp: Removed.
2256         * replay/EventLoopInputDispatcher.h: Removed.
2257         * replay/FunctorInputCursor.h: Removed.
2258         * replay/MemoizedDOMResult.cpp: Removed.
2259         * replay/MemoizedDOMResult.h: Removed.
2260         * replay/ReplayController.cpp: Removed.
2261         * replay/ReplayController.h: Removed.
2262         * replay/ReplayInputCreationMethods.cpp: Removed.
2263         * replay/ReplayInputDispatchMethods.cpp: Removed.
2264         * replay/ReplaySession.cpp: Removed.
2265         * replay/ReplaySession.h: Removed.
2266         * replay/ReplaySessionSegment.cpp: Removed.
2267         * replay/ReplaySessionSegment.h: Removed.
2268         * replay/ReplayingInputCursor.cpp: Removed.
2269         * replay/ReplayingInputCursor.h: Removed.
2270         * replay/SegmentedInputStorage.cpp: Removed.
2271         * replay/SegmentedInputStorage.h: Removed.
2272         * replay/SerializationMethods.cpp: Removed.
2273         * replay/SerializationMethods.h: Removed.
2274         * replay/WebInputs.json: Removed.
2275
2276 2017-07-10  Brady Eidson  <beidson@apple.com>
2277
2278         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
2279         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
2280
2281         Reviewed by David Kilzer and Alex Christensen. 
2282
2283         No targeted test possible, implicitly covered by all IDB tests.
2284
2285         The original idea behind UniqueIDBDatabase lifetime was that they are ThreadSafeRefCounted and
2286         we take protector Refs when any operation that needs it alive is in flight.
2287         
2288         This added variability to their lifetime which made it difficult to enforce a few different 
2289         design invariants, namely:
2290             - UniqueIBDDatabase objects are always created and destroyed only on the main thread.
2291             - IDBBackingStore objects are always created and destroyed only on the database thread.
2292         
2293         This patch removes the ref counting and instead ties UniqueIDBDatabase lifetime to a
2294         std::unique_ptr that is owned by the IDBServer.
2295         
2296         Whenever any operations on the UniqueIDBDatabase are in flight it is kept alive by virtue
2297         of that unique_ptr in the IDBServer. Once a UniqueIDBDatabase is completely done with all of
2298         its work, the following happens:
2299             - On the main thread the IDBServer removes the unique_ptr owning the UniqueIDBDatabase
2300               from its map.
2301             - It hands the unique_ptr to the UniqueIDBDatabase itself, which schedules one final 
2302               database thread task.
2303             - That database thread task is to destroy the IDBBackingStore, kill its message queues,
2304               and then message back to the main thread for one final task.
2305             - That main thread task is to release the unique_ptr, resulting in destruction of the
2306               UniqueIDBDatabase object.
2307         
2308         This is safe, predictable, solves the lifetime issues that r218516 originally tried to solve,
2309         and solves the lifetime issues that r218516 introduced.
2310
2311         (This patch also adds many more assertions to cover various design invariants throughout the
2312         lifecycle of a particular UniqueIDBDatabase)
2313
2314         ASSERT that IDBBackingStores are only ever created and destroyed on the background thread:
2315         * Modules/indexeddb/server/IDBBackingStore.h:
2316         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
2317         (WebCore::IDBServer::IDBBackingStore::IDBBackingStore):
2318         
2319         Transition UniqueIDBDatabase ownership from a RefPtr to a std::unique_ptr:
2320         * Modules/indexeddb/server/IDBServer.cpp:
2321         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
2322         (WebCore::IDBServer::IDBServer::closeAndTakeUniqueIDBDatabase):
2323         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2324         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
2325         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase): Deleted.
2326         * Modules/indexeddb/server/IDBServer.h:
2327         
2328         Make all the other changes mentioned above:
2329         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2330         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Bulk up on ASSERTs
2331         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): 
2332         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
2333         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
2334         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2335         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
2336         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2337         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
2338         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
2339         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2340         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2341         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
2342         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2343         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
2344         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
2345         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
2346         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
2347         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
2348         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
2349         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2350         (WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore): Deleted.
2351         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2352         (WebCore::IDBServer::UniqueIDBDatabase::create): Deleted.
2353
2354 2017-07-10  Chris Dumez  <cdumez@apple.com>
2355
2356         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
2357         https://bugs.webkit.org/show_bug.cgi?id=174301
2358
2359         Reviewed by Brent Fulgham.
2360
2361         Moved some generic file system utility functions down to platform's FileSystem.h.
2362
2363         * platform/FileSystem.cpp:
2364         (WebCore::openAndLockFile):
2365         (WebCore::unlockAndCloseFile):
2366         * platform/FileSystem.h:
2367
2368 2017-07-10  Andreas Kling  <akling@apple.com>
2369
2370         REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
2371         https://bugs.webkit.org/show_bug.cgi?id=174302
2372         <rdar://problem/33204273>
2373
2374         Reviewed by Antti Koivisto.
2375
2376         Don't clear the active/hovered/focused elements when destroying the render tree,
2377         since we might need to reconstruct it later, and would like to remember which
2378         elements those were.
2379
2380         Only the focused state actually stuck when going in and out of the page cache,
2381         but this patch removes all the element pointer clearing for consistency.
2382
2383         Test: fast/history/page-cache-element-state-focused.html
2384
2385         * dom/Document.cpp:
2386         (WebCore::Document::destroyRenderTree):
2387
2388 2017-07-10  Daniel Bates  <dabates@apple.com>
2389
2390         REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
2391         https://bugs.webkit.org/show_bug.cgi?id=173939
2392
2393         Reviewed by Dan Bernstein.
2394
2395         (The code in this change was either suggested or written by Dan Bernstein with a very
2396         minor adjustment to get it to build).
2397
2398         Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
2399         undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
2400         linker resolve the undefined symbol.
2401
2402         For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
2403         from the macOS 10.13 SDK.
2404
2405         * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
2406         can be undefined when building against macOS 10.13 or later SDK.
2407         * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
2408         with its availability information.
2409
2410 2017-07-10  Zalan Bujtas  <zalan@apple.com>
2411
2412         Block of text is missing in iBooks sample books.
2413         https://bugs.webkit.org/show_bug.cgi?id=174295
2414         <rdar://problem/32955620>
2415
2416         Reviewed by Antti Koivisto.
2417
2418         In the simple line layout context, translating y coordinate to a line index is
2419         normally just a (y / line height) operation. However in case of strut offsets (pagination)
2420         we need to take these extra paddings into account while resolving the line index.
2421         This patch fixes the boundary checking for a given line by using the font size only
2422         when the font is taller than the line.
2423
2424         * rendering/SimpleLineLayoutResolver.cpp:
2425         (WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):
2426
2427 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2428
2429         [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
2430         https://bugs.webkit.org/show_bug.cgi?id=166029
2431
2432         Reviewed by Michael Catanzaro.
2433
2434         Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
2435         network session, ensuring the cookies database is properly closed.
2436
2437         * platform/network/NetworkStorageSession.h:
2438         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2439         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
2440
2441 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2442
2443         Move make-js-file-arrays.py from WebCore to JavaScriptCore
2444         https://bugs.webkit.org/show_bug.cgi?id=174024
2445
2446         Reviewed by Michael Catanzaro.
2447
2448         * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
2449         does it.
2450         * DerivedSources.make: Updated to use make-js-file-arrays.py from JavaScriptCore. It's no longer needed to set
2451         PYTHON_PATH to find jsmin.py.
2452
2453 2017-07-10  Charlie Turner  <cturner@igalia.com>
2454
2455         [GTK] http/tests/media/video-redirect.html is failing
2456         https://bugs.webkit.org/show_bug.cgi?id=174260
2457
2458         Reviewed by Carlos Garcia Campos.
2459
2460         Make sure we're testing new URLs within the same security origin.
2461
2462         Covered by existing tests.
2463
2464         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2465         (WebCore::convertToInternalProtocol): Factor out setting our
2466         internal URL schema.
2467         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Use the
2468         refactored helper.
2469         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Use
2470         refactored helper to ensure both URLs have the same origin.
2471
2472 2017-07-08  John Wilander  <wilander@apple.com>
2473
2474         Resource Load Statistics: User interaction should always go to top document
2475         https://bugs.webkit.org/show_bug.cgi?id=174120
2476         <rdar://problem/33117899>
2477
2478         Reviewed by Chris Dumez.
2479
2480         Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
2481
2482         * dom/UserGestureIndicator.cpp:
2483         (WebCore::UserGestureIndicator::UserGestureIndicator):
2484             Now logs user interaction for the top document.
2485         * loader/ResourceLoadObserver.cpp:
2486         (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
2487             Test infrastructure.
2488         (WebCore::ResourceLoadObserver::setNotificationCallback):
2489             Callback now takes a ResourceLoadObserver::NotificationType.
2490         (WebCore::ResourceLoadObserver::logFrameNavigation):
2491             Submits the configured ResourceLoadObserver::NotificationType.
2492         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2493             Submits the configured ResourceLoadObserver::NotificationType.
2494         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2495             Submits the configured ResourceLoadObserver::NotificationType.
2496         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2497             Submits the configured ResourceLoadObserver::NotificationType.
2498         * loader/ResourceLoadObserver.h:
2499         * testing/Internals.cpp:
2500         (WebCore::Internals::resetToConsistentState):
2501             Resets to throttled notifications.
2502         (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
2503             Test infrastructure.
2504         * testing/Internals.h:
2505         * testing/Internals.idl:
2506             Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
2507
2508 2017-07-09  Brady Eidson  <beidson@apple.com>
2509
2510         Remove some obsolete WebKitVersionChecks.
2511         https://bugs.webkit.org/show_bug.cgi?id=174294
2512
2513         Reviewed by Dan Bernstein.
2514
2515         No new tests (No change to testable behavior)
2516
2517         * dom/ScriptExecutionContext.cpp:
2518         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
2519         
2520         * page/Settings.in:
2521         
2522         * platform/RuntimeApplicationChecks.h:
2523         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2524         (WebCore::IOSApplication::isOkCupid): Deleted.
2525         (WebCore::IOSApplication::isFacebook): Deleted.
2526         
2527         * rendering/RenderBox.cpp:
2528         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2529
2530 2017-07-08  Brady Eidson  <beidson@apple.com>
2531
2532         Remove some obsolete RuntimeApplicationChecks.
2533         https://bugs.webkit.org/show_bug.cgi?id=174293
2534
2535         Reviewed by Dan Bernstein.
2536
2537         No new tests (No change to testable behavior)
2538
2539         * html/HTMLObjectElement.cpp:
2540         (WebCore::HTMLObjectElement::parametersForPlugin):
2541         (WebCore::shouldNotPerformURLAdjustment): Deleted.
2542
2543         * platform/RuntimeApplicationChecks.h:
2544         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2545         (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
2546         (WebCore::IOSApplication::isNASAHD): Deleted.
2547         (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.
2548
2549         * platform/ios/wak/WebCoreThread.h:
2550         * platform/ios/wak/WebCoreThread.mm:
2551         (StartWebThread):
2552         (WebThreadSetDelegateSourceRunLoopMode): Deleted.
2553
2554 2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2555
2556         [Curl] Safe access and life cycle management of bare Curl handle
2557         by wrapping with C++ class
2558         https://bugs.webkit.org/show_bug.cgi?id=174002
2559
2560         Reviewed by Alex Christensen.
2561
2562         * platform/network/ResourceHandle.h:
2563         * platform/network/ResourceHandleInternal.h:
2564         * platform/network/curl/CookieJarCurl.cpp:
2565         (WebCore::setCookiesFromDOM):
2566         (WebCore::cookiesForSession):
2567         * platform/network/curl/CurlContext.cpp:
2568         (WebCore::CurlContext::CurlContext):
2569         (WebCore::CurlContext::~CurlContext):
2570         (WebCore::CurlContext::initCookieSession):
2571         (WebCore::CurlShareHandle::CurlShareHandle):
2572         (WebCore::CurlShareHandle::~CurlShareHandle):
2573         (WebCore::CurlShareHandle::lockCallback):
2574         (WebCore::CurlShareHandle::unlockCallback):
2575         (WebCore::CurlShareHandle::mutexFor):
2576         (WebCore::CurlMultiHandle::CurlMultiHandle):
2577         (WebCore::CurlMultiHandle::~CurlMultiHandle):
2578         (WebCore::CurlMultiHandle::addHandle):
2579         (WebCore::CurlMultiHandle::removeHandle):
2580         (WebCore::CurlMultiHandle::getFdSet):
2581         (WebCore::CurlMultiHandle::perform):
2582         (WebCore::CurlMultiHandle::readInfo):
2583         (WebCore::CurlHandle::CurlHandle):
2584         (WebCore::CurlHandle::~CurlHandle):
2585         (WebCore::CurlHandle::perform):
2586         (WebCore::CurlHandle::pause):
2587         (WebCore::CurlHandle::enableShareHandle):
2588         (WebCore::CurlHandle::setPrivateData):
2589         (WebCore::CurlHandle::setUrl):
2590         (WebCore::CurlHandle::clearUrl):
2591         (WebCore::CurlHandle::clearRequestHeaders):
2592         (WebCore::CurlHandle::appendRequestHeader):
2593         (WebCore::CurlHandle::enableRequestHeaders):
2594         (WebCore::CurlHandle::enableHttpGetRequest):
2595         (WebCore::CurlHandle::enableHttpHeadRequest):
2596         (WebCore::CurlHandle::enableHttpPostRequest):
2597         (WebCore::CurlHandle::setPostFields):
2598         (WebCore::CurlHandle::setPostFieldLarge):
2599         (WebCore::CurlHandle::enableHttpPutRequest):
2600         (WebCore::CurlHandle::setInFileSizeLarge):
2601         (WebCore::CurlHandle::setHttpCustomRequest):
2602         (WebCore::CurlHandle::enableAcceptEncoding):
2603         (WebCore::CurlHandle::enableAllowedProtocols):
2604         (WebCore::CurlHandle::enableFollowLocation):
2605         (WebCore::CurlHandle::enableAutoReferer):
2606         (WebCore::CurlHandle::enableHttpAuthentication):
2607         (WebCore::CurlHandle::setHttpAuthUserPass):
2608         (WebCore::CurlHandle::enableCAInfoIfExists):
2609         (WebCore::CurlHandle::setSslVerifyPeer):
2610         (WebCore::CurlHandle::setSslVerifyHost):
2611         (WebCore::CurlHandle::setSslCert):
2612         (WebCore::CurlHandle::setSslCertType):
2613         (WebCore::CurlHandle::setSslKeyPassword):
2614         (WebCore::CurlHandle::enableCookieJarIfExists):
2615         (WebCore::CurlHandle::setCookieList):
2616         (WebCore::CurlHandle::getCookieList):
2617         (WebCore::CurlHandle::clearCookieList):
2618         (WebCore::CurlHandle::enableProxyIfExists):
2619         (WebCore::CurlHandle::enableTimeout):
2620         (WebCore::CurlHandle::setHeaderCallbackFunction):
2621         (WebCore::CurlHandle::setWriteCallbackFunction):
2622         (WebCore::CurlHandle::setReadCallbackFunction):
2623         (WebCore::CurlHandle::setSslCtxCallbackFunction):
2624         (WebCore::CurlHandle::getEffectiveURL):
2625         (WebCore::CurlHandle::getPrimaryPort):
2626         (WebCore::CurlHandle::getResponseCode):
2627         (WebCore::CurlHandle::getContentLenghtDownload):
2628         (WebCore::CurlHandle::getHttpAuthAvail):
2629         (WebCore::CurlHandle::getTimes):
2630         (WebCore::CurlHandle::maxCurlOffT):
2631         (WebCore::CurlHandle::expectedSizeOfCurlOffT):
2632         (WebCore::CurlHandle::enableVerboseIfUsed):
2633         (WebCore::CurlHandle::enableStdErrIfUsed):
2634         (WebCore::CurlContext::getEffectiveURL): Deleted.
2635         (WebCore::CurlContext::createMultiHandle): Deleted.
2636         (WebCore::CurlContext::mutexFor): Deleted.
2637         (WebCore::CurlContext::lock): Deleted.
2638         (WebCore::CurlContext::unlock): Deleted.
2639         * platform/network/curl/CurlContext.h:
2640         (WebCore::CurlGlobal::CurlGlobal):
2641         (WebCore::CurlGlobal::~CurlGlobal):
2642         (WebCore::CurlShareHandle::handle):
2643         (WebCore::CurlContext::shareHandle):
2644         (WebCore::CurlHandle::handle):
2645         (WebCore::CurlHandle::url):
2646         (WebCore::CurlContext::curlShareHandle): Deleted.
2647         * platform/network/curl/CurlDownload.cpp:
2648         (WebCore::CurlDownload::~CurlDownload):
2649         (WebCore::CurlDownload::init):
2650         (WebCore::CurlDownload::start):
2651         (WebCore::CurlDownload::cancel):
2652         (WebCore::CurlDownload::getUrl):
2653         (WebCore::CurlDownload::addHeaders):
2654         (WebCore::CurlDownload::didReceiveHeader):
2655         (WebCore::CurlDownload::writeCallback):
2656         * platform/network/curl/CurlDownload.h:
2657         * platform/network/curl/CurlJobManager.cpp:
2658         (WebCore::CurlJobManager::CurlJobManager):
2659         (WebCore::CurlJobManager::~CurlJobManager):
2660         (WebCore::CurlJobManager::addToCurl):
2661         (WebCore::CurlJobManager::removeFromCurl):
2662         (WebCore::CurlJobManager::workerThread):
2663         * platform/network/curl/CurlJobManager.h:
2664         (WebCore::CurlJobManager::getMultiHandle): Deleted.
2665         * platform/network/curl/ResourceHandleCurl.cpp:
2666         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2667         (WebCore::ResourceHandle::platformSetDefersLoading):
2668         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2669         (WebCore::ResourceHandle::receivedCredential):
2670         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2671         (WebCore::calculateWebTimingInformations):
2672         (WebCore::handleLocalReceiveResponse):
2673         (WebCore::writeCallback):
2674         (WebCore::getProtectionSpace):
2675         (WebCore::headerCallback):
2676         (WebCore::readCallback):
2677         (WebCore::setupFormData):
2678         (WebCore::ResourceHandle::setupPUT):
2679         (WebCore::ResourceHandle::setupPOST):
2680         (WebCore::ResourceHandle::dispatchSynchronousJob):
2681         (WebCore::ResourceHandle::applyAuthentication):
2682         (WebCore::ResourceHandle::initialize):
2683         (WebCore::ResourceHandle::handleCurlMsg):
2684         * platform/network/curl/ResourceHandleManager.cpp:
2685         (WebCore::ResourceHandleManager::ResourceHandleManager):
2686         (WebCore::ResourceHandleManager::~ResourceHandleManager):
2687         (WebCore::ResourceHandleManager::downloadTimerCallback):
2688         (WebCore::ResourceHandleManager::removeFromCurl):
2689         (WebCore::ResourceHandleManager::startJob):
2690         * platform/network/curl/ResourceHandleManager.h:
2691         * platform/network/curl/SSLHandle.cpp:
2692         (WebCore::setSSLClientCertificate):
2693         (WebCore::certVerifyCallback):
2694         (WebCore::setSSLVerifyOptions):
2695
2696 2017-07-08  Antoine Quint  <graouts@apple.com>
2697
2698         REGRESSION: "visibility:hidden" does not hide play button for video elements
2699         https://bugs.webkit.org/show_bug.cgi?id=174258
2700         <rdar://problem/33181452>
2701
2702         Reviewed by Dean Jackson.
2703
2704         In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
2705         media controls container. However, we need to still make the "visibility" property inherit from its
2706         host such that "visibility: hidden" on the host won't be overridden by setting the property back to
2707         its initial value, which is "visible".
2708
2709         Test: media/modern-media-controls/css/visibility-hidden.html
2710
2711         * Modules/modern-media-controls/controls/media-controls.css:
2712         (.media-controls-container):
2713
2714 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2715
2716         Drop NOSNIFF compile flag
2717         https://bugs.webkit.org/show_bug.cgi?id=174289
2718
2719         Reviewed by Michael Catanzaro.
2720
2721         * Configurations/FeatureDefines.xcconfig:
2722         * css/StyleSheetContents.cpp:
2723         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2724         (WebCore::StyleSheetContents::notifyLoadedSheet):
2725         * dom/LoadableClassicScript.cpp:
2726         (WebCore::LoadableClassicScript::notifyFinished):
2727         * loader/cache/CachedCSSStyleSheet.cpp:
2728         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
2729         (WebCore::CachedCSSStyleSheet::canUseSheet):
2730         * loader/cache/CachedCSSStyleSheet.h:
2731         * platform/network/HTTPParsers.cpp:
2732         (WebCore::parseContentTypeOptionsHeader):
2733         * platform/network/HTTPParsers.h:
2734         * platform/network/ResourceResponseBase.cpp:
2735         (WebCore::isScriptAllowedByNosniff):
2736         * platform/network/ResourceResponseBase.h:
2737         * workers/WorkerScriptLoader.cpp:
2738         (WebCore::WorkerScriptLoader::didReceiveResponse):
2739
2740 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
2741
2742         [WK2] Use a rolling 30-day uptime for processing statistics
2743         https://bugs.webkit.org/show_bug.cgi?id=174235
2744         <rdar://problem/33164381>
2745
2746         Reviewed by Chris Dumez.
2747
2748         Add a KeyedDecoder specialization for Deque.
2749
2750         * platform/KeyedCoding.h:
2751         (WebCore::KeyedDecoder::decodeObjects):
2752
2753 2017-07-07  Daniel Bates  <dabates@apple.com>
2754
2755         [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
2756         https://bugs.webkit.org/show_bug.cgi?id=174273
2757         <rdar://problem/33011682>
2758
2759         Reviewed by Brent Fulgham.
2760
2761         As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
2762         we should ignore fallback entires whose fallback namespace URL is not prefixed with
2763         the manifest path. For now we only apply this policy when the manifest is served with
2764         a non-standard Content-Type to minimize web compatibility risk.
2765
2766         Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html
2767
2768         * loader/appcache/ApplicationCacheGroup.cpp:
2769         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
2770         * loader/appcache/ManifestParser.cpp:
2771         (WebCore::manifestPath): Computes the manifest path from a manifest URL.
2772         (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
2773         non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
2774         prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
2775         up the code a bit while I was here, including renaming a local variable to be more descriptive
2776         and using a const character array for the manifest signature to avoid the need to document the
2777         length of the manifest signature in a comment.
2778         * loader/appcache/ManifestParser.h:
2779
2780 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
2781
2782         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
2783         https://bugs.webkit.org/show_bug.cgi?id=174219
2784         <rdar://problem/32083177>
2785
2786         Reviewed by Ryosuke Niwa.
2787
2788         Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
2789         DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
2790         not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.
2791
2792         To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
2793         and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
2794         operation mask of DragOperationGeneric to platformGenericDragOperation().
2795
2796         Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
2797                 DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
2798                 DataInteractionTests.ExternalSourceMoveOperationNotAllowed
2799
2800         * page/DragController.cpp:
2801         (WebCore::DragController::platformGenericDragOperation):
2802         (WebCore::defaultOperationForDrag):
2803         * page/DragController.h:
2804         * page/mac/DragControllerMac.mm:
2805         (WebCore::DragController::platformGenericDragOperation):
2806
2807 2017-07-07  Devin Rousso  <drousso@apple.com>
2808
2809         Web Inspector: Show all elements currently using a given CSS Canvas
2810         https://bugs.webkit.org/show_bug.cgi?id=173965
2811
2812         Reviewed by Joseph Pecoraro.
2813
2814         Test: inspector/canvas/css-canvas-clients.html
2815
2816         * css/CSSImageGeneratorValue.cpp:
2817         (WebCore::CSSImageGeneratorValue::addClient):
2818         (WebCore::CSSImageGeneratorValue::removeClient):
2819         * css/CSSImageGeneratorValue.h:
2820         (WebCore::CSSImageGeneratorValue::clients):
2821         * html/HTMLCanvasElement.cpp:
2822         (WebCore::HTMLCanvasElement::addObserver):
2823         (WebCore::HTMLCanvasElement::removeObserver):
2824         (WebCore::HTMLCanvasElement::cssCanvasClients):
2825         Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
2826         inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
2827         client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.
2828
2829         * css/CSSCanvasValue.h:
2830         (isType):
2831         * html/HTMLCanvasElement.h:
2832         (WebCore::CanvasObserver::isCSSCanvasValueObserver):
2833         Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.
2834
2835         * inspector/InspectorCanvasAgent.h:
2836         * inspector/InspectorCanvasAgent.cpp:
2837         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
2838         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
2839         * inspector/InspectorInstrumentation.h:
2840         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
2841         * inspector/InspectorInstrumentation.cpp:
2842         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
2843         Notify the frontend that the list of client nodes has changed for the given canvas. Let the
2844         frontend request the actual list of node IDs when it needs, possibly at a later time.
2845
2846 2017-07-07  Jer Noble  <jer.noble@apple.com>
2847
2848         AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
2849         https://bugs.webkit.org/show_bug.cgi?id=174264
2850
2851         Reviewed by Eric Carlson.
2852
2853         If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
2854         AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
2855         releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
2856         cancel all activity in the AVPlayer.
2857
2858         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2859         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2860
2861 2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2862
2863         [Curl] Remove data url handler for async load
2864         https://bugs.webkit.org/show_bug.cgi?id=174263
2865
2866         data url is handled by ResourceLoader. No need for specific handling
2867         in platform dependent layer.
2868
2869         Reviewed by Alex Christensen.
2870
2871         * platform/network/curl/ResourceHandleManager.cpp:
2872         (WebCore::ResourceHandleManager::startJob):
2873
2874 2017-07-07  Matt Lewis  <jlewis3@apple.com>
2875
2876         Unreviewed, rolling out r219257.
2877
2878         The test added in the revision was still extreamly flaky on
2879         all testers.
2880
2881         Reverted changeset:
2882
2883         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
2884         https://bugs.webkit.org/show_bug.cgi?id=172545
2885         http://trac.webkit.org/changeset/219257
2886
2887 2017-07-07  Commit Queue  <commit-queue@webkit.org>
2888
2889         Unreviewed, rolling out r219238, r219239, and r219241.
2890         https://bugs.webkit.org/show_bug.cgi?id=174265
2891
2892         "fast/workers/dedicated-worker-lifecycle.html is flaky"
2893         (Requested by yusukesuzuki on #webkit).
2894
2895         Reverted changesets:
2896
2897         "[WTF] Implement WTF::ThreadGroup"
2898         https://bugs.webkit.org/show_bug.cgi?id=174081
2899         http://trac.webkit.org/changeset/219238
2900
2901         "Unreviewed, build fix after r219238"
2902         https://bugs.webkit.org/show_bug.cgi?id=174081
2903         http://trac.webkit.org/changeset/219239
2904
2905         "Unreviewed, CLoop build fix after r219238"
2906         https://bugs.webkit.org/show_bug.cgi?id=174081
2907         http://trac.webkit.org/changeset/219241
2908
2909 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
2910
2911         [SVG] Leak in SVGAnimatedListPropertyTearOff
2912         https://bugs.webkit.org/show_bug.cgi?id=172545
2913
2914         Reviewed by Said Abou-Hallawa.
2915
2916         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
2917         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
2918         reference to SVGAnimatedProperty.
2919
2920         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
2921         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
2922         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
2923         is going to be added to. This effectively creates a reference cycle between the
2924         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
2925
2926         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
2927
2928         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2929
2930 2017-07-07  Charlie Turner  <cturner@igalia.com>
2931
2932         [GStreamer] vid.me videos do not play
2933         https://bugs.webkit.org/show_bug.cgi?id=172240
2934
2935         Reviewed by Xabier Rodriguez-Calvar.
2936
2937         In r142251, code to hide the WK HTTP source elements from elsewhere in
2938         the pipeline was removed. This has the nasty side-effect of
2939         auto-plugging the WK HTTP source into things it really should not be
2940         used in, especially the adaptive streaming demuxers. The reasons this
2941         is bad are documented in several places on Bugzilla, see the parent
2942         bug report for more details. The high-level issue is that the WK HTTP
2943         source and its use of WebCore is not thread-safe. Although work has
2944         been recently done to improve this situation, it's still not perfect.
2945
2946         Another issue is the interface hlsdemux expects its HTTP source to
2947         implement, specifically seeking in READY.
2948
2949         This does rely on HTTP context sharing being available in GStreamer,
2950         upstream bug is here:
2951         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
2952         can be demonstrated with
2953         https://github.com/thiagoss/adaptive-test-server but manual testing on
2954         popular video hosting sites, including vid.me, shows that this doesn't
2955         bite us at the moment, just something else to fix in the future.
2956
2957         There are some QoS issues with the adaptive streaming code in
2958         GStreamer, but it seems much better to offer a below par QoS in lieu
2959         of crashing/livelocking when playing certain streams, and issues can be
2960         raised upstream when they arise.
2961
2962         This patch does take us further away from the future goal of having all
2963         networking operations go through the network process, but in return it
2964         solves some nasty crashes and livelocks that have been irritating
2965         users for some time. With the pressure off on this issue, work can be
2966         planned to consider how to make the WK HTTP source a better citizen
2967         inside the GStreamer pipeline when we migrate the netcode to go
2968         through the network process.
2969
2970         A new test is added to check that the single file HLS playlists
2971         (new in version 4) can be played, which was the primary cause of
2972         this bug report.
2973
2974         Test: http/tests/media/hls/range-request.html
2975
2976         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2977         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
2978         some trickery to make sure that we only ever fetch URLs handed to
2979         us by WebCore. Any further URLs discovered inside the pipeline
2980         will not get WKWS auto-plugged, since they'll be plain https?
2981         schemas.
2982         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
2983         setPlaybinURL helper method.
2984         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
2985         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
2986         the setPlaybinURL helper method.
2987         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2988         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
2989         ensures we won't get auto-plugged by pipeline elements asking for
2990         an element to fetch https? resources (like adaptive demuxers).
2991         (convertPlaybinURI): Undo the trick when another element asks us
2992         for our URI.
2993
2994 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2995
2996         [WTF] Implement WTF::ThreadGroup
2997         https://bugs.webkit.org/show_bug.cgi?id=174081
2998
2999         Reviewed by Mark Lam.
3000
3001         * page/ResourceUsageThread.h:
3002
3003 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
3004
3005         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
3006         https://bugs.webkit.org/show_bug.cgi?id=174150
3007
3008         Reviewed by Mark Lam.
3009
3010         * Modules/mediacontrols/MediaControlsHost.cpp:
3011         (WebCore::MediaControlsHost::captionDisplayMode):
3012         * Modules/mediastream/RTCDataChannel.cpp:
3013         (WebCore::RTCDataChannel::binaryType):
3014         * accessibility/AXObjectCache.cpp:
3015         (WebCore::createFromRenderer):
3016         * accessibility/AccessibilityMediaControls.cpp:
3017         (WebCore::AccessibilityMediaControl::controlTypeName):
3018         * accessibility/AccessibilityObject.cpp:
3019         (WebCore::AccessibilityObject::language):
3020         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
3021         (WebCore::AccessibilityObject::actionVerb):
3022         (WebCore::AccessibilityObject::getAttribute):
3023         (WebCore::AccessibilityObject::placeholderValue):
3024         * accessibility/AccessibilityObject.h:
3025         (WebCore::AccessibilityObject::accessKey):
3026         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
3027         * accessibility/AccessibilityRenderObject.cpp:
3028         (WebCore::AccessibilityRenderObject::accessKey):
3029         (WebCore::AccessibilityRenderObject::actionVerb):
3030         * bindings/js/JSCustomElementInterface.cpp:
3031         (WebCore::JSCustomElementInterface::constructElementWithFallback):
3032         * bindings/js/JSCustomElementRegistryCustom.cpp:
3033         (WebCore::JSCustomElementRegistry::define):
3034         * bindings/scripts/CodeGeneratorJS.pm:
3035         (GenerateDefaultValue):
3036         * bindings/scripts/test/JS/JSTestObj.cpp:
3037         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
3038         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
3039         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
3040         * css/CSSPageRule.cpp:
3041         (WebCore::CSSPageRule::selectorText):
3042         * css/CSSPrimitiveValue.cpp:
3043         (WebCore::valueName):
3044         * css/CSSSelector.cpp:
3045         (WebCore::simpleSelectorSpecificityInternal):
3046         (WebCore::CSSSelector::specificityForPage):
3047         (WebCore::CSSSelector::RareData::RareData):
3048         * css/CSSSelector.h:
3049         (WebCore::CSSSelector::argument):
3050         * css/CSSSelectorList.cpp:
3051         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
3052         * css/PageRuleCollector.cpp:
3053         (WebCore::checkPageSelectorComponents):
3054         * css/RuleSet.cpp:
3055         (WebCore::computeMatchBasedOnRuleHash):
3056         (WebCore::RuleSet::addRule):
3057         * css/SelectorChecker.cpp:
3058         (WebCore::tagMatches):
3059         * css/SelectorFilter.cpp:
3060         (WebCore::collectDescendantSelectorIdentifierHashes):
3061         * css/StyleBuilderConverter.h:
3062         (WebCore::StyleBuilderConverter::convertStringOrAuto):
3063         (WebCore::StyleBuilderConverter::convertStringOrNone):
3064         * css/StyleBuilderCustom.h:
3065         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
3066         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
3067         (WebCore::StyleBuilderCustom::applyValueContent):
3068         (WebCore::StyleBuilderCustom::applyValueAlt):
3069         * css/StyleSheetContents.cpp:
3070         (WebCore::StyleSheetContents::StyleSheetContents):
3071         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
3072         * css/makeprop.pl:
3073         * css/parser/CSSParserImpl.cpp:
3074         (WebCore::CSSParserImpl::parsePageSelector):
3075         * css/parser/CSSSelectorParser.cpp:
3076         (WebCore::CSSSelectorParser::consumeCompoundSelector):
3077         (WebCore::CSSSelectorParser::consumeName):
3078         (WebCore::CSSSelectorParser::consumeAttribute):
3079         (WebCore::CSSSelectorParser::defaultNamespace):
3080         (WebCore::CSSSelectorParser::determineNamespace):
3081         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
3082         * cssjit/SelectorCompiler.cpp:
3083         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
3084         (WebCore::SelectorCompiler::equalTagNames):
3085         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
3086         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
3087         * dom/Attr.cpp:
3088         (WebCore::Attr::setPrefix):
3089         (WebCore::Attr::attachToElement):
3090         * dom/Attribute.h:
3091         (WebCore::Attribute::nameMatchesFilter):
3092         * dom/ConstantPropertyMap.cpp:
3093         (WebCore::ConstantPropertyMap::nameForProperty):
3094         * dom/ContainerNode.cpp:
3095         (WebCore::ContainerNode::getElementsByTagName):
3096         (WebCore::ContainerNode::getElementsByTagNameNS):
3097         * dom/CustomElementReactionQueue.cpp:
3098         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
3099         * dom/DatasetDOMStringMap.cpp:
3100         (WebCore::convertPropertyNameToAttributeName):
3101         * dom/Document.cpp:
3102         (WebCore::createUpgradeCandidateElement):
3103         (WebCore::Document::createElementForBindings):
3104         (WebCore::Document::importNode):
3105         (WebCore::Document::hasValidNamespaceForElements):
3106         (WebCore::Document::processBaseElement):
3107         (WebCore::Document::dir):
3108         (WebCore::Document::bgColor):
3109         (WebCore::Document::fgColor):
3110         (WebCore::Document::alinkColor):
3111         (WebCore::Document::linkColorForBindings):
3112         (WebCore::Document::vlinkColor):
3113         * dom/Document.h:
3114         * dom/Element.cpp:
3115         (WebCore::Element::setBooleanAttribute):
3116         (WebCore::Element::synchronizeAttribute):
3117         (WebCore::Element::getAttribute):
3118         (WebCore::Element::getAttributeNS):
3119         (WebCore::Element::setAttribute):
3120         (WebCore::Element::parserSetAttributes):
3121         (WebCore::Element::didMoveToNewDocument):
3122         (WebCore::Element::setPrefix):
3123         (WebCore::Element::insertedInto):
3124         (WebCore::Element::removedFrom):
3125         (WebCore::Element::removeAttributeInternal):
3126         (WebCore::Element::addAttributeInternal):
3127         (WebCore::Element::removeAttributeNS):
3128         (WebCore::Element::getAttributeNodeNS):
3129         (WebCore::Element::hasAttributeNS):
3130         (WebCore::Element::computeInheritedLanguage):
3131         (WebCore::Element::updateNameForDocument):
3132         (WebCore::Element::updateIdForDocument):
3133         (WebCore::Element::didAddAttribute):
3134         (WebCore::Element::didRemoveAttribute):
3135         (WebCore::Element::cloneAttributesFromElement):
3136         * dom/Element.h:
3137         (WebCore::Element::attributeWithoutSynchronization):
3138         (WebCore::Element::idForStyleResolution):
3139         (WebCore::Element::getIdAttribute):
3140         (WebCore::Element::getNameAttribute):
3141         * dom/EventTarget.cpp:
3142         (WebCore::legacyType):
3143         * dom/MutationRecord.h:
3144         (WebCore::MutationRecord::attributeName):
3145         (WebCore::MutationRecord::attributeNamespace):
3146         * dom/NamedNodeMap.cpp:
3147         (WebCore::NamedNodeMap::removeNamedItemNS):
3148         * dom/Node.cpp:
3149         (WebCore::Node::prefix):
3150         (WebCore::Node::localName):
3151         (WebCore::Node::namespaceURI):
3152         (WebCore::Node::checkSetPrefix):
3153         (WebCore::locateDefaultNamespace):
3154         (WebCore::Node::isDefaultNamespace):
3155         (WebCore::Node::lookupNamespaceURI):
3156         (WebCore::locateNamespacePrefix):
3157         (WebCore::Node::lookupPrefix):
3158         * dom/NodeRareData.h:
3159         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
3160         (WebCore::NodeListsNodeData::addCachedCollection):
3161         (WebCore::NodeListsNodeData::cachedCollection):
3162         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
3163         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
3164         (WebCore::NodeListsNodeData::removeCachedCollection):
3165         * dom/PseudoElement.cpp:
3166         (WebCore::pseudoElementTagName):
3167         * dom/QualifiedName.cpp:
3168         (WebCore::QualifiedName::init):
3169         (WebCore::nullQName):
3170         (WebCore::createQualifiedName):
3171         * dom/QualifiedName.h:
3172         (WebCore::QualifiedName::hasPrefix):
3173         * dom/SelectorQuery.cpp:
3174         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
3175         * dom/SlotAssignment.cpp:
3176         (WebCore::slotNameFromAttributeValue):
3177         * dom/SlotAssignment.h:
3178         (WebCore::SlotAssignment::defaultSlotName):
3179         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
3180         (WebCore::ShadowRoot::didChangeDefaultSlot):
3181         * dom/TagCollection.cpp:
3182         (WebCore::TagCollection::TagCollection):
3183         (WebCore::HTMLTagCollection::HTMLTagCollection):
3184         * dom/TagCollection.h:
3185         (WebCore::TagCollectionNS::elementMatches):
3186         * dom/make_names.pl:
3187         (printNamesCppFile):
3188         (printDefinitions):
3189         (printFactoryCppFile):
3190         * editing/CompositeEditCommand.cpp:
3191         (WebCore::CompositeEditCommand::removeNodeAttribute):
3192         * editing/Editing.cpp:
3193         (WebCore::createHTMLElement):
3194         * editing/MarkupAccumulator.cpp:
3195         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3196         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
3197         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
3198         (WebCore::MarkupAccumulator::appendNamespace):
3199         (WebCore::MarkupAccumulator::appendOpenTag):
3200         (WebCore::MarkupAccumulator::appendAttribute):
3201         * editing/gtk/EditorGtk.cpp:
3202         (WebCore::elementURL):
3203         * editing/markup.cpp:
3204         (WebCore::AttributeChange::AttributeChange):
3205         * html/Autocapitalize.cpp:
3206         (WebCore::stringForAutocapitalizeType):
3207         * html/Autofill.cpp:
3208         (WebCore::AutofillData::createFromHTMLFormControlElement):
3209         * html/DOMTokenList.h:
3210         (WebCore::DOMTokenList::item):
3211         * html/FormAssociatedElement.cpp:
3212         (WebCore::FormAssociatedElement::name):
3213         * html/HTMLButtonElement.cpp:
3214         (WebCore::HTMLButtonElement::formControlType):
3215         * html/HTMLDetailsElement.cpp:
3216         (WebCore::HTMLDetailsElement::toggleOpen):
3217         * html/HTMLDocument.cpp:
3218         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
3219         * html/HTMLElement.cpp:
3220         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
3221         (WebCore::toValidDirValue):
3222         * html/HTMLImageElement.cpp:
3223         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3224         * html/HTMLInputElement.cpp:
3225         (WebCore::HTMLInputElement::name):
3226         (WebCore::HTMLInputElement::updateType):
3227         * html/HTMLMediaElement.cpp:
3228         (WebCore::HTMLMediaElement::doesHaveAttribute):
3229         * html/HTMLOptionElement.cpp:
3230         (WebCore::HTMLOptionElement::createForJSConstructor):
3231         * html/HTMLParamElement.cpp:
3232         (WebCore::HTMLParamElement::name):
3233         * html/HTMLSelectElement.cpp:
3234         (WebCore::HTMLSelectElement::setMultiple):
3235         * html/HTMLTableCellElement.cpp:
3236         (WebCore::HTMLTableCellElement::scope):
3237         * html/HTMLTrackElement.cpp:
3238         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
3239         * html/LabelableElement.cpp:
3240         (WebCore::LabelableElement::labels):
3241         * html/LabelsNodeList.cpp:
3242         (WebCore::LabelsNodeList::~LabelsNodeList):
3243         * html/MediaController.cpp:
3244         (MediaController::playbackState):
3245         (eventNameForReadyState):
3246         * html/MediaDocument.cpp:
3247         (WebCore::MediaDocumentParser::createDocumentStructure):
3248         * html/parser/AtomicHTMLToken.h:
3249         (WebCore::AtomicHTMLToken::initializeAttributes):
3250         * html/parser/HTMLConstructionSite.cpp:
3251         (WebCore::HTMLConstructionSite::createElement):
3252         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3253         * html/parser/HTMLParserIdioms.cpp:
3254         (WebCore::stripLeadingAndTrailingHTMLSpaces):
3255         (WebCore::parseHTMLHashNameReference):
3256         * html/parser/HTMLTreeBuilder.cpp:
3257         (WebCore::createForeignAttributesMap):
3258         * html/track/InbandTextTrack.cpp:
3259         (WebCore::InbandTextTrack::InbandTextTrack):
3260         * html/track/LoadableTextTrack.cpp:
3261         (WebCore::LoadableTextTrack::id):
3262         * html/track/TextTrack.cpp:
3263         (WebCore::TextTrack::captionMenuOffItem):
3264         (WebCore::TextTrack::captionMenuAutomaticItem):
3265         * html/track/TrackBase.cpp:
3266         (WebCore::MediaTrackBase::setKindInternal):
3267         * html/track/VTTRegion.cpp:
3268         (WebCore::VTTRegion::scroll):
3269         * html/track/WebVTTElement.cpp:
3270         (WebCore::nodeTypeToTagName):
3271         * html/track/WebVTTElement.h:
3272         * html/track/WebVTTToken.h:
3273         (WebCore::WebVTTToken::StartTag):
3274         * loader/FrameLoader.cpp:
3275         (WebCore::FrameLoader::clear):
3276         * loader/FrameLoader.h:
3277         * loader/ImageLoader.cpp:
3278         (WebCore::ImageLoader::clearFailedLoadURL):
3279         * loader/NavigationAction.h:
3280         * loader/PolicyChecker.cpp:
3281         (WebCore::PolicyChecker::checkNavigationPolicy):
3282         * page/DOMWindow.cpp:
3283         (WebCore::DOMWindow::showModalDialog):
3284         * page/EventHandler.cpp:
3285         (WebCore::eventNameForTouchPointState):
3286         * page/FrameTree.cpp:
3287         (WebCore::FrameTree::setName):
3288         (WebCore::FrameTree::clearName):
3289         * page/Page.cpp:
3290         (WebCore::Page::groupName):
3291         * platform/graphics/ComplexTextController.cpp:
3292         (WebCore::ComplexTextController::offsetForPosition):
3293         * platform/graphics/FontCache.cpp:
3294         (WebCore::FontCache::alternateFamilyName):
3295         * platform/graphics/FontDescription.h:
3296         (WebCore::FontCascadeDescription::initialLocale):
3297         * platform/graphics/FontGenericFamilies.cpp:
3298         (WebCore::genericFontFamilyForScript):
3299         * platform/graphics/InbandTextTrackPrivate.h:
3300         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
3301         * platform/graphics/TrackPrivateBase.h:
3302         (WebCore::TrackPrivateBase::id):
3303         (WebCore::TrackPrivateBase::label):
3304         (WebCore::TrackPrivateBase::language):
3305         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3306         (WebCore::AVTrackPrivateAVFObjCImpl::id):
3307         (WebCore::AVTrackPrivateAVFObjCImpl::label):
3308         (WebCore::AVTrackPrivateAVFObjCImpl::language):
3309         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
3310         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3311         (WebCore::InbandTextTrackPrivateAVCF::label):
3312         (WebCore::InbandTextTrackPrivateAVCF::language):
3313         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
3314         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
3315         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
3316         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3317         (WebCore::InbandTextTrackPrivateAVFObjC::label):
3318         (WebCore::InbandTextTrackPrivateAVFObjC::language):
3319         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3320         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
3321         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
3322         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3323         (WebCore::metadataType):
3324         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3325         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3326         (WebCore::FontCache::platformAlternateFamilyName):
3327         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3328         (WebCore::FontCascadeDescription::effectiveFamilyAt):
3329         * platform/graphics/freetype/FontCacheFreeType.cpp:
3330         (WebCore::FontCache::platformAlternateFamilyName):
3331         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
3332         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
3333         * platform/graphics/win/FontCacheWin.cpp:
3334         (WebCore::FontCache::platformAlternateFamilyName):
3335         * platform/mediastream/AudioTrackPrivateMediaStream.h:
3336         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3337         (WebCore::RealtimeMediaSourceSettings::facingMode):
3338         * platform/mediastream/VideoTrackPrivateMediaStream.h:
3339         * rendering/HitTestResult.cpp:
3340         (WebCore::HitTestResult::linkSuggestedFilename):
3341         * rendering/InlineTextBox.cpp:
3342         (WebCore::InlineTextBox::paint):
3343         * rendering/RenderListItem.cpp:
3344         (WebCore::RenderListItem::markerText):
3345         * rendering/RenderText.cpp:
3346         (WebCore::RenderText::previousOffset):
3347         (WebCore::RenderText::nextOffset):
3348         * rendering/RenderTreeAsText.cpp:
3349         (WebCore::RenderTreeAsText::writeRenderObject):
3350         * rendering/TextPainter.cpp:
3351         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
3352         * rendering/style/RenderStyle.cpp:
3353         (WebCore::RenderStyle::textEmphasisMarkString):
3354         * rendering/style/RenderStyle.h:
3355         (WebCore::RenderStyle::initialHyphenationString):
3356         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
3357         (WebCore::RenderStyle::initialContentAltText):
3358         (WebCore::RenderStyle::initialLineGrid):
3359         (WebCore::RenderStyle::initialFlowThread):
3360         (WebCore::RenderStyle::initialRegionThread):
3361         * style/StyleScope.cpp:
3362         (WebCore::Style::Scope::collectActiveStyleSheets):
3363         * svg/SVGElement.cpp:
3364         (WebCore::SVGElement::getPresentationAttribute):
3365         * svg/SVGElement.h:
3366         (WebCore::SVGAttributeHashTranslator::hash):
3367         * svg/SVGUseElement.cpp:
3368         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
3369         * svg/animation/SVGSMILElement.cpp:
3370         (WebCore::SVGSMILElement::constructAttributeName):
3371         * testing/MockCDMFactory.cpp:
3372         (WebCore::MockCDMInstance::requestLicense):
3373         * xml/XMLErrors.cpp:
3374         (WebCore::createXHTMLParserErrorHeader):
3375         * xml/XPathStep.cpp:
3376         (WebCore::XPath::nodeMatchesBasicTest):
3377         (WebCore::XPath::Step::nodesInAxis):
3378         * xml/parser/XMLDocumentParserLibxml2.cpp:
3379         (WebCore::XMLDocumentParser::XMLDocumentParser):
3380         (WebCore::handleNamespaceAttributes):
3381         (WebCore::handleElementAttributes):
3382
3383 2017-07-06  Chris Dumez  <cdumez@apple.com>
3384
3385         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
3386         https://bugs.webkit.org/show_bug.cgi?id=174234
3387
3388         Reviewed by Brent Fulgham.
3389
3390         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
3391         always 0 since this member is only initialized later on, in the UIProcess.
3392
3393         * loader/ResourceLoadObserver.cpp:
3394         (WebCore::ResourceLoadObserver::logFrameNavigation):
3395         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3396         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3397
3398 2017-07-06  Yoav Weiss  <yoav@yoav.ws>
3399
3400         [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
3401         https://bugs.webkit.org/show_bug.cgi?id=174199
3402
3403         Reviewed by Youenn Fablet.
3404
3405         No new tests as video/audio is supported in tests. I tested this manually.
3406
3407         * html/HTMLLinkElement.cpp:
3408         (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.
3409
3410 2017-07-06  Chris Dumez  <cdumez@apple.com>
3411
3412         Drop unused ResourceLoadStatistics members
3413         https://bugs.webkit.org/show_bug.cgi?id=174226
3414
3415         Reviewed by Brent Fulgham.
3416
3417         * loader/ResourceLoadObserver.cpp:
3418         (WebCore::ResourceLoadObserver::logFrameNavigation):
3419         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3420         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3421         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
3422         * loader/ResourceLoadObserver.h:
3423         * loader/ResourceLoadStatistics.cpp:
3424         (WebCore::ResourceLoadStatistics::encode):
3425         (WebCore::ResourceLoadStatistics::decode):
3426         (WebCore::ResourceLoadStatistics::toString):
3427         (WebCore::ResourceLoadStatistics::merge):
3428         * loader/ResourceLoadStatistics.h:
3429
3430 2017-07-06  Youenn Fablet  <youenn@apple.com>
3431
3432         Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
3433         https://bugs.webkit.org/show_bug.cgi?id=174223
3434
3435         Reviewed by Eric Carlson.
3436
3437         We try reading too quickly and need to back off a little bit if we do not enough data.
3438         This only affects real audio and not web audio, hence validated through manual testing only.
3439