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