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